@lssm/bundle.lifecycle-managed 0.0.0-canary-20251217083314 → 0.0.0-canary-20251219202229
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/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/__tests__/assessment-service.test.d.ts +2 -0
- package/dist/__tests__/assessment-service.test.d.ts.map +1 -0
- package/dist/agents/lifecycle-advisor-agent.d.ts +2 -6
- package/dist/agents/lifecycle-advisor-agent.d.ts.map +1 -0
- package/dist/api/rest-handlers.d.ts +15 -17
- package/dist/api/rest-handlers.d.ts.map +1 -0
- package/dist/events/lifecycle-events.d.ts +10 -13
- package/dist/events/lifecycle-events.d.ts.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -5
- package/dist/services/assessment-service.d.ts +40 -44
- package/dist/services/assessment-service.d.ts.map +1 -0
- package/package.json +15 -14
- package/dist/agents/lifecycle-advisor-agent.js +0 -71
- package/dist/api/rest-handlers.js +0 -22
- package/dist/events/lifecycle-events.js +0 -45
- package/dist/libs/ai-agent/dist/agent/agent-factory.js +0 -1
- package/dist/libs/ai-agent/dist/agent/contract-spec-agent.js +0 -18
- package/dist/libs/ai-agent/dist/agent/index.js +0 -2
- package/dist/libs/ai-agent/dist/approval/index.js +0 -1
- package/dist/libs/ai-agent/dist/approval/workflow.js +0 -1
- package/dist/libs/ai-agent/dist/index.js +0 -15
- package/dist/libs/ai-agent/dist/schema/index.js +0 -2
- package/dist/libs/ai-agent/dist/schema/json-schema-to-zod.js +0 -1
- package/dist/libs/ai-agent/dist/schema/schema-output.js +0 -3
- package/dist/libs/ai-agent/dist/spec/spec.js +0 -23
- package/dist/libs/ai-agent/dist/tools/index.js +0 -4
- package/dist/libs/ai-agent/dist/tools/knowledge-tool.js +0 -2
- package/dist/libs/ai-agent/dist/tools/mcp-client.js +0 -2
- package/dist/libs/ai-agent/dist/tools/mcp-server.js +0 -3
- package/dist/libs/ai-agent/dist/tools/tool-adapter.js +0 -2
- package/dist/libs/analytics/dist/churn/index.js +0 -1
- package/dist/libs/analytics/dist/churn/predictor.js +0 -1
- package/dist/libs/analytics/dist/cohort/index.js +0 -1
- package/dist/libs/analytics/dist/cohort/tracker.js +0 -1
- package/dist/libs/analytics/dist/index.js +0 -5
- package/dist/libs/analytics/dist/lifecycle/metric-collectors.js +0 -9
- package/dist/libs/lifecycle/dist/index.js +0 -5
- package/dist/libs/lifecycle/dist/types/axes.js +0 -28
- package/dist/libs/lifecycle/dist/types/milestones.js +0 -1
- package/dist/libs/lifecycle/dist/types/signals.js +0 -1
- package/dist/libs/lifecycle/dist/types/stages.js +0 -151
- package/dist/libs/lifecycle/dist/utils/formatters.js +0 -1
- package/dist/libs/observability/dist/index.js +0 -8
- package/dist/libs/observability/dist/intent/aggregator.js +0 -4
- package/dist/libs/observability/dist/intent/detector.js +0 -1
- package/dist/libs/observability/dist/lifecycle/dist/index.js +0 -4
- package/dist/libs/observability/dist/lifecycle/dist/types/milestones.js +0 -1
- package/dist/libs/observability/dist/lifecycle/dist/types/signals.js +0 -1
- package/dist/libs/observability/dist/lifecycle/dist/types/stages.js +0 -143
- package/dist/libs/observability/dist/lifecycle/dist/utils/formatters.js +0 -7
- package/dist/libs/observability/dist/logging/index.js +0 -39
- package/dist/libs/observability/dist/metrics/index.js +0 -25
- package/dist/libs/observability/dist/pipeline/evolution-pipeline.js +0 -3
- package/dist/libs/observability/dist/pipeline/lifecycle-pipeline.js +0 -73
- package/dist/libs/observability/dist/tracing/index.js +0 -1
- package/dist/libs/observability/dist/tracing/middleware.js +0 -2
- package/dist/modules/lifecycle-advisor/dist/ceremony/ceremony-designer.js +0 -17
- package/dist/modules/lifecycle-advisor/dist/data/library-stage-map.js +0 -90
- package/dist/modules/lifecycle-advisor/dist/data/stage-playbooks.js +0 -240
- package/dist/modules/lifecycle-advisor/dist/index.js +0 -3
- package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/index.js +0 -4
- package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/types/milestones.js +0 -1
- package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/types/signals.js +0 -1
- package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/types/stages.js +0 -143
- package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/utils/formatters.js +0 -1
- package/dist/modules/lifecycle-advisor/dist/recommendations/library-recommender.js +0 -19
- package/dist/modules/lifecycle-advisor/dist/recommendations/recommendation-engine.js +0 -46
- package/dist/modules/lifecycle-core/dist/collectors/signal-collector.js +0 -65
- package/dist/modules/lifecycle-core/dist/data/milestones-catalog.js +0 -73
- package/dist/modules/lifecycle-core/dist/data/stage-weights.js +0 -169
- package/dist/modules/lifecycle-core/dist/index.js +0 -4
- package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/index.js +0 -4
- package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/axes.js +0 -28
- package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/milestones.js +0 -1
- package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/signals.js +0 -1
- package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/stages.js +0 -143
- package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/utils/formatters.js +0 -1
- package/dist/modules/lifecycle-core/dist/orchestrator/lifecycle-orchestrator.js +0 -53
- package/dist/modules/lifecycle-core/dist/planning/milestone-planner.js +0 -16
- package/dist/modules/lifecycle-core/dist/scoring/stage-scorer.js +0 -64
- package/dist/services/assessment-service.js +0 -72
package/dist/index.js
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
|
-
import { LifecycleEventBridge } from "./events/lifecycle-events.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var jL=Object.create;var{getPrototypeOf:NL,defineProperty:VJ,getOwnPropertyNames:qU,getOwnPropertyDescriptor:kL}=Object,IU=Object.prototype.hasOwnProperty;var mW=(Q,X,Y)=>{Y=Q!=null?jL(NL(Q)):{};let W=X||!Q||!Q.__esModule?VJ(Y,"default",{value:Q,enumerable:!0}):Y;for(let G of qU(Q))if(!IU.call(W,G))VJ(W,G,{get:()=>Q[G],enumerable:!0});return W},DU=new WeakMap,WQ=(Q)=>{var X=DU.get(Q),Y;if(X)return X;if(X=VJ({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function")qU(Q).map((W)=>!IU.call(X,W)&&VJ(X,W,{get:()=>Q[W],enumerable:!(Y=kL(Q,W))||Y.enumerable}));return DU.set(Q,X),X},F0=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports);var w1=(Q,X)=>{for(var Y in X)VJ(Q,Y,{get:X[Y],enumerable:!0,configurable:!0,set:(W)=>X[Y]=()=>W})};var dW=(Q,X)=>()=>(Q&&(X=Q(Q=0)),X);var wL=((Q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Q,{get:(X,Y)=>(typeof require<"u"?require:X)[Y]}):Q)(function(Q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});var YX={};w1(YX,{transcode:()=>TT,resolveObjectURL:()=>MT,kStringMaxLength:()=>eU,kMaxLength:()=>MJ,isUtf8:()=>LT,isAscii:()=>ET,default:()=>RT,constants:()=>oE,btoa:()=>lE,atob:()=>mE,INSPECT_MAX_BYTES:()=>aU,File:()=>dE,Buffer:()=>z0,Blob:()=>nE});function bE(Q){var X=Q.length;if(X%4>0)throw Error("Invalid string. Length must be a multiple of 4");var Y=Q.indexOf("=");if(Y===-1)Y=X;var W=Y===X?0:4-Y%4;return[Y,W]}function hE(Q,X){return(Q+X)*3/4-X}function uE(Q){var X,Y=bE(Q),W=Y[0],G=Y[1],K=new Uint8Array(hE(W,G)),Z=0,q=G>0?W-4:W,E;for(E=0;E<q;E+=4)X=lX[Q.charCodeAt(E)]<<18|lX[Q.charCodeAt(E+1)]<<12|lX[Q.charCodeAt(E+2)]<<6|lX[Q.charCodeAt(E+3)],K[Z++]=X>>16&255,K[Z++]=X>>8&255,K[Z++]=X&255;if(G===2)X=lX[Q.charCodeAt(E)]<<2|lX[Q.charCodeAt(E+1)]>>4,K[Z++]=X&255;if(G===1)X=lX[Q.charCodeAt(E)]<<10|lX[Q.charCodeAt(E+1)]<<4|lX[Q.charCodeAt(E+2)]>>2,K[Z++]=X>>8&255,K[Z++]=X&255;return K}function pE(Q){return zY[Q>>18&63]+zY[Q>>12&63]+zY[Q>>6&63]+zY[Q&63]}function cE(Q,X,Y){var W,G=[];for(var K=X;K<Y;K+=3)W=(Q[K]<<16&16711680)+(Q[K+1]<<8&65280)+(Q[K+2]&255),G.push(pE(W));return G.join("")}function nU(Q){var X,Y=Q.length,W=Y%3,G=[],K=16383;for(var Z=0,q=Y-W;Z<q;Z+=K)G.push(cE(Q,Z,Z+K>q?q:Z+K));if(W===1)X=Q[Y-1],G.push(zY[X>>2]+zY[X<<4&63]+"==");else if(W===2)X=(Q[Y-2]<<8)+Q[Y-1],G.push(zY[X>>10]+zY[X>>4&63]+zY[X<<2&63]+"=");return G.join("")}function XG(Q,X,Y,W,G){var K,Z,q=G*8-W-1,E=(1<<q)-1,I=E>>1,L=-7,D=Y?G-1:0,T=Y?-1:1,P=Q[X+D];D+=T,K=P&(1<<-L)-1,P>>=-L,L+=q;for(;L>0;K=K*256+Q[X+D],D+=T,L-=8);Z=K&(1<<-L)-1,K>>=-L,L+=W;for(;L>0;Z=Z*256+Q[X+D],D+=T,L-=8);if(K===0)K=1-I;else if(K===E)return Z?NaN:(P?-1:1)*(1/0);else Z=Z+Math.pow(2,W),K=K-I;return(P?-1:1)*Z*Math.pow(2,K-W)}function sU(Q,X,Y,W,G,K){var Z,q,E,I=K*8-G-1,L=(1<<I)-1,D=L>>1,T=G===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=W?0:K-1,B=W?1:-1,j=X<0||X===0&&1/X<0?1:0;if(X=Math.abs(X),isNaN(X)||X===1/0)q=isNaN(X)?1:0,Z=L;else{if(Z=Math.floor(Math.log(X)/Math.LN2),X*(E=Math.pow(2,-Z))<1)Z--,E*=2;if(Z+D>=1)X+=T/E;else X+=T*Math.pow(2,1-D);if(X*E>=2)Z++,E/=2;if(Z+D>=L)q=0,Z=L;else if(Z+D>=1)q=(X*E-1)*Math.pow(2,G),Z=Z+D;else q=X*Math.pow(2,D-1)*Math.pow(2,G),Z=0}for(;G>=8;Q[Y+P]=q&255,P+=B,q/=256,G-=8);Z=Z<<G|q,I+=G;for(;I>0;Q[Y+P]=Z&255,P+=B,Z/=256,I-=8);Q[Y+P-B]|=j*128}function TY(Q){if(Q>MJ)throw RangeError('The value "'+Q+'" is invalid for option "size"');let X=new Uint8Array(Q);return Object.setPrototypeOf(X,z0.prototype),X}function yZ(Q,X,Y){return class extends Y{constructor(){super();Object.defineProperty(this,"message",{value:X.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}function z0(Q,X,Y){if(typeof Q==="number"){if(typeof X==="string")throw TypeError('The "string" argument must be of type string. Received type number');return gZ(Q)}return QK(Q,X,Y)}function QK(Q,X,Y){if(typeof Q==="string")return sE(Q,X);if(ArrayBuffer.isView(Q))return aE(Q);if(Q==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(OY(Q,ArrayBuffer)||Q&&OY(Q.buffer,ArrayBuffer))return _Z(Q,X,Y);if(typeof SharedArrayBuffer<"u"&&(OY(Q,SharedArrayBuffer)||Q&&OY(Q.buffer,SharedArrayBuffer)))return _Z(Q,X,Y);if(typeof Q==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let W=Q.valueOf&&Q.valueOf();if(W!=null&&W!==Q)return z0.from(W,X,Y);let G=eE(Q);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]==="function")return z0.from(Q[Symbol.toPrimitive]("string"),X,Y);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}function XK(Q){if(typeof Q!=="number")throw TypeError('"size" argument must be of type number');else if(Q<0)throw RangeError('The value "'+Q+'" is invalid for option "size"')}function tE(Q,X,Y){if(XK(Q),Q<=0)return TY(Q);if(X!==void 0)return typeof Y==="string"?TY(Q).fill(X,Y):TY(Q).fill(X);return TY(Q)}function gZ(Q){return XK(Q),TY(Q<0?0:fZ(Q)|0)}function sE(Q,X){if(typeof X!=="string"||X==="")X="utf8";if(!z0.isEncoding(X))throw TypeError("Unknown encoding: "+X);let Y=YK(Q,X)|0,W=TY(Y),G=W.write(Q,X);if(G!==Y)W=W.slice(0,G);return W}function vZ(Q){let X=Q.length<0?0:fZ(Q.length)|0,Y=TY(X);for(let W=0;W<X;W+=1)Y[W]=Q[W]&255;return Y}function aE(Q){if(OY(Q,Uint8Array)){let X=new Uint8Array(Q);return _Z(X.buffer,X.byteOffset,X.byteLength)}return vZ(Q)}function _Z(Q,X,Y){if(X<0||Q.byteLength<X)throw RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<X+(Y||0))throw RangeError('"length" is outside of buffer bounds');let W;if(X===void 0&&Y===void 0)W=new Uint8Array(Q);else if(Y===void 0)W=new Uint8Array(Q,X);else W=new Uint8Array(Q,X,Y);return Object.setPrototypeOf(W,z0.prototype),W}function eE(Q){if(z0.isBuffer(Q)){let X=fZ(Q.length)|0,Y=TY(X);if(Y.length===0)return Y;return Q.copy(Y,0,0,X),Y}if(Q.length!==void 0){if(typeof Q.length!=="number"||Number.isNaN(Q.length))return TY(0);return vZ(Q)}if(Q.type==="Buffer"&&Array.isArray(Q.data))return vZ(Q.data)}function fZ(Q){if(Q>=MJ)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+MJ.toString(16)+" bytes");return Q|0}function YK(Q,X){if(z0.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||OY(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);let Y=Q.length,W=arguments.length>2&&arguments[2]===!0;if(!W&&Y===0)return 0;let G=!1;for(;;)switch(X){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return xZ(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return FK(Q).length;default:if(G)return W?-1:xZ(Q).length;X=(""+X).toLowerCase(),G=!0}}function QT(Q,X,Y){let W=!1;if(X===void 0||X<0)X=0;if(X>this.length)return"";if(Y===void 0||Y>this.length)Y=this.length;if(Y<=0)return"";if(Y>>>=0,X>>>=0,Y<=X)return"";if(!Q)Q="utf8";while(!0)switch(Q){case"hex":return KT(this,X,Y);case"utf8":case"utf-8":return WK(this,X,Y);case"ascii":return HT(this,X,Y);case"latin1":case"binary":return UT(this,X,Y);case"base64":return $T(this,X,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return FT(this,X,Y);default:if(W)throw TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),W=!0}}function F1(Q,X,Y){let W=Q[X];Q[X]=Q[Y],Q[Y]=W}function JK(Q,X,Y,W,G){if(Q.length===0)return-1;if(typeof Y==="string")W=Y,Y=0;else if(Y>2147483647)Y=2147483647;else if(Y<-2147483648)Y=-2147483648;if(Y=+Y,Number.isNaN(Y))Y=G?0:Q.length-1;if(Y<0)Y=Q.length+Y;if(Y>=Q.length)if(G)return-1;else Y=Q.length-1;else if(Y<0)if(G)Y=0;else return-1;if(typeof X==="string")X=z0.from(X,W);if(z0.isBuffer(X)){if(X.length===0)return-1;return rU(Q,X,Y,W,G)}else if(typeof X==="number"){if(X=X&255,typeof Uint8Array.prototype.indexOf==="function")if(G)return Uint8Array.prototype.indexOf.call(Q,X,Y);else return Uint8Array.prototype.lastIndexOf.call(Q,X,Y);return rU(Q,[X],Y,W,G)}throw TypeError("val must be string, number or Buffer")}function rU(Q,X,Y,W,G){let K=1,Z=Q.length,q=X.length;if(W!==void 0){if(W=String(W).toLowerCase(),W==="ucs2"||W==="ucs-2"||W==="utf16le"||W==="utf-16le"){if(Q.length<2||X.length<2)return-1;K=2,Z/=2,q/=2,Y/=2}}function E(L,D){if(K===1)return L[D];else return L.readUInt16BE(D*K)}let I;if(G){let L=-1;for(I=Y;I<Z;I++)if(E(Q,I)===E(X,L===-1?0:I-L)){if(L===-1)L=I;if(I-L+1===q)return L*K}else{if(L!==-1)I-=I-L;L=-1}}else{if(Y+q>Z)Y=Z-q;for(I=Y;I>=0;I--){let L=!0;for(let D=0;D<q;D++)if(E(Q,I+D)!==E(X,D)){L=!1;break}if(L)return I}}return-1}function XT(Q,X,Y,W){Y=Number(Y)||0;let G=Q.length-Y;if(!W)W=G;else if(W=Number(W),W>G)W=G;let K=X.length;if(W>K/2)W=K/2;let Z;for(Z=0;Z<W;++Z){let q=parseInt(X.substr(Z*2,2),16);if(Number.isNaN(q))return Z;Q[Y+Z]=q}return Z}function YT(Q,X,Y,W){return YG(xZ(X,Q.length-Y),Q,Y,W)}function JT(Q,X,Y,W){return YG(AT(X),Q,Y,W)}function WT(Q,X,Y,W){return YG(FK(X),Q,Y,W)}function GT(Q,X,Y,W){return YG(DT(X,Q.length-Y),Q,Y,W)}function $T(Q,X,Y){if(X===0&&Y===Q.length)return nU(Q);else return nU(Q.slice(X,Y))}function WK(Q,X,Y){Y=Math.min(Q.length,Y);let W=[],G=X;while(G<Y){let K=Q[G],Z=null,q=K>239?4:K>223?3:K>191?2:1;if(G+q<=Y){let E,I,L,D;switch(q){case 1:if(K<128)Z=K;break;case 2:if(E=Q[G+1],(E&192)===128){if(D=(K&31)<<6|E&63,D>127)Z=D}break;case 3:if(E=Q[G+1],I=Q[G+2],(E&192)===128&&(I&192)===128){if(D=(K&15)<<12|(E&63)<<6|I&63,D>2047&&(D<55296||D>57343))Z=D}break;case 4:if(E=Q[G+1],I=Q[G+2],L=Q[G+3],(E&192)===128&&(I&192)===128&&(L&192)===128){if(D=(K&15)<<18|(E&63)<<12|(I&63)<<6|L&63,D>65535&&D<1114112)Z=D}}}if(Z===null)Z=65533,q=1;else if(Z>65535)Z-=65536,W.push(Z>>>10&1023|55296),Z=56320|Z&1023;W.push(Z),G+=q}return ZT(W)}function ZT(Q){let X=Q.length;if(X<=iU)return String.fromCharCode.apply(String,Q);let Y="",W=0;while(W<X)Y+=String.fromCharCode.apply(String,Q.slice(W,W+=iU));return Y}function HT(Q,X,Y){let W="";Y=Math.min(Q.length,Y);for(let G=X;G<Y;++G)W+=String.fromCharCode(Q[G]&127);return W}function UT(Q,X,Y){let W="";Y=Math.min(Q.length,Y);for(let G=X;G<Y;++G)W+=String.fromCharCode(Q[G]);return W}function KT(Q,X,Y){let W=Q.length;if(!X||X<0)X=0;if(!Y||Y<0||Y>W)Y=W;let G="";for(let K=X;K<Y;++K)G+=qT[Q[K]];return G}function FT(Q,X,Y){let W=Q.slice(X,Y),G="";for(let K=0;K<W.length-1;K+=2)G+=String.fromCharCode(W[K]+W[K+1]*256);return G}function XX(Q,X,Y){if(Q%1!==0||Q<0)throw RangeError("offset is not uint");if(Q+X>Y)throw RangeError("Trying to access beyond buffer length")}function jX(Q,X,Y,W,G,K){if(!z0.isBuffer(Q))throw TypeError('"buffer" argument must be a Buffer instance');if(X>G||X<K)throw RangeError('"value" argument is out of bounds');if(Y+W>Q.length)throw RangeError("Index out of range")}function GK(Q,X,Y,W,G){KK(X,W,G,Q,Y,7);let K=Number(X&BigInt(4294967295));Q[Y++]=K,K=K>>8,Q[Y++]=K,K=K>>8,Q[Y++]=K,K=K>>8,Q[Y++]=K;let Z=Number(X>>BigInt(32)&BigInt(4294967295));return Q[Y++]=Z,Z=Z>>8,Q[Y++]=Z,Z=Z>>8,Q[Y++]=Z,Z=Z>>8,Q[Y++]=Z,Y}function $K(Q,X,Y,W,G){KK(X,W,G,Q,Y,7);let K=Number(X&BigInt(4294967295));Q[Y+7]=K,K=K>>8,Q[Y+6]=K,K=K>>8,Q[Y+5]=K,K=K>>8,Q[Y+4]=K;let Z=Number(X>>BigInt(32)&BigInt(4294967295));return Q[Y+3]=Z,Z=Z>>8,Q[Y+2]=Z,Z=Z>>8,Q[Y+1]=Z,Z=Z>>8,Q[Y]=Z,Y+8}function ZK(Q,X,Y,W,G,K){if(Y+W>Q.length)throw RangeError("Index out of range");if(Y<0)throw RangeError("Index out of range")}function HK(Q,X,Y,W,G){if(X=+X,Y=Y>>>0,!G)ZK(Q,X,Y,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return sU(Q,X,Y,W,23,4),Y+4}function UK(Q,X,Y,W,G){if(X=+X,Y=Y>>>0,!G)ZK(Q,X,Y,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return sU(Q,X,Y,W,52,8),Y+8}function tU(Q){let X="",Y=Q.length,W=Q[0]==="-"?1:0;for(;Y>=W+4;Y-=3)X=`_${Q.slice(Y-3,Y)}${X}`;return`${Q.slice(0,Y)}${X}`}function VT(Q,X,Y){if(_1(X,"offset"),Q[X]===void 0||Q[X+Y]===void 0)LJ(X,Q.length-(Y+1))}function KK(Q,X,Y,W,G,K){if(Q>Y||Q<X){let Z=typeof X==="bigint"?"n":"",q;if(K>3)if(X===0||X===BigInt(0))q=`>= 0${Z} and < 2${Z} ** ${(K+1)*8}${Z}`;else q=`>= -(2${Z} ** ${(K+1)*8-1}${Z}) and < 2 ** ${(K+1)*8-1}${Z}`;else q=`>= ${X}${Z} and <= ${Y}${Z}`;throw new wZ("value",q,Q)}VT(W,G,K)}function _1(Q,X){if(typeof Q!=="number")throw new iE(X,"number",Q)}function LJ(Q,X,Y){if(Math.floor(Q)!==Q)throw _1(Q,Y),new wZ(Y||"offset","an integer",Q);if(X<0)throw new rE;throw new wZ(Y||"offset",`>= ${Y?1:0} and <= ${X}`,Q)}function OT(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(zT,""),Q.length<2)return"";while(Q.length%4!==0)Q=Q+"=";return Q}function xZ(Q,X){X=X||1/0;let Y,W=Q.length,G=null,K=[];for(let Z=0;Z<W;++Z){if(Y=Q.charCodeAt(Z),Y>55295&&Y<57344){if(!G){if(Y>56319){if((X-=3)>-1)K.push(239,191,189);continue}else if(Z+1===W){if((X-=3)>-1)K.push(239,191,189);continue}G=Y;continue}if(Y<56320){if((X-=3)>-1)K.push(239,191,189);G=Y;continue}Y=(G-55296<<10|Y-56320)+65536}else if(G){if((X-=3)>-1)K.push(239,191,189)}if(G=null,Y<128){if((X-=1)<0)break;K.push(Y)}else if(Y<2048){if((X-=2)<0)break;K.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((X-=3)<0)break;K.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((X-=4)<0)break;K.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw Error("Invalid code point")}return K}function AT(Q){let X=[];for(let Y=0;Y<Q.length;++Y)X.push(Q.charCodeAt(Y)&255);return X}function DT(Q,X){let Y,W,G,K=[];for(let Z=0;Z<Q.length;++Z){if((X-=2)<0)break;Y=Q.charCodeAt(Z),W=Y>>8,G=Y%256,K.push(G),K.push(W)}return K}function FK(Q){return uE(OT(Q))}function YG(Q,X,Y,W){let G;for(G=0;G<W;++G){if(G+Y>=X.length||G>=Q.length)break;X[G+Y]=Q[G]}return G}function OY(Q,X){return Q instanceof X||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===X.name}function cY(Q){return typeof BigInt>"u"?IT:Q}function IT(){throw Error("BigInt not supported")}function bZ(Q){return()=>{throw Error(Q+" is not implemented for node:buffer browser polyfill")}}var zY,lX,kZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K1,dU,oU,aU=50,MJ=2147483647,eU=536870888,lE,mE,dE,nE,oE,rE,iE,wZ,iU=4096,zT,qT,MT,LT,ET=(Q)=>{for(let X of Q)if(X.charCodeAt(0)>127)return!1;return!0},TT,RT;var JX=dW(()=>{zY=[],lX=[];for(K1=0,dU=kZ.length;K1<dU;++K1)zY[K1]=kZ[K1],lX[kZ.charCodeAt(K1)]=K1;lX[45]=62;lX[95]=63;oU=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,lE=globalThis.btoa,mE=globalThis.atob,dE=globalThis.File,nE=globalThis.Blob,oE={MAX_LENGTH:MJ,MAX_STRING_LENGTH:eU};rE=yZ("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){if(Q)return`${Q} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),iE=yZ("ERR_INVALID_ARG_TYPE",function(Q,X){return`The "${Q}" argument must be of type number. Received type ${typeof X}`},TypeError),wZ=yZ("ERR_OUT_OF_RANGE",function(Q,X,Y){let W=`The value of "${Q}" is out of range.`,G=Y;if(Number.isInteger(Y)&&Math.abs(Y)>4294967296)G=tU(String(Y));else if(typeof Y==="bigint"){if(G=String(Y),Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))G=tU(G);G+="n"}return W+=` It must be ${X}. Received ${G}`,W},RangeError);Object.defineProperty(z0.prototype,"parent",{enumerable:!0,get:function(){if(!z0.isBuffer(this))return;return this.buffer}});Object.defineProperty(z0.prototype,"offset",{enumerable:!0,get:function(){if(!z0.isBuffer(this))return;return this.byteOffset}});z0.poolSize=8192;z0.from=function(Q,X,Y){return QK(Q,X,Y)};Object.setPrototypeOf(z0.prototype,Uint8Array.prototype);Object.setPrototypeOf(z0,Uint8Array);z0.alloc=function(Q,X,Y){return tE(Q,X,Y)};z0.allocUnsafe=function(Q){return gZ(Q)};z0.allocUnsafeSlow=function(Q){return gZ(Q)};z0.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==z0.prototype};z0.compare=function(Q,X){if(OY(Q,Uint8Array))Q=z0.from(Q,Q.offset,Q.byteLength);if(OY(X,Uint8Array))X=z0.from(X,X.offset,X.byteLength);if(!z0.isBuffer(Q)||!z0.isBuffer(X))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===X)return 0;let Y=Q.length,W=X.length;for(let G=0,K=Math.min(Y,W);G<K;++G)if(Q[G]!==X[G]){Y=Q[G],W=X[G];break}if(Y<W)return-1;if(W<Y)return 1;return 0};z0.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};z0.concat=function(Q,X){if(!Array.isArray(Q))throw TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return z0.alloc(0);let Y;if(X===void 0){X=0;for(Y=0;Y<Q.length;++Y)X+=Q[Y].length}let W=z0.allocUnsafe(X),G=0;for(Y=0;Y<Q.length;++Y){let K=Q[Y];if(OY(K,Uint8Array))if(G+K.length>W.length){if(!z0.isBuffer(K))K=z0.from(K);K.copy(W,G)}else Uint8Array.prototype.set.call(W,K,G);else if(!z0.isBuffer(K))throw TypeError('"list" argument must be an Array of Buffers');else K.copy(W,G);G+=K.length}return W};z0.byteLength=YK;z0.prototype._isBuffer=!0;z0.prototype.swap16=function(){let Q=this.length;if(Q%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let X=0;X<Q;X+=2)F1(this,X,X+1);return this};z0.prototype.swap32=function(){let Q=this.length;if(Q%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let X=0;X<Q;X+=4)F1(this,X,X+3),F1(this,X+1,X+2);return this};z0.prototype.swap64=function(){let Q=this.length;if(Q%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let X=0;X<Q;X+=8)F1(this,X,X+7),F1(this,X+1,X+6),F1(this,X+2,X+5),F1(this,X+3,X+4);return this};z0.prototype.toString=function(){let Q=this.length;if(Q===0)return"";if(arguments.length===0)return WK(this,0,Q);return QT.apply(this,arguments)};z0.prototype.toLocaleString=z0.prototype.toString;z0.prototype.equals=function(Q){if(!z0.isBuffer(Q))throw TypeError("Argument must be a Buffer");if(this===Q)return!0;return z0.compare(this,Q)===0};z0.prototype.inspect=function(){let Q="",X=aU;if(Q=this.toString("hex",0,X).replace(/(.{2})/g,"$1 ").trim(),this.length>X)Q+=" ... ";return"<Buffer "+Q+">"};if(oU)z0.prototype[oU]=z0.prototype.inspect;z0.prototype.compare=function(Q,X,Y,W,G){if(OY(Q,Uint8Array))Q=z0.from(Q,Q.offset,Q.byteLength);if(!z0.isBuffer(Q))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if(X===void 0)X=0;if(Y===void 0)Y=Q?Q.length:0;if(W===void 0)W=0;if(G===void 0)G=this.length;if(X<0||Y>Q.length||W<0||G>this.length)throw RangeError("out of range index");if(W>=G&&X>=Y)return 0;if(W>=G)return-1;if(X>=Y)return 1;if(X>>>=0,Y>>>=0,W>>>=0,G>>>=0,this===Q)return 0;let K=G-W,Z=Y-X,q=Math.min(K,Z),E=this.slice(W,G),I=Q.slice(X,Y);for(let L=0;L<q;++L)if(E[L]!==I[L]){K=E[L],Z=I[L];break}if(K<Z)return-1;if(Z<K)return 1;return 0};z0.prototype.includes=function(Q,X,Y){return this.indexOf(Q,X,Y)!==-1};z0.prototype.indexOf=function(Q,X,Y){return JK(this,Q,X,Y,!0)};z0.prototype.lastIndexOf=function(Q,X,Y){return JK(this,Q,X,Y,!1)};z0.prototype.write=function(Q,X,Y,W){if(X===void 0)W="utf8",Y=this.length,X=0;else if(Y===void 0&&typeof X==="string")W=X,Y=this.length,X=0;else if(isFinite(X))if(X=X>>>0,isFinite(Y)){if(Y=Y>>>0,W===void 0)W="utf8"}else W=Y,Y=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let G=this.length-X;if(Y===void 0||Y>G)Y=G;if(Q.length>0&&(Y<0||X<0)||X>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!W)W="utf8";let K=!1;for(;;)switch(W){case"hex":return XT(this,Q,X,Y);case"utf8":case"utf-8":return YT(this,Q,X,Y);case"ascii":case"latin1":case"binary":return JT(this,Q,X,Y);case"base64":return WT(this,Q,X,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return GT(this,Q,X,Y);default:if(K)throw TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),K=!0}};z0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};z0.prototype.slice=function(Q,X){let Y=this.length;if(Q=~~Q,X=X===void 0?Y:~~X,Q<0){if(Q+=Y,Q<0)Q=0}else if(Q>Y)Q=Y;if(X<0){if(X+=Y,X<0)X=0}else if(X>Y)X=Y;if(X<Q)X=Q;let W=this.subarray(Q,X);return Object.setPrototypeOf(W,z0.prototype),W};z0.prototype.readUintLE=z0.prototype.readUIntLE=function(Q,X,Y){if(Q=Q>>>0,X=X>>>0,!Y)XX(Q,X,this.length);let W=this[Q],G=1,K=0;while(++K<X&&(G*=256))W+=this[Q+K]*G;return W};z0.prototype.readUintBE=z0.prototype.readUIntBE=function(Q,X,Y){if(Q=Q>>>0,X=X>>>0,!Y)XX(Q,X,this.length);let W=this[Q+--X],G=1;while(X>0&&(G*=256))W+=this[Q+--X]*G;return W};z0.prototype.readUint8=z0.prototype.readUInt8=function(Q,X){if(Q=Q>>>0,!X)XX(Q,1,this.length);return this[Q]};z0.prototype.readUint16LE=z0.prototype.readUInt16LE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,2,this.length);return this[Q]|this[Q+1]<<8};z0.prototype.readUint16BE=z0.prototype.readUInt16BE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,2,this.length);return this[Q]<<8|this[Q+1]};z0.prototype.readUint32LE=z0.prototype.readUInt32LE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,4,this.length);return(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216};z0.prototype.readUint32BE=z0.prototype.readUInt32BE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,4,this.length);return this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])};z0.prototype.readBigUInt64LE=cY(function(Q){Q=Q>>>0,_1(Q,"offset");let X=this[Q],Y=this[Q+7];if(X===void 0||Y===void 0)LJ(Q,this.length-8);let W=X+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216,G=this[++Q]+this[++Q]*256+this[++Q]*65536+Y*16777216;return BigInt(W)+(BigInt(G)<<BigInt(32))});z0.prototype.readBigUInt64BE=cY(function(Q){Q=Q>>>0,_1(Q,"offset");let X=this[Q],Y=this[Q+7];if(X===void 0||Y===void 0)LJ(Q,this.length-8);let W=X*16777216+this[++Q]*65536+this[++Q]*256+this[++Q],G=this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+Y;return(BigInt(W)<<BigInt(32))+BigInt(G)});z0.prototype.readIntLE=function(Q,X,Y){if(Q=Q>>>0,X=X>>>0,!Y)XX(Q,X,this.length);let W=this[Q],G=1,K=0;while(++K<X&&(G*=256))W+=this[Q+K]*G;if(G*=128,W>=G)W-=Math.pow(2,8*X);return W};z0.prototype.readIntBE=function(Q,X,Y){if(Q=Q>>>0,X=X>>>0,!Y)XX(Q,X,this.length);let W=X,G=1,K=this[Q+--W];while(W>0&&(G*=256))K+=this[Q+--W]*G;if(G*=128,K>=G)K-=Math.pow(2,8*X);return K};z0.prototype.readInt8=function(Q,X){if(Q=Q>>>0,!X)XX(Q,1,this.length);if(!(this[Q]&128))return this[Q];return(255-this[Q]+1)*-1};z0.prototype.readInt16LE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,2,this.length);let Y=this[Q]|this[Q+1]<<8;return Y&32768?Y|4294901760:Y};z0.prototype.readInt16BE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,2,this.length);let Y=this[Q+1]|this[Q]<<8;return Y&32768?Y|4294901760:Y};z0.prototype.readInt32LE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,4,this.length);return this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24};z0.prototype.readInt32BE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,4,this.length);return this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]};z0.prototype.readBigInt64LE=cY(function(Q){Q=Q>>>0,_1(Q,"offset");let X=this[Q],Y=this[Q+7];if(X===void 0||Y===void 0)LJ(Q,this.length-8);let W=this[Q+4]+this[Q+5]*256+this[Q+6]*65536+(Y<<24);return(BigInt(W)<<BigInt(32))+BigInt(X+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216)});z0.prototype.readBigInt64BE=cY(function(Q){Q=Q>>>0,_1(Q,"offset");let X=this[Q],Y=this[Q+7];if(X===void 0||Y===void 0)LJ(Q,this.length-8);let W=(X<<24)+this[++Q]*65536+this[++Q]*256+this[++Q];return(BigInt(W)<<BigInt(32))+BigInt(this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+Y)});z0.prototype.readFloatLE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,4,this.length);return XG(this,Q,!0,23,4)};z0.prototype.readFloatBE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,4,this.length);return XG(this,Q,!1,23,4)};z0.prototype.readDoubleLE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,8,this.length);return XG(this,Q,!0,52,8)};z0.prototype.readDoubleBE=function(Q,X){if(Q=Q>>>0,!X)XX(Q,8,this.length);return XG(this,Q,!1,52,8)};z0.prototype.writeUintLE=z0.prototype.writeUIntLE=function(Q,X,Y,W){if(Q=+Q,X=X>>>0,Y=Y>>>0,!W){let Z=Math.pow(2,8*Y)-1;jX(this,Q,X,Y,Z,0)}let G=1,K=0;this[X]=Q&255;while(++K<Y&&(G*=256))this[X+K]=Q/G&255;return X+Y};z0.prototype.writeUintBE=z0.prototype.writeUIntBE=function(Q,X,Y,W){if(Q=+Q,X=X>>>0,Y=Y>>>0,!W){let Z=Math.pow(2,8*Y)-1;jX(this,Q,X,Y,Z,0)}let G=Y-1,K=1;this[X+G]=Q&255;while(--G>=0&&(K*=256))this[X+G]=Q/K&255;return X+Y};z0.prototype.writeUint8=z0.prototype.writeUInt8=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,1,255,0);return this[X]=Q&255,X+1};z0.prototype.writeUint16LE=z0.prototype.writeUInt16LE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,2,65535,0);return this[X]=Q&255,this[X+1]=Q>>>8,X+2};z0.prototype.writeUint16BE=z0.prototype.writeUInt16BE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,2,65535,0);return this[X]=Q>>>8,this[X+1]=Q&255,X+2};z0.prototype.writeUint32LE=z0.prototype.writeUInt32LE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,4,4294967295,0);return this[X+3]=Q>>>24,this[X+2]=Q>>>16,this[X+1]=Q>>>8,this[X]=Q&255,X+4};z0.prototype.writeUint32BE=z0.prototype.writeUInt32BE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,4,4294967295,0);return this[X]=Q>>>24,this[X+1]=Q>>>16,this[X+2]=Q>>>8,this[X+3]=Q&255,X+4};z0.prototype.writeBigUInt64LE=cY(function(Q,X=0){return GK(this,Q,X,BigInt(0),BigInt("0xffffffffffffffff"))});z0.prototype.writeBigUInt64BE=cY(function(Q,X=0){return $K(this,Q,X,BigInt(0),BigInt("0xffffffffffffffff"))});z0.prototype.writeIntLE=function(Q,X,Y,W){if(Q=+Q,X=X>>>0,!W){let q=Math.pow(2,8*Y-1);jX(this,Q,X,Y,q-1,-q)}let G=0,K=1,Z=0;this[X]=Q&255;while(++G<Y&&(K*=256)){if(Q<0&&Z===0&&this[X+G-1]!==0)Z=1;this[X+G]=(Q/K>>0)-Z&255}return X+Y};z0.prototype.writeIntBE=function(Q,X,Y,W){if(Q=+Q,X=X>>>0,!W){let q=Math.pow(2,8*Y-1);jX(this,Q,X,Y,q-1,-q)}let G=Y-1,K=1,Z=0;this[X+G]=Q&255;while(--G>=0&&(K*=256)){if(Q<0&&Z===0&&this[X+G+1]!==0)Z=1;this[X+G]=(Q/K>>0)-Z&255}return X+Y};z0.prototype.writeInt8=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,1,127,-128);if(Q<0)Q=255+Q+1;return this[X]=Q&255,X+1};z0.prototype.writeInt16LE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,2,32767,-32768);return this[X]=Q&255,this[X+1]=Q>>>8,X+2};z0.prototype.writeInt16BE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,2,32767,-32768);return this[X]=Q>>>8,this[X+1]=Q&255,X+2};z0.prototype.writeInt32LE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,4,2147483647,-2147483648);return this[X]=Q&255,this[X+1]=Q>>>8,this[X+2]=Q>>>16,this[X+3]=Q>>>24,X+4};z0.prototype.writeInt32BE=function(Q,X,Y){if(Q=+Q,X=X>>>0,!Y)jX(this,Q,X,4,2147483647,-2147483648);if(Q<0)Q=4294967295+Q+1;return this[X]=Q>>>24,this[X+1]=Q>>>16,this[X+2]=Q>>>8,this[X+3]=Q&255,X+4};z0.prototype.writeBigInt64LE=cY(function(Q,X=0){return GK(this,Q,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});z0.prototype.writeBigInt64BE=cY(function(Q,X=0){return $K(this,Q,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});z0.prototype.writeFloatLE=function(Q,X,Y){return HK(this,Q,X,!0,Y)};z0.prototype.writeFloatBE=function(Q,X,Y){return HK(this,Q,X,!1,Y)};z0.prototype.writeDoubleLE=function(Q,X,Y){return UK(this,Q,X,!0,Y)};z0.prototype.writeDoubleBE=function(Q,X,Y){return UK(this,Q,X,!1,Y)};z0.prototype.copy=function(Q,X,Y,W){if(!z0.isBuffer(Q))throw TypeError("argument should be a Buffer");if(!Y)Y=0;if(!W&&W!==0)W=this.length;if(X>=Q.length)X=Q.length;if(!X)X=0;if(W>0&&W<Y)W=Y;if(W===Y)return 0;if(Q.length===0||this.length===0)return 0;if(X<0)throw RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw RangeError("Index out of range");if(W<0)throw RangeError("sourceEnd out of bounds");if(W>this.length)W=this.length;if(Q.length-X<W-Y)W=Q.length-X+Y;let G=W-Y;if(this===Q&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(X,Y,W);else Uint8Array.prototype.set.call(Q,this.subarray(Y,W),X);return G};z0.prototype.fill=function(Q,X,Y,W){if(typeof Q==="string"){if(typeof X==="string")W=X,X=0,Y=this.length;else if(typeof Y==="string")W=Y,Y=this.length;if(W!==void 0&&typeof W!=="string")throw TypeError("encoding must be a string");if(typeof W==="string"&&!z0.isEncoding(W))throw TypeError("Unknown encoding: "+W);if(Q.length===1){let K=Q.charCodeAt(0);if(W==="utf8"&&K<128||W==="latin1")Q=K}}else if(typeof Q==="number")Q=Q&255;else if(typeof Q==="boolean")Q=Number(Q);if(X<0||this.length<X||this.length<Y)throw RangeError("Out of range index");if(Y<=X)return this;if(X=X>>>0,Y=Y===void 0?this.length:Y>>>0,!Q)Q=0;let G;if(typeof Q==="number")for(G=X;G<Y;++G)this[G]=Q;else{let K=z0.isBuffer(Q)?Q:z0.from(Q,W),Z=K.length;if(Z===0)throw TypeError('The value "'+Q+'" is invalid for argument "value"');for(G=0;G<Y-X;++G)this[G+X]=K[G%Z]}return this};zT=/[^+/0-9A-Za-z-_]/g;qT=function(){let Q=Array(256);for(let X=0;X<16;++X){let Y=X*16;for(let W=0;W<16;++W)Q[Y+W]="0123456789abcdef"[X]+"0123456789abcdef"[W]}return Q}();MT=bZ("resolveObjectURL"),LT=bZ("isUtf8"),TT=bZ("transcode"),RT=z0});var EK={};w1(EK,{types:()=>_T,promisify:()=>qK,log:()=>OK,isUndefined:()=>x1,isSymbol:()=>yT,isString:()=>HG,isRegExp:()=>JG,isPrimitive:()=>gT,isObject:()=>y1,isNumber:()=>zK,isNullOrUndefined:()=>xT,isNull:()=>ZG,isFunction:()=>GG,isError:()=>WG,isDate:()=>cZ,isBuffer:()=>fT,isBoolean:()=>mZ,isArray:()=>VK,inspect:()=>V1,inherits:()=>AK,format:()=>lZ,deprecate:()=>BT,default:()=>uT,debuglog:()=>ST,callbackifyOnRejected:()=>oZ,callbackify:()=>IK,_extend:()=>nZ,TextEncoder:()=>MK,TextDecoder:()=>LK});function lZ(Q,...X){if(!HG(Q)){var Y=[Q];for(var W=0;W<X.length;W++)Y.push(V1(X[W]));return Y.join(" ")}var W=0,G=X.length,K=String(Q).replace(PT,function(q){if(q==="%%")return"%";if(W>=G)return q;switch(q){case"%s":return String(X[W++]);case"%d":return Number(X[W++]);case"%j":try{return JSON.stringify(X[W++])}catch(E){return"[Circular]"}default:return q}});for(var Z=X[W];W<G;Z=X[++W])if(ZG(Z)||!y1(Z))K+=" "+Z;else K+=" "+V1(Z);return K}function BT(Q,X){if(typeof process>"u"||process?.noDeprecation===!0)return Q;var Y=!1;function W(...G){if(!Y){if(process.throwDeprecation)throw Error(X);else if(process.traceDeprecation)console.trace(X);else console.error(X);Y=!0}return Q.apply(this,...G)}return W}function CT(Q,X){var Y=V1.styles[X];if(Y)return"\x1B["+V1.colors[Y][0]+"m"+Q+"\x1B["+V1.colors[Y][1]+"m";else return Q}function jT(Q,X){return Q}function NT(Q){var X={};return Q.forEach(function(Y,W){X[Y]=!0}),X}function $G(Q,X,Y){if(Q.customInspect&&X&&GG(X.inspect)&&X.inspect!==V1&&!(X.constructor&&X.constructor.prototype===X)){var W=X.inspect(Y,Q);if(!HG(W))W=$G(Q,W,Y);return W}var G=kT(Q,X);if(G)return G;var K=Object.keys(X),Z=NT(K);if(Q.showHidden)K=Object.getOwnPropertyNames(X);if(WG(X)&&(K.indexOf("message")>=0||K.indexOf("description")>=0))return hZ(X);if(K.length===0){if(GG(X)){var q=X.name?": "+X.name:"";return Q.stylize("[Function"+q+"]","special")}if(JG(X))return Q.stylize(RegExp.prototype.toString.call(X),"regexp");if(cZ(X))return Q.stylize(Date.prototype.toString.call(X),"date");if(WG(X))return hZ(X)}var E="",I=!1,L=["{","}"];if(VK(X))I=!0,L=["[","]"];if(GG(X)){var D=X.name?": "+X.name:"";E=" [Function"+D+"]"}if(JG(X))E=" "+RegExp.prototype.toString.call(X);if(cZ(X))E=" "+Date.prototype.toUTCString.call(X);if(WG(X))E=" "+hZ(X);if(K.length===0&&(!I||X.length==0))return L[0]+E+L[1];if(Y<0)if(JG(X))return Q.stylize(RegExp.prototype.toString.call(X),"regexp");else return Q.stylize("[Object]","special");Q.seen.push(X);var T;if(I)T=wT(Q,X,Y,Z,K);else T=K.map(function(P){return pZ(Q,X,Y,Z,P,I)});return Q.seen.pop(),vT(T,E,L)}function kT(Q,X){if(x1(X))return Q.stylize("undefined","undefined");if(HG(X)){var Y="'"+JSON.stringify(X).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Q.stylize(Y,"string")}if(zK(X))return Q.stylize(""+X,"number");if(mZ(X))return Q.stylize(""+X,"boolean");if(ZG(X))return Q.stylize("null","null")}function hZ(Q){return"["+Error.prototype.toString.call(Q)+"]"}function wT(Q,X,Y,W,G){var K=[];for(var Z=0,q=X.length;Z<q;++Z)if(DK(X,String(Z)))K.push(pZ(Q,X,Y,W,String(Z),!0));else K.push("");return G.forEach(function(E){if(!E.match(/^\d+$/))K.push(pZ(Q,X,Y,W,E,!0))}),K}function pZ(Q,X,Y,W,G,K){var Z,q,E;if(E=Object.getOwnPropertyDescriptor(X,G)||{value:X[G]},E.get)if(E.set)q=Q.stylize("[Getter/Setter]","special");else q=Q.stylize("[Getter]","special");else if(E.set)q=Q.stylize("[Setter]","special");if(!DK(W,G))Z="["+G+"]";if(!q)if(Q.seen.indexOf(E.value)<0){if(ZG(Y))q=$G(Q,E.value,null);else q=$G(Q,E.value,Y-1);if(q.indexOf(`
|
|
2
|
+
`)>-1)if(K)q=q.split(`
|
|
3
|
+
`).map(function(I){return" "+I}).join(`
|
|
4
|
+
`).slice(2);else q=`
|
|
5
|
+
`+q.split(`
|
|
6
|
+
`).map(function(I){return" "+I}).join(`
|
|
7
|
+
`)}else q=Q.stylize("[Circular]","special");if(x1(Z)){if(K&&G.match(/^\d+$/))return q;if(Z=JSON.stringify(""+G),Z.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))Z=Z.slice(1,-1),Z=Q.stylize(Z,"name");else Z=Z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Z=Q.stylize(Z,"string")}return Z+": "+q}function vT(Q,X,Y){var W=0,G=Q.reduce(function(K,Z){if(W++,Z.indexOf(`
|
|
8
|
+
`)>=0)W++;return K+Z.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(G>60)return Y[0]+(X===""?"":X+`
|
|
9
|
+
`)+" "+Q.join(`,
|
|
10
|
+
`)+" "+Y[1];return Y[0]+X+" "+Q.join(", ")+" "+Y[1]}function VK(Q){return Array.isArray(Q)}function mZ(Q){return typeof Q==="boolean"}function ZG(Q){return Q===null}function xT(Q){return Q==null}function zK(Q){return typeof Q==="number"}function HG(Q){return typeof Q==="string"}function yT(Q){return typeof Q==="symbol"}function x1(Q){return Q===void 0}function JG(Q){return y1(Q)&&dZ(Q)==="[object RegExp]"}function y1(Q){return typeof Q==="object"&&Q!==null}function cZ(Q){return y1(Q)&&dZ(Q)==="[object Date]"}function WG(Q){return y1(Q)&&(dZ(Q)==="[object Error]"||Q instanceof Error)}function GG(Q){return typeof Q==="function"}function gT(Q){return Q===null||typeof Q==="boolean"||typeof Q==="number"||typeof Q==="string"||typeof Q==="symbol"||typeof Q>"u"}function fT(Q){return Q instanceof Buffer}function dZ(Q){return Object.prototype.toString.call(Q)}function uZ(Q){return Q<10?"0"+Q.toString(10):Q.toString(10)}function hT(){var Q=new Date,X=[uZ(Q.getHours()),uZ(Q.getMinutes()),uZ(Q.getSeconds())].join(":");return[Q.getDate(),bT[Q.getMonth()],X].join(" ")}function OK(...Q){console.log("%s - %s",hT(),lZ.apply(null,Q))}function AK(Q,X){if(X)Q.super_=X,Q.prototype=Object.create(X.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})}function nZ(Q,X){if(!X||!y1(X))return Q;var Y=Object.keys(X),W=Y.length;while(W--)Q[Y[W]]=X[Y[W]];return Q}function DK(Q,X){return Object.prototype.hasOwnProperty.call(Q,X)}function oZ(Q,X){if(!Q){var Y=Error("Promise was rejected with a falsy value");Y.reason=Q,Q=Y}return X(Q)}function IK(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');function X(...Y){var W=Y.pop();if(typeof W!=="function")throw TypeError("The last argument must be of type Function");var G=this,K=function(...Z){return W.apply(G,...Z)};Q.apply(this,Y).then(function(Z){process.nextTick(K.bind(null,null,Z))},function(Z){process.nextTick(oZ.bind(null,Z,K))})}return Object.setPrototypeOf(X,Object.getPrototypeOf(Q)),Object.defineProperties(X,Object.getOwnPropertyDescriptors(Q)),X}var PT,ST,V1,_T=()=>{},bT,qK,MK,LK,uT;var TK=dW(()=>{PT=/%[sdj%]/g;ST=((Q={},X={},Y)=>((Y=typeof process<"u"&&!1)&&(Y=Y.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),X=new RegExp("^"+Y+"$","i"),(W)=>{if(W=W.toUpperCase(),!Q[W])if(X.test(W))Q[W]=function(...G){console.error("%s: %s",W,pid,lZ.apply(null,...G))};else Q[W]=function(){};return Q[W]}))(),V1=((Q)=>(Q.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Q.custom=Symbol.for("nodejs.util.inspect.custom"),Q))(function(Q,X,...Y){var W={seen:[],stylize:jT};if(Y.length>=1)W.depth=Y[0];if(Y.length>=2)W.colors=Y[1];if(mZ(X))W.showHidden=X;else if(X)nZ(W,X);if(x1(W.showHidden))W.showHidden=!1;if(x1(W.depth))W.depth=2;if(x1(W.colors))W.colors=!1;if(W.colors)W.stylize=CT;return $G(W,Q,W.depth)});bT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];qK=((Q)=>(Q.custom=Symbol.for("nodejs.util.promisify.custom"),Q))(function(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&Q[kCustomPromisifiedSymbol]){var X=Q[kCustomPromisifiedSymbol];if(typeof X!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(X,kCustomPromisifiedSymbol,{value:X,enumerable:!1,writable:!1,configurable:!0}),X}function X(...Y){var W,G,K=new Promise(function(Z,q){W=Z,G=q});Y.push(function(Z,q){if(Z)G(Z);else W(q)});try{Q.apply(this,Y)}catch(Z){G(Z)}return K}if(Object.setPrototypeOf(X,Object.getPrototypeOf(Q)),kCustomPromisifiedSymbol)Object.defineProperty(X,kCustomPromisifiedSymbol,{value:X,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(X,Object.getOwnPropertyDescriptors(Q))});({TextEncoder:MK,TextDecoder:LK}=globalThis),uT={TextEncoder:MK,TextDecoder:LK,promisify:qK,log:OK,inherits:AK,_extend:nZ,callbackifyOnRejected:oZ,callbackify:IK}});var TJ={};w1(TJ,{setMaxListeners:()=>_K,once:()=>wK,listenerCount:()=>xK,init:()=>eX,getMaxListeners:()=>gK,getEventListeners:()=>vK,default:()=>iT,captureRejectionSymbol:()=>CK,addAbortListener:()=>fK,EventEmitter:()=>eX});function jK(Q,X){var{_events:Y}=Q;if(X[0]??=Error("Unhandled error."),!Y)throw X[0];var W=Y[SK];if(W)for(var G of PK.call(W))G.apply(Q,X);var K=Y.error;if(!K)throw X[0];for(var G of PK.call(K))G.apply(Q,X);return!0}function lT(Q,X,Y,W){X.then(void 0,function(G){queueMicrotask(()=>mT(Q,G,Y,W))})}function mT(Q,X,Y,W){if(typeof Q[RK]==="function")Q[RK](X,Y,...W);else try{Q[z1]=!1,Q.emit("error",X)}finally{Q[z1]=!0}}function NK(Q,X,Y){Y.warned=!0;let W=Error(`Possible EventEmitter memory leak detected. ${Y.length} ${String(X)} listeners added to [${Q.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);W.name="MaxListenersExceededWarning",W.emitter=Q,W.type=X,W.count=Y.length,console.warn(W)}function kK(Q,X,...Y){this.removeListener(Q,X),X.apply(this,Y)}function wK(Q,X,Y){var W=Y?.signal;if(yK(W,"options.signal"),W?.aborted)throw new rZ(void 0,{cause:W?.reason});let{resolve:G,reject:K,promise:Z}=$newPromiseCapability(Promise),q=(L)=>{if(Q.removeListener(X,E),W!=null)UG(W,"abort",I);K(L)},E=(...L)=>{if(typeof Q.removeListener==="function")Q.removeListener("error",q);if(W!=null)UG(W,"abort",I);G(L)};if(BK(Q,X,E,{once:!0}),X!=="error"&&typeof Q.once==="function")Q.once("error",q);function I(){UG(Q,X,E),UG(Q,"error",q),K(new rZ(void 0,{cause:W?.reason}))}if(W!=null)BK(W,"abort",I,{once:!0});return Z}function vK(Q,X){return Q.listeners(X)}function _K(Q,...X){tZ(Q,"setMaxListeners",0);var Y;if(X&&(Y=X.length))for(let W=0;W<Y;W++)X[W].setMaxListeners(Q);else O1=Q}function xK(Q,X){return Q.listenerCount(X)}function UG(Q,X,Y,W){if(typeof Q.removeListener==="function")Q.removeListener(X,Y);else Q.removeEventListener(X,Y,W)}function BK(Q,X,Y,W){if(typeof Q.on==="function")if(W.once)Q.once(X,Y);else Q.on(X,Y);else Q.addEventListener(X,Y,W)}function g1(Q,X,Y){let W=TypeError(`The "${Q}" argument must be of type ${X}. Received ${Y}`);return W.code="ERR_INVALID_ARG_TYPE",W}function oT(Q,X,Y){let W=RangeError(`The "${Q}" argument is out of range. It must be ${X}. Received ${Y}`);return W.code="ERR_OUT_OF_RANGE",W}function yK(Q,X){if(Q!==void 0&&(Q===null||typeof Q!=="object"||!("aborted"in Q)))throw g1(X,"AbortSignal",Q)}function tZ(Q,X,Y,W){if(typeof Q!=="number")throw g1(X,"number",Q);if(Y!=null&&Q<Y||W!=null&&Q>W||(Y!=null||W!=null)&&Number.isNaN(Q))throw oT(X,`${Y!=null?`>= ${Y}`:""}${Y!=null&&W!=null?" && ":""}${W!=null?`<= ${W}`:""}`,Q)}function EJ(Q){if(typeof Q!=="function")throw TypeError("The listener must be a function")}function rT(Q,X){if(typeof Q!=="boolean")throw g1(X,"boolean",Q)}function gK(Q){return Q?._maxListeners??O1}function fK(Q,X){if(Q===void 0)throw g1("signal","AbortSignal",Q);if(yK(Q,"signal"),typeof X!=="function")throw g1("listener","function",X);let Y;if(Q.aborted)queueMicrotask(()=>X());else Q.addEventListener("abort",X,{__proto__:null,once:!0}),Y=()=>{Q.removeEventListener("abort",X)};return{__proto__:null,[Symbol.dispose](){Y?.()}}}var iZ,z1,SK,pT,cT,RK,CK,PK,O1=10,eX=function(Q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[z1]=Q?.captureRejections?Boolean(Q?.captureRejections):LQ[z1])this.emit=nT},LQ,dT=function(Q,...X){if(Q==="error")return jK(this,X);var{_events:Y}=this;if(Y===void 0)return!1;var W=Y[Q];if(W===void 0)return!1;let G=W.length>1?W.slice():W;for(let K=0,{length:Z}=G;K<Z;K++){let q=G[K];switch(X.length){case 0:q.call(this);break;case 1:q.call(this,X[0]);break;case 2:q.call(this,X[0],X[1]);break;case 3:q.call(this,X[0],X[1],X[2]);break;default:q.apply(this,X);break}}return!0},nT=function(Q,...X){if(Q==="error")return jK(this,X);var{_events:Y}=this;if(Y===void 0)return!1;var W=Y[Q];if(W===void 0)return!1;let G=W.length>1?W.slice():W;for(let K=0,{length:Z}=G;K<Z;K++){let q=G[K],E;switch(X.length){case 0:E=q.call(this);break;case 1:E=q.call(this,X[0]);break;case 2:E=q.call(this,X[0],X[1]);break;case 3:E=q.call(this,X[0],X[1],X[2]);break;default:E=q.apply(this,X);break}if(E!==void 0&&typeof E?.then==="function"&&E.then===Promise.prototype.then)lT(this,E,Q,X)}return!0},rZ,iT;var A1=dW(()=>{iZ=Symbol.for,z1=Symbol("kCapture"),SK=iZ("events.errorMonitor"),pT=Symbol("events.maxEventTargetListeners"),cT=Symbol("events.maxEventTargetListenersWarned"),RK=iZ("nodejs.rejection"),CK=iZ("nodejs.rejection"),PK=Array.prototype.slice,LQ=eX.prototype={};LQ._events=void 0;LQ._eventsCount=0;LQ._maxListeners=void 0;LQ.setMaxListeners=function(Q){return tZ(Q,"setMaxListeners",0),this._maxListeners=Q,this};LQ.constructor=eX;LQ.getMaxListeners=function(){return this?._maxListeners??O1};LQ.emit=dT;LQ.addListener=function(Q,X){EJ(X);var Y=this._events;if(!Y)Y=this._events={__proto__:null},this._eventsCount=0;else if(Y.newListener)this.emit("newListener",Q,X.listener??X);var W=Y[Q];if(!W)Y[Q]=[X],this._eventsCount++;else{W.push(X);var G=this._maxListeners??O1;if(G>0&&W.length>G&&!W.warned)NK(this,Q,W)}return this};LQ.on=LQ.addListener;LQ.prependListener=function(Q,X){EJ(X);var Y=this._events;if(!Y)Y=this._events={__proto__:null},this._eventsCount=0;else if(Y.newListener)this.emit("newListener",Q,X.listener??X);var W=Y[Q];if(!W)Y[Q]=[X],this._eventsCount++;else{W.unshift(X);var G=this._maxListeners??O1;if(G>0&&W.length>G&&!W.warned)NK(this,Q,W)}return this};LQ.once=function(Q,X){EJ(X);let Y=kK.bind(this,Q,X);return Y.listener=X,this.addListener(Q,Y),this};LQ.prependOnceListener=function(Q,X){EJ(X);let Y=kK.bind(this,Q,X);return Y.listener=X,this.prependListener(Q,Y),this};LQ.removeListener=function(Q,X){EJ(X);var{_events:Y}=this;if(!Y)return this;var W=Y[Q];if(!W)return this;var G=W.length;let K=-1;for(let Z=G-1;Z>=0;Z--)if(W[Z]===X||W[Z].listener===X){K=Z;break}if(K<0)return this;if(K===0)W.shift();else W.splice(K,1);if(W.length===0)delete Y[Q],this._eventsCount--;return this};LQ.off=LQ.removeListener;LQ.removeAllListeners=function(Q){var{_events:X}=this;if(Q&&X){if(X[Q])delete X[Q],this._eventsCount--}else this._events={__proto__:null};return this};LQ.listeners=function(Q){var{_events:X}=this;if(!X)return[];var Y=X[Q];if(!Y)return[];return Y.map((W)=>W.listener??W)};LQ.rawListeners=function(Q){var{_events:X}=this;if(!X)return[];var Y=X[Q];if(!Y)return[];return Y.slice()};LQ.listenerCount=function(Q){var{_events:X}=this;if(!X)return 0;return X[Q]?.length??0};LQ.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};LQ[z1]=!1;rZ=class rZ extends Error{constructor(Q="The operation was aborted",X=void 0){if(X!==void 0&&typeof X!=="object")throw g1("options","Object",X);super(Q,X);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(eX,{captureRejections:{get(){return LQ[z1]},set(Q){rT(Q,"EventEmitter.captureRejections"),LQ[z1]=Q},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return O1},set:(Q)=>{tZ(Q,"defaultMaxListeners",0),O1=Q}},kMaxEventTargetListeners:{value:pT,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:cT,enumerable:!1,configurable:!1,writable:!1}});Object.assign(eX,{once:wK,getEventListeners:vK,getMaxListeners:gK,setMaxListeners:_K,EventEmitter:eX,usingDomains:!1,captureRejectionSymbol:CK,errorMonitor:SK,addAbortListener:fK,init:eX,listenerCount:xK});iT=eX});var QH=F0((qd,dK)=>{var KQ=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports),CQ=KQ((Q,X)=>{class Y extends Error{constructor(W){if(!Array.isArray(W))throw TypeError(`Expected input to be an Array, got ${typeof W}`);let G="";for(let K=0;K<W.length;K++)G+=` ${W[K].stack}
|
|
11
|
+
`;super(G);this.name="AggregateError",this.errors=W}}X.exports={AggregateError:Y,ArrayIsArray(W){return Array.isArray(W)},ArrayPrototypeIncludes(W,G){return W.includes(G)},ArrayPrototypeIndexOf(W,G){return W.indexOf(G)},ArrayPrototypeJoin(W,G){return W.join(G)},ArrayPrototypeMap(W,G){return W.map(G)},ArrayPrototypePop(W,G){return W.pop(G)},ArrayPrototypePush(W,G){return W.push(G)},ArrayPrototypeSlice(W,G,K){return W.slice(G,K)},Error,FunctionPrototypeCall(W,G,...K){return W.call(G,...K)},FunctionPrototypeSymbolHasInstance(W,G){return Function.prototype[Symbol.hasInstance].call(W,G)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(W,G){return Object.defineProperties(W,G)},ObjectDefineProperty(W,G,K){return Object.defineProperty(W,G,K)},ObjectGetOwnPropertyDescriptor(W,G){return Object.getOwnPropertyDescriptor(W,G)},ObjectKeys(W){return Object.keys(W)},ObjectSetPrototypeOf(W,G){return Object.setPrototypeOf(W,G)},Promise,PromisePrototypeCatch(W,G){return W.catch(G)},PromisePrototypeThen(W,G,K){return W.then(G,K)},PromiseReject(W){return Promise.reject(W)},PromiseResolve(W){return Promise.resolve(W)},ReflectApply:Reflect.apply,RegExpPrototypeTest(W,G){return W.test(G)},SafeSet:Set,String,StringPrototypeSlice(W,G,K){return W.slice(G,K)},StringPrototypeToLowerCase(W){return W.toLowerCase()},StringPrototypeToUpperCase(W){return W.toUpperCase()},StringPrototypeTrim(W){return W.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(W,G,K){return W.set(G,K)},Boolean,Uint8Array}}),bK=KQ((Q,X)=>{X.exports={format(Y,...W){return Y.replace(/%([sdifj])/g,function(...[G,K]){let Z=W.shift();if(K==="f")return Z.toFixed(6);else if(K==="j")return JSON.stringify(Z);else if(K==="s"&&typeof Z==="object")return`${Z.constructor!==Object?Z.constructor.name:""} {}`.trim();else return Z.toString()})},inspect(Y){switch(typeof Y){case"string":if(Y.includes("'")){if(!Y.includes('"'))return`"${Y}"`;else if(!Y.includes("`")&&!Y.includes("${"))return`\`${Y}\``}return`'${Y}'`;case"number":if(isNaN(Y))return"NaN";else if(Object.is(Y,-0))return String(Y);return Y;case"bigint":return`${String(Y)}n`;case"boolean":case"undefined":return String(Y);case"object":return"{}"}}}}),MX=KQ((Q,X)=>{var{format:Y,inspect:W}=bK(),{AggregateError:G}=CQ(),K=globalThis.AggregateError||G,Z=Symbol("kIsNodeError"),q=["string","function","number","object","Function","Object","boolean","bigint","symbol"],E=/^([A-Z][a-z0-9]*)+$/,I={};function L(N,k){if(!N)throw new I.ERR_INTERNAL_ASSERTION(k)}function D(N){let k="",v=N.length,_=N[0]==="-"?1:0;for(;v>=_+4;v-=3)k=`_${N.slice(v-3,v)}${k}`;return`${N.slice(0,v)}${k}`}function T(N,k,v){if(typeof k==="function")return L(k.length<=v.length,`Code: ${N}; The provided arguments length (${v.length}) does not match the required ones (${k.length}).`),k(...v);let _=(k.match(/%[dfijoOs]/g)||[]).length;if(L(_===v.length,`Code: ${N}; The provided arguments length (${v.length}) does not match the required ones (${_}).`),v.length===0)return k;return Y(k,...v)}function P(N,k,v){if(!v)v=Error;class _ extends v{constructor(...x){super(T(N,k,x))}toString(){return`${this.name} [${N}]: ${this.message}`}}Object.defineProperties(_.prototype,{name:{value:v.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${N}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),_.prototype.code=N,_.prototype[Z]=!0,I[N]=_}function B(N){let k="__node_internal_"+N.name;return Object.defineProperty(N,"name",{value:k}),N}function j(N,k){if(N&&k&&N!==k){if(Array.isArray(k.errors))return k.errors.push(N),k;let v=new K([k,N],k.message);return v.code=k.code,v}return N||k}class S extends Error{constructor(N="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!=="object")throw new I.ERR_INVALID_ARG_TYPE("options","Object",k);super(N,k);this.code="ABORT_ERR",this.name="AbortError"}}P("ERR_ASSERTION","%s",Error),P("ERR_INVALID_ARG_TYPE",(N,k,v)=>{if(L(typeof N==="string","'name' must be a string"),!Array.isArray(k))k=[k];let _="The ";if(N.endsWith(" argument"))_+=`${N} `;else _+=`"${N}" ${N.includes(".")?"property":"argument"} `;_+="must be ";let x=[],c=[],Y0=[];for(let e of k)if(L(typeof e==="string","All expected entries have to be of type string"),q.includes(e))x.push(e.toLowerCase());else if(E.test(e))c.push(e);else L(e!=="object",'The value "object" should be written as "Object"'),Y0.push(e);if(c.length>0){let e=x.indexOf("object");if(e!==-1)x.splice(x,e,1),c.push("Object")}if(x.length>0){switch(x.length){case 1:_+=`of type ${x[0]}`;break;case 2:_+=`one of type ${x[0]} or ${x[1]}`;break;default:{let e=x.pop();_+=`one of type ${x.join(", ")}, or ${e}`}}if(c.length>0||Y0.length>0)_+=" or "}if(c.length>0){switch(c.length){case 1:_+=`an instance of ${c[0]}`;break;case 2:_+=`an instance of ${c[0]} or ${c[1]}`;break;default:{let e=c.pop();_+=`an instance of ${c.join(", ")}, or ${e}`}}if(Y0.length>0)_+=" or "}switch(Y0.length){case 0:break;case 1:if(Y0[0].toLowerCase()!==Y0[0])_+="an ";_+=`${Y0[0]}`;break;case 2:_+=`one of ${Y0[0]} or ${Y0[1]}`;break;default:{let e=Y0.pop();_+=`one of ${Y0.join(", ")}, or ${e}`}}if(v==null)_+=`. Received ${v}`;else if(typeof v==="function"&&v.name)_+=`. Received function ${v.name}`;else if(typeof v==="object"){var $0;if(($0=v.constructor)!==null&&$0!==void 0&&$0.name)_+=`. Received an instance of ${v.constructor.name}`;else{let e=W(v,{depth:-1});_+=`. Received ${e}`}}else{let e=W(v,{colors:!1});if(e.length>25)e=`${e.slice(0,25)}...`;_+=`. Received type ${typeof v} (${e})`}return _},TypeError),P("ERR_INVALID_ARG_VALUE",(N,k,v="is invalid")=>{let _=W(k);if(_.length>128)_=_.slice(0,128)+"...";return`The ${N.includes(".")?"property":"argument"} '${N}' ${v}. Received ${_}`},TypeError),P("ERR_INVALID_RETURN_VALUE",(N,k,v)=>{var _;let x=v!==null&&v!==void 0&&(_=v.constructor)!==null&&_!==void 0&&_.name?`instance of ${v.constructor.name}`:`type ${typeof v}`;return`Expected ${N} to be returned from the "${k}" function but got ${x}.`},TypeError),P("ERR_MISSING_ARGS",(...N)=>{L(N.length>0,"At least one arg needs to be specified");let k,v=N.length;switch(N=(Array.isArray(N)?N:[N]).map((_)=>`"${_}"`).join(" or "),v){case 1:k+=`The ${N[0]} argument`;break;case 2:k+=`The ${N[0]} and ${N[1]} arguments`;break;default:{let _=N.pop();k+=`The ${N.join(", ")}, and ${_} arguments`}break}return`${k} must be specified`},TypeError),P("ERR_OUT_OF_RANGE",(N,k,v)=>{L(k,'Missing "range" argument');let _;if(Number.isInteger(v)&&Math.abs(v)>4294967296)_=D(String(v));else if(typeof v==="bigint"){_=String(v);let x=BigInt(2)**BigInt(32);if(v>x||v<-x)_=D(_);_+="n"}else _=W(v);return`The value of "${N}" is out of range. It must be ${k}. Received ${_}`},RangeError),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),P("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),P("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),P("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),P("ERR_STREAM_WRITE_AFTER_END","write after end",Error),P("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),X.exports={AbortError:S,aggregateTwoErrors:B(j),hideStackFrames:B,codes:I}}),tT=KQ((Q,X)=>{Object.defineProperty(Q,"__esModule",{value:!0});var Y=new WeakMap,W=new WeakMap;function G(p){let X0=Y.get(p);return console.assert(X0!=null,"'this' is expected an Event object, but got",p),X0}function K(p){if(p.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",p.passiveListener);return}if(!p.event.cancelable)return;if(p.canceled=!0,typeof p.event.preventDefault==="function")p.event.preventDefault()}function Z(p,X0){Y.set(this,{eventTarget:p,event:X0,eventPhase:2,currentTarget:p,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:X0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let J=Object.keys(X0);for(let U=0;U<J.length;++U){let V=J[U];if(!(V in this))Object.defineProperty(this,V,q(V))}}if(Z.prototype={get type(){return G(this).event.type},get target(){return G(this).eventTarget},get currentTarget(){return G(this).currentTarget},composedPath(){let p=G(this).currentTarget;if(p==null)return[];return[p]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return G(this).eventPhase},stopPropagation(){let p=G(this);if(p.stopped=!0,typeof p.event.stopPropagation==="function")p.event.stopPropagation()},stopImmediatePropagation(){let p=G(this);if(p.stopped=!0,p.immediateStopped=!0,typeof p.event.stopImmediatePropagation==="function")p.event.stopImmediatePropagation()},get bubbles(){return Boolean(G(this).event.bubbles)},get cancelable(){return Boolean(G(this).event.cancelable)},preventDefault(){K(G(this))},get defaultPrevented(){return G(this).canceled},get composed(){return Boolean(G(this).event.composed)},get timeStamp(){return G(this).timeStamp},get srcElement(){return G(this).eventTarget},get cancelBubble(){return G(this).stopped},set cancelBubble(p){if(!p)return;let X0=G(this);if(X0.stopped=!0,typeof X0.event.cancelBubble==="boolean")X0.event.cancelBubble=!0},get returnValue(){return!G(this).canceled},set returnValue(p){if(!p)K(G(this))},initEvent(){}},Object.defineProperty(Z.prototype,"constructor",{value:Z,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(Z.prototype,window.Event.prototype),W.set(window.Event.prototype,Z);function q(p){return{get(){return G(this).event[p]},set(X0){G(this).event[p]=X0},configurable:!0,enumerable:!0}}function E(p){return{value(){let X0=G(this).event;return X0[p].apply(X0,arguments)},configurable:!0,enumerable:!0}}function I(p,X0){let J=Object.keys(X0);if(J.length===0)return p;function U(V,H){p.call(this,V,H)}U.prototype=Object.create(p.prototype,{constructor:{value:U,configurable:!0,writable:!0}});for(let V=0;V<J.length;++V){let H=J[V];if(!(H in p.prototype)){let F=typeof Object.getOwnPropertyDescriptor(X0,H).value==="function";Object.defineProperty(U.prototype,H,F?E(H):q(H))}}return U}function L(p){if(p==null||p===Object.prototype)return Z;let X0=W.get(p);if(X0==null)X0=I(L(Object.getPrototypeOf(p)),p),W.set(p,X0);return X0}function D(p,X0){return new(L(Object.getPrototypeOf(X0)))(p,X0)}function T(p){return G(p).immediateStopped}function P(p,X0){G(p).eventPhase=X0}function B(p,X0){G(p).currentTarget=X0}function j(p,X0){G(p).passiveListener=X0}var S=new WeakMap,N=1,k=2,v=3;function _(p){return p!==null&&typeof p==="object"}function x(p){let X0=S.get(p);if(X0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return X0}function c(p){return{get(){let X0=x(this).get(p);while(X0!=null){if(X0.listenerType===v)return X0.listener;X0=X0.next}return null},set(X0){if(typeof X0!=="function"&&!_(X0))X0=null;let J=x(this),U=null,V=J.get(p);while(V!=null){if(V.listenerType===v)if(U!==null)U.next=V.next;else if(V.next!==null)J.set(p,V.next);else J.delete(p);else U=V;V=V.next}if(X0!==null){let H={listener:X0,listenerType:v,passive:!1,once:!1,next:null};if(U===null)J.set(p,H);else U.next=H}},configurable:!0,enumerable:!0}}function Y0(p,X0){Object.defineProperty(p,`on${X0}`,c(X0))}function $0(p){function X0(){e.call(this)}X0.prototype=Object.create(e.prototype,{constructor:{value:X0,configurable:!0,writable:!0}});for(let J=0;J<p.length;++J)Y0(X0.prototype,p[J]);return X0}function e(){if(this instanceof e){S.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return $0(arguments[0]);if(arguments.length>0){let p=Array(arguments.length);for(let X0=0;X0<arguments.length;++X0)p[X0]=arguments[X0];return $0(p)}throw TypeError("Cannot call a class as a function")}if(e.prototype={addEventListener(p,X0,J){if(X0==null)return;if(typeof X0!=="function"&&!_(X0))throw TypeError("'listener' should be a function or an object.");let U=x(this),V=_(J),H=(V?Boolean(J.capture):Boolean(J))?N:k,F={listener:X0,listenerType:H,passive:V&&Boolean(J.passive),once:V&&Boolean(J.once),next:null},A=U.get(p);if(A===void 0){U.set(p,F);return}let M=null;while(A!=null){if(A.listener===X0&&A.listenerType===H)return;M=A,A=A.next}M.next=F},removeEventListener(p,X0,J){if(X0==null)return;let U=x(this),V=(_(J)?Boolean(J.capture):Boolean(J))?N:k,H=null,F=U.get(p);while(F!=null){if(F.listener===X0&&F.listenerType===V){if(H!==null)H.next=F.next;else if(F.next!==null)U.set(p,F.next);else U.delete(p);return}H=F,F=F.next}},dispatchEvent(p){if(p==null||typeof p.type!=="string")throw TypeError('"event.type" should be a string.');let X0=x(this),J=p.type,U=X0.get(J);if(U==null)return!0;let V=D(this,p),H=null;while(U!=null){if(U.once)if(H!==null)H.next=U.next;else if(U.next!==null)X0.set(J,U.next);else X0.delete(J);else H=U;if(j(V,U.passive?U.listener:null),typeof U.listener==="function")try{U.listener.call(this,V)}catch(F){if(typeof console<"u"&&typeof console.error==="function")console.error(F)}else if(U.listenerType!==v&&typeof U.listener.handleEvent==="function")U.listener.handleEvent(V);if(T(V))break;U=U.next}return j(V,null),P(V,0),B(V,null),!V.defaultPrevented}},Object.defineProperty(e.prototype,"constructor",{value:e,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(e.prototype,window.EventTarget.prototype);Q.defineEventAttribute=Y0,Q.EventTarget=e,Q.default=e,X.exports=e,X.exports.EventTarget=X.exports.default=e,X.exports.defineEventAttribute=Y0}),RJ=KQ((Q,X)=>{Object.defineProperty(Q,"__esModule",{value:!0});var Y=tT();class W extends Y.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let L=Z.get(this);if(typeof L!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return L}}Y.defineEventAttribute(W.prototype,"abort");function G(){let L=Object.create(W.prototype);return Y.EventTarget.call(L),Z.set(L,!1),L}function K(L){if(Z.get(L)!==!1)return;Z.set(L,!0),L.dispatchEvent({type:"abort"})}var Z=new WeakMap;if(Object.defineProperties(W.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(W.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class q{constructor(){E.set(this,G())}get signal(){return I(this)}abort(){K(I(this))}}var E=new WeakMap;function I(L){let D=E.get(L);if(D==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${L===null?"null":typeof L}`);return D}if(Object.defineProperties(q.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(q.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Q.AbortController=q,Q.AbortSignal=W,Q.default=q,X.exports=q,X.exports.AbortController=X.exports.default=q,X.exports.AbortSignal=W}),NX=KQ((Q,X)=>{var Y=(JX(),WQ(YX)),{format:W,inspect:G}=bK(),{codes:{ERR_INVALID_ARG_TYPE:K}}=MX(),{kResistStopPropagation:Z,AggregateError:q,SymbolDispose:E}=CQ(),I=globalThis.AbortSignal||RJ().AbortSignal,L=globalThis.AbortController||RJ().AbortController,D=Object.getPrototypeOf(async function(){}).constructor,T=globalThis.Blob||Y.Blob,P=typeof T<"u"?function(S){return S instanceof T}:function(S){return!1},B=(S,N)=>{if(S!==void 0&&(S===null||typeof S!=="object"||!("aborted"in S)))throw new K(N,"AbortSignal",S)},j=(S,N)=>{if(typeof S!=="function")throw new K(N,"Function",S)};X.exports={AggregateError:q,kEmptyObject:Object.freeze({}),once(S){let N=!1;return function(...k){if(N)return;N=!0,S.apply(this,k)}},createDeferredPromise:function(){let S,N;return{promise:new Promise((k,v)=>{S=k,N=v}),resolve:S,reject:N}},promisify(S){return new Promise((N,k)=>{S((v,..._)=>{if(v)return k(v);return N(..._)})})},debuglog(){return function(){}},format:W,inspect:G,types:{isAsyncFunction(S){return S instanceof D},isArrayBufferView(S){return ArrayBuffer.isView(S)}},isBlob:P,deprecate(S,N){return S},addAbortListener:(A1(),WQ(TJ)).addAbortListener||function(S,N){if(S===void 0)throw new K("signal","AbortSignal",S);B(S,"signal"),j(N,"listener");let k;if(S.aborted)queueMicrotask(()=>N());else S.addEventListener("abort",N,{__proto__:null,once:!0,[Z]:!0}),k=()=>{S.removeEventListener("abort",N)};return{__proto__:null,[E](){var v;(v=k)===null||v===void 0||v()}}},AbortSignalAny:I.any||function(S){if(S.length===1)return S[0];let N=new L,k=()=>N.abort();return S.forEach((v)=>{B(v,"signals"),v.addEventListener("abort",k,{once:!0})}),N.signal.addEventListener("abort",()=>{S.forEach((v)=>v.removeEventListener("abort",k))},{once:!0}),N.signal}},X.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),PJ=KQ((Q,X)=>{var{ArrayIsArray:Y,ArrayPrototypeIncludes:W,ArrayPrototypeJoin:G,ArrayPrototypeMap:K,NumberIsInteger:Z,NumberIsNaN:q,NumberMAX_SAFE_INTEGER:E,NumberMIN_SAFE_INTEGER:I,NumberParseInt:L,ObjectPrototypeHasOwnProperty:D,RegExpPrototypeExec:T,String:P,StringPrototypeToUpperCase:B,StringPrototypeTrim:j}=CQ(),{hideStackFrames:S,codes:{ERR_SOCKET_BAD_PORT:N,ERR_INVALID_ARG_TYPE:k,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:x}}=MX(),{normalizeEncoding:c}=NX(),{isAsyncFunction:Y0,isArrayBufferView:$0}=NX().types,e={};function p(b){return b===(b|0)}function X0(b){return b===b>>>0}var J=/^[0-7]+$/,U="must be a 32-bit unsigned integer or an octal string";function V(b,n,g0){if(typeof b>"u")b=g0;if(typeof b==="string"){if(T(J,b)===null)throw new v(n,b,U);b=L(b,8)}return A(b,n),b}var H=S((b,n,g0=I,r=E)=>{if(typeof b!=="number")throw new k(n,"number",b);if(!Z(b))throw new _(n,"an integer",b);if(b<g0||b>r)throw new _(n,`>= ${g0} && <= ${r}`,b)}),F=S((b,n,g0=-2147483648,r=2147483647)=>{if(typeof b!=="number")throw new k(n,"number",b);if(!Z(b))throw new _(n,"an integer",b);if(b<g0||b>r)throw new _(n,`>= ${g0} && <= ${r}`,b)}),A=S((b,n,g0=!1)=>{if(typeof b!=="number")throw new k(n,"number",b);if(!Z(b))throw new _(n,"an integer",b);let r=g0?1:0,W0=4294967295;if(b<r||b>W0)throw new _(n,`>= ${r} && <= ${W0}`,b)});function M(b,n){if(typeof b!=="string")throw new k(n,"string",b)}function z(b,n,g0=void 0,r){if(typeof b!=="number")throw new k(n,"number",b);if(g0!=null&&b<g0||r!=null&&b>r||(g0!=null||r!=null)&&q(b))throw new _(n,`${g0!=null?`>= ${g0}`:""}${g0!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,b)}var $=S((b,n,g0)=>{if(!W(g0,b)){let r="must be one of: "+G(K(g0,(W0)=>typeof W0==="string"?`'${W0}'`:P(W0)),", ");throw new v(n,b,r)}});function O(b,n){if(typeof b!=="boolean")throw new k(n,"boolean",b)}function C(b,n,g0){return b==null||!D(b,n)?g0:b[n]}var R=S((b,n,g0=null)=>{let r=C(g0,"allowArray",!1),W0=C(g0,"allowFunction",!1);if(!C(g0,"nullable",!1)&&b===null||!r&&Y(b)||typeof b!=="object"&&(!W0||typeof b!=="function"))throw new k(n,"Object",b)}),w=S((b,n)=>{if(b!=null&&typeof b!=="object"&&typeof b!=="function")throw new k(n,"a dictionary",b)}),g=S((b,n,g0=0)=>{if(!Y(b))throw new k(n,"Array",b);if(b.length<g0){let r=`must be longer than ${g0}`;throw new v(n,b,r)}});function h(b,n){g(b,n);for(let g0=0;g0<b.length;g0++)M(b[g0],`${n}[${g0}]`)}function d(b,n){g(b,n);for(let g0=0;g0<b.length;g0++)O(b[g0],`${n}[${g0}]`)}function K0(b,n){g(b,n);for(let g0=0;g0<b.length;g0++){let r=b[g0],W0=`${n}[${g0}]`;if(r==null)throw new k(W0,"AbortSignal",r);Q0(r,W0)}}function i(b,n="signal"){if(M(b,n),e[b]===void 0){if(e[B(b)]!==void 0)throw new x(b+" (signals must use all capital letters)");throw new x(b)}}var m=S((b,n="buffer")=>{if(!$0(b))throw new k(n,["Buffer","TypedArray","DataView"],b)});function G0(b,n){let g0=c(n),r=b.length;if(g0==="hex"&&r%2!==0)throw new v("encoding",n,`is invalid for data of length ${r}`)}function o(b,n="Port",g0=!0){if(typeof b!=="number"&&typeof b!=="string"||typeof b==="string"&&j(b).length===0||+b!==+b>>>0||b>65535||b===0&&!g0)throw new N(n,b,g0);return b|0}var Q0=S((b,n)=>{if(b!==void 0&&(b===null||typeof b!=="object"||!("aborted"in b)))throw new k(n,"AbortSignal",b)}),f0=S((b,n)=>{if(typeof b!=="function")throw new k(n,"Function",b)}),f=S((b,n)=>{if(typeof b!=="function"||Y0(b))throw new k(n,"Function",b)}),u=S((b,n)=>{if(b!==void 0)throw new k(n,"undefined",b)});function Z0(b,n,g0){if(!W(g0,b))throw new k(n,`('${G(g0,"|")}')`,b)}var t=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function a(b,n){if(typeof b>"u"||!T(t,b))throw new v(n,b,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function R0(b){if(typeof b==="string")return a(b,"hints"),b;else if(Y(b)){let n=b.length,g0="";if(n===0)return g0;for(let r=0;r<n;r++){let W0=b[r];if(a(W0,"hints"),g0+=W0,r!==n-1)g0+=", "}return g0}throw new v("hints",b,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}X.exports={isInt32:p,isUint32:X0,parseFileMode:V,validateArray:g,validateStringArray:h,validateBooleanArray:d,validateAbortSignalArray:K0,validateBoolean:O,validateBuffer:m,validateDictionary:w,validateEncoding:G0,validateFunction:f0,validateInt32:F,validateInteger:H,validateNumber:z,validateObject:R,validateOneOf:$,validatePlainFunction:f,validatePort:o,validateSignalName:i,validateString:M,validateUint32:A,validateUndefined:u,validateUnion:Z0,validateAbortSignal:Q0,validateLinkHeaderValue:R0}}),D1=KQ((Q,X)=>{X.exports=globalThis.process}),PY=KQ((Q,X)=>{var{SymbolAsyncIterator:Y,SymbolIterator:W,SymbolFor:G}=CQ(),K=G("nodejs.stream.destroyed"),Z=G("nodejs.stream.errored"),q=G("nodejs.stream.readable"),E=G("nodejs.stream.writable"),I=G("nodejs.stream.disturbed"),L=G("nodejs.webstream.isClosedPromise"),D=G("nodejs.webstream.controllerErrorFunction");function T(C,R=!1){var w;return!!(C&&typeof C.pipe==="function"&&typeof C.on==="function"&&(!R||typeof C.pause==="function"&&typeof C.resume==="function")&&(!C._writableState||((w=C._readableState)===null||w===void 0?void 0:w.readable)!==!1)&&(!C._writableState||C._readableState))}function P(C){var R;return!!(C&&typeof C.write==="function"&&typeof C.on==="function"&&(!C._readableState||((R=C._writableState)===null||R===void 0?void 0:R.writable)!==!1))}function B(C){return!!(C&&typeof C.pipe==="function"&&C._readableState&&typeof C.on==="function"&&typeof C.write==="function")}function j(C){return C&&(C._readableState||C._writableState||typeof C.write==="function"&&typeof C.on==="function"||typeof C.pipe==="function"&&typeof C.on==="function")}function S(C){return!!(C&&!j(C)&&typeof C.pipeThrough==="function"&&typeof C.getReader==="function"&&typeof C.cancel==="function")}function N(C){return!!(C&&!j(C)&&typeof C.getWriter==="function"&&typeof C.abort==="function")}function k(C){return!!(C&&!j(C)&&typeof C.readable==="object"&&typeof C.writable==="object")}function v(C){return S(C)||N(C)||k(C)}function _(C,R){if(C==null)return!1;if(R===!0)return typeof C[Y]==="function";if(R===!1)return typeof C[W]==="function";return typeof C[Y]==="function"||typeof C[W]==="function"}function x(C){if(!j(C))return null;let{_writableState:R,_readableState:w}=C,g=R||w;return!!(C.destroyed||C[K]||g!==null&&g!==void 0&&g.destroyed)}function c(C){if(!P(C))return null;if(C.writableEnded===!0)return!0;let R=C._writableState;if(R!==null&&R!==void 0&&R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.ended)!=="boolean")return null;return R.ended}function Y0(C,R){if(!P(C))return null;if(C.writableFinished===!0)return!0;let w=C._writableState;if(w!==null&&w!==void 0&&w.errored)return!1;if(typeof(w===null||w===void 0?void 0:w.finished)!=="boolean")return null;return!!(w.finished||R===!1&&w.ended===!0&&w.length===0)}function $0(C){if(!T(C))return null;if(C.readableEnded===!0)return!0;let R=C._readableState;if(!R||R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.ended)!=="boolean")return null;return R.ended}function e(C,R){if(!T(C))return null;let w=C._readableState;if(w!==null&&w!==void 0&&w.errored)return!1;if(typeof(w===null||w===void 0?void 0:w.endEmitted)!=="boolean")return null;return!!(w.endEmitted||R===!1&&w.ended===!0&&w.length===0)}function p(C){if(C&&C[q]!=null)return C[q];if(typeof(C===null||C===void 0?void 0:C.readable)!=="boolean")return null;if(x(C))return!1;return T(C)&&C.readable&&!e(C)}function X0(C){if(C&&C[E]!=null)return C[E];if(typeof(C===null||C===void 0?void 0:C.writable)!=="boolean")return null;if(x(C))return!1;return P(C)&&C.writable&&!c(C)}function J(C,R){if(!j(C))return null;if(x(C))return!0;if((R===null||R===void 0?void 0:R.readable)!==!1&&p(C))return!1;if((R===null||R===void 0?void 0:R.writable)!==!1&&X0(C))return!1;return!0}function U(C){var R,w;if(!j(C))return null;if(C.writableErrored)return C.writableErrored;return(R=(w=C._writableState)===null||w===void 0?void 0:w.errored)!==null&&R!==void 0?R:null}function V(C){var R,w;if(!j(C))return null;if(C.readableErrored)return C.readableErrored;return(R=(w=C._readableState)===null||w===void 0?void 0:w.errored)!==null&&R!==void 0?R:null}function H(C){if(!j(C))return null;if(typeof C.closed==="boolean")return C.closed;let{_writableState:R,_readableState:w}=C;if(typeof(R===null||R===void 0?void 0:R.closed)==="boolean"||typeof(w===null||w===void 0?void 0:w.closed)==="boolean")return(R===null||R===void 0?void 0:R.closed)||(w===null||w===void 0?void 0:w.closed);if(typeof C._closed==="boolean"&&F(C))return C._closed;return null}function F(C){return typeof C._closed==="boolean"&&typeof C._defaultKeepAlive==="boolean"&&typeof C._removedConnection==="boolean"&&typeof C._removedContLen==="boolean"}function A(C){return typeof C._sent100==="boolean"&&F(C)}function M(C){var R;return typeof C._consuming==="boolean"&&typeof C._dumped==="boolean"&&((R=C.req)===null||R===void 0?void 0:R.upgradeOrConnect)===void 0}function z(C){if(!j(C))return null;let{_writableState:R,_readableState:w}=C,g=R||w;return!g&&A(C)||!!(g&&g.autoDestroy&&g.emitClose&&g.closed===!1)}function $(C){var R;return!!(C&&((R=C[I])!==null&&R!==void 0?R:C.readableDidRead||C.readableAborted))}function O(C){var R,w,g,h,d,K0,i,m,G0,o;return!!(C&&((R=(w=(g=(h=(d=(K0=C[Z])!==null&&K0!==void 0?K0:C.readableErrored)!==null&&d!==void 0?d:C.writableErrored)!==null&&h!==void 0?h:(i=C._readableState)===null||i===void 0?void 0:i.errorEmitted)!==null&&g!==void 0?g:(m=C._writableState)===null||m===void 0?void 0:m.errorEmitted)!==null&&w!==void 0?w:(G0=C._readableState)===null||G0===void 0?void 0:G0.errored)!==null&&R!==void 0?R:(o=C._writableState)===null||o===void 0?void 0:o.errored))}X.exports={isDestroyed:x,kIsDestroyed:K,isDisturbed:$,kIsDisturbed:I,isErrored:O,kIsErrored:Z,isReadable:p,kIsReadable:q,kIsClosedPromise:L,kControllerErrorFunction:D,kIsWritable:E,isClosed:H,isDuplexNodeStream:B,isFinished:J,isIterable:_,isReadableNodeStream:T,isReadableStream:S,isReadableEnded:$0,isReadableFinished:e,isReadableErrored:V,isNodeStream:j,isWebStream:v,isWritable:X0,isWritableNodeStream:P,isWritableStream:N,isWritableEnded:c,isWritableFinished:Y0,isWritableErrored:U,isServerRequest:M,isServerResponse:A,willEmitClose:z,isTransformStream:k}}),lY=KQ((Q,X)=>{var Y=D1(),{AbortError:W,codes:G}=MX(),{ERR_INVALID_ARG_TYPE:K,ERR_STREAM_PREMATURE_CLOSE:Z}=G,{kEmptyObject:q,once:E}=NX(),{validateAbortSignal:I,validateFunction:L,validateObject:D,validateBoolean:T}=PJ(),{Promise:P,PromisePrototypeThen:B,SymbolDispose:j}=CQ(),{isClosed:S,isReadable:N,isReadableNodeStream:k,isReadableStream:v,isReadableFinished:_,isReadableErrored:x,isWritable:c,isWritableNodeStream:Y0,isWritableStream:$0,isWritableFinished:e,isWritableErrored:p,isNodeStream:X0,willEmitClose:J,kIsClosedPromise:U}=PY(),V;function H($){return $.setHeader&&typeof $.abort==="function"}var F=()=>{};function A($,O,C){var R,w;if(arguments.length===2)C=O,O=q;else if(O==null)O=q;else D(O,"options");if(L(C,"callback"),I(O.signal,"options.signal"),C=E(C),v($)||$0($))return M($,O,C);if(!X0($))throw new K("stream",["ReadableStream","WritableStream","Stream"],$);let g=(R=O.readable)!==null&&R!==void 0?R:k($),h=(w=O.writable)!==null&&w!==void 0?w:Y0($),d=$._writableState,K0=$._readableState,i=()=>{if(!$.writable)o()},m=J($)&&k($)===g&&Y0($)===h,G0=e($,!1),o=()=>{if(G0=!0,$.destroyed)m=!1;if(m&&(!$.readable||g))return;if(!g||Q0)C.call($)},Q0=_($,!1),f0=()=>{if(Q0=!0,$.destroyed)m=!1;if(m&&(!$.writable||h))return;if(!h||G0)C.call($)},f=(b)=>{C.call($,b)},u=S($),Z0=()=>{u=!0;let b=p($)||x($);if(b&&typeof b!=="boolean")return C.call($,b);if(g&&!Q0&&k($,!0)){if(!_($,!1))return C.call($,new Z)}if(h&&!G0){if(!e($,!1))return C.call($,new Z)}C.call($)},t=()=>{u=!0;let b=p($)||x($);if(b&&typeof b!=="boolean")return C.call($,b);C.call($)},a=()=>{$.req.on("finish",o)};if(H($)){if($.on("complete",o),!m)$.on("abort",Z0);if($.req)a();else $.on("request",a)}else if(h&&!d)$.on("end",i),$.on("close",i);if(!m&&typeof $.aborted==="boolean")$.on("aborted",Z0);if($.on("end",f0),$.on("finish",o),O.error!==!1)$.on("error",f);if($.on("close",Z0),u)Y.nextTick(Z0);else if(d!==null&&d!==void 0&&d.errorEmitted||K0!==null&&K0!==void 0&&K0.errorEmitted){if(!m)Y.nextTick(t)}else if(!g&&(!m||N($))&&(G0||c($)===!1))Y.nextTick(t);else if(!h&&(!m||c($))&&(Q0||N($)===!1))Y.nextTick(t);else if(K0&&$.req&&$.aborted)Y.nextTick(t);let R0=()=>{if(C=F,$.removeListener("aborted",Z0),$.removeListener("complete",o),$.removeListener("abort",Z0),$.removeListener("request",a),$.req)$.req.removeListener("finish",o);$.removeListener("end",i),$.removeListener("close",i),$.removeListener("finish",o),$.removeListener("end",f0),$.removeListener("error",f),$.removeListener("close",Z0)};if(O.signal&&!u){let b=()=>{let n=C;R0(),n.call($,new W(void 0,{cause:O.signal.reason}))};if(O.signal.aborted)Y.nextTick(b);else{V=V||NX().addAbortListener;let n=V(O.signal,b),g0=C;C=E((...r)=>{n[j](),g0.apply($,r)})}}return R0}function M($,O,C){let R=!1,w=F;if(O.signal)if(w=()=>{R=!0,C.call($,new W(void 0,{cause:O.signal.reason}))},O.signal.aborted)Y.nextTick(w);else{V=V||NX().addAbortListener;let h=V(O.signal,w),d=C;C=E((...K0)=>{h[j](),d.apply($,K0)})}let g=(...h)=>{if(!R)Y.nextTick(()=>C.apply($,h))};return B($[U].promise,g,g),F}function z($,O){var C;let R=!1;if(O===null)O=q;if((C=O)!==null&&C!==void 0&&C.cleanup)T(O.cleanup,"cleanup"),R=O.cleanup;return new P((w,g)=>{let h=A($,O,(d)=>{if(R)h();if(d)g(d);else w()})})}X.exports=A,X.exports.finished=z}),f1=KQ((Q,X)=>{var Y=D1(),{aggregateTwoErrors:W,codes:{ERR_MULTIPLE_CALLBACK:G},AbortError:K}=MX(),{Symbol:Z}=CQ(),{kIsDestroyed:q,isDestroyed:E,isFinished:I,isServerRequest:L}=PY(),D=Z("kDestroy"),T=Z("kConstruct");function P(J,U,V){if(J){if(J.stack,U&&!U.errored)U.errored=J;if(V&&!V.errored)V.errored=J}}function B(J,U){let V=this._readableState,H=this._writableState,F=H||V;if(H!==null&&H!==void 0&&H.destroyed||V!==null&&V!==void 0&&V.destroyed){if(typeof U==="function")U();return this}if(P(J,H,V),H)H.destroyed=!0;if(V)V.destroyed=!0;if(!F.constructed)this.once(D,function(A){j(this,W(A,J),U)});else j(this,J,U);return this}function j(J,U,V){let H=!1;function F(A){if(H)return;H=!0;let{_readableState:M,_writableState:z}=J;if(P(A,z,M),z)z.closed=!0;if(M)M.closed=!0;if(typeof V==="function")V(A);if(A)Y.nextTick(S,J,A);else Y.nextTick(N,J)}try{J._destroy(U||null,F)}catch(A){F(A)}}function S(J,U){k(J,U),N(J)}function N(J){let{_readableState:U,_writableState:V}=J;if(V)V.closeEmitted=!0;if(U)U.closeEmitted=!0;if(V!==null&&V!==void 0&&V.emitClose||U!==null&&U!==void 0&&U.emitClose)J.emit("close")}function k(J,U){let{_readableState:V,_writableState:H}=J;if(H!==null&&H!==void 0&&H.errorEmitted||V!==null&&V!==void 0&&V.errorEmitted)return;if(H)H.errorEmitted=!0;if(V)V.errorEmitted=!0;J.emit("error",U)}function v(){let J=this._readableState,U=this._writableState;if(J)J.constructed=!0,J.closed=!1,J.closeEmitted=!1,J.destroyed=!1,J.errored=null,J.errorEmitted=!1,J.reading=!1,J.ended=J.readable===!1,J.endEmitted=J.readable===!1;if(U)U.constructed=!0,U.destroyed=!1,U.closed=!1,U.closeEmitted=!1,U.errored=null,U.errorEmitted=!1,U.finalCalled=!1,U.prefinished=!1,U.ended=U.writable===!1,U.ending=U.writable===!1,U.finished=U.writable===!1}function _(J,U,V){let{_readableState:H,_writableState:F}=J;if(F!==null&&F!==void 0&&F.destroyed||H!==null&&H!==void 0&&H.destroyed)return this;if(H!==null&&H!==void 0&&H.autoDestroy||F!==null&&F!==void 0&&F.autoDestroy)J.destroy(U);else if(U){if(U.stack,F&&!F.errored)F.errored=U;if(H&&!H.errored)H.errored=U;if(V)Y.nextTick(k,J,U);else k(J,U)}}function x(J,U){if(typeof J._construct!=="function")return;let{_readableState:V,_writableState:H}=J;if(V)V.constructed=!1;if(H)H.constructed=!1;if(J.once(T,U),J.listenerCount(T)>1)return;Y.nextTick(c,J)}function c(J){let U=!1;function V(H){if(U){_(J,H!==null&&H!==void 0?H:new G);return}U=!0;let{_readableState:F,_writableState:A}=J,M=A||F;if(F)F.constructed=!0;if(A)A.constructed=!0;if(M.destroyed)J.emit(D,H);else if(H)_(J,H,!0);else Y.nextTick(Y0,J)}try{J._construct((H)=>{Y.nextTick(V,H)})}catch(H){Y.nextTick(V,H)}}function Y0(J){J.emit(T)}function $0(J){return(J===null||J===void 0?void 0:J.setHeader)&&typeof J.abort==="function"}function e(J){J.emit("close")}function p(J,U){J.emit("error",U),Y.nextTick(e,J)}function X0(J,U){if(!J||E(J))return;if(!U&&!I(J))U=new K;if(L(J))J.socket=null,J.destroy(U);else if($0(J))J.abort();else if($0(J.req))J.req.abort();else if(typeof J.destroy==="function")J.destroy(U);else if(typeof J.close==="function")J.close();else if(U)Y.nextTick(p,J,U);else Y.nextTick(e,J);if(!J.destroyed)J[q]=!0}X.exports={construct:x,destroyer:X0,destroy:B,undestroy:v,errorOrDestroy:_}}),sZ=KQ((Q,X)=>{var{ArrayIsArray:Y,ObjectSetPrototypeOf:W}=CQ(),{EventEmitter:G}=(A1(),WQ(TJ));function K(q){G.call(this,q)}W(K.prototype,G.prototype),W(K,G),K.prototype.pipe=function(q,E){let I=this;function L(N){if(q.writable&&q.write(N)===!1&&I.pause)I.pause()}I.on("data",L);function D(){if(I.readable&&I.resume)I.resume()}if(q.on("drain",D),!q._isStdio&&(!E||E.end!==!1))I.on("end",P),I.on("close",B);let T=!1;function P(){if(T)return;T=!0,q.end()}function B(){if(T)return;if(T=!0,typeof q.destroy==="function")q.destroy()}function j(N){if(S(),G.listenerCount(this,"error")===0)this.emit("error",N)}Z(I,"error",j),Z(q,"error",j);function S(){I.removeListener("data",L),q.removeListener("drain",D),I.removeListener("end",P),I.removeListener("close",B),I.removeListener("error",j),q.removeListener("error",j),I.removeListener("end",S),I.removeListener("close",S),q.removeListener("close",S)}return I.on("end",S),I.on("close",S),q.on("close",S),q.emit("pipe",I),q};function Z(q,E,I){if(typeof q.prependListener==="function")return q.prependListener(E,I);if(!q._events||!q._events[E])q.on(E,I);else if(Y(q._events[E]))q._events[E].unshift(I);else q._events[E]=[I,q._events[E]]}X.exports={Stream:K,prependListener:Z}}),KG=KQ((Q,X)=>{var{SymbolDispose:Y}=CQ(),{AbortError:W,codes:G}=MX(),{isNodeStream:K,isWebStream:Z,kControllerErrorFunction:q}=PY(),E=lY(),{ERR_INVALID_ARG_TYPE:I}=G,L,D=(T,P)=>{if(typeof T!=="object"||!("aborted"in T))throw new I(P,"AbortSignal",T)};X.exports.addAbortSignal=function(T,P){if(D(T,"signal"),!K(P)&&!Z(P))throw new I("stream",["ReadableStream","WritableStream","Stream"],P);return X.exports.addAbortSignalNoValidate(T,P)},X.exports.addAbortSignalNoValidate=function(T,P){if(typeof T!=="object"||!("aborted"in T))return P;let B=K(P)?()=>{P.destroy(new W(void 0,{cause:T.reason}))}:()=>{P[q](new W(void 0,{cause:T.reason}))};if(T.aborted)B();else{L=L||NX().addAbortListener;let j=L(T,B);E(P,j[Y])}return P}}),sT=KQ((Q,X)=>{var{StringPrototypeSlice:Y,SymbolIterator:W,TypedArrayPrototypeSet:G,Uint8Array:K}=CQ(),{Buffer:Z}=(JX(),WQ(YX)),{inspect:q}=NX();X.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(E){let I={data:E,next:null};if(this.length>0)this.tail.next=I;else this.head=I;this.tail=I,++this.length}unshift(E){let I={data:E,next:this.head};if(this.length===0)this.tail=I;this.head=I,++this.length}shift(){if(this.length===0)return;let E=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,E}clear(){this.head=this.tail=null,this.length=0}join(E){if(this.length===0)return"";let I=this.head,L=""+I.data;while((I=I.next)!==null)L+=E+I.data;return L}concat(E){if(this.length===0)return Z.alloc(0);let I=Z.allocUnsafe(E>>>0),L=this.head,D=0;while(L)G(I,L.data,D),D+=L.data.length,L=L.next;return I}consume(E,I){let L=this.head.data;if(E<L.length){let D=L.slice(0,E);return this.head.data=L.slice(E),D}if(E===L.length)return this.shift();return I?this._getString(E):this._getBuffer(E)}first(){return this.head.data}*[W](){for(let E=this.head;E;E=E.next)yield E.data}_getString(E){let I="",L=this.head,D=0;do{let T=L.data;if(E>T.length)I+=T,E-=T.length;else{if(E===T.length)if(I+=T,++D,L.next)this.head=L.next;else this.head=this.tail=null;else I+=Y(T,0,E),this.head=L,L.data=Y(T,E);break}++D}while((L=L.next)!==null);return this.length-=D,I}_getBuffer(E){let I=Z.allocUnsafe(E),L=E,D=this.head,T=0;do{let P=D.data;if(E>P.length)G(I,P,L-E),E-=P.length;else{if(E===P.length)if(G(I,P,L-E),++T,D.next)this.head=D.next;else this.head=this.tail=null;else G(I,new K(P.buffer,P.byteOffset,E),L-E),this.head=D,D.data=P.slice(E);break}++T}while((D=D.next)!==null);return this.length-=T,I}[Symbol.for("nodejs.util.inspect.custom")](E,I){return q(this,{...I,depth:0,customInspect:!1})}}}),FG=KQ((Q,X)=>{var{MathFloor:Y,NumberIsInteger:W}=CQ(),{validateInteger:G}=PJ(),{ERR_INVALID_ARG_VALUE:K}=MX().codes,Z=16384,q=16;function E(T,P,B){return T.highWaterMark!=null?T.highWaterMark:P?T[B]:null}function I(T){return T?q:Z}function L(T,P){if(G(P,"value",0),T)q=P;else Z=P}function D(T,P,B,j){let S=E(P,j,B);if(S!=null){if(!W(S)||S<0){let N=j?`options.${B}`:"options.highWaterMark";throw new K(N,S)}return Y(S)}return I(T.objectMode)}X.exports={getHighWaterMark:D,getDefaultHighWaterMark:I,setDefaultHighWaterMark:L}}),aT=KQ((Q,X)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Y=(JX(),WQ(YX)),W=Y.Buffer;function G(Z,q){for(var E in Z)q[E]=Z[E]}if(W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow)X.exports=Y;else G(Y,Q),Q.Buffer=K;function K(Z,q,E){return W(Z,q,E)}K.prototype=Object.create(W.prototype),G(W,K),K.from=function(Z,q,E){if(typeof Z==="number")throw TypeError("Argument must not be a number");return W(Z,q,E)},K.alloc=function(Z,q,E){if(typeof Z!=="number")throw TypeError("Argument must be a number");var I=W(Z);if(q!==void 0)if(typeof E==="string")I.fill(q,E);else I.fill(q);else I.fill(0);return I},K.allocUnsafe=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return W(Z)},K.allocUnsafeSlow=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return Y.SlowBuffer(Z)}}),eT=KQ((Q)=>{var X=aT().Buffer,Y=X.isEncoding||function(k){switch(k=""+k,k&&k.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function W(k){if(!k)return"utf8";var v;while(!0)switch(k){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return k;default:if(v)return;k=(""+k).toLowerCase(),v=!0}}function G(k){var v=W(k);if(typeof v!=="string"&&(X.isEncoding===Y||!Y(k)))throw Error("Unknown encoding: "+k);return v||k}Q.StringDecoder=K;function K(k){this.encoding=G(k);var v;switch(this.encoding){case"utf16le":this.text=T,this.end=P,v=4;break;case"utf8":this.fillLast=I,v=4;break;case"base64":this.text=B,this.end=j,v=3;break;default:this.write=S,this.end=N;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=X.allocUnsafe(v)}K.prototype.write=function(k){if(k.length===0)return"";var v,_;if(this.lastNeed){if(v=this.fillLast(k),v===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;if(_<k.length)return v?v+this.text(k,_):this.text(k,_);return v||""},K.prototype.end=D,K.prototype.text=L,K.prototype.fillLast=function(k){if(this.lastNeed<=k.length)return k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,k.length),this.lastNeed-=k.length};function Z(k){if(k<=127)return 0;else if(k>>5===6)return 2;else if(k>>4===14)return 3;else if(k>>3===30)return 4;return k>>6===2?-1:-2}function q(k,v,_){var x=v.length-1;if(x<_)return 0;var c=Z(v[x]);if(c>=0){if(c>0)k.lastNeed=c-1;return c}if(--x<_||c===-2)return 0;if(c=Z(v[x]),c>=0){if(c>0)k.lastNeed=c-2;return c}if(--x<_||c===-2)return 0;if(c=Z(v[x]),c>=0){if(c>0)if(c===2)c=0;else k.lastNeed=c-3;return c}return 0}function E(k,v,_){if((v[0]&192)!==128)return k.lastNeed=0,"�";if(k.lastNeed>1&&v.length>1){if((v[1]&192)!==128)return k.lastNeed=1,"�";if(k.lastNeed>2&&v.length>2){if((v[2]&192)!==128)return k.lastNeed=2,"�"}}}function I(k){var v=this.lastTotal-this.lastNeed,_=E(this,k,v);if(_!==void 0)return _;if(this.lastNeed<=k.length)return k.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,v,0,k.length),this.lastNeed-=k.length}function L(k,v){var _=q(this,k,v);if(!this.lastNeed)return k.toString("utf8",v);this.lastTotal=_;var x=k.length-(_-this.lastNeed);return k.copy(this.lastChar,0,x),k.toString("utf8",v,x)}function D(k){var v=k&&k.length?this.write(k):"";if(this.lastNeed)return v+"�";return v}function T(k,v){if((k.length-v)%2===0){var _=k.toString("utf16le",v);if(_){var x=_.charCodeAt(_.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=k[k.length-1],k.toString("utf16le",v,k.length-1)}function P(k){var v=k&&k.length?this.write(k):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,_)}return v}function B(k,v){var _=(k.length-v)%3;if(_===0)return k.toString("base64",v);if(this.lastNeed=3-_,this.lastTotal=3,_===1)this.lastChar[0]=k[k.length-1];else this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1];return k.toString("base64",v,k.length-_)}function j(k){var v=k&&k.length?this.write(k):"";if(this.lastNeed)return v+this.lastChar.toString("base64",0,3-this.lastNeed);return v}function S(k){return k.toString(this.encoding)}function N(k){return k&&k.length?this.write(k):""}}),hK=KQ((Q,X)=>{var Y=D1(),{PromisePrototypeThen:W,SymbolAsyncIterator:G,SymbolIterator:K}=CQ(),{Buffer:Z}=(JX(),WQ(YX)),{ERR_INVALID_ARG_TYPE:q,ERR_STREAM_NULL_VALUES:E}=MX().codes;function I(L,D,T){let P;if(typeof D==="string"||D instanceof Z)return new L({objectMode:!0,...T,read(){this.push(D),this.push(null)}});let B;if(D&&D[G])B=!0,P=D[G]();else if(D&&D[K])B=!1,P=D[K]();else throw new q("iterable",["Iterable"],D);let j=new L({objectMode:!0,highWaterMark:1,...T}),S=!1;j._read=function(){if(!S)S=!0,k()},j._destroy=function(v,_){W(N(v),()=>Y.nextTick(_,v),(x)=>Y.nextTick(_,x||v))};async function N(v){let _=v!==void 0&&v!==null,x=typeof P.throw==="function";if(_&&x){let{value:c,done:Y0}=await P.throw(v);if(await c,Y0)return}if(typeof P.return==="function"){let{value:c}=await P.return();await c}}async function k(){for(;;){try{let{value:v,done:_}=B?await P.next():P.next();if(_)j.push(null);else{let x=v&&typeof v.then==="function"?await v:v;if(x===null)throw S=!1,new E;else if(j.push(x))continue;else S=!1}}catch(v){j.destroy(v)}break}}return j}X.exports=I}),VG=KQ((Q,X)=>{var Y=D1(),{ArrayPrototypeIndexOf:W,NumberIsInteger:G,NumberIsNaN:K,NumberParseInt:Z,ObjectDefineProperties:q,ObjectKeys:E,ObjectSetPrototypeOf:I,Promise:L,SafeSet:D,SymbolAsyncDispose:T,SymbolAsyncIterator:P,Symbol:B}=CQ();X.exports=r,r.ReadableState=g0;var{EventEmitter:j}=(A1(),WQ(TJ)),{Stream:S,prependListener:N}=sZ(),{Buffer:k}=(JX(),WQ(YX)),{addAbortSignal:v}=KG(),_=lY(),x=NX().debuglog("stream",(y)=>{x=y}),c=sT(),Y0=f1(),{getHighWaterMark:$0,getDefaultHighWaterMark:e}=FG(),{aggregateTwoErrors:p,codes:{ERR_INVALID_ARG_TYPE:X0,ERR_METHOD_NOT_IMPLEMENTED:J,ERR_OUT_OF_RANGE:U,ERR_STREAM_PUSH_AFTER_EOF:V,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:H},AbortError:F}=MX(),{validateObject:A}=PJ(),M=B("kPaused"),{StringDecoder:z}=eT(),$=hK();I(r.prototype,S.prototype),I(r,S);var O=()=>{},{errorOrDestroy:C}=Y0,R=1,w=2,g=4,h=8,d=16,K0=32,i=64,m=128,G0=256,o=512,Q0=1024,f0=2048,f=4096,u=8192,Z0=16384,t=32768,a=65536,R0=131072,b=262144;function n(y){return{enumerable:!1,get(){return(this.state&y)!==0},set(l){if(l)this.state|=y;else this.state&=~y}}}q(g0.prototype,{objectMode:n(R),ended:n(w),endEmitted:n(g),reading:n(h),constructed:n(d),sync:n(K0),needReadable:n(i),emittedReadable:n(m),readableListening:n(G0),resumeScheduled:n(o),errorEmitted:n(Q0),emitClose:n(f0),autoDestroy:n(f),destroyed:n(u),closed:n(Z0),closeEmitted:n(t),multiAwaitDrain:n(a),readingMore:n(R0),dataEmitted:n(b)});function g0(y,l,s){if(typeof s!=="boolean")s=l instanceof RY();if(this.state=f0|f|d|K0,y&&y.objectMode)this.state|=R;if(s&&y&&y.readableObjectMode)this.state|=R;if(this.highWaterMark=y?$0(this,y,"readableHighWaterMark",s):e(!1),this.buffer=new c,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,y&&y.emitClose===!1)this.state&=~f0;if(y&&y.autoDestroy===!1)this.state&=~f;if(this.errored=null,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,y&&y.encoding)this.decoder=new z(y.encoding),this.encoding=y.encoding}function r(y){if(!(this instanceof r))return new r(y);let l=this instanceof RY();if(this._readableState=new g0(y,this,l),y){if(typeof y.read==="function")this._read=y.read;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal&&!l)v(y.signal,this)}S.call(this,y),Y0.construct(this,()=>{if(this._readableState.needReadable)E0(this,this._readableState)})}r.prototype.destroy=Y0.destroy,r.prototype._undestroy=Y0.undestroy,r.prototype._destroy=function(y,l){l(y)},r.prototype[j.captureRejectionSymbol]=function(y){this.destroy(y)},r.prototype[T]=function(){let y;if(!this.destroyed)y=this.readableEnded?null:new F,this.destroy(y);return new L((l,s)=>_(this,(J0)=>J0&&J0!==y?s(J0):l(null)))},r.prototype.push=function(y,l){return W0(this,y,l,!1)},r.prototype.unshift=function(y,l){return W0(this,y,l,!0)};function W0(y,l,s,J0){x("readableAddChunk",l);let b0=y._readableState,A0;if((b0.state&R)===0){if(typeof l==="string"){if(s=s||b0.defaultEncoding,b0.encoding!==s)if(J0&&b0.encoding)l=k.from(l,s).toString(b0.encoding);else l=k.from(l,s),s=""}else if(l instanceof k)s="";else if(S._isUint8Array(l))l=S._uint8ArrayToBuffer(l),s="";else if(l!=null)A0=new X0("chunk",["string","Buffer","Uint8Array"],l)}if(A0)C(y,A0);else if(l===null)b0.state&=~h,O0(y,b0);else if((b0.state&R)!==0||l&&l.length>0)if(J0)if((b0.state&g)!==0)C(y,new H);else if(b0.destroyed||b0.errored)return!1;else m0(y,b0,l,!0);else if(b0.ended)C(y,new V);else if(b0.destroyed||b0.errored)return!1;else if(b0.state&=~h,b0.decoder&&!s)if(l=b0.decoder.write(l),b0.objectMode||l.length!==0)m0(y,b0,l,!1);else E0(y,b0);else m0(y,b0,l,!1);else if(!J0)b0.state&=~h,E0(y,b0);return!b0.ended&&(b0.length<b0.highWaterMark||b0.length===0)}function m0(y,l,s,J0){if(l.flowing&&l.length===0&&!l.sync&&y.listenerCount("data")>0){if((l.state&a)!==0)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;l.dataEmitted=!0,y.emit("data",s)}else{if(l.length+=l.objectMode?1:s.length,J0)l.buffer.unshift(s);else l.buffer.push(s);if((l.state&i)!==0)I0(y)}E0(y,l)}r.prototype.isPaused=function(){let y=this._readableState;return y[M]===!0||y.flowing===!1},r.prototype.setEncoding=function(y){let l=new z(y);this._readableState.decoder=l,this._readableState.encoding=this._readableState.decoder.encoding;let s=this._readableState.buffer,J0="";for(let b0 of s)J0+=l.write(b0);if(s.clear(),J0!=="")s.push(J0);return this._readableState.length=J0.length,this};var D0=1073741824;function q0(y){if(y>D0)throw new U("size","<= 1GiB",y);else y--,y|=y>>>1,y|=y>>>2,y|=y>>>4,y|=y>>>8,y|=y>>>16,y++;return y}function kQ(y,l){if(y<=0||l.length===0&&l.ended)return 0;if((l.state&R)!==0)return 1;if(K(y)){if(l.flowing&&l.length)return l.buffer.first().length;return l.length}if(y<=l.length)return y;return l.ended?l.length:0}r.prototype.read=function(y){if(x("read",y),y===void 0)y=NaN;else if(!G(y))y=Z(y,10);let l=this._readableState,s=y;if(y>l.highWaterMark)l.highWaterMark=q0(y);if(y!==0)l.state&=~m;if(y===0&&l.needReadable&&((l.highWaterMark!==0?l.length>=l.highWaterMark:l.length>0)||l.ended)){if(x("read: emitReadable",l.length,l.ended),l.length===0&&l.ended)eQ(this);else I0(this);return null}if(y=kQ(y,l),y===0&&l.ended){if(l.length===0)eQ(this);return null}let J0=(l.state&i)!==0;if(x("need readable",J0),l.length===0||l.length-y<l.highWaterMark)J0=!0,x("length less than watermark",J0);if(l.ended||l.reading||l.destroyed||l.errored||!l.constructed)J0=!1,x("reading, ended or constructing",J0);else if(J0){if(x("do read"),l.state|=h|K0,l.length===0)l.state|=i;try{this._read(l.highWaterMark)}catch(A0){C(this,A0)}if(l.state&=~K0,!l.reading)y=kQ(s,l)}let b0;if(y>0)b0=S0(y,l);else b0=null;if(b0===null)l.needReadable=l.length<=l.highWaterMark,y=0;else if(l.length-=y,l.multiAwaitDrain)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;if(l.length===0){if(!l.ended)l.needReadable=!0;if(s!==y&&l.ended)eQ(this)}if(b0!==null&&!l.errorEmitted&&!l.closeEmitted)l.dataEmitted=!0,this.emit("data",b0);return b0};function O0(y,l){if(x("onEofChunk"),l.ended)return;if(l.decoder){let s=l.decoder.end();if(s&&s.length)l.buffer.push(s),l.length+=l.objectMode?1:s.length}if(l.ended=!0,l.sync)I0(y);else l.needReadable=!1,l.emittedReadable=!0,yQ(y)}function I0(y){let l=y._readableState;if(x("emitReadable",l.needReadable,l.emittedReadable),l.needReadable=!1,!l.emittedReadable)x("emitReadable",l.flowing),l.emittedReadable=!0,Y.nextTick(yQ,y)}function yQ(y){let l=y._readableState;if(x("emitReadable_",l.destroyed,l.length,l.ended),!l.destroyed&&!l.errored&&(l.length||l.ended))y.emit("readable"),l.emittedReadable=!1;l.needReadable=!l.flowing&&!l.ended&&l.length<=l.highWaterMark,B0(y)}function E0(y,l){if(!l.readingMore&&l.constructed)l.readingMore=!0,Y.nextTick(L0,y,l)}function L0(y,l){while(!l.reading&&!l.ended&&(l.length<l.highWaterMark||l.flowing&&l.length===0)){let s=l.length;if(x("maybeReadMore read 0"),y.read(0),s===l.length)break}l.readingMore=!1}r.prototype._read=function(y){throw new J("_read()")},r.prototype.pipe=function(y,l){let s=this,J0=this._readableState;if(J0.pipes.length===1){if(!J0.multiAwaitDrain)J0.multiAwaitDrain=!0,J0.awaitDrainWriters=new D(J0.awaitDrainWriters?[J0.awaitDrainWriters]:[])}J0.pipes.push(y),x("pipe count=%d opts=%j",J0.pipes.length,l);let b0=(!l||l.end!==!1)&&y!==Y.stdout&&y!==Y.stderr?M0:r0;if(J0.endEmitted)Y.nextTick(b0);else s.once("end",b0);y.on("unpipe",A0);function A0(OQ,FQ){if(x("onunpipe"),OQ===s){if(FQ&&FQ.hasUnpiped===!1)FQ.hasUnpiped=!0,y0()}}function M0(){x("onend"),y.end()}let wQ,j0=!1;function y0(){if(x("cleanup"),y.removeListener("close",vQ),y.removeListener("finish",s0),wQ)y.removeListener("drain",wQ);if(y.removeListener("error",T0),y.removeListener("unpipe",A0),s.removeListener("end",M0),s.removeListener("end",r0),s.removeListener("data",N0),j0=!0,wQ&&J0.awaitDrainWriters&&(!y._writableState||y._writableState.needDrain))wQ()}function $X(){if(!j0){if(J0.pipes.length===1&&J0.pipes[0]===y)x("false write response, pause",0),J0.awaitDrainWriters=y,J0.multiAwaitDrain=!1;else if(J0.pipes.length>1&&J0.pipes.includes(y))x("false write response, pause",J0.awaitDrainWriters.size),J0.awaitDrainWriters.add(y);s.pause()}if(!wQ)wQ=OX(s,y),y.on("drain",wQ)}s.on("data",N0);function N0(OQ){x("ondata");let FQ=y.write(OQ);if(x("dest.write",FQ),FQ===!1)$X()}function T0(OQ){if(x("onerror",OQ),r0(),y.removeListener("error",T0),y.listenerCount("error")===0){let FQ=y._writableState||y._readableState;if(FQ&&!FQ.errorEmitted)C(y,OQ);else y.emit("error",OQ)}}N(y,"error",T0);function vQ(){y.removeListener("finish",s0),r0()}y.once("close",vQ);function s0(){x("onfinish"),y.removeListener("close",vQ),r0()}y.once("finish",s0);function r0(){x("unpipe"),s.unpipe(y)}if(y.emit("pipe",s),y.writableNeedDrain===!0)$X();else if(!J0.flowing)x("pipe resume"),s.resume();return y};function OX(y,l){return function(){let s=y._readableState;if(s.awaitDrainWriters===l)x("pipeOnDrain",1),s.awaitDrainWriters=null;else if(s.multiAwaitDrain)x("pipeOnDrain",s.awaitDrainWriters.size),s.awaitDrainWriters.delete(l);if((!s.awaitDrainWriters||s.awaitDrainWriters.size===0)&&y.listenerCount("data"))y.resume()}}r.prototype.unpipe=function(y){let l=this._readableState,s={hasUnpiped:!1};if(l.pipes.length===0)return this;if(!y){let b0=l.pipes;l.pipes=[],this.pause();for(let A0=0;A0<b0.length;A0++)b0[A0].emit("unpipe",this,{hasUnpiped:!1});return this}let J0=W(l.pipes,y);if(J0===-1)return this;if(l.pipes.splice(J0,1),l.pipes.length===0)this.pause();return y.emit("unpipe",this,s),this},r.prototype.on=function(y,l){let s=S.prototype.on.call(this,y,l),J0=this._readableState;if(y==="data"){if(J0.readableListening=this.listenerCount("readable")>0,J0.flowing!==!1)this.resume()}else if(y==="readable"){if(!J0.endEmitted&&!J0.readableListening){if(J0.readableListening=J0.needReadable=!0,J0.flowing=!1,J0.emittedReadable=!1,x("on readable",J0.length,J0.reading),J0.length)I0(this);else if(!J0.reading)Y.nextTick(k0,this)}}return s},r.prototype.addListener=r.prototype.on,r.prototype.removeListener=function(y,l){let s=S.prototype.removeListener.call(this,y,l);if(y==="readable")Y.nextTick(P0,this);return s},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(y){let l=S.prototype.removeAllListeners.apply(this,arguments);if(y==="readable"||y===void 0)Y.nextTick(P0,this);return l};function P0(y){let l=y._readableState;if(l.readableListening=y.listenerCount("readable")>0,l.resumeScheduled&&l[M]===!1)l.flowing=!0;else if(y.listenerCount("data")>0)y.resume();else if(!l.readableListening)l.flowing=null}function k0(y){x("readable nexttick read 0"),y.read(0)}r.prototype.resume=function(){let y=this._readableState;if(!y.flowing)x("resume"),y.flowing=!y.readableListening,AX(this,y);return y[M]=!1,this};function AX(y,l){if(!l.resumeScheduled)l.resumeScheduled=!0,Y.nextTick(w0,y,l)}function w0(y,l){if(x("resume",l.reading),!l.reading)y.read(0);if(l.resumeScheduled=!1,y.emit("resume"),B0(y),l.flowing&&!l.reading)y.read(0)}r.prototype.pause=function(){if(x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)x("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[M]=!0,this};function B0(y){let l=y._readableState;x("flow",l.flowing);while(l.flowing&&y.read()!==null);}r.prototype.wrap=function(y){let l=!1;y.on("data",(J0)=>{if(!this.push(J0)&&y.pause)l=!0,y.pause()}),y.on("end",()=>{this.push(null)}),y.on("error",(J0)=>{C(this,J0)}),y.on("close",()=>{this.destroy()}),y.on("destroy",()=>{this.destroy()}),this._read=()=>{if(l&&y.resume)l=!1,y.resume()};let s=E(y);for(let J0=1;J0<s.length;J0++){let b0=s[J0];if(this[b0]===void 0&&typeof y[b0]==="function")this[b0]=y[b0].bind(y)}return this},r.prototype[P]=function(){return GX(this)},r.prototype.iterator=function(y){if(y!==void 0)A(y,"options");return GX(this,y)};function GX(y,l){if(typeof y.read!=="function")y=r.wrap(y,{objectMode:!0});let s=v0(y,l);return s.stream=y,s}async function*v0(y,l){let s=O;function J0(M0){if(this===y)s(),s=O;else s=M0}y.on("readable",J0);let b0,A0=_(y,{writable:!1},(M0)=>{b0=M0?p(b0,M0):null,s(),s=O});try{while(!0){let M0=y.destroyed?null:y.read();if(M0!==null)yield M0;else if(b0)throw b0;else if(b0===null)return;else await new L(J0)}}catch(M0){throw b0=p(b0,M0),b0}finally{if((b0||(l===null||l===void 0?void 0:l.destroyOnReturn)!==!1)&&(b0===void 0||y._readableState.autoDestroy))Y0.destroyer(y,null);else y.off("readable",J0),A0()}}q(r.prototype,{readable:{__proto__:null,get(){let y=this._readableState;return!!y&&y.readable!==!1&&!y.destroyed&&!y.errorEmitted&&!y.endEmitted},set(y){if(this._readableState)this._readableState.readable=!!y}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(y){if(this._readableState)this._readableState.flowing=y}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(y){if(!this._readableState)return;this._readableState.destroyed=y}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),q(g0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[M]!==!1},set(y){this[M]=!!y}}}),r._fromList=S0;function S0(y,l){if(l.length===0)return null;let s;if(l.objectMode)s=l.buffer.shift();else if(!y||y>=l.length){if(l.decoder)s=l.buffer.join("");else if(l.buffer.length===1)s=l.buffer.first();else s=l.buffer.concat(l.length);l.buffer.clear()}else s=l.buffer.consume(y,l.decoder);return s}function eQ(y){let l=y._readableState;if(x("endReadable",l.endEmitted),!l.endEmitted)l.ended=!0,Y.nextTick(_0,l,y)}function _0(y,l){if(x("endReadableNT",y.endEmitted,y.length),!y.errored&&!y.closeEmitted&&!y.endEmitted&&y.length===0){if(y.endEmitted=!0,l.emit("end"),l.writable&&l.allowHalfOpen===!1)Y.nextTick(x0,l);else if(y.autoDestroy){let s=l._writableState;if(!s||s.autoDestroy&&(s.finished||s.writable===!1))l.destroy()}}}function x0(y){if(y.writable&&!y.writableEnded&&!y.destroyed)y.end()}r.from=function(y,l){return $(r,y,l)};var QX;function C0(){if(QX===void 0)QX={};return QX}r.fromWeb=function(y,l){return C0().newStreamReadableFromReadableStream(y,l)},r.toWeb=function(y,l){return C0().newReadableStreamFromStreamReadable(y,l)},r.wrap=function(y,l){var s,J0;return new r({objectMode:(s=(J0=y.readableObjectMode)!==null&&J0!==void 0?J0:y.objectMode)!==null&&s!==void 0?s:!0,...l,destroy(b0,A0){Y0.destroyer(y,b0),A0(b0)}}).wrap(y)}}),aZ=KQ((Q,X)=>{var Y=D1(),{ArrayPrototypeSlice:W,Error:G,FunctionPrototypeSymbolHasInstance:K,ObjectDefineProperty:Z,ObjectDefineProperties:q,ObjectSetPrototypeOf:E,StringPrototypeToLowerCase:I,Symbol:L,SymbolHasInstance:D}=CQ();X.exports=A,A.WritableState=H;var{EventEmitter:T}=(A1(),WQ(TJ)),P=sZ().Stream,{Buffer:B}=(JX(),WQ(YX)),j=f1(),{addAbortSignal:S}=KG(),{getHighWaterMark:N,getDefaultHighWaterMark:k}=FG(),{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:x,ERR_STREAM_CANNOT_PIPE:c,ERR_STREAM_DESTROYED:Y0,ERR_STREAM_ALREADY_FINISHED:$0,ERR_STREAM_NULL_VALUES:e,ERR_STREAM_WRITE_AFTER_END:p,ERR_UNKNOWN_ENCODING:X0}=MX().codes,{errorOrDestroy:J}=j;E(A.prototype,P.prototype),E(A,P);function U(){}var V=L("kOnFinished");function H(f,u,Z0){if(typeof Z0!=="boolean")Z0=u instanceof RY();if(this.objectMode=!!(f&&f.objectMode),Z0)this.objectMode=this.objectMode||!!(f&&f.writableObjectMode);this.highWaterMark=f?N(this,f,"writableHighWaterMark",Z0):k(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let t=!!(f&&f.decodeStrings===!1);this.decodeStrings=!t,this.defaultEncoding=f&&f.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=C.bind(void 0,u),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,F(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!f||f.emitClose!==!1,this.autoDestroy=!f||f.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[V]=[]}function F(f){f.buffered=[],f.bufferedIndex=0,f.allBuffers=!0,f.allNoop=!0}H.prototype.getBuffer=function(){return W(this.buffered,this.bufferedIndex)},Z(H.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function A(f){let u=this instanceof RY();if(!u&&!K(A,this))return new A(f);if(this._writableState=new H(f,this,u),f){if(typeof f.write==="function")this._write=f.write;if(typeof f.writev==="function")this._writev=f.writev;if(typeof f.destroy==="function")this._destroy=f.destroy;if(typeof f.final==="function")this._final=f.final;if(typeof f.construct==="function")this._construct=f.construct;if(f.signal)S(f.signal,this)}P.call(this,f),j.construct(this,()=>{let Z0=this._writableState;if(!Z0.writing)h(this,Z0);m(this,Z0)})}Z(A,D,{__proto__:null,value:function(f){if(K(this,f))return!0;if(this!==A)return!1;return f&&f._writableState instanceof H}}),A.prototype.pipe=function(){J(this,new c)};function M(f,u,Z0,t){let a=f._writableState;if(typeof Z0==="function")t=Z0,Z0=a.defaultEncoding;else{if(!Z0)Z0=a.defaultEncoding;else if(Z0!=="buffer"&&!B.isEncoding(Z0))throw new X0(Z0);if(typeof t!=="function")t=U}if(u===null)throw new e;else if(!a.objectMode)if(typeof u==="string"){if(a.decodeStrings!==!1)u=B.from(u,Z0),Z0="buffer"}else if(u instanceof B)Z0="buffer";else if(P._isUint8Array(u))u=P._uint8ArrayToBuffer(u),Z0="buffer";else throw new v("chunk",["string","Buffer","Uint8Array"],u);let R0;if(a.ending)R0=new p;else if(a.destroyed)R0=new Y0("write");if(R0)return Y.nextTick(t,R0),J(f,R0,!0),R0;return a.pendingcb++,z(f,a,u,Z0,t)}A.prototype.write=function(f,u,Z0){return M(this,f,u,Z0)===!0},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){let f=this._writableState;if(f.corked){if(f.corked--,!f.writing)h(this,f)}},A.prototype.setDefaultEncoding=function(f){if(typeof f==="string")f=I(f);if(!B.isEncoding(f))throw new X0(f);return this._writableState.defaultEncoding=f,this};function z(f,u,Z0,t,a){let R0=u.objectMode?1:Z0.length;u.length+=R0;let b=u.length<u.highWaterMark;if(!b)u.needDrain=!0;if(u.writing||u.corked||u.errored||!u.constructed){if(u.buffered.push({chunk:Z0,encoding:t,callback:a}),u.allBuffers&&t!=="buffer")u.allBuffers=!1;if(u.allNoop&&a!==U)u.allNoop=!1}else u.writelen=R0,u.writecb=a,u.writing=!0,u.sync=!0,f._write(Z0,t,u.onwrite),u.sync=!1;return b&&!u.errored&&!u.destroyed}function $(f,u,Z0,t,a,R0,b){if(u.writelen=t,u.writecb=b,u.writing=!0,u.sync=!0,u.destroyed)u.onwrite(new Y0("write"));else if(Z0)f._writev(a,u.onwrite);else f._write(a,R0,u.onwrite);u.sync=!1}function O(f,u,Z0,t){--u.pendingcb,t(Z0),g(u),J(f,Z0)}function C(f,u){let Z0=f._writableState,t=Z0.sync,a=Z0.writecb;if(typeof a!=="function"){J(f,new x);return}if(Z0.writing=!1,Z0.writecb=null,Z0.length-=Z0.writelen,Z0.writelen=0,u){if(u.stack,!Z0.errored)Z0.errored=u;if(f._readableState&&!f._readableState.errored)f._readableState.errored=u;if(t)Y.nextTick(O,f,Z0,u,a);else O(f,Z0,u,a)}else{if(Z0.buffered.length>Z0.bufferedIndex)h(f,Z0);if(t)if(Z0.afterWriteTickInfo!==null&&Z0.afterWriteTickInfo.cb===a)Z0.afterWriteTickInfo.count++;else Z0.afterWriteTickInfo={count:1,cb:a,stream:f,state:Z0},Y.nextTick(R,Z0.afterWriteTickInfo);else w(f,Z0,1,a)}}function R({stream:f,state:u,count:Z0,cb:t}){return u.afterWriteTickInfo=null,w(f,u,Z0,t)}function w(f,u,Z0,t){if(!u.ending&&!f.destroyed&&u.length===0&&u.needDrain)u.needDrain=!1,f.emit("drain");while(Z0-- >0)u.pendingcb--,t();if(u.destroyed)g(u);m(f,u)}function g(f){if(f.writing)return;for(let a=f.bufferedIndex;a<f.buffered.length;++a){var u;let{chunk:R0,callback:b}=f.buffered[a],n=f.objectMode?1:R0.length;f.length-=n,b((u=f.errored)!==null&&u!==void 0?u:new Y0("write"))}let Z0=f[V].splice(0);for(let a=0;a<Z0.length;a++){var t;Z0[a]((t=f.errored)!==null&&t!==void 0?t:new Y0("end"))}F(f)}function h(f,u){if(u.corked||u.bufferProcessing||u.destroyed||!u.constructed)return;let{buffered:Z0,bufferedIndex:t,objectMode:a}=u,R0=Z0.length-t;if(!R0)return;let b=t;if(u.bufferProcessing=!0,R0>1&&f._writev){u.pendingcb-=R0-1;let n=u.allNoop?U:(r)=>{for(let W0=b;W0<Z0.length;++W0)Z0[W0].callback(r)},g0=u.allNoop&&b===0?Z0:W(Z0,b);g0.allBuffers=u.allBuffers,$(f,u,!0,u.length,g0,"",n),F(u)}else{do{let{chunk:n,encoding:g0,callback:r}=Z0[b];Z0[b++]=null;let W0=a?1:n.length;$(f,u,!1,W0,n,g0,r)}while(b<Z0.length&&!u.writing);if(b===Z0.length)F(u);else if(b>256)Z0.splice(0,b),u.bufferedIndex=0;else u.bufferedIndex=b}u.bufferProcessing=!1}A.prototype._write=function(f,u,Z0){if(this._writev)this._writev([{chunk:f,encoding:u}],Z0);else throw new _("_write()")},A.prototype._writev=null,A.prototype.end=function(f,u,Z0){let t=this._writableState;if(typeof f==="function")Z0=f,f=null,u=null;else if(typeof u==="function")Z0=u,u=null;let a;if(f!==null&&f!==void 0){let R0=M(this,f,u);if(R0 instanceof G)a=R0}if(t.corked)t.corked=1,this.uncork();if(a);else if(!t.errored&&!t.ending)t.ending=!0,m(this,t,!0),t.ended=!0;else if(t.finished)a=new $0("end");else if(t.destroyed)a=new Y0("end");if(typeof Z0==="function")if(a||t.finished)Y.nextTick(Z0,a);else t[V].push(Z0);return this};function d(f){return f.ending&&!f.destroyed&&f.constructed&&f.length===0&&!f.errored&&f.buffered.length===0&&!f.finished&&!f.writing&&!f.errorEmitted&&!f.closeEmitted}function K0(f,u){let Z0=!1;function t(a){if(Z0){J(f,a!==null&&a!==void 0?a:x());return}if(Z0=!0,u.pendingcb--,a){let R0=u[V].splice(0);for(let b=0;b<R0.length;b++)R0[b](a);J(f,a,u.sync)}else if(d(u))u.prefinished=!0,f.emit("prefinish"),u.pendingcb++,Y.nextTick(G0,f,u)}u.sync=!0,u.pendingcb++;try{f._final(t)}catch(a){t(a)}u.sync=!1}function i(f,u){if(!u.prefinished&&!u.finalCalled)if(typeof f._final==="function"&&!u.destroyed)u.finalCalled=!0,K0(f,u);else u.prefinished=!0,f.emit("prefinish")}function m(f,u,Z0){if(d(u)){if(i(f,u),u.pendingcb===0){if(Z0)u.pendingcb++,Y.nextTick((t,a)=>{if(d(a))G0(t,a);else a.pendingcb--},f,u);else if(d(u))u.pendingcb++,G0(f,u)}}}function G0(f,u){u.pendingcb--,u.finished=!0;let Z0=u[V].splice(0);for(let t=0;t<Z0.length;t++)Z0[t]();if(f.emit("finish"),u.autoDestroy){let t=f._readableState;if(!t||t.autoDestroy&&(t.endEmitted||t.readable===!1))f.destroy()}}q(A.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(f){if(this._writableState)this._writableState.destroyed=f}},writable:{__proto__:null,get(){let f=this._writableState;return!!f&&f.writable!==!1&&!f.destroyed&&!f.errored&&!f.ending&&!f.ended},set(f){if(this._writableState)this._writableState.writable=!!f}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let f=this._writableState;if(!f)return!1;return!f.destroyed&&!f.ending&&f.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var o=j.destroy;A.prototype.destroy=function(f,u){let Z0=this._writableState;if(!Z0.destroyed&&(Z0.bufferedIndex<Z0.buffered.length||Z0[V].length))Y.nextTick(g,Z0);return o.call(this,f,u),this},A.prototype._undestroy=j.undestroy,A.prototype._destroy=function(f,u){u(f)},A.prototype[T.captureRejectionSymbol]=function(f){this.destroy(f)};var Q0;function f0(){if(Q0===void 0)Q0={};return Q0}A.fromWeb=function(f,u){return f0().newStreamWritableFromWritableStream(f,u)},A.toWeb=function(f){return f0().newWritableStreamFromStreamWritable(f)}}),QR=KQ((Q,X)=>{var Y=D1(),W=(JX(),WQ(YX)),{isReadable:G,isWritable:K,isIterable:Z,isNodeStream:q,isReadableNodeStream:E,isWritableNodeStream:I,isDuplexNodeStream:L,isReadableStream:D,isWritableStream:T}=PY(),P=lY(),{AbortError:B,codes:{ERR_INVALID_ARG_TYPE:j,ERR_INVALID_RETURN_VALUE:S}}=MX(),{destroyer:N}=f1(),k=RY(),v=VG(),_=aZ(),{createDeferredPromise:x}=NX(),c=hK(),Y0=globalThis.Blob||W.Blob,$0=typeof Y0<"u"?function(V){return V instanceof Y0}:function(V){return!1},e=globalThis.AbortController||RJ().AbortController,{FunctionPrototypeCall:p}=CQ();class X0 extends k{constructor(V){super(V);if((V===null||V===void 0?void 0:V.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((V===null||V===void 0?void 0:V.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}X.exports=function V(H,F){if(L(H))return H;if(E(H))return U({readable:H});if(I(H))return U({writable:H});if(q(H))return U({writable:!1,readable:!1});if(D(H))return U({readable:v.fromWeb(H)});if(T(H))return U({writable:_.fromWeb(H)});if(typeof H==="function"){let{value:M,write:z,final:$,destroy:O}=J(H);if(Z(M))return c(X0,M,{objectMode:!0,write:z,final:$,destroy:O});let C=M===null||M===void 0?void 0:M.then;if(typeof C==="function"){let R,w=p(C,M,(g)=>{if(g!=null)throw new S("nully","body",g)},(g)=>{N(R,g)});return R=new X0({objectMode:!0,readable:!1,write:z,final(g){$(async()=>{try{await w,Y.nextTick(g,null)}catch(h){Y.nextTick(g,h)}})},destroy:O})}throw new S("Iterable, AsyncIterable or AsyncFunction",F,M)}if($0(H))return V(H.arrayBuffer());if(Z(H))return c(X0,H,{objectMode:!0,writable:!1});if(D(H===null||H===void 0?void 0:H.readable)&&T(H===null||H===void 0?void 0:H.writable))return X0.fromWeb(H);if(typeof(H===null||H===void 0?void 0:H.writable)==="object"||typeof(H===null||H===void 0?void 0:H.readable)==="object"){let M=H!==null&&H!==void 0&&H.readable?E(H===null||H===void 0?void 0:H.readable)?H===null||H===void 0?void 0:H.readable:V(H.readable):void 0,z=H!==null&&H!==void 0&&H.writable?I(H===null||H===void 0?void 0:H.writable)?H===null||H===void 0?void 0:H.writable:V(H.writable):void 0;return U({readable:M,writable:z})}let A=H===null||H===void 0?void 0:H.then;if(typeof A==="function"){let M;return p(A,H,(z)=>{if(z!=null)M.push(z);M.push(null)},(z)=>{N(M,z)}),M=new X0({objectMode:!0,writable:!1,read(){}})}throw new j(F,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],H)};function J(V){let{promise:H,resolve:F}=x(),A=new e,M=A.signal;return{value:V(async function*(){while(!0){let z=H;H=null;let{chunk:$,done:O,cb:C}=await z;if(Y.nextTick(C),O)return;if(M.aborted)throw new B(void 0,{cause:M.reason});({promise:H,resolve:F}=x()),yield $}}(),{signal:M}),write(z,$,O){let C=F;F=null,C({chunk:z,done:!1,cb:O})},final(z){let $=F;F=null,$({done:!0,cb:z})},destroy(z,$){A.abort(),$(z)}}}function U(V){let H=V.readable&&typeof V.readable.read!=="function"?v.wrap(V.readable):V.readable,F=V.writable,A=!!G(H),M=!!K(F),z,$,O,C,R;function w(g){let h=C;if(C=null,h)h(g);else if(g)R.destroy(g)}if(R=new X0({readableObjectMode:!!(H!==null&&H!==void 0&&H.readableObjectMode),writableObjectMode:!!(F!==null&&F!==void 0&&F.writableObjectMode),readable:A,writable:M}),M)P(F,(g)=>{if(M=!1,g)N(H,g);w(g)}),R._write=function(g,h,d){if(F.write(g,h))d();else z=d},R._final=function(g){F.end(),$=g},F.on("drain",function(){if(z){let g=z;z=null,g()}}),F.on("finish",function(){if($){let g=$;$=null,g()}});if(A)P(H,(g)=>{if(A=!1,g)N(H,g);w(g)}),H.on("readable",function(){if(O){let g=O;O=null,g()}}),H.on("end",function(){R.push(null)}),R._read=function(){while(!0){let g=H.read();if(g===null){O=R._read;return}if(!R.push(g))return}};return R._destroy=function(g,h){if(!g&&C!==null)g=new B;if(O=null,z=null,$=null,C===null)h(g);else C=h,N(F,g),N(H,g)},R}}),RY=KQ((Q,X)=>{var{ObjectDefineProperties:Y,ObjectGetOwnPropertyDescriptor:W,ObjectKeys:G,ObjectSetPrototypeOf:K}=CQ();X.exports=E;var Z=VG(),q=aZ();K(E.prototype,Z.prototype),K(E,Z);{let T=G(q.prototype);for(let P=0;P<T.length;P++){let B=T[P];if(!E.prototype[B])E.prototype[B]=q.prototype[B]}}function E(T){if(!(this instanceof E))return new E(T);if(Z.call(this,T),q.call(this,T),T){if(this.allowHalfOpen=T.allowHalfOpen!==!1,T.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(T.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}Y(E.prototype,{writable:{__proto__:null,...W(q.prototype,"writable")},writableHighWaterMark:{__proto__:null,...W(q.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...W(q.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...W(q.prototype,"writableBuffer")},writableLength:{__proto__:null,...W(q.prototype,"writableLength")},writableFinished:{__proto__:null,...W(q.prototype,"writableFinished")},writableCorked:{__proto__:null,...W(q.prototype,"writableCorked")},writableEnded:{__proto__:null,...W(q.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...W(q.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(T){if(this._readableState&&this._writableState)this._readableState.destroyed=T,this._writableState.destroyed=T}}});var I;function L(){if(I===void 0)I={};return I}E.fromWeb=function(T,P){return L().newStreamDuplexFromReadableWritablePair(T,P)},E.toWeb=function(T){return L().newReadableWritablePairFromDuplex(T)};var D;E.from=function(T){if(!D)D=QR();return D(T,"body")}}),uK=KQ((Q,X)=>{var{ObjectSetPrototypeOf:Y,Symbol:W}=CQ();X.exports=E;var{ERR_METHOD_NOT_IMPLEMENTED:G}=MX().codes,K=RY(),{getHighWaterMark:Z}=FG();Y(E.prototype,K.prototype),Y(E,K);var q=W("kCallback");function E(D){if(!(this instanceof E))return new E(D);let T=D?Z(this,D,"readableHighWaterMark",!0):null;if(T===0)D={...D,highWaterMark:null,readableHighWaterMark:T,writableHighWaterMark:D.writableHighWaterMark||0};if(K.call(this,D),this._readableState.sync=!1,this[q]=null,D){if(typeof D.transform==="function")this._transform=D.transform;if(typeof D.flush==="function")this._flush=D.flush}this.on("prefinish",L)}function I(D){if(typeof this._flush==="function"&&!this.destroyed)this._flush((T,P)=>{if(T){if(D)D(T);else this.destroy(T);return}if(P!=null)this.push(P);if(this.push(null),D)D()});else if(this.push(null),D)D()}function L(){if(this._final!==I)I.call(this)}E.prototype._final=I,E.prototype._transform=function(D,T,P){throw new G("_transform()")},E.prototype._write=function(D,T,P){let B=this._readableState,j=this._writableState,S=B.length;this._transform(D,T,(N,k)=>{if(N){P(N);return}if(k!=null)this.push(k);if(j.ended||S===B.length||B.length<B.highWaterMark)P();else this[q]=P})},E.prototype._read=function(){if(this[q]){let D=this[q];this[q]=null,D()}}}),pK=KQ((Q,X)=>{var{ObjectSetPrototypeOf:Y}=CQ();X.exports=G;var W=uK();Y(G.prototype,W.prototype),Y(G,W);function G(K){if(!(this instanceof G))return new G(K);W.call(this,K)}G.prototype._transform=function(K,Z,q){q(null,K)}}),eZ=KQ((Q,X)=>{var Y=D1(),{ArrayIsArray:W,Promise:G,SymbolAsyncIterator:K,SymbolDispose:Z}=CQ(),q=lY(),{once:E}=NX(),I=f1(),L=RY(),{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:T,ERR_INVALID_RETURN_VALUE:P,ERR_MISSING_ARGS:B,ERR_STREAM_DESTROYED:j,ERR_STREAM_PREMATURE_CLOSE:S},AbortError:N}=MX(),{validateFunction:k,validateAbortSignal:v}=PJ(),{isIterable:_,isReadable:x,isReadableNodeStream:c,isNodeStream:Y0,isTransformStream:$0,isWebStream:e,isReadableStream:p,isReadableFinished:X0}=PY(),J=globalThis.AbortController||RJ().AbortController,U,V,H;function F(g,h,d){let K0=!1;g.on("close",()=>{K0=!0});let i=q(g,{readable:h,writable:d},(m)=>{K0=!m});return{destroy:(m)=>{if(K0)return;K0=!0,I.destroyer(g,m||new j("pipe"))},cleanup:i}}function A(g){return k(g[g.length-1],"streams[stream.length - 1]"),g.pop()}function M(g){if(_(g))return g;else if(c(g))return z(g);throw new T("val",["Readable","Iterable","AsyncIterable"],g)}async function*z(g){if(!V)V=VG();yield*V.prototype[K].call(g)}async function $(g,h,d,{end:K0}){let i,m=null,G0=(f0)=>{if(f0)i=f0;if(m){let f=m;m=null,f()}},o=()=>new G((f0,f)=>{if(i)f(i);else m=()=>{if(i)f(i);else f0()}});h.on("drain",G0);let Q0=q(h,{readable:!1},G0);try{if(h.writableNeedDrain)await o();for await(let f0 of g)if(!h.write(f0))await o();if(K0)h.end(),await o();d()}catch(f0){d(i!==f0?D(i,f0):f0)}finally{Q0(),h.off("drain",G0)}}async function O(g,h,d,{end:K0}){if($0(h))h=h.writable;let i=h.getWriter();try{for await(let m of g)await i.ready,i.write(m).catch(()=>{});if(await i.ready,K0)await i.close();d()}catch(m){try{await i.abort(m),d(m)}catch(G0){d(G0)}}}function C(...g){return R(g,E(A(g)))}function R(g,h,d){if(g.length===1&&W(g[0]))g=g[0];if(g.length<2)throw new B("streams");let K0=new J,i=K0.signal,m=d===null||d===void 0?void 0:d.signal,G0=[];v(m,"options.signal");function o(){a(new N)}H=H||NX().addAbortListener;let Q0;if(m)Q0=H(m,o);let f0,f,u=[],Z0=0;function t(r){a(r,--Z0===0)}function a(r,W0){var m0;if(r&&(!f0||f0.code==="ERR_STREAM_PREMATURE_CLOSE"))f0=r;if(!f0&&!W0)return;while(u.length)u.shift()(f0);if((m0=Q0)===null||m0===void 0||m0[Z](),K0.abort(),W0){if(!f0)G0.forEach((D0)=>D0());Y.nextTick(h,f0,f)}}let R0;for(let r=0;r<g.length;r++){let W0=g[r],m0=r<g.length-1,D0=r>0,q0=m0||(d===null||d===void 0?void 0:d.end)!==!1,kQ=r===g.length-1;if(Y0(W0)){let O0=function(I0){if(I0&&I0.name!=="AbortError"&&I0.code!=="ERR_STREAM_PREMATURE_CLOSE")t(I0)};var b=O0;if(q0){let{destroy:I0,cleanup:yQ}=F(W0,m0,D0);if(u.push(I0),x(W0)&&kQ)G0.push(yQ)}if(W0.on("error",O0),x(W0)&&kQ)G0.push(()=>{W0.removeListener("error",O0)})}if(r===0)if(typeof W0==="function"){if(R0=W0({signal:i}),!_(R0))throw new P("Iterable, AsyncIterable or Stream","source",R0)}else if(_(W0)||c(W0)||$0(W0))R0=W0;else R0=L.from(W0);else if(typeof W0==="function"){if($0(R0)){var n;R0=M((n=R0)===null||n===void 0?void 0:n.readable)}else R0=M(R0);if(R0=W0(R0,{signal:i}),m0){if(!_(R0,!0))throw new P("AsyncIterable",`transform[${r-1}]`,R0)}else{var g0;if(!U)U=pK();let O0=new U({objectMode:!0}),I0=(g0=R0)===null||g0===void 0?void 0:g0.then;if(typeof I0==="function")Z0++,I0.call(R0,(L0)=>{if(f=L0,L0!=null)O0.write(L0);if(q0)O0.end();Y.nextTick(t)},(L0)=>{O0.destroy(L0),Y.nextTick(t,L0)});else if(_(R0,!0))Z0++,$(R0,O0,t,{end:q0});else if(p(R0)||$0(R0)){let L0=R0.readable||R0;Z0++,$(L0,O0,t,{end:q0})}else throw new P("AsyncIterable or Promise","destination",R0);R0=O0;let{destroy:yQ,cleanup:E0}=F(R0,!1,!0);if(u.push(yQ),kQ)G0.push(E0)}}else if(Y0(W0)){if(c(R0)){Z0+=2;let O0=w(R0,W0,t,{end:q0});if(x(W0)&&kQ)G0.push(O0)}else if($0(R0)||p(R0)){let O0=R0.readable||R0;Z0++,$(O0,W0,t,{end:q0})}else if(_(R0))Z0++,$(R0,W0,t,{end:q0});else throw new T("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],R0);R0=W0}else if(e(W0)){if(c(R0))Z0++,O(M(R0),W0,t,{end:q0});else if(p(R0)||_(R0))Z0++,O(R0,W0,t,{end:q0});else if($0(R0))Z0++,O(R0.readable,W0,t,{end:q0});else throw new T("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],R0);R0=W0}else R0=L.from(W0)}if(i!==null&&i!==void 0&&i.aborted||m!==null&&m!==void 0&&m.aborted)Y.nextTick(o);return R0}function w(g,h,d,{end:K0}){let i=!1;if(h.on("close",()=>{if(!i)d(new S)}),g.pipe(h,{end:!1}),K0){let G0=function(){i=!0,h.end()};var m=G0;if(X0(g))Y.nextTick(G0);else g.once("end",G0)}else d();return q(g,{readable:!0,writable:!1},(G0)=>{let o=g._readableState;if(G0&&G0.code==="ERR_STREAM_PREMATURE_CLOSE"&&o&&o.ended&&!o.errored&&!o.errorEmitted)g.once("end",d).once("error",d);else d(G0)}),q(h,{readable:!1,writable:!0},d)}X.exports={pipelineImpl:R,pipeline:C}}),cK=KQ((Q,X)=>{var{pipeline:Y}=eZ(),W=RY(),{destroyer:G}=f1(),{isNodeStream:K,isReadable:Z,isWritable:q,isWebStream:E,isTransformStream:I,isWritableStream:L,isReadableStream:D}=PY(),{AbortError:T,codes:{ERR_INVALID_ARG_VALUE:P,ERR_MISSING_ARGS:B}}=MX(),j=lY();X.exports=function(...S){if(S.length===0)throw new B("streams");if(S.length===1)return W.from(S[0]);let N=[...S];if(typeof S[0]==="function")S[0]=W.from(S[0]);if(typeof S[S.length-1]==="function"){let J=S.length-1;S[J]=W.from(S[J])}for(let J=0;J<S.length;++J){if(!K(S[J])&&!E(S[J]))continue;if(J<S.length-1&&!(Z(S[J])||D(S[J])||I(S[J])))throw new P(`streams[${J}]`,N[J],"must be readable");if(J>0&&!(q(S[J])||L(S[J])||I(S[J])))throw new P(`streams[${J}]`,N[J],"must be writable")}let k,v,_,x,c;function Y0(J){let U=x;if(x=null,U)U(J);else if(J)c.destroy(J);else if(!X0&&!p)c.destroy()}let $0=S[0],e=Y(S,Y0),p=!!(q($0)||L($0)||I($0)),X0=!!(Z(e)||D(e)||I(e));if(c=new W({writableObjectMode:!!($0!==null&&$0!==void 0&&$0.writableObjectMode),readableObjectMode:!!(e!==null&&e!==void 0&&e.readableObjectMode),writable:p,readable:X0}),p){if(K($0))c._write=function(U,V,H){if($0.write(U,V))H();else k=H},c._final=function(U){$0.end(),v=U},$0.on("drain",function(){if(k){let U=k;k=null,U()}});else if(E($0)){let U=(I($0)?$0.writable:$0).getWriter();c._write=async function(V,H,F){try{await U.ready,U.write(V).catch(()=>{}),F()}catch(A){F(A)}},c._final=async function(V){try{await U.ready,U.close().catch(()=>{}),v=V}catch(H){V(H)}}}let J=I(e)?e.readable:e;j(J,()=>{if(v){let U=v;v=null,U()}})}if(X0){if(K(e))e.on("readable",function(){if(_){let J=_;_=null,J()}}),e.on("end",function(){c.push(null)}),c._read=function(){while(!0){let J=e.read();if(J===null){_=c._read;return}if(!c.push(J))return}};else if(E(e)){let J=(I(e)?e.readable:e).getReader();c._read=async function(){while(!0)try{let{value:U,done:V}=await J.read();if(!c.push(U))return;if(V){c.push(null);return}}catch{return}}}}return c._destroy=function(J,U){if(!J&&x!==null)J=new T;if(_=null,k=null,v=null,x===null)U(J);else if(x=U,K(e))G(e,J)},c}}),XR=KQ((Q,X)=>{var Y=globalThis.AbortController||RJ().AbortController,{codes:{ERR_INVALID_ARG_VALUE:W,ERR_INVALID_ARG_TYPE:G,ERR_MISSING_ARGS:K,ERR_OUT_OF_RANGE:Z},AbortError:q}=MX(),{validateAbortSignal:E,validateInteger:I,validateObject:L}=PJ(),D=CQ().Symbol("kWeak"),T=CQ().Symbol("kResistStopPropagation"),{finished:P}=lY(),B=cK(),{addAbortSignalNoValidate:j}=KG(),{isWritable:S,isNodeStream:N}=PY(),{deprecate:k}=NX(),{ArrayPrototypePush:v,Boolean:_,MathFloor:x,Number:c,NumberIsNaN:Y0,Promise:$0,PromiseReject:e,PromiseResolve:p,PromisePrototypeThen:X0,Symbol:J}=CQ(),U=J("kEmpty"),V=J("kEof");function H(m,G0){if(G0!=null)L(G0,"options");if((G0===null||G0===void 0?void 0:G0.signal)!=null)E(G0.signal,"options.signal");if(N(m)&&!S(m))throw new W("stream",m,"must be writable");let o=B(this,m);if(G0!==null&&G0!==void 0&&G0.signal)j(G0.signal,o);return o}function F(m,G0){if(typeof m!=="function")throw new G("fn",["Function","AsyncFunction"],m);if(G0!=null)L(G0,"options");if((G0===null||G0===void 0?void 0:G0.signal)!=null)E(G0.signal,"options.signal");let o=1;if((G0===null||G0===void 0?void 0:G0.concurrency)!=null)o=x(G0.concurrency);let Q0=o-1;if((G0===null||G0===void 0?void 0:G0.highWaterMark)!=null)Q0=x(G0.highWaterMark);return I(o,"options.concurrency",1),I(Q0,"options.highWaterMark",0),Q0+=o,async function*(){let f0=NX().AbortSignalAny([G0===null||G0===void 0?void 0:G0.signal].filter(_)),f=this,u=[],Z0={signal:f0},t,a,R0=!1,b=0;function n(){R0=!0,g0()}function g0(){b-=1,r()}function r(){if(a&&!R0&&b<o&&u.length<Q0)a(),a=null}async function W0(){try{for await(let m0 of f){if(R0)return;if(f0.aborted)throw new q;try{if(m0=m(m0,Z0),m0===U)continue;m0=p(m0)}catch(D0){m0=e(D0)}if(b+=1,X0(m0,g0,n),u.push(m0),t)t(),t=null;if(!R0&&(u.length>=Q0||b>=o))await new $0((D0)=>{a=D0})}u.push(V)}catch(m0){let D0=e(m0);X0(D0,g0,n),u.push(D0)}finally{if(R0=!0,t)t(),t=null}}W0();try{while(!0){while(u.length>0){let m0=await u[0];if(m0===V)return;if(f0.aborted)throw new q;if(m0!==U)yield m0;u.shift(),r()}await new $0((m0)=>{t=m0})}}finally{if(R0=!0,a)a(),a=null}}.call(this)}function A(m=void 0){if(m!=null)L(m,"options");if((m===null||m===void 0?void 0:m.signal)!=null)E(m.signal,"options.signal");return async function*(){let G0=0;for await(let Q0 of this){var o;if(m!==null&&m!==void 0&&(o=m.signal)!==null&&o!==void 0&&o.aborted)throw new q({cause:m.signal.reason});yield[G0++,Q0]}}.call(this)}async function M(m,G0=void 0){for await(let o of C.call(this,m,G0))return!0;return!1}async function z(m,G0=void 0){if(typeof m!=="function")throw new G("fn",["Function","AsyncFunction"],m);return!await M.call(this,async(...o)=>{return!await m(...o)},G0)}async function $(m,G0){for await(let o of C.call(this,m,G0))return o;return}async function O(m,G0){if(typeof m!=="function")throw new G("fn",["Function","AsyncFunction"],m);async function o(Q0,f0){return await m(Q0,f0),U}for await(let Q0 of F.call(this,o,G0));}function C(m,G0){if(typeof m!=="function")throw new G("fn",["Function","AsyncFunction"],m);async function o(Q0,f0){if(await m(Q0,f0))return Q0;return U}return F.call(this,o,G0)}class R extends K{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function w(m,G0,o){var Q0;if(typeof m!=="function")throw new G("reducer",["Function","AsyncFunction"],m);if(o!=null)L(o,"options");if((o===null||o===void 0?void 0:o.signal)!=null)E(o.signal,"options.signal");let f0=arguments.length>1;if(o!==null&&o!==void 0&&(Q0=o.signal)!==null&&Q0!==void 0&&Q0.aborted){let a=new q(void 0,{cause:o.signal.reason});throw this.once("error",()=>{}),await P(this.destroy(a)),a}let f=new Y,u=f.signal;if(o!==null&&o!==void 0&&o.signal){let a={once:!0,[D]:this,[T]:!0};o.signal.addEventListener("abort",()=>f.abort(),a)}let Z0=!1;try{for await(let a of this){var t;if(Z0=!0,o!==null&&o!==void 0&&(t=o.signal)!==null&&t!==void 0&&t.aborted)throw new q;if(!f0)G0=a,f0=!0;else G0=await m(G0,a,{signal:u})}if(!Z0&&!f0)throw new R}finally{f.abort()}return G0}async function g(m){if(m!=null)L(m,"options");if((m===null||m===void 0?void 0:m.signal)!=null)E(m.signal,"options.signal");let G0=[];for await(let Q0 of this){var o;if(m!==null&&m!==void 0&&(o=m.signal)!==null&&o!==void 0&&o.aborted)throw new q(void 0,{cause:m.signal.reason});v(G0,Q0)}return G0}function h(m,G0){let o=F.call(this,m,G0);return async function*(){for await(let Q0 of o)yield*Q0}.call(this)}function d(m){if(m=c(m),Y0(m))return 0;if(m<0)throw new Z("number",">= 0",m);return m}function K0(m,G0=void 0){if(G0!=null)L(G0,"options");if((G0===null||G0===void 0?void 0:G0.signal)!=null)E(G0.signal,"options.signal");return m=d(m),async function*(){var o;if(G0!==null&&G0!==void 0&&(o=G0.signal)!==null&&o!==void 0&&o.aborted)throw new q;for await(let f0 of this){var Q0;if(G0!==null&&G0!==void 0&&(Q0=G0.signal)!==null&&Q0!==void 0&&Q0.aborted)throw new q;if(m--<=0)yield f0}}.call(this)}function i(m,G0=void 0){if(G0!=null)L(G0,"options");if((G0===null||G0===void 0?void 0:G0.signal)!=null)E(G0.signal,"options.signal");return m=d(m),async function*(){var o;if(G0!==null&&G0!==void 0&&(o=G0.signal)!==null&&o!==void 0&&o.aborted)throw new q;for await(let f0 of this){var Q0;if(G0!==null&&G0!==void 0&&(Q0=G0.signal)!==null&&Q0!==void 0&&Q0.aborted)throw new q;if(m-- >0)yield f0;if(m<=0)return}}.call(this)}X.exports.streamReturningOperators={asIndexedPairs:k(A,"readable.asIndexedPairs will be removed in a future version."),drop:K0,filter:C,flatMap:h,map:F,take:i,compose:H},X.exports.promiseReturningOperators={every:z,forEach:O,reduce:w,toArray:g,some:M,find:$}}),lK=KQ((Q,X)=>{var{ArrayPrototypePop:Y,Promise:W}=CQ(),{isIterable:G,isNodeStream:K,isWebStream:Z}=PY(),{pipelineImpl:q}=eZ(),{finished:E}=lY();mK();function I(...L){return new W((D,T)=>{let P,B,j=L[L.length-1];if(j&&typeof j==="object"&&!K(j)&&!G(j)&&!Z(j)){let S=Y(L);P=S.signal,B=S.end}q(L,(S,N)=>{if(S)T(S);else D(N)},{signal:P,end:B})})}X.exports={finished:E,pipeline:I}}),mK=KQ((Q,X)=>{var{Buffer:Y}=(JX(),WQ(YX)),{ObjectDefineProperty:W,ObjectKeys:G,ReflectApply:K}=CQ(),{promisify:{custom:Z}}=NX(),{streamReturningOperators:q,promiseReturningOperators:E}=XR(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:I}}=MX(),L=cK(),{setDefaultHighWaterMark:D,getDefaultHighWaterMark:T}=FG(),{pipeline:P}=eZ(),{destroyer:B}=f1(),j=lY(),S=lK(),N=PY(),k=X.exports=sZ().Stream;k.isDestroyed=N.isDestroyed,k.isDisturbed=N.isDisturbed,k.isErrored=N.isErrored,k.isReadable=N.isReadable,k.isWritable=N.isWritable,k.Readable=VG();for(let _ of G(q)){let x=function(...Y0){if(new.target)throw I();return k.Readable.from(K(c,this,Y0))},c=q[_];W(x,"name",{__proto__:null,value:c.name}),W(x,"length",{__proto__:null,value:c.length}),W(k.Readable.prototype,_,{__proto__:null,value:x,enumerable:!1,configurable:!0,writable:!0})}for(let _ of G(E)){let x=function(...Y0){if(new.target)throw I();return K(c,this,Y0)},c=E[_];W(x,"name",{__proto__:null,value:c.name}),W(x,"length",{__proto__:null,value:c.length}),W(k.Readable.prototype,_,{__proto__:null,value:x,enumerable:!1,configurable:!0,writable:!0})}k.Writable=aZ(),k.Duplex=RY(),k.Transform=uK(),k.PassThrough=pK(),k.pipeline=P;var{addAbortSignal:v}=KG();k.addAbortSignal=v,k.finished=j,k.destroy=B,k.compose=L,k.setDefaultHighWaterMark=D,k.getDefaultHighWaterMark=T,W(k,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),W(P,Z,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),W(j,Z,{__proto__:null,enumerable:!0,get(){return S.finished}}),k.Stream=k,k._isUint8Array=function(_){return _ instanceof Uint8Array},k._uint8ArrayToBuffer=function(_){return Y.from(_.buffer,_.byteOffset,_.byteLength)}}),YR=KQ((Q,X)=>{var Y=QH();{let W=mK(),G=lK(),K=W.Readable.destroy;X.exports=W.Readable,X.exports._uint8ArrayToBuffer=W._uint8ArrayToBuffer,X.exports._isUint8Array=W._isUint8Array,X.exports.isDisturbed=W.isDisturbed,X.exports.isErrored=W.isErrored,X.exports.isReadable=W.isReadable,X.exports.Readable=W.Readable,X.exports.Writable=W.Writable,X.exports.Duplex=W.Duplex,X.exports.Transform=W.Transform,X.exports.PassThrough=W.PassThrough,X.exports.addAbortSignal=W.addAbortSignal,X.exports.finished=W.finished,X.exports.destroy=W.destroy,X.exports.destroy=K,X.exports.pipeline=W.pipeline,X.exports.compose=W.compose,Object.defineProperty(W,"promises",{configurable:!0,enumerable:!0,get(){return G}}),X.exports.Stream=W.Stream}X.exports.default=X.exports});dK.exports=YR()});var uX={};w1(uX,{webcrypto:()=>jB,rng:()=>pP,randomUUID:()=>FH,randomFillSync:()=>EB,randomFill:()=>LB,randomBytes:()=>cP,publicEncrypt:()=>DB,publicDecrypt:()=>IB,pseudoRandomBytes:()=>uP,prng:()=>hP,privateEncrypt:()=>qB,privateDecrypt:()=>MB,pbkdf2Sync:()=>iP,pbkdf2:()=>rP,listCiphers:()=>GB,getRandomValues:()=>BB,getHashes:()=>oP,getDiffieHellman:()=>HB,getCurves:()=>CB,getCiphers:()=>WB,default:()=>NB,createVerify:()=>zB,createSign:()=>FB,createHmac:()=>nP,createHash:()=>mP,createECDH:()=>AB,createDiffieHellmanGroup:()=>ZB,createDiffieHellman:()=>UB,createDecipheriv:()=>JB,createDecipher:()=>XB,createCredentials:()=>TB,createCipheriv:()=>eP,createCipher:()=>sP,constants:()=>RB,Verify:()=>OB,Sign:()=>VB,Hmac:()=>dP,Hash:()=>lP,DiffieHellmanGroup:()=>$B,DiffieHellman:()=>KB,Decipheriv:()=>YB,Decipher:()=>QB,DEFAULT_ENCODING:()=>PB,Cipheriv:()=>aP,Cipher:()=>tP});function CB(){return SB}var JR,WR,nK,GR,$R,ZR=(Q,X,Y)=>{Y=Q!=null?JR(WR(Q)):{};let W=X||!Q||!Q.__esModule?nK(Y,"default",{value:Q,enumerable:!0}):Y;for(let G of GR(Q))if(!$R.call(W,G))nK(W,G,{get:()=>Q[G],enumerable:!0});return W},H0=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports),zG,OG,rK,HR,YH,JH,LX,UR,SJ,iK,KR,FR,VR,zR,tK,OR,AR,DR,qR,IR,MR,LR,ER,TR,RR,CJ,AG,sK,PR,aK,eK,BR,jJ,WH,GH,SR,QF,$H,CR,XF,jR,YF,JF,NR,kR,wR,vR,_R,xR,yR,gR,fR,bR,hR,uR,pR,cR,ZH,WF,lR,GF,mR,dR,nR,oR,BY,mY,$F,mX,ZF,DG,rR,hX,iR,tR,sR,HF,AY,NJ,UF,aR,KF,eR,FF,QP,XP,YP,JP,HH,WP,UH,GP,$P,ZP,HP,UP,KP,FP,VP,zP,OP,AP,DP,qP,IP,oK,MP,BJ,LP,VF,zF,EP,TP,OF,RP,PP,kJ,BP,SP,CP,jP,NP,kP,AF,wP,DF,qF,IF,KH,MF,vP,LF,_P,xP,XH,yP,gP,fP,bP,e0,hP,uP,pP,cP,lP,mP,dP,nP,oP,rP,iP,tP,sP,aP,eP,QB,XB,YB,JB,WB,GB,$B,ZB,HB,UB,KB,FB,VB,zB,OB,AB,DB,qB,IB,MB,LB,EB,TB,RB,PB="buffer",BB=(Q)=>{return crypto.getRandomValues(Q)},FH=()=>{return crypto.randomUUID()},SB,jB,NB;var EX=dW(()=>{JR=Object.create,{getPrototypeOf:WR,defineProperty:nK,getOwnPropertyNames:GR}=Object,$R=Object.prototype.hasOwnProperty,zG=H0((Q,X)=>{X.exports=(EX(),WQ(uX)).randomBytes}),OG=H0((Q,X)=>{X.exports=(EX(),WQ(uX)).createHash}),rK=H0((Q,X)=>{X.exports=(EX(),WQ(uX)).createHmac}),HR=H0((Q,X)=>{X.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),YH=H0((Q,X)=>{var Y=isFinite,W=Math.pow(2,30)-1;X.exports=function(G,K){if(typeof G!=="number")throw TypeError("Iterations not a number");if(G<0||!Y(G))throw TypeError("Bad iterations");if(typeof K!=="number")throw TypeError("Key length not a number");if(K<0||K>W||K!==K)throw TypeError("Bad key length")}}),JH=H0((Q,X)=>{var Y;if(globalThis.process&&globalThis.process.browser)Y="utf-8";else if(globalThis.process&&globalThis.process.version)W=parseInt(process.version.split(".")[0].slice(1),10),Y=W>=6?"utf-8":"binary";else Y="utf-8";var W;X.exports=Y}),LX=H0((Q,X)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Y=(JX(),WQ(YX)),W=Y.Buffer;function G(Z,q){for(var E in Z)q[E]=Z[E]}if(W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow)X.exports=Y;else G(Y,Q),Q.Buffer=K;function K(Z,q,E){return W(Z,q,E)}K.prototype=Object.create(W.prototype),G(W,K),K.from=function(Z,q,E){if(typeof Z==="number")throw TypeError("Argument must not be a number");return W(Z,q,E)},K.alloc=function(Z,q,E){if(typeof Z!=="number")throw TypeError("Argument must be a number");var I=W(Z);if(q!==void 0)if(typeof E==="string")I.fill(q,E);else I.fill(q);else I.fill(0);return I},K.allocUnsafe=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return W(Z)},K.allocUnsafeSlow=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return Y.SlowBuffer(Z)}}),UR=H0((Q,X)=>{var Y={}.toString;X.exports=Array.isArray||function(W){return Y.call(W)=="[object Array]"}}),SJ=H0((Q,X)=>{X.exports=TypeError}),iK=H0((Q,X)=>{X.exports=Object}),KR=H0((Q,X)=>{X.exports=Error}),FR=H0((Q,X)=>{X.exports=EvalError}),VR=H0((Q,X)=>{X.exports=RangeError}),zR=H0((Q,X)=>{X.exports=ReferenceError}),tK=H0((Q,X)=>{X.exports=SyntaxError}),OR=H0((Q,X)=>{X.exports=URIError}),AR=H0((Q,X)=>{X.exports=Math.abs}),DR=H0((Q,X)=>{X.exports=Math.floor}),qR=H0((Q,X)=>{X.exports=Math.max}),IR=H0((Q,X)=>{X.exports=Math.min}),MR=H0((Q,X)=>{X.exports=Math.pow}),LR=H0((Q,X)=>{X.exports=Math.round}),ER=H0((Q,X)=>{X.exports=Number.isNaN||function(Y){return Y!==Y}}),TR=H0((Q,X)=>{var Y=ER();X.exports=function(W){if(Y(W)||W===0)return W;return W<0?-1:1}}),RR=H0((Q,X)=>{X.exports=Object.getOwnPropertyDescriptor}),CJ=H0((Q,X)=>{var Y=RR();if(Y)try{Y([],"length")}catch(W){Y=null}X.exports=Y}),AG=H0((Q,X)=>{var Y=Object.defineProperty||!1;if(Y)try{Y({},"a",{value:1})}catch(W){Y=!1}X.exports=Y}),sK=H0((Q,X)=>{X.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var Y={},W=Symbol("test"),G=Object(W);if(typeof W==="string")return!1;if(Object.prototype.toString.call(W)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(G)!=="[object Symbol]")return!1;var K=42;Y[W]=K;for(var Z in Y)return!1;if(typeof Object.keys==="function"&&Object.keys(Y).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(Y).length!==0)return!1;var q=Object.getOwnPropertySymbols(Y);if(q.length!==1||q[0]!==W)return!1;if(!Object.prototype.propertyIsEnumerable.call(Y,W))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var E=Object.getOwnPropertyDescriptor(Y,W);if(E.value!==K||E.enumerable!==!0)return!1}return!0}}),PR=H0((Q,X)=>{var Y=typeof Symbol<"u"&&Symbol,W=sK();X.exports=function(){if(typeof Y!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof Y("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return W()}}),aK=H0((Q,X)=>{X.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),eK=H0((Q,X)=>{var Y=iK();X.exports=Y.getPrototypeOf||null}),BR=H0((Q,X)=>{var Y="Function.prototype.bind called on incompatible ",W=Object.prototype.toString,G=Math.max,K="[object Function]",Z=function(I,L){var D=[];for(var T=0;T<I.length;T+=1)D[T]=I[T];for(var P=0;P<L.length;P+=1)D[P+I.length]=L[P];return D},q=function(I,L){var D=[];for(var T=L||0,P=0;T<I.length;T+=1,P+=1)D[P]=I[T];return D},E=function(I,L){var D="";for(var T=0;T<I.length;T+=1)if(D+=I[T],T+1<I.length)D+=L;return D};X.exports=function(I){var L=this;if(typeof L!=="function"||W.apply(L)!==K)throw TypeError(Y+L);var D=q(arguments,1),T,P=function(){if(this instanceof T){var k=L.apply(this,Z(D,arguments));if(Object(k)===k)return k;return this}return L.apply(I,Z(D,arguments))},B=G(0,L.length-D.length),j=[];for(var S=0;S<B;S++)j[S]="$"+S;if(T=Function("binder","return function ("+E(j,",")+"){ return binder.apply(this,arguments); }")(P),L.prototype){var N=function(){};N.prototype=L.prototype,T.prototype=new N,N.prototype=null}return T}}),jJ=H0((Q,X)=>{var Y=BR();X.exports=Function.prototype.bind||Y}),WH=H0((Q,X)=>{X.exports=Function.prototype.call}),GH=H0((Q,X)=>{X.exports=Function.prototype.apply}),SR=H0((Q,X)=>{X.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),QF=H0((Q,X)=>{var Y=jJ(),W=GH(),G=WH(),K=SR();X.exports=K||Y.call(G,W)}),$H=H0((Q,X)=>{var Y=jJ(),W=SJ(),G=WH(),K=QF();X.exports=function(Z){if(Z.length<1||typeof Z[0]!=="function")throw new W("a function is required");return K(Y,G,Z)}}),CR=H0((Q,X)=>{var Y=$H(),W=CJ(),G;try{G=[].__proto__===Array.prototype}catch(E){if(!E||typeof E!=="object"||!("code"in E)||E.code!=="ERR_PROTO_ACCESS")throw E}var K=!!G&&W&&W(Object.prototype,"__proto__"),Z=Object,q=Z.getPrototypeOf;X.exports=K&&typeof K.get==="function"?Y([K.get]):typeof q==="function"?function(E){return q(E==null?E:Z(E))}:!1}),XF=H0((Q,X)=>{var Y=aK(),W=eK(),G=CR();X.exports=Y?function(K){return Y(K)}:W?function(K){if(!K||typeof K!=="object"&&typeof K!=="function")throw TypeError("getProto: not an object");return W(K)}:G?function(K){return G(K)}:null}),jR=H0((Q,X)=>{var Y=Function.prototype.call,W=Object.prototype.hasOwnProperty,G=jJ();X.exports=G.call(Y,W)}),YF=H0((Q,X)=>{var Y,W=iK(),G=KR(),K=FR(),Z=VR(),q=zR(),E=tK(),I=SJ(),L=OR(),D=AR(),T=DR(),P=qR(),B=IR(),j=MR(),S=LR(),N=TR(),k=Function,v=function(G0){try{return k('"use strict"; return ('+G0+").constructor;")()}catch(o){}},_=CJ(),x=AG(),c=function(){throw new I},Y0=_?function(){try{return arguments.callee,c}catch(G0){try{return _(arguments,"callee").get}catch(o){return c}}}():c,$0=PR()(),e=XF(),p=eK(),X0=aK(),J=GH(),U=WH(),V={},H=typeof Uint8Array>"u"||!e?Y:e(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Y:ArrayBuffer,"%ArrayIteratorPrototype%":$0&&e?e([][Symbol.iterator]()):Y,"%AsyncFromSyncIteratorPrototype%":Y,"%AsyncFunction%":V,"%AsyncGenerator%":V,"%AsyncGeneratorFunction%":V,"%AsyncIteratorPrototype%":V,"%Atomics%":typeof Atomics>"u"?Y:Atomics,"%BigInt%":typeof BigInt>"u"?Y:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Y:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Y:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":G,"%eval%":eval,"%EvalError%":K,"%Float16Array%":typeof Float16Array>"u"?Y:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Y:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Y:FinalizationRegistry,"%Function%":k,"%GeneratorFunction%":V,"%Int8Array%":typeof Int8Array>"u"?Y:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Y:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$0&&e?e(e([][Symbol.iterator]())):Y,"%JSON%":typeof JSON==="object"?JSON:Y,"%Map%":typeof Map>"u"?Y:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$0||!e?Y:e(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":W,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Y:Promise,"%Proxy%":typeof Proxy>"u"?Y:Proxy,"%RangeError%":Z,"%ReferenceError%":q,"%Reflect%":typeof Reflect>"u"?Y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Y:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$0||!e?Y:e(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$0&&e?e(""[Symbol.iterator]()):Y,"%Symbol%":$0?Symbol:Y,"%SyntaxError%":E,"%ThrowTypeError%":Y0,"%TypedArray%":H,"%TypeError%":I,"%Uint8Array%":typeof Uint8Array>"u"?Y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Y:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Y:Uint32Array,"%URIError%":L,"%WeakMap%":typeof WeakMap>"u"?Y:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Y:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Y:WeakSet,"%Function.prototype.call%":U,"%Function.prototype.apply%":J,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":p,"%Math.abs%":D,"%Math.floor%":T,"%Math.max%":P,"%Math.min%":B,"%Math.pow%":j,"%Math.round%":S,"%Math.sign%":N,"%Reflect.getPrototypeOf%":X0};if(e)try{null.error}catch(G0){A=e(e(G0)),F["%Error.prototype%"]=A}var A,M=function G0(o){var Q0;if(o==="%AsyncFunction%")Q0=v("async function () {}");else if(o==="%GeneratorFunction%")Q0=v("function* () {}");else if(o==="%AsyncGeneratorFunction%")Q0=v("async function* () {}");else if(o==="%AsyncGenerator%"){var f0=G0("%AsyncGeneratorFunction%");if(f0)Q0=f0.prototype}else if(o==="%AsyncIteratorPrototype%"){var f=G0("%AsyncGenerator%");if(f&&e)Q0=e(f.prototype)}return F[o]=Q0,Q0},z={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$=jJ(),O=jR(),C=$.call(U,Array.prototype.concat),R=$.call(J,Array.prototype.splice),w=$.call(U,String.prototype.replace),g=$.call(U,String.prototype.slice),h=$.call(U,RegExp.prototype.exec),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K0=/\\(\\)?/g,i=function(G0){var o=g(G0,0,1),Q0=g(G0,-1);if(o==="%"&&Q0!=="%")throw new E("invalid intrinsic syntax, expected closing `%`");else if(Q0==="%"&&o!=="%")throw new E("invalid intrinsic syntax, expected opening `%`");var f0=[];return w(G0,d,function(f,u,Z0,t){f0[f0.length]=Z0?w(t,K0,"$1"):u||f}),f0},m=function(G0,o){var Q0=G0,f0;if(O(z,Q0))f0=z[Q0],Q0="%"+f0[0]+"%";if(O(F,Q0)){var f=F[Q0];if(f===V)f=M(Q0);if(typeof f>"u"&&!o)throw new I("intrinsic "+G0+" exists, but is not available. Please file an issue!");return{alias:f0,name:Q0,value:f}}throw new E("intrinsic "+G0+" does not exist!")};X.exports=function(G0,o){if(typeof G0!=="string"||G0.length===0)throw new I("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!=="boolean")throw new I('"allowMissing" argument must be a boolean');if(h(/^%?[^%]*%?$/,G0)===null)throw new E("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Q0=i(G0),f0=Q0.length>0?Q0[0]:"",f=m("%"+f0+"%",o),u=f.name,Z0=f.value,t=!1,a=f.alias;if(a)f0=a[0],R(Q0,C([0,1],a));for(var R0=1,b=!0;R0<Q0.length;R0+=1){var n=Q0[R0],g0=g(n,0,1),r=g(n,-1);if((g0==='"'||g0==="'"||g0==="`"||(r==='"'||r==="'"||r==="`"))&&g0!==r)throw new E("property names with quotes must have matching quotes");if(n==="constructor"||!b)t=!0;if(f0+="."+n,u="%"+f0+"%",O(F,u))Z0=F[u];else if(Z0!=null){if(!(n in Z0)){if(!o)throw new I("base intrinsic for "+G0+" exists, but the property is not available.");return}if(_&&R0+1>=Q0.length){var W0=_(Z0,n);if(b=!!W0,b&&"get"in W0&&!("originalValue"in W0.get))Z0=W0.get;else Z0=Z0[n]}else b=O(Z0,n),Z0=Z0[n];if(b&&!t)F[u]=Z0}}return Z0}}),JF=H0((Q,X)=>{var Y=YF(),W=$H(),G=W([Y("%String.prototype.indexOf%")]);X.exports=function(K,Z){var q=Y(K,!!Z);if(typeof q==="function"&&G(K,".prototype.")>-1)return W([q]);return q}}),NR=H0((Q,X)=>{var Y=Function.prototype.toString,W=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,G,K;if(typeof W==="function"&&typeof Object.defineProperty==="function")try{G=Object.defineProperty({},"length",{get:function(){throw K}}),K={},W(function(){throw 42},null,G)}catch(_){if(_!==K)W=null}else W=null;var Z=/^\s*class\b/,q=function(_){try{var x=Y.call(_);return Z.test(x)}catch(c){return!1}},E=function(_){try{if(q(_))return!1;return Y.call(_),!0}catch(x){return!1}},I=Object.prototype.toString,L="[object Object]",D="[object Function]",T="[object GeneratorFunction]",P="[object HTMLAllCollection]",B="[object HTML document.all class]",j="[object HTMLCollection]",S=typeof Symbol==="function"&&!!Symbol.toStringTag,N=!(0 in[,]),k=function(){return!1};if(typeof document==="object"){if(v=document.all,I.call(v)===I.call(document.all))k=function(_){if((N||!_)&&(typeof _>"u"||typeof _==="object"))try{var x=I.call(_);return(x===P||x===B||x===j||x===L)&&_("")==null}catch(c){}return!1}}var v;X.exports=W?function(_){if(k(_))return!0;if(!_)return!1;if(typeof _!=="function"&&typeof _!=="object")return!1;try{W(_,null,G)}catch(x){if(x!==K)return!1}return!q(_)&&E(_)}:function(_){if(k(_))return!0;if(!_)return!1;if(typeof _!=="function"&&typeof _!=="object")return!1;if(S)return E(_);if(q(_))return!1;var x=I.call(_);if(x!==D&&x!==T&&!/^\[object HTML/.test(x))return!1;return E(_)}}),kR=H0((Q,X)=>{var Y=NR(),W=Object.prototype.toString,G=Object.prototype.hasOwnProperty,K=function(I,L,D){for(var T=0,P=I.length;T<P;T++)if(G.call(I,T))if(D==null)L(I[T],T,I);else L.call(D,I[T],T,I)},Z=function(I,L,D){for(var T=0,P=I.length;T<P;T++)if(D==null)L(I.charAt(T),T,I);else L.call(D,I.charAt(T),T,I)},q=function(I,L,D){for(var T in I)if(G.call(I,T))if(D==null)L(I[T],T,I);else L.call(D,I[T],T,I)};function E(I){return W.call(I)==="[object Array]"}X.exports=function(I,L,D){if(!Y(L))throw TypeError("iterator must be a function");var T;if(arguments.length>=3)T=D;if(E(I))K(I,L,T);else if(typeof I==="string")Z(I,L,T);else q(I,L,T)}}),wR=H0((Q,X)=>{X.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),vR=H0((Q,X)=>{var Y=wR(),W=typeof globalThis>"u"?globalThis:globalThis;X.exports=function(){var G=[];for(var K=0;K<Y.length;K++)if(typeof W[Y[K]]==="function")G[G.length]=Y[K];return G}}),_R=H0((Q,X)=>{var Y=AG(),W=tK(),G=SJ(),K=CJ();X.exports=function(Z,q,E){if(!Z||typeof Z!=="object"&&typeof Z!=="function")throw new G("`obj` must be an object or a function`");if(typeof q!=="string"&&typeof q!=="symbol")throw new G("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new G("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new G("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new G("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new G("`loose`, if provided, must be a boolean");var I=arguments.length>3?arguments[3]:null,L=arguments.length>4?arguments[4]:null,D=arguments.length>5?arguments[5]:null,T=arguments.length>6?arguments[6]:!1,P=!!K&&K(Z,q);if(Y)Y(Z,q,{configurable:D===null&&P?P.configurable:!D,enumerable:I===null&&P?P.enumerable:!I,value:E,writable:L===null&&P?P.writable:!L});else if(T||!I&&!L&&!D)Z[q]=E;else throw new W("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),xR=H0((Q,X)=>{var Y=AG(),W=function(){return!!Y};W.hasArrayLengthDefineBug=function(){if(!Y)return null;try{return Y([],"length",{value:1}).length!==1}catch(G){return!0}},X.exports=W}),yR=H0((Q,X)=>{var Y=YF(),W=_R(),G=xR()(),K=CJ(),Z=SJ(),q=Y("%Math.floor%");X.exports=function(E,I){if(typeof E!=="function")throw new Z("`fn` is not a function");if(typeof I!=="number"||I<0||I>4294967295||q(I)!==I)throw new Z("`length` must be a positive 32-bit integer");var L=arguments.length>2&&!!arguments[2],D=!0,T=!0;if("length"in E&&K){var P=K(E,"length");if(P&&!P.configurable)D=!1;if(P&&!P.writable)T=!1}if(D||T||!L)if(G)W(E,"length",I,!0,!0);else W(E,"length",I);return E}}),gR=H0((Q,X)=>{var Y=jJ(),W=GH(),G=QF();X.exports=function(){return G(Y,W,arguments)}}),fR=H0((Q,X)=>{var Y=yR(),W=AG(),G=$H(),K=gR();if(X.exports=function(Z){var q=G(arguments),E=Z.length-(arguments.length-1);return Y(q,1+(E>0?E:0),!0)},W)W(X.exports,"apply",{value:K});else X.exports.apply=K}),bR=H0((Q,X)=>{var Y=sK();X.exports=function(){return Y()&&!!Symbol.toStringTag}}),hR=H0((Q,X)=>{var Y=kR(),W=vR(),G=fR(),K=JF(),Z=CJ(),q=XF(),E=K("Object.prototype.toString"),I=bR()(),L=typeof globalThis>"u"?globalThis:globalThis,D=W(),T=K("String.prototype.slice"),P=K("Array.prototype.indexOf",!0)||function(N,k){for(var v=0;v<N.length;v+=1)if(N[v]===k)return v;return-1},B={__proto__:null};if(I&&Z&&q)Y(D,function(N){var k=new L[N];if(Symbol.toStringTag in k&&q){var v=q(k),_=Z(v,Symbol.toStringTag);if(!_&&v){var x=q(v);_=Z(x,Symbol.toStringTag)}B["$"+N]=G(_.get)}});else Y(D,function(N){var k=new L[N],v=k.slice||k.set;if(v)B["$"+N]=G(v)});var j=function(N){var k=!1;return Y(B,function(v,_){if(!k)try{if("$"+v(N)===_)k=T(_,1)}catch(x){}}),k},S=function(N){var k=!1;return Y(B,function(v,_){if(!k)try{v(N),k=T(_,1)}catch(x){}}),k};X.exports=function(N){if(!N||typeof N!=="object")return!1;if(!I){var k=T(E(N),8,-1);if(P(D,k)>-1)return k;if(k!=="Object")return!1;return S(N)}if(!Z)return null;return j(N)}}),uR=H0((Q,X)=>{var Y=hR();X.exports=function(W){return!!Y(W)}}),pR=H0((Q,X)=>{var Y=SJ(),W=JF(),G=W("TypedArray.prototype.buffer",!0),K=uR();X.exports=G||function(Z){if(!K(Z))throw new Y("Not a Typed Array");return Z.buffer}}),cR=H0((Q,X)=>{var Y=LX().Buffer,W=UR(),G=pR(),K=ArrayBuffer.isView||function(I){try{return G(I),!0}catch(L){return!1}},Z=typeof Uint8Array<"u",q=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",E=q&&(Y.prototype instanceof Uint8Array||Y.TYPED_ARRAY_SUPPORT);X.exports=function(I,L){if(Y.isBuffer(I)){if(I.constructor&&!("isBuffer"in I))return Y.from(I);return I}if(typeof I==="string")return Y.from(I,L);if(q&&K(I)){if(I.byteLength===0)return Y.alloc(0);if(E){var D=Y.from(I.buffer,I.byteOffset,I.byteLength);if(D.byteLength===I.byteLength)return D}var T=I instanceof Uint8Array?I:new Uint8Array(I.buffer,I.byteOffset,I.byteLength),P=Y.from(T);if(P.length===I.byteLength)return P}if(Z&&I instanceof Uint8Array)return Y.from(I);var B=W(I);if(B)for(var j=0;j<I.length;j+=1){var S=I[j];if(typeof S!=="number"||S<0||S>255||~~S!==S)throw RangeError("Array items must be numbers in the range 0-255.")}if(B||Y.isBuffer(I)&&I.constructor&&typeof I.constructor.isBuffer==="function"&&I.constructor.isBuffer(I))return Y.from(I);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),ZH=H0((Q,X)=>{var Y=LX().Buffer,W=cR(),G=typeof Uint8Array<"u",K=G&&typeof ArrayBuffer<"u",Z=K&&ArrayBuffer.isView;X.exports=function(q,E,I){if(typeof q==="string"||Y.isBuffer(q)||G&&q instanceof Uint8Array||Z&&Z(q))return W(q,E);throw TypeError(I+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),WF=H0((Q,X)=>{var Y={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},W={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},G=rK(),K=LX().Buffer,Z=YH(),q=JH(),E=ZH();function I(L,D,T,P,B){Z(T,P),L=E(L,q,"Password"),D=E(D,q,"Salt");var j=(B||"sha1").toLowerCase(),S=W[j]||j,N=Y[S];if(typeof N!=="number"||!N)throw TypeError("Digest algorithm not supported: "+B);var k=K.allocUnsafe(P),v=K.allocUnsafe(D.length+4);D.copy(v,0,0,D.length);var _=0,x=N,c=Math.ceil(P/x);for(var Y0=1;Y0<=c;Y0++){v.writeUInt32BE(Y0,D.length);var $0=G(S,L).update(v).digest(),e=$0;for(var p=1;p<T;p++){e=G(S,L).update(e).digest();for(var X0=0;X0<x;X0++)$0[X0]^=e[X0]}$0.copy(k,_),_+=x}return k}X.exports=I}),lR=H0((Q,X)=>{var Y=LX().Buffer,W=YH(),G=JH(),K=WF(),Z=ZH(),q,E=globalThis.crypto&&globalThis.crypto.subtle,I={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},L=[],D;function T(){if(D)return D;if(globalThis.process&&globalThis.process.nextTick)D=globalThis.process.nextTick;else if(globalThis.queueMicrotask)D=globalThis.queueMicrotask;else if(globalThis.setImmediate)D=globalThis.setImmediate;else D=globalThis.setTimeout;return D}function P(S,N,k,v,_){return E.importKey("raw",S,{name:"PBKDF2"},!1,["deriveBits"]).then(function(x){return E.deriveBits({name:"PBKDF2",salt:N,iterations:k,hash:{name:_}},x,v<<3)}).then(function(x){return Y.from(x)})}function B(S){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!E||!E.importKey||!E.deriveBits)return Promise.resolve(!1);if(L[S]!==void 0)return L[S];q=q||Y.alloc(8);var N=P(q,q,10,128,S).then(function(){return!0},function(){return!1});return L[S]=N,N}function j(S,N){S.then(function(k){T()(function(){N(null,k)})},function(k){T()(function(){N(k)})})}X.exports=function(S,N,k,v,_,x){if(typeof _==="function")x=_,_=void 0;if(W(k,v),S=Z(S,G,"Password"),N=Z(N,G,"Salt"),typeof x!=="function")throw Error("No callback provided to pbkdf2");_=_||"sha1";var c=I[_.toLowerCase()];if(!c||typeof globalThis.Promise!=="function"){T()(function(){var Y0;try{Y0=K(S,N,k,v,_)}catch($0){x($0);return}x(null,Y0)});return}j(B(c).then(function(Y0){if(Y0)return P(S,N,k,v,c);return K(S,N,k,v,_)}),x)}}),GF=H0((Q)=>{var X=(EX(),WQ(uX)),Y=YH(),W=JH(),G=ZH();function K(q,E,I,L,D,T){if(Y(I,L),q=G(q,W,"Password"),E=G(E,W,"Salt"),typeof D==="function")T=D,D="sha1";if(typeof T!=="function")throw Error("No callback provided to pbkdf2");return X.pbkdf2(q,E,I,L,D,T)}function Z(q,E,I,L,D){return Y(I,L),q=G(q,W,"Password"),E=G(E,W,"Salt"),D=D||"sha1",X.pbkdf2Sync(q,E,I,L,D)}if(!X.pbkdf2Sync||X.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)Q.pbkdf2Sync=WF(),Q.pbkdf2=lR();else Q.pbkdf2Sync=Z,Q.pbkdf2=K}),mR=H0((Q)=>{var X=(EX(),WQ(uX));Q.createCipher=Q.Cipher=X.createCipher,Q.createCipheriv=Q.Cipheriv=X.createCipheriv,Q.createDecipher=Q.Decipher=X.createDecipher,Q.createDecipheriv=Q.Decipheriv=X.createDecipheriv,Q.listCiphers=Q.getCiphers=X.getCiphers}),dR=H0((Q)=>{var X=(EX(),WQ(uX));Q.DiffieHellmanGroup=X.DiffieHellmanGroup,Q.createDiffieHellmanGroup=X.createDiffieHellmanGroup,Q.getDiffieHellman=X.getDiffieHellman,Q.createDiffieHellman=X.createDiffieHellman,Q.DiffieHellman=X.DiffieHellman}),nR=H0((Q)=>{var X=(EX(),WQ(uX));Q.createSign=X.createSign,Q.Sign=X.Sign,Q.createVerify=X.createVerify,Q.Verify=X.Verify}),oR=H0((Q,X)=>{X.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),BY=H0((Q,X)=>{(function(Y,W){function G(J,U){if(!J)throw Error(U||"Assertion failed")}function K(J,U){J.super_=U;var V=function(){};V.prototype=U.prototype,J.prototype=new V,J.prototype.constructor=J}function Z(J,U,V){if(Z.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(U==="le"||U==="be")V=U,U=10;this._init(J||0,U||10,V||"be")}}if(typeof Y==="object")Y.exports=Z;else W.BN=Z;Z.BN=Z,Z.wordSize=26;var q;try{if(typeof window<"u"&&typeof window.Buffer<"u")q=window.Buffer;else q=(JX(),WQ(YX)).Buffer}catch(J){}Z.isBN=function(J){if(J instanceof Z)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Z.wordSize&&Array.isArray(J.words)},Z.max=function(J,U){if(J.cmp(U)>0)return J;return U},Z.min=function(J,U){if(J.cmp(U)<0)return J;return U},Z.prototype._init=function(J,U,V){if(typeof J==="number")return this._initNumber(J,U,V);if(typeof J==="object")return this._initArray(J,U,V);if(U==="hex")U=16;G(U===(U|0)&&U>=2&&U<=36),J=J.toString().replace(/\s+/g,"");var H=0;if(J[0]==="-")H++,this.negative=1;if(H<J.length){if(U===16)this._parseHex(J,H,V);else if(this._parseBase(J,U,H),V==="le")this._initArray(this.toArray(),U,V)}},Z.prototype._initNumber=function(J,U,V){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(V!=="le")return;this._initArray(this.toArray(),U,V)},Z.prototype._initArray=function(J,U,V){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F,A,M=0;if(V==="be"){for(H=J.length-1,F=0;H>=0;H-=3)if(A=J[H]|J[H-1]<<8|J[H-2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}else if(V==="le"){for(H=0,F=0;H<J.length;H+=3)if(A=J[H]|J[H+1]<<8|J[H+2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}return this.strip()};function E(J,U){var V=J.charCodeAt(U);if(V>=65&&V<=70)return V-55;else if(V>=97&&V<=102)return V-87;else return V-48&15}function I(J,U,V){var H=E(J,V);if(V-1>=U)H|=E(J,V-1)<<4;return H}Z.prototype._parseHex=function(J,U,V){this.length=Math.ceil((J.length-U)/6),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F=0,A=0,M;if(V==="be")for(H=J.length-1;H>=U;H-=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8;else{var z=J.length-U;for(H=z%2===0?U+1:U;H<J.length;H+=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8}this.strip()};function L(J,U,V,H){var F=0,A=Math.min(J.length,V);for(var M=U;M<A;M++){var z=J.charCodeAt(M)-48;if(F*=H,z>=49)F+=z-49+10;else if(z>=17)F+=z-17+10;else F+=z}return F}Z.prototype._parseBase=function(J,U,V){this.words=[0],this.length=1;for(var H=0,F=1;F<=67108863;F*=U)H++;H--,F=F/U|0;var A=J.length-V,M=A%H,z=Math.min(A,A-M)+V,$=0;for(var O=V;O<z;O+=H)if($=L(J,O,O+H,U),this.imuln(F),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(M!==0){var C=1;$=L(J,O,J.length,U);for(O=0;O<M;O++)C*=U;if(this.imuln(C),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Z.prototype.copy=function(J){J.words=Array(this.length);for(var U=0;U<this.length;U++)J.words[U]=this.words[U];J.length=this.length,J.negative=this.negative,J.red=this.red},Z.prototype.clone=function(){var J=new Z(null);return this.copy(J),J},Z.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Z.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Z.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Z.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var D=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],T=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Z.prototype.toString=function(J,U){J=J||10,U=U|0||1;var V;if(J===16||J==="hex"){V="";var H=0,F=0;for(var A=0;A<this.length;A++){var M=this.words[A],z=((M<<H|F)&16777215).toString(16);if(F=M>>>24-H&16777215,H+=2,H>=26)H-=26,A--;if(F!==0||A!==this.length-1)V=D[6-z.length]+z+V;else V=z+V}if(F!==0)V=F.toString(16)+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}if(J===(J|0)&&J>=2&&J<=36){var $=T[J],O=P[J];V="";var C=this.clone();C.negative=0;while(!C.isZero()){var R=C.modn(O).toString(J);if(C=C.idivn(O),!C.isZero())V=D[$-R.length]+R+V;else V=R+V}if(this.isZero())V="0"+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}G(!1,"Base should be between 2 and 36")},Z.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Z.prototype.toJSON=function(){return this.toString(16)},Z.prototype.toBuffer=function(J,U){return G(typeof q<"u"),this.toArrayLike(q,J,U)},Z.prototype.toArray=function(J,U){return this.toArrayLike(Array,J,U)},Z.prototype.toArrayLike=function(J,U,V){var H=this.byteLength(),F=V||Math.max(1,H);G(H<=F,"byte array longer than desired length"),G(F>0,"Requested array length <= 0"),this.strip();var A=U==="le",M=new J(F),z,$,O=this.clone();if(!A){for($=0;$<F-H;$++)M[$]=0;for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[F-$-1]=z}else{for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[$]=z;for(;$<F;$++)M[$]=0}return M},Math.clz32)Z.prototype._countBits=function(J){return 32-Math.clz32(J)};else Z.prototype._countBits=function(J){var U=J,V=0;if(U>=4096)V+=13,U>>>=13;if(U>=64)V+=7,U>>>=7;if(U>=8)V+=4,U>>>=4;if(U>=2)V+=2,U>>>=2;return V+U};Z.prototype._zeroBits=function(J){if(J===0)return 26;var U=J,V=0;if((U&8191)===0)V+=13,U>>>=13;if((U&127)===0)V+=7,U>>>=7;if((U&15)===0)V+=4,U>>>=4;if((U&3)===0)V+=2,U>>>=2;if((U&1)===0)V++;return V},Z.prototype.bitLength=function(){var J=this.words[this.length-1],U=this._countBits(J);return(this.length-1)*26+U};function B(J){var U=Array(J.bitLength());for(var V=0;V<U.length;V++){var H=V/26|0,F=V%26;U[V]=(J.words[H]&1<<F)>>>F}return U}Z.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var U=0;U<this.length;U++){var V=this._zeroBits(this.words[U]);if(J+=V,V!==26)break}return J},Z.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Z.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Z.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Z.prototype.isNeg=function(){return this.negative!==0},Z.prototype.neg=function(){return this.clone().ineg()},Z.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Z.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var U=0;U<J.length;U++)this.words[U]=this.words[U]|J.words[U];return this.strip()},Z.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Z.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Z.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Z.prototype.iuand=function(J){var U;if(this.length>J.length)U=J;else U=this;for(var V=0;V<U.length;V++)this.words[V]=this.words[V]&J.words[V];return this.length=U.length,this.strip()},Z.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Z.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Z.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Z.prototype.iuxor=function(J){var U,V;if(this.length>J.length)U=this,V=J;else U=J,V=this;for(var H=0;H<V.length;H++)this.words[H]=U.words[H]^V.words[H];if(this!==U)for(;H<U.length;H++)this.words[H]=U.words[H];return this.length=U.length,this.strip()},Z.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Z.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Z.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Z.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var U=Math.ceil(J/26)|0,V=J%26;if(this._expand(U),V>0)U--;for(var H=0;H<U;H++)this.words[H]=~this.words[H]&67108863;if(V>0)this.words[H]=~this.words[H]&67108863>>26-V;return this.strip()},Z.prototype.notn=function(J){return this.clone().inotn(J)},Z.prototype.setn=function(J,U){G(typeof J==="number"&&J>=0);var V=J/26|0,H=J%26;if(this._expand(V+1),U)this.words[V]=this.words[V]|1<<H;else this.words[V]=this.words[V]&~(1<<H);return this.strip()},Z.prototype.iadd=function(J){var U;if(this.negative!==0&&J.negative===0)return this.negative=0,U=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,U=this.isub(J),J.negative=1,U._normSign();var V,H;if(this.length>J.length)V=this,H=J;else V=J,H=this;var F=0;for(var A=0;A<H.length;A++)U=(V.words[A]|0)+(H.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;for(;F!==0&&A<V.length;A++)U=(V.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;if(this.length=V.length,F!==0)this.words[this.length]=F,this.length++;else if(V!==this)for(;A<V.length;A++)this.words[A]=V.words[A];return this},Z.prototype.add=function(J){var U;if(J.negative!==0&&this.negative===0)return J.negative=0,U=this.sub(J),J.negative^=1,U;else if(J.negative===0&&this.negative!==0)return this.negative=0,U=J.sub(this),this.negative=1,U;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Z.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var U=this.iadd(J);return J.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var V=this.cmp(J);if(V===0)return this.negative=0,this.length=1,this.words[0]=0,this;var H,F;if(V>0)H=this,F=J;else H=J,F=this;var A=0;for(var M=0;M<F.length;M++)U=(H.words[M]|0)-(F.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;for(;A!==0&&M<H.length;M++)U=(H.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;if(A===0&&M<H.length&&H!==this)for(;M<H.length;M++)this.words[M]=H.words[M];if(this.length=Math.max(this.length,M),H!==this)this.negative=1;return this.strip()},Z.prototype.sub=function(J){return this.clone().isub(J)};function j(J,U,V){V.negative=U.negative^J.negative;var H=J.length+U.length|0;V.length=H,H=H-1|0;var F=J.words[0]|0,A=U.words[0]|0,M=F*A,z=M&67108863,$=M/67108864|0;V.words[0]=z;for(var O=1;O<H;O++){var C=$>>>26,R=$&67108863,w=Math.min(O,U.length-1);for(var g=Math.max(0,O-J.length+1);g<=w;g++){var h=O-g|0;F=J.words[h]|0,A=U.words[g]|0,M=F*A+R,C+=M/67108864|0,R=M&67108863}V.words[O]=R|0,$=C|0}if($!==0)V.words[O]=$|0;else V.length--;return V.strip()}var S=function(J,U,V){var H=J.words,F=U.words,A=V.words,M=0,z,$,O,C=H[0]|0,R=C&8191,w=C>>>13,g=H[1]|0,h=g&8191,d=g>>>13,K0=H[2]|0,i=K0&8191,m=K0>>>13,G0=H[3]|0,o=G0&8191,Q0=G0>>>13,f0=H[4]|0,f=f0&8191,u=f0>>>13,Z0=H[5]|0,t=Z0&8191,a=Z0>>>13,R0=H[6]|0,b=R0&8191,n=R0>>>13,g0=H[7]|0,r=g0&8191,W0=g0>>>13,m0=H[8]|0,D0=m0&8191,q0=m0>>>13,kQ=H[9]|0,O0=kQ&8191,I0=kQ>>>13,yQ=F[0]|0,E0=yQ&8191,L0=yQ>>>13,OX=F[1]|0,P0=OX&8191,k0=OX>>>13,AX=F[2]|0,w0=AX&8191,B0=AX>>>13,GX=F[3]|0,v0=GX&8191,S0=GX>>>13,eQ=F[4]|0,_0=eQ&8191,x0=eQ>>>13,QX=F[5]|0,C0=QX&8191,y=QX>>>13,l=F[6]|0,s=l&8191,J0=l>>>13,b0=F[7]|0,A0=b0&8191,M0=b0>>>13,wQ=F[8]|0,j0=wQ&8191,y0=wQ>>>13,$X=F[9]|0,N0=$X&8191,T0=$X>>>13;V.negative=J.negative^U.negative,V.length=19,z=Math.imul(R,E0),$=Math.imul(R,L0),$=$+Math.imul(w,E0)|0,O=Math.imul(w,L0);var vQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(vQ>>>26)|0,vQ&=67108863,z=Math.imul(h,E0),$=Math.imul(h,L0),$=$+Math.imul(d,E0)|0,O=Math.imul(d,L0),z=z+Math.imul(R,P0)|0,$=$+Math.imul(R,k0)|0,$=$+Math.imul(w,P0)|0,O=O+Math.imul(w,k0)|0;var s0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(s0>>>26)|0,s0&=67108863,z=Math.imul(i,E0),$=Math.imul(i,L0),$=$+Math.imul(m,E0)|0,O=Math.imul(m,L0),z=z+Math.imul(h,P0)|0,$=$+Math.imul(h,k0)|0,$=$+Math.imul(d,P0)|0,O=O+Math.imul(d,k0)|0,z=z+Math.imul(R,w0)|0,$=$+Math.imul(R,B0)|0,$=$+Math.imul(w,w0)|0,O=O+Math.imul(w,B0)|0;var r0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(r0>>>26)|0,r0&=67108863,z=Math.imul(o,E0),$=Math.imul(o,L0),$=$+Math.imul(Q0,E0)|0,O=Math.imul(Q0,L0),z=z+Math.imul(i,P0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(m,P0)|0,O=O+Math.imul(m,k0)|0,z=z+Math.imul(h,w0)|0,$=$+Math.imul(h,B0)|0,$=$+Math.imul(d,w0)|0,O=O+Math.imul(d,B0)|0,z=z+Math.imul(R,v0)|0,$=$+Math.imul(R,S0)|0,$=$+Math.imul(w,v0)|0,O=O+Math.imul(w,S0)|0;var OQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(OQ>>>26)|0,OQ&=67108863,z=Math.imul(f,E0),$=Math.imul(f,L0),$=$+Math.imul(u,E0)|0,O=Math.imul(u,L0),z=z+Math.imul(o,P0)|0,$=$+Math.imul(o,k0)|0,$=$+Math.imul(Q0,P0)|0,O=O+Math.imul(Q0,k0)|0,z=z+Math.imul(i,w0)|0,$=$+Math.imul(i,B0)|0,$=$+Math.imul(m,w0)|0,O=O+Math.imul(m,B0)|0,z=z+Math.imul(h,v0)|0,$=$+Math.imul(h,S0)|0,$=$+Math.imul(d,v0)|0,O=O+Math.imul(d,S0)|0,z=z+Math.imul(R,_0)|0,$=$+Math.imul(R,x0)|0,$=$+Math.imul(w,_0)|0,O=O+Math.imul(w,x0)|0;var FQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(FQ>>>26)|0,FQ&=67108863,z=Math.imul(t,E0),$=Math.imul(t,L0),$=$+Math.imul(a,E0)|0,O=Math.imul(a,L0),z=z+Math.imul(f,P0)|0,$=$+Math.imul(f,k0)|0,$=$+Math.imul(u,P0)|0,O=O+Math.imul(u,k0)|0,z=z+Math.imul(o,w0)|0,$=$+Math.imul(o,B0)|0,$=$+Math.imul(Q0,w0)|0,O=O+Math.imul(Q0,B0)|0,z=z+Math.imul(i,v0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(m,v0)|0,O=O+Math.imul(m,S0)|0,z=z+Math.imul(h,_0)|0,$=$+Math.imul(h,x0)|0,$=$+Math.imul(d,_0)|0,O=O+Math.imul(d,x0)|0,z=z+Math.imul(R,C0)|0,$=$+Math.imul(R,y)|0,$=$+Math.imul(w,C0)|0,O=O+Math.imul(w,y)|0;var hQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(hQ>>>26)|0,hQ&=67108863,z=Math.imul(b,E0),$=Math.imul(b,L0),$=$+Math.imul(n,E0)|0,O=Math.imul(n,L0),z=z+Math.imul(t,P0)|0,$=$+Math.imul(t,k0)|0,$=$+Math.imul(a,P0)|0,O=O+Math.imul(a,k0)|0,z=z+Math.imul(f,w0)|0,$=$+Math.imul(f,B0)|0,$=$+Math.imul(u,w0)|0,O=O+Math.imul(u,B0)|0,z=z+Math.imul(o,v0)|0,$=$+Math.imul(o,S0)|0,$=$+Math.imul(Q0,v0)|0,O=O+Math.imul(Q0,S0)|0,z=z+Math.imul(i,_0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(m,_0)|0,O=O+Math.imul(m,x0)|0,z=z+Math.imul(h,C0)|0,$=$+Math.imul(h,y)|0,$=$+Math.imul(d,C0)|0,O=O+Math.imul(d,y)|0,z=z+Math.imul(R,s)|0,$=$+Math.imul(R,J0)|0,$=$+Math.imul(w,s)|0,O=O+Math.imul(w,J0)|0;var uQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(uQ>>>26)|0,uQ&=67108863,z=Math.imul(r,E0),$=Math.imul(r,L0),$=$+Math.imul(W0,E0)|0,O=Math.imul(W0,L0),z=z+Math.imul(b,P0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(n,P0)|0,O=O+Math.imul(n,k0)|0,z=z+Math.imul(t,w0)|0,$=$+Math.imul(t,B0)|0,$=$+Math.imul(a,w0)|0,O=O+Math.imul(a,B0)|0,z=z+Math.imul(f,v0)|0,$=$+Math.imul(f,S0)|0,$=$+Math.imul(u,v0)|0,O=O+Math.imul(u,S0)|0,z=z+Math.imul(o,_0)|0,$=$+Math.imul(o,x0)|0,$=$+Math.imul(Q0,_0)|0,O=O+Math.imul(Q0,x0)|0,z=z+Math.imul(i,C0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(m,C0)|0,O=O+Math.imul(m,y)|0,z=z+Math.imul(h,s)|0,$=$+Math.imul(h,J0)|0,$=$+Math.imul(d,s)|0,O=O+Math.imul(d,J0)|0,z=z+Math.imul(R,A0)|0,$=$+Math.imul(R,M0)|0,$=$+Math.imul(w,A0)|0,O=O+Math.imul(w,M0)|0;var pQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(pQ>>>26)|0,pQ&=67108863,z=Math.imul(D0,E0),$=Math.imul(D0,L0),$=$+Math.imul(q0,E0)|0,O=Math.imul(q0,L0),z=z+Math.imul(r,P0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(W0,P0)|0,O=O+Math.imul(W0,k0)|0,z=z+Math.imul(b,w0)|0,$=$+Math.imul(b,B0)|0,$=$+Math.imul(n,w0)|0,O=O+Math.imul(n,B0)|0,z=z+Math.imul(t,v0)|0,$=$+Math.imul(t,S0)|0,$=$+Math.imul(a,v0)|0,O=O+Math.imul(a,S0)|0,z=z+Math.imul(f,_0)|0,$=$+Math.imul(f,x0)|0,$=$+Math.imul(u,_0)|0,O=O+Math.imul(u,x0)|0,z=z+Math.imul(o,C0)|0,$=$+Math.imul(o,y)|0,$=$+Math.imul(Q0,C0)|0,O=O+Math.imul(Q0,y)|0,z=z+Math.imul(i,s)|0,$=$+Math.imul(i,J0)|0,$=$+Math.imul(m,s)|0,O=O+Math.imul(m,J0)|0,z=z+Math.imul(h,A0)|0,$=$+Math.imul(h,M0)|0,$=$+Math.imul(d,A0)|0,O=O+Math.imul(d,M0)|0,z=z+Math.imul(R,j0)|0,$=$+Math.imul(R,y0)|0,$=$+Math.imul(w,j0)|0,O=O+Math.imul(w,y0)|0;var cQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(cQ>>>26)|0,cQ&=67108863,z=Math.imul(O0,E0),$=Math.imul(O0,L0),$=$+Math.imul(I0,E0)|0,O=Math.imul(I0,L0),z=z+Math.imul(D0,P0)|0,$=$+Math.imul(D0,k0)|0,$=$+Math.imul(q0,P0)|0,O=O+Math.imul(q0,k0)|0,z=z+Math.imul(r,w0)|0,$=$+Math.imul(r,B0)|0,$=$+Math.imul(W0,w0)|0,O=O+Math.imul(W0,B0)|0,z=z+Math.imul(b,v0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(n,v0)|0,O=O+Math.imul(n,S0)|0,z=z+Math.imul(t,_0)|0,$=$+Math.imul(t,x0)|0,$=$+Math.imul(a,_0)|0,O=O+Math.imul(a,x0)|0,z=z+Math.imul(f,C0)|0,$=$+Math.imul(f,y)|0,$=$+Math.imul(u,C0)|0,O=O+Math.imul(u,y)|0,z=z+Math.imul(o,s)|0,$=$+Math.imul(o,J0)|0,$=$+Math.imul(Q0,s)|0,O=O+Math.imul(Q0,J0)|0,z=z+Math.imul(i,A0)|0,$=$+Math.imul(i,M0)|0,$=$+Math.imul(m,A0)|0,O=O+Math.imul(m,M0)|0,z=z+Math.imul(h,j0)|0,$=$+Math.imul(h,y0)|0,$=$+Math.imul(d,j0)|0,O=O+Math.imul(d,y0)|0,z=z+Math.imul(R,N0)|0,$=$+Math.imul(R,T0)|0,$=$+Math.imul(w,N0)|0,O=O+Math.imul(w,T0)|0;var lQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(lQ>>>26)|0,lQ&=67108863,z=Math.imul(O0,P0),$=Math.imul(O0,k0),$=$+Math.imul(I0,P0)|0,O=Math.imul(I0,k0),z=z+Math.imul(D0,w0)|0,$=$+Math.imul(D0,B0)|0,$=$+Math.imul(q0,w0)|0,O=O+Math.imul(q0,B0)|0,z=z+Math.imul(r,v0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(W0,v0)|0,O=O+Math.imul(W0,S0)|0,z=z+Math.imul(b,_0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(n,_0)|0,O=O+Math.imul(n,x0)|0,z=z+Math.imul(t,C0)|0,$=$+Math.imul(t,y)|0,$=$+Math.imul(a,C0)|0,O=O+Math.imul(a,y)|0,z=z+Math.imul(f,s)|0,$=$+Math.imul(f,J0)|0,$=$+Math.imul(u,s)|0,O=O+Math.imul(u,J0)|0,z=z+Math.imul(o,A0)|0,$=$+Math.imul(o,M0)|0,$=$+Math.imul(Q0,A0)|0,O=O+Math.imul(Q0,M0)|0,z=z+Math.imul(i,j0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(m,j0)|0,O=O+Math.imul(m,y0)|0,z=z+Math.imul(h,N0)|0,$=$+Math.imul(h,T0)|0,$=$+Math.imul(d,N0)|0,O=O+Math.imul(d,T0)|0;var mQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(mQ>>>26)|0,mQ&=67108863,z=Math.imul(O0,w0),$=Math.imul(O0,B0),$=$+Math.imul(I0,w0)|0,O=Math.imul(I0,B0),z=z+Math.imul(D0,v0)|0,$=$+Math.imul(D0,S0)|0,$=$+Math.imul(q0,v0)|0,O=O+Math.imul(q0,S0)|0,z=z+Math.imul(r,_0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(W0,_0)|0,O=O+Math.imul(W0,x0)|0,z=z+Math.imul(b,C0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(n,C0)|0,O=O+Math.imul(n,y)|0,z=z+Math.imul(t,s)|0,$=$+Math.imul(t,J0)|0,$=$+Math.imul(a,s)|0,O=O+Math.imul(a,J0)|0,z=z+Math.imul(f,A0)|0,$=$+Math.imul(f,M0)|0,$=$+Math.imul(u,A0)|0,O=O+Math.imul(u,M0)|0,z=z+Math.imul(o,j0)|0,$=$+Math.imul(o,y0)|0,$=$+Math.imul(Q0,j0)|0,O=O+Math.imul(Q0,y0)|0,z=z+Math.imul(i,N0)|0,$=$+Math.imul(i,T0)|0,$=$+Math.imul(m,N0)|0,O=O+Math.imul(m,T0)|0;var dQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(dQ>>>26)|0,dQ&=67108863,z=Math.imul(O0,v0),$=Math.imul(O0,S0),$=$+Math.imul(I0,v0)|0,O=Math.imul(I0,S0),z=z+Math.imul(D0,_0)|0,$=$+Math.imul(D0,x0)|0,$=$+Math.imul(q0,_0)|0,O=O+Math.imul(q0,x0)|0,z=z+Math.imul(r,C0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(W0,C0)|0,O=O+Math.imul(W0,y)|0,z=z+Math.imul(b,s)|0,$=$+Math.imul(b,J0)|0,$=$+Math.imul(n,s)|0,O=O+Math.imul(n,J0)|0,z=z+Math.imul(t,A0)|0,$=$+Math.imul(t,M0)|0,$=$+Math.imul(a,A0)|0,O=O+Math.imul(a,M0)|0,z=z+Math.imul(f,j0)|0,$=$+Math.imul(f,y0)|0,$=$+Math.imul(u,j0)|0,O=O+Math.imul(u,y0)|0,z=z+Math.imul(o,N0)|0,$=$+Math.imul(o,T0)|0,$=$+Math.imul(Q0,N0)|0,O=O+Math.imul(Q0,T0)|0;var nQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(nQ>>>26)|0,nQ&=67108863,z=Math.imul(O0,_0),$=Math.imul(O0,x0),$=$+Math.imul(I0,_0)|0,O=Math.imul(I0,x0),z=z+Math.imul(D0,C0)|0,$=$+Math.imul(D0,y)|0,$=$+Math.imul(q0,C0)|0,O=O+Math.imul(q0,y)|0,z=z+Math.imul(r,s)|0,$=$+Math.imul(r,J0)|0,$=$+Math.imul(W0,s)|0,O=O+Math.imul(W0,J0)|0,z=z+Math.imul(b,A0)|0,$=$+Math.imul(b,M0)|0,$=$+Math.imul(n,A0)|0,O=O+Math.imul(n,M0)|0,z=z+Math.imul(t,j0)|0,$=$+Math.imul(t,y0)|0,$=$+Math.imul(a,j0)|0,O=O+Math.imul(a,y0)|0,z=z+Math.imul(f,N0)|0,$=$+Math.imul(f,T0)|0,$=$+Math.imul(u,N0)|0,O=O+Math.imul(u,T0)|0;var oQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(oQ>>>26)|0,oQ&=67108863,z=Math.imul(O0,C0),$=Math.imul(O0,y),$=$+Math.imul(I0,C0)|0,O=Math.imul(I0,y),z=z+Math.imul(D0,s)|0,$=$+Math.imul(D0,J0)|0,$=$+Math.imul(q0,s)|0,O=O+Math.imul(q0,J0)|0,z=z+Math.imul(r,A0)|0,$=$+Math.imul(r,M0)|0,$=$+Math.imul(W0,A0)|0,O=O+Math.imul(W0,M0)|0,z=z+Math.imul(b,j0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(n,j0)|0,O=O+Math.imul(n,y0)|0,z=z+Math.imul(t,N0)|0,$=$+Math.imul(t,T0)|0,$=$+Math.imul(a,N0)|0,O=O+Math.imul(a,T0)|0;var rQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(rQ>>>26)|0,rQ&=67108863,z=Math.imul(O0,s),$=Math.imul(O0,J0),$=$+Math.imul(I0,s)|0,O=Math.imul(I0,J0),z=z+Math.imul(D0,A0)|0,$=$+Math.imul(D0,M0)|0,$=$+Math.imul(q0,A0)|0,O=O+Math.imul(q0,M0)|0,z=z+Math.imul(r,j0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(W0,j0)|0,O=O+Math.imul(W0,y0)|0,z=z+Math.imul(b,N0)|0,$=$+Math.imul(b,T0)|0,$=$+Math.imul(n,N0)|0,O=O+Math.imul(n,T0)|0;var iQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(iQ>>>26)|0,iQ&=67108863,z=Math.imul(O0,A0),$=Math.imul(O0,M0),$=$+Math.imul(I0,A0)|0,O=Math.imul(I0,M0),z=z+Math.imul(D0,j0)|0,$=$+Math.imul(D0,y0)|0,$=$+Math.imul(q0,j0)|0,O=O+Math.imul(q0,y0)|0,z=z+Math.imul(r,N0)|0,$=$+Math.imul(r,T0)|0,$=$+Math.imul(W0,N0)|0,O=O+Math.imul(W0,T0)|0;var tQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(tQ>>>26)|0,tQ&=67108863,z=Math.imul(O0,j0),$=Math.imul(O0,y0),$=$+Math.imul(I0,j0)|0,O=Math.imul(I0,y0),z=z+Math.imul(D0,N0)|0,$=$+Math.imul(D0,T0)|0,$=$+Math.imul(q0,N0)|0,O=O+Math.imul(q0,T0)|0;var sQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(sQ>>>26)|0,sQ&=67108863,z=Math.imul(O0,N0),$=Math.imul(O0,T0),$=$+Math.imul(I0,N0)|0,O=Math.imul(I0,T0);var aQ=(M+z|0)+(($&8191)<<13)|0;if(M=(O+($>>>13)|0)+(aQ>>>26)|0,aQ&=67108863,A[0]=vQ,A[1]=s0,A[2]=r0,A[3]=OQ,A[4]=FQ,A[5]=hQ,A[6]=uQ,A[7]=pQ,A[8]=cQ,A[9]=lQ,A[10]=mQ,A[11]=dQ,A[12]=nQ,A[13]=oQ,A[14]=rQ,A[15]=iQ,A[16]=tQ,A[17]=sQ,A[18]=aQ,M!==0)A[19]=M,V.length++;return V};if(!Math.imul)S=j;function N(J,U,V){V.negative=U.negative^J.negative,V.length=J.length+U.length;var H=0,F=0;for(var A=0;A<V.length-1;A++){var M=F;F=0;var z=H&67108863,$=Math.min(A,U.length-1);for(var O=Math.max(0,A-J.length+1);O<=$;O++){var C=A-O,R=J.words[C]|0,w=U.words[O]|0,g=R*w,h=g&67108863;M=M+(g/67108864|0)|0,h=h+z|0,z=h&67108863,M=M+(h>>>26)|0,F+=M>>>26,M&=67108863}V.words[A]=z,H=M,M=F}if(H!==0)V.words[A]=H;else V.length--;return V.strip()}function k(J,U,V){var H=new v;return H.mulp(J,U,V)}Z.prototype.mulTo=function(J,U){var V,H=this.length+J.length;if(this.length===10&&J.length===10)V=S(this,J,U);else if(H<63)V=j(this,J,U);else if(H<1024)V=N(this,J,U);else V=k(this,J,U);return V};function v(J,U){this.x=J,this.y=U}v.prototype.makeRBT=function(J){var U=Array(J),V=Z.prototype._countBits(J)-1;for(var H=0;H<J;H++)U[H]=this.revBin(H,V,J);return U},v.prototype.revBin=function(J,U,V){if(J===0||J===V-1)return J;var H=0;for(var F=0;F<U;F++)H|=(J&1)<<U-F-1,J>>=1;return H},v.prototype.permute=function(J,U,V,H,F,A){for(var M=0;M<A;M++)H[M]=U[J[M]],F[M]=V[J[M]]},v.prototype.transform=function(J,U,V,H,F,A){this.permute(A,J,U,V,H,F);for(var M=1;M<F;M<<=1){var z=M<<1,$=Math.cos(2*Math.PI/z),O=Math.sin(2*Math.PI/z);for(var C=0;C<F;C+=z){var R=$,w=O;for(var g=0;g<M;g++){var h=V[C+g],d=H[C+g],K0=V[C+g+M],i=H[C+g+M],m=R*K0-w*i;if(i=R*i+w*K0,K0=m,V[C+g]=h+K0,H[C+g]=d+i,V[C+g+M]=h-K0,H[C+g+M]=d-i,g!==z)m=$*R-O*w,w=$*w+O*R,R=m}}}},v.prototype.guessLen13b=function(J,U){var V=Math.max(U,J)|1,H=V&1,F=0;for(V=V/2|0;V;V=V>>>1)F++;return 1<<F+1+H},v.prototype.conjugate=function(J,U,V){if(V<=1)return;for(var H=0;H<V/2;H++){var F=J[H];J[H]=J[V-H-1],J[V-H-1]=F,F=U[H],U[H]=-U[V-H-1],U[V-H-1]=-F}},v.prototype.normalize13b=function(J,U){var V=0;for(var H=0;H<U/2;H++){var F=Math.round(J[2*H+1]/U)*8192+Math.round(J[2*H]/U)+V;if(J[H]=F&67108863,F<67108864)V=0;else V=F/67108864|0}return J},v.prototype.convert13b=function(J,U,V,H){var F=0;for(var A=0;A<U;A++)F=F+(J[A]|0),V[2*A]=F&8191,F=F>>>13,V[2*A+1]=F&8191,F=F>>>13;for(A=2*U;A<H;++A)V[A]=0;G(F===0),G((F&-8192)===0)},v.prototype.stub=function(J){var U=Array(J);for(var V=0;V<J;V++)U[V]=0;return U},v.prototype.mulp=function(J,U,V){var H=2*this.guessLen13b(J.length,U.length),F=this.makeRBT(H),A=this.stub(H),M=Array(H),z=Array(H),$=Array(H),O=Array(H),C=Array(H),R=Array(H),w=V.words;w.length=H,this.convert13b(J.words,J.length,M,H),this.convert13b(U.words,U.length,O,H),this.transform(M,A,z,$,H,F),this.transform(O,A,C,R,H,F);for(var g=0;g<H;g++){var h=z[g]*C[g]-$[g]*R[g];$[g]=z[g]*R[g]+$[g]*C[g],z[g]=h}return this.conjugate(z,$,H),this.transform(z,$,w,A,H,F),this.conjugate(w,A,H),this.normalize13b(w,H),V.negative=J.negative^U.negative,V.length=J.length+U.length,V.strip()},Z.prototype.mul=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),this.mulTo(J,U)},Z.prototype.mulf=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),k(this,J,U)},Z.prototype.imul=function(J){return this.clone().mulTo(J,this)},Z.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var U=0;for(var V=0;V<this.length;V++){var H=(this.words[V]|0)*J,F=(H&67108863)+(U&67108863);U>>=26,U+=H/67108864|0,U+=F>>>26,this.words[V]=F&67108863}if(U!==0)this.words[V]=U,this.length++;return this.length=J===0?1:this.length,this},Z.prototype.muln=function(J){return this.clone().imuln(J)},Z.prototype.sqr=function(){return this.mul(this)},Z.prototype.isqr=function(){return this.imul(this.clone())},Z.prototype.pow=function(J){var U=B(J);if(U.length===0)return new Z(1);var V=this;for(var H=0;H<U.length;H++,V=V.sqr())if(U[H]!==0)break;if(++H<U.length)for(var F=V.sqr();H<U.length;H++,F=F.sqr()){if(U[H]===0)continue;V=V.mul(F)}return V},Z.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=67108863>>>26-U<<26-U,F;if(U!==0){var A=0;for(F=0;F<this.length;F++){var M=this.words[F]&H,z=(this.words[F]|0)-M<<U;this.words[F]=z|A,A=M>>>26-U}if(A)this.words[F]=A,this.length++}if(V!==0){for(F=this.length-1;F>=0;F--)this.words[F+V]=this.words[F];for(F=0;F<V;F++)this.words[F]=0;this.length+=V}return this.strip()},Z.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Z.prototype.iushrn=function(J,U,V){G(typeof J==="number"&&J>=0);var H;if(U)H=(U-U%26)/26;else H=0;var F=J%26,A=Math.min((J-F)/26,this.length),M=67108863^67108863>>>F<<F,z=V;if(H-=A,H=Math.max(0,H),z){for(var $=0;$<A;$++)z.words[$]=this.words[$];z.length=A}if(A===0);else if(this.length>A){this.length-=A;for($=0;$<this.length;$++)this.words[$]=this.words[$+A]}else this.words[0]=0,this.length=1;var O=0;for($=this.length-1;$>=0&&(O!==0||$>=H);$--){var C=this.words[$]|0;this.words[$]=O<<26-F|C>>>F,O=C&M}if(z&&O!==0)z.words[z.length++]=O;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Z.prototype.ishrn=function(J,U,V){return G(this.negative===0),this.iushrn(J,U,V)},Z.prototype.shln=function(J){return this.clone().ishln(J)},Z.prototype.ushln=function(J){return this.clone().iushln(J)},Z.prototype.shrn=function(J){return this.clone().ishrn(J)},Z.prototype.ushrn=function(J){return this.clone().iushrn(J)},Z.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return!1;var F=this.words[V];return!!(F&H)},Z.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=V)return this;if(U!==0)V++;if(this.length=Math.min(V,this.length),U!==0){var H=67108863^67108863>>>U<<U;this.words[this.length-1]&=H}return this.strip()},Z.prototype.maskn=function(J){return this.clone().imaskn(J)},Z.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Z.prototype._iaddn=function(J){this.words[0]+=J;for(var U=0;U<this.length&&this.words[U]>=67108864;U++)if(this.words[U]-=67108864,U===this.length-1)this.words[U+1]=1;else this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},Z.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U<this.length&&this.words[U]<0;U++)this.words[U]+=67108864,this.words[U+1]-=1;return this.strip()},Z.prototype.addn=function(J){return this.clone().iaddn(J)},Z.prototype.subn=function(J){return this.clone().isubn(J)},Z.prototype.iabs=function(){return this.negative=0,this},Z.prototype.abs=function(){return this.clone().iabs()},Z.prototype._ishlnsubmul=function(J,U,V){var H=J.length+V,F;this._expand(H);var A,M=0;for(F=0;F<J.length;F++){A=(this.words[F+V]|0)+M;var z=(J.words[F]|0)*U;A-=z&67108863,M=(A>>26)-(z/67108864|0),this.words[F+V]=A&67108863}for(;F<this.length-V;F++)A=(this.words[F+V]|0)+M,M=A>>26,this.words[F+V]=A&67108863;if(M===0)return this.strip();G(M===-1),M=0;for(F=0;F<this.length;F++)A=-(this.words[F]|0)+M,M=A>>26,this.words[F]=A&67108863;return this.negative=1,this.strip()},Z.prototype._wordDiv=function(J,U){var V=this.length-J.length,H=this.clone(),F=J,A=F.words[F.length-1]|0,M=this._countBits(A);if(V=26-M,V!==0)F=F.ushln(V),H.iushln(V),A=F.words[F.length-1]|0;var z=H.length-F.length,$;if(U!=="mod"){$=new Z(null),$.length=z+1,$.words=Array($.length);for(var O=0;O<$.length;O++)$.words[O]=0}var C=H.clone()._ishlnsubmul(F,1,z);if(C.negative===0){if(H=C,$)$.words[z]=1}for(var R=z-1;R>=0;R--){var w=(H.words[F.length+R]|0)*67108864+(H.words[F.length+R-1]|0);w=Math.min(w/A|0,67108863),H._ishlnsubmul(F,w,R);while(H.negative!==0)if(w--,H.negative=0,H._ishlnsubmul(F,1,R),!H.isZero())H.negative^=1;if($)$.words[R]=w}if($)$.strip();if(H.strip(),U!=="div"&&V!==0)H.iushrn(V);return{div:$||null,mod:H}},Z.prototype.divmod=function(J,U,V){if(G(!J.isZero()),this.isZero())return{div:new Z(0),mod:new Z(0)};var H,F,A;if(this.negative!==0&&J.negative===0){if(A=this.neg().divmod(J,U),U!=="mod")H=A.div.neg();if(U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.iadd(J)}return{div:H,mod:F}}if(this.negative===0&&J.negative!==0){if(A=this.divmod(J.neg(),U),U!=="mod")H=A.div.neg();return{div:H,mod:A.mod}}if((this.negative&J.negative)!==0){if(A=this.neg().divmod(J.neg(),U),U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.isub(J)}return{div:A.div,mod:F}}if(J.length>this.length||this.cmp(J)<0)return{div:new Z(0),mod:this};if(J.length===1){if(U==="div")return{div:this.divn(J.words[0]),mod:null};if(U==="mod")return{div:null,mod:new Z(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Z(this.modn(J.words[0]))}}return this._wordDiv(J,U)},Z.prototype.div=function(J){return this.divmod(J,"div",!1).div},Z.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Z.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Z.prototype.divRound=function(J){var U=this.divmod(J);if(U.mod.isZero())return U.div;var V=U.div.negative!==0?U.mod.isub(J):U.mod,H=J.ushrn(1),F=J.andln(1),A=V.cmp(H);if(A<0||F===1&&A===0)return U.div;return U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},Z.prototype.modn=function(J){G(J<=67108863);var U=67108864%J,V=0;for(var H=this.length-1;H>=0;H--)V=(U*V+(this.words[H]|0))%J;return V},Z.prototype.idivn=function(J){G(J<=67108863);var U=0;for(var V=this.length-1;V>=0;V--){var H=(this.words[V]|0)+U*67108864;this.words[V]=H/J|0,U=H%J}return this.strip()},Z.prototype.divn=function(J){return this.clone().idivn(J)},Z.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=new Z(0),M=new Z(1),z=0;while(U.isEven()&&V.isEven())U.iushrn(1),V.iushrn(1),++z;var $=V.clone(),O=U.clone();while(!U.isZero()){for(var C=0,R=1;(U.words[0]&R)===0&&C<26;++C,R<<=1);if(C>0){U.iushrn(C);while(C-- >0){if(H.isOdd()||F.isOdd())H.iadd($),F.isub(O);H.iushrn(1),F.iushrn(1)}}for(var w=0,g=1;(V.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0){V.iushrn(w);while(w-- >0){if(A.isOdd()||M.isOdd())A.iadd($),M.isub(O);A.iushrn(1),M.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(A),F.isub(M);else V.isub(U),A.isub(H),M.isub(F)}return{a:A,b:M,gcd:V.iushln(z)}},Z.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=V.clone();while(U.cmpn(1)>0&&V.cmpn(1)>0){for(var M=0,z=1;(U.words[0]&z)===0&&M<26;++M,z<<=1);if(M>0){U.iushrn(M);while(M-- >0){if(H.isOdd())H.iadd(A);H.iushrn(1)}}for(var $=0,O=1;(V.words[0]&O)===0&&$<26;++$,O<<=1);if($>0){V.iushrn($);while($-- >0){if(F.isOdd())F.iadd(A);F.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(F);else V.isub(U),F.isub(H)}var C;if(U.cmpn(1)===0)C=H;else C=F;if(C.cmpn(0)<0)C.iadd(J);return C},Z.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var U=this.clone(),V=J.clone();U.negative=0,V.negative=0;for(var H=0;U.isEven()&&V.isEven();H++)U.iushrn(1),V.iushrn(1);do{while(U.isEven())U.iushrn(1);while(V.isEven())V.iushrn(1);var F=U.cmp(V);if(F<0){var A=U;U=V,V=A}else if(F===0||V.cmpn(1)===0)break;U.isub(V)}while(!0);return V.iushln(H)},Z.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Z.prototype.isEven=function(){return(this.words[0]&1)===0},Z.prototype.isOdd=function(){return(this.words[0]&1)===1},Z.prototype.andln=function(J){return this.words[0]&J},Z.prototype.bincn=function(J){G(typeof J==="number");var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return this._expand(V+1),this.words[V]|=H,this;var F=H;for(var A=V;F!==0&&A<this.length;A++){var M=this.words[A]|0;M+=F,F=M>>>26,M&=67108863,this.words[A]=M}if(F!==0)this.words[A]=F,this.length++;return this},Z.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Z.prototype.cmpn=function(J){var U=J<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var V;if(this.length>1)V=1;else{if(U)J=-J;G(J<=67108863,"Number is too big");var H=this.words[0]|0;V=H===J?0:H<J?-1:1}if(this.negative!==0)return-V|0;return V},Z.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var U=this.ucmp(J);if(this.negative!==0)return-U|0;return U},Z.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var U=0;for(var V=this.length-1;V>=0;V--){var H=this.words[V]|0,F=J.words[V]|0;if(H===F)continue;if(H<F)U=-1;else if(H>F)U=1;break}return U},Z.prototype.gtn=function(J){return this.cmpn(J)===1},Z.prototype.gt=function(J){return this.cmp(J)===1},Z.prototype.gten=function(J){return this.cmpn(J)>=0},Z.prototype.gte=function(J){return this.cmp(J)>=0},Z.prototype.ltn=function(J){return this.cmpn(J)===-1},Z.prototype.lt=function(J){return this.cmp(J)===-1},Z.prototype.lten=function(J){return this.cmpn(J)<=0},Z.prototype.lte=function(J){return this.cmp(J)<=0},Z.prototype.eqn=function(J){return this.cmpn(J)===0},Z.prototype.eq=function(J){return this.cmp(J)===0},Z.red=function(J){return new p(J)},Z.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Z.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Z.prototype._forceRed=function(J){return this.red=J,this},Z.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Z.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Z.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Z.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Z.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Z.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Z.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Z.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Z.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Z.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Z.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Z.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Z.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Z.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var _={k256:null,p224:null,p192:null,p25519:null};function x(J,U){this.name=J,this.p=new Z(U,16),this.n=this.p.bitLength(),this.k=new Z(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}x.prototype._tmp=function(){var J=new Z(null);return J.words=Array(Math.ceil(this.n/13)),J},x.prototype.ireduce=function(J){var U=J,V;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),V=U.bitLength();while(V>this.n);var H=V<this.n?-1:U.ucmp(this.p);if(H===0)U.words[0]=0,U.length=1;else if(H>0)U.isub(this.p);else if(U.strip!==void 0)U.strip();else U._strip();return U},x.prototype.split=function(J,U){J.iushrn(this.n,0,U)},x.prototype.imulK=function(J){return J.imul(this.k)};function c(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(c,x),c.prototype.split=function(J,U){var V=4194303,H=Math.min(J.length,9);for(var F=0;F<H;F++)U.words[F]=J.words[F];if(U.length=H,J.length<=9){J.words[0]=0,J.length=1;return}var A=J.words[9];U.words[U.length++]=A&V;for(F=10;F<J.length;F++){var M=J.words[F]|0;J.words[F-10]=(M&V)<<4|A>>>22,A=M}if(A>>>=22,J.words[F-10]=A,A===0&&J.length>10)J.length-=10;else J.length-=9},c.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var U=0;for(var V=0;V<J.length;V++){var H=J.words[V]|0;U+=H*977,J.words[V]=U&67108863,U=H*64+(U/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function Y0(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(Y0,x);function $0(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K($0,x);function e(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(e,x),e.prototype.imulK=function(J){var U=0;for(var V=0;V<J.length;V++){var H=(J.words[V]|0)*19+U,F=H&67108863;H>>>=26,J.words[V]=F,U=H}if(U!==0)J.words[J.length++]=U;return J},Z._prime=function(J){if(_[J])return _[J];var U;if(J==="k256")U=new c;else if(J==="p224")U=new Y0;else if(J==="p192")U=new $0;else if(J==="p25519")U=new e;else throw Error("Unknown prime "+J);return _[J]=U,U};function p(J){if(typeof J==="string"){var U=Z._prime(J);this.m=U.p,this.prime=U}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}p.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},p.prototype._verify2=function(J,U){G((J.negative|U.negative)===0,"red works only with positives"),G(J.red&&J.red===U.red,"red works only with red numbers")},p.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},p.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},p.prototype.add=function(J,U){this._verify2(J,U);var V=J.add(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V._forceRed(this)},p.prototype.iadd=function(J,U){this._verify2(J,U);var V=J.iadd(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V},p.prototype.sub=function(J,U){this._verify2(J,U);var V=J.sub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V._forceRed(this)},p.prototype.isub=function(J,U){this._verify2(J,U);var V=J.isub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V},p.prototype.shl=function(J,U){return this._verify1(J),this.imod(J.ushln(U))},p.prototype.imul=function(J,U){return this._verify2(J,U),this.imod(J.imul(U))},p.prototype.mul=function(J,U){return this._verify2(J,U),this.imod(J.mul(U))},p.prototype.isqr=function(J){return this.imul(J,J.clone())},p.prototype.sqr=function(J){return this.mul(J,J)},p.prototype.sqrt=function(J){if(J.isZero())return J.clone();var U=this.m.andln(3);if(G(U%2===1),U===3){var V=this.m.add(new Z(1)).iushrn(2);return this.pow(J,V)}var H=this.m.subn(1),F=0;while(!H.isZero()&&H.andln(1)===0)F++,H.iushrn(1);G(!H.isZero());var A=new Z(1).toRed(this),M=A.redNeg(),z=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Z(2*$*$).toRed(this);while(this.pow($,z).cmp(M)!==0)$.redIAdd(M);var O=this.pow($,H),C=this.pow(J,H.addn(1).iushrn(1)),R=this.pow(J,H),w=F;while(R.cmp(A)!==0){var g=R;for(var h=0;g.cmp(A)!==0;h++)g=g.redSqr();G(h<w);var d=this.pow(O,new Z(1).iushln(w-h-1));C=C.redMul(d),O=d.redSqr(),R=R.redMul(O),w=h}return C},p.prototype.invm=function(J){var U=J._invmp(this.m);if(U.negative!==0)return U.negative=0,this.imod(U).redNeg();else return this.imod(U)},p.prototype.pow=function(J,U){if(U.isZero())return new Z(1).toRed(this);if(U.cmpn(1)===0)return J.clone();var V=4,H=Array(1<<V);H[0]=new Z(1).toRed(this),H[1]=J;for(var F=2;F<H.length;F++)H[F]=this.mul(H[F-1],J);var A=H[0],M=0,z=0,$=U.bitLength()%26;if($===0)$=26;for(F=U.length-1;F>=0;F--){var O=U.words[F];for(var C=$-1;C>=0;C--){var R=O>>C&1;if(A!==H[0])A=this.sqr(A);if(R===0&&M===0){z=0;continue}if(M<<=1,M|=R,z++,z!==V&&(F!==0||C!==0))continue;A=this.mul(A,H[M]),z=0,M=0}$=26}return A},p.prototype.convertTo=function(J){var U=J.umod(this.m);return U===J?U.clone():U},p.prototype.convertFrom=function(J){var U=J.clone();return U.red=null,U},Z.mont=function(J){return new X0(J)};function X0(J){if(p.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Z(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(X0,p),X0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},X0.prototype.convertFrom=function(J){var U=this.imod(J.mul(this.rinv));return U.red=null,U},X0.prototype.imul=function(J,U){if(J.isZero()||U.isZero())return J.words[0]=0,J.length=1,J;var V=J.imul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.mul=function(J,U){if(J.isZero()||U.isZero())return new Z(0)._forceRed(this);var V=J.mul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.invm=function(J){var U=this.imod(J._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(typeof X>"u"||X,Q)}),mY=H0((Q,X)=>{X.exports=Y;function Y(W,G){if(!W)throw Error(G||"Assertion failed")}Y.equal=function(W,G,K){if(W!=G)throw Error(K||"Assertion failed: "+W+" != "+G)}}),$F=H0((Q)=>{var X=Q;function Y(K,Z){if(Array.isArray(K))return K.slice();if(!K)return[];var q=[];if(typeof K!=="string"){for(var E=0;E<K.length;E++)q[E]=K[E]|0;return q}if(Z==="hex"){if(K=K.replace(/[^a-z0-9]+/ig,""),K.length%2!==0)K="0"+K;for(var E=0;E<K.length;E+=2)q.push(parseInt(K[E]+K[E+1],16))}else for(var E=0;E<K.length;E++){var I=K.charCodeAt(E),L=I>>8,D=I&255;if(L)q.push(L,D);else q.push(D)}return q}X.toArray=Y;function W(K){if(K.length===1)return"0"+K;else return K}X.zero2=W;function G(K){var Z="";for(var q=0;q<K.length;q++)Z+=W(K[q].toString(16));return Z}X.toHex=G,X.encode=function(K,Z){if(Z==="hex")return G(K);else return K}}),mX=H0((Q)=>{var X=Q,Y=BY(),W=mY(),G=$F();X.assert=W,X.toArray=G.toArray,X.zero2=G.zero2,X.toHex=G.toHex,X.encode=G.encode;function K(L,D,T){var P=Array(Math.max(L.bitLength(),T)+1),B;for(B=0;B<P.length;B+=1)P[B]=0;var j=1<<D+1,S=L.clone();for(B=0;B<P.length;B++){var N,k=S.andln(j-1);if(S.isOdd()){if(k>(j>>1)-1)N=(j>>1)-k;else N=k;S.isubn(N)}else N=0;P[B]=N,S.iushrn(1)}return P}X.getNAF=K;function Z(L,D){var T=[[],[]];L=L.clone(),D=D.clone();var P=0,B=0,j;while(L.cmpn(-P)>0||D.cmpn(-B)>0){var S=L.andln(3)+P&3,N=D.andln(3)+B&3;if(S===3)S=-1;if(N===3)N=-1;var k;if((S&1)===0)k=0;else if(j=L.andln(7)+P&7,(j===3||j===5)&&N===2)k=-S;else k=S;T[0].push(k);var v;if((N&1)===0)v=0;else if(j=D.andln(7)+B&7,(j===3||j===5)&&S===2)v=-N;else v=N;if(T[1].push(v),2*P===k+1)P=1-P;if(2*B===v+1)B=1-B;L.iushrn(1),D.iushrn(1)}return T}X.getJSF=Z;function q(L,D,T){var P="_"+D;L.prototype[D]=function(){return this[P]!==void 0?this[P]:this[P]=T.call(this)}}X.cachedProperty=q;function E(L){return typeof L==="string"?X.toArray(L,"hex"):L}X.parseBytes=E;function I(L){return new Y(L,"hex","le")}X.intFromLE=I}),ZF=H0((Q,X)=>{var Y;X.exports=function(K){if(!Y)Y=new W(null);return Y.generate(K)};function W(K){this.rand=K}if(X.exports.Rand=W,W.prototype.generate=function(K){return this._rand(K)},W.prototype._rand=function(K){if(this.rand.getBytes)return this.rand.getBytes(K);var Z=new Uint8Array(K);for(var q=0;q<Z.length;q++)Z[q]=this.rand.getByte();return Z},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)W.prototype._rand=function(K){var Z=new Uint8Array(K);return self.crypto.getRandomValues(Z),Z};else if(self.msCrypto&&self.msCrypto.getRandomValues)W.prototype._rand=function(K){var Z=new Uint8Array(K);return self.msCrypto.getRandomValues(Z),Z};else if(typeof window==="object")W.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(G=(EX(),WQ(uX)),typeof G.randomBytes!=="function")throw Error("Not supported");W.prototype._rand=function(K){return G.randomBytes(K)}}catch(K){}var G}),DG=H0((Q,X)=>{var Y=BY(),W=mX(),G=W.getNAF,K=W.getJSF,Z=W.assert;function q(I,L){this.type=I,this.p=new Y(L.p,16),this.red=L.prime?Y.red(L.prime):Y.mont(this.p),this.zero=new Y(0).toRed(this.red),this.one=new Y(1).toRed(this.red),this.two=new Y(2).toRed(this.red),this.n=L.n&&new Y(L.n,16),this.g=L.g&&this.pointFromJSON(L.g,L.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var D=this.n&&this.p.div(this.n);if(!D||D.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}X.exports=q,q.prototype.point=function(){throw Error("Not implemented")},q.prototype.validate=function(){throw Error("Not implemented")},q.prototype._fixedNafMul=function(I,L){Z(I.precomputed);var D=I._getDoubles(),T=G(L,1,this._bitLength),P=(1<<D.step+1)-(D.step%2===0?2:1);P/=3;var B=[],j,S;for(j=0;j<T.length;j+=D.step){S=0;for(var N=j+D.step-1;N>=j;N--)S=(S<<1)+T[N];B.push(S)}var k=this.jpoint(null,null,null),v=this.jpoint(null,null,null);for(var _=P;_>0;_--){for(j=0;j<B.length;j++)if(S=B[j],S===_)v=v.mixedAdd(D.points[j]);else if(S===-_)v=v.mixedAdd(D.points[j].neg());k=k.add(v)}return k.toP()},q.prototype._wnafMul=function(I,L){var D=4,T=I._getNAFPoints(D);D=T.wnd;var P=T.points,B=G(L,D,this._bitLength),j=this.jpoint(null,null,null);for(var S=B.length-1;S>=0;S--){for(var N=0;S>=0&&B[S]===0;S--)N++;if(S>=0)N++;if(j=j.dblp(N),S<0)break;var k=B[S];if(Z(k!==0),I.type==="affine")if(k>0)j=j.mixedAdd(P[k-1>>1]);else j=j.mixedAdd(P[-k-1>>1].neg());else if(k>0)j=j.add(P[k-1>>1]);else j=j.add(P[-k-1>>1].neg())}return I.type==="affine"?j.toP():j},q.prototype._wnafMulAdd=function(I,L,D,T,P){var B=this._wnafT1,j=this._wnafT2,S=this._wnafT3,N=0,k,v,_;for(k=0;k<T;k++){_=L[k];var x=_._getNAFPoints(I);B[k]=x.wnd,j[k]=x.points}for(k=T-1;k>=1;k-=2){var c=k-1,Y0=k;if(B[c]!==1||B[Y0]!==1){S[c]=G(D[c],B[c],this._bitLength),S[Y0]=G(D[Y0],B[Y0],this._bitLength),N=Math.max(S[c].length,N),N=Math.max(S[Y0].length,N);continue}var $0=[L[c],null,null,L[Y0]];if(L[c].y.cmp(L[Y0].y)===0)$0[1]=L[c].add(L[Y0]),$0[2]=L[c].toJ().mixedAdd(L[Y0].neg());else if(L[c].y.cmp(L[Y0].y.redNeg())===0)$0[1]=L[c].toJ().mixedAdd(L[Y0]),$0[2]=L[c].add(L[Y0].neg());else $0[1]=L[c].toJ().mixedAdd(L[Y0]),$0[2]=L[c].toJ().mixedAdd(L[Y0].neg());var e=[-3,-1,-5,-7,0,7,5,1,3],p=K(D[c],D[Y0]);N=Math.max(p[0].length,N),S[c]=Array(N),S[Y0]=Array(N);for(v=0;v<N;v++){var X0=p[0][v]|0,J=p[1][v]|0;S[c][v]=e[(X0+1)*3+(J+1)],S[Y0][v]=0,j[c]=$0}}var U=this.jpoint(null,null,null),V=this._wnafT4;for(k=N;k>=0;k--){var H=0;while(k>=0){var F=!0;for(v=0;v<T;v++)if(V[v]=S[v][k]|0,V[v]!==0)F=!1;if(!F)break;H++,k--}if(k>=0)H++;if(U=U.dblp(H),k<0)break;for(v=0;v<T;v++){var A=V[v];if(A===0)continue;else if(A>0)_=j[v][A-1>>1];else if(A<0)_=j[v][-A-1>>1].neg();if(_.type==="affine")U=U.mixedAdd(_);else U=U.add(_)}}for(k=0;k<T;k++)j[k]=null;if(P)return U;else return U.toP()};function E(I,L){this.curve=I,this.type=L,this.precomputed=null}q.BasePoint=E,E.prototype.eq=function(){throw Error("Not implemented")},E.prototype.validate=function(){return this.curve.validate(this)},q.prototype.decodePoint=function(I,L){I=W.toArray(I,L);var D=this.p.byteLength();if((I[0]===4||I[0]===6||I[0]===7)&&I.length-1===2*D){if(I[0]===6)Z(I[I.length-1]%2===0);else if(I[0]===7)Z(I[I.length-1]%2===1);var T=this.point(I.slice(1,1+D),I.slice(1+D,1+2*D));return T}else if((I[0]===2||I[0]===3)&&I.length-1===D)return this.pointFromX(I.slice(1,1+D),I[0]===3);throw Error("Unknown point format")},E.prototype.encodeCompressed=function(I){return this.encode(I,!0)},E.prototype._encode=function(I){var L=this.curve.p.byteLength(),D=this.getX().toArray("be",L);if(I)return[this.getY().isEven()?2:3].concat(D);return[4].concat(D,this.getY().toArray("be",L))},E.prototype.encode=function(I,L){return W.encode(this._encode(L),I)},E.prototype.precompute=function(I){if(this.precomputed)return this;var L={doubles:null,naf:null,beta:null};return L.naf=this._getNAFPoints(8),L.doubles=this._getDoubles(4,I),L.beta=this._getBeta(),this.precomputed=L,this},E.prototype._hasDoubles=function(I){if(!this.precomputed)return!1;var L=this.precomputed.doubles;if(!L)return!1;return L.points.length>=Math.ceil((I.bitLength()+1)/L.step)},E.prototype._getDoubles=function(I,L){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var D=[this],T=this;for(var P=0;P<L;P+=I){for(var B=0;B<I;B++)T=T.dbl();D.push(T)}return{step:I,points:D}},E.prototype._getNAFPoints=function(I){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var L=[this],D=(1<<I)-1,T=D===1?null:this.dbl();for(var P=1;P<D;P++)L[P]=L[P-1].add(T);return{wnd:I,points:L}},E.prototype._getBeta=function(){return null},E.prototype.dblp=function(I){var L=this;for(var D=0;D<I;D++)L=L.dbl();return L}}),rR=H0((Q,X)=>{if(typeof Object.create==="function")X.exports=function(Y,W){if(W)Y.super_=W,Y.prototype=Object.create(W.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else X.exports=function(Y,W){if(W){Y.super_=W;var G=function(){};G.prototype=W.prototype,Y.prototype=new G,Y.prototype.constructor=Y}}}),hX=H0((Q,X)=>{try{if(Y=(TK(),WQ(EK)),typeof Y.inherits!=="function")throw"";X.exports=Y.inherits}catch(W){X.exports=rR()}var Y}),iR=H0((Q,X)=>{var Y=mX(),W=BY(),G=hX(),K=DG(),Z=Y.assert;function q(L){K.call(this,"short",L),this.a=new W(L.a,16).toRed(this.red),this.b=new W(L.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(L),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}G(q,K),X.exports=q,q.prototype._getEndomorphism=function(L){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var D,T;if(L.beta)D=new W(L.beta,16).toRed(this.red);else{var P=this._getEndoRoots(this.p);D=P[0].cmp(P[1])<0?P[0]:P[1],D=D.toRed(this.red)}if(L.lambda)T=new W(L.lambda,16);else{var B=this._getEndoRoots(this.n);if(this.g.mul(B[0]).x.cmp(this.g.x.redMul(D))===0)T=B[0];else T=B[1],Z(this.g.mul(T).x.cmp(this.g.x.redMul(D))===0)}var j;if(L.basis)j=L.basis.map(function(S){return{a:new W(S.a,16),b:new W(S.b,16)}});else j=this._getEndoBasis(T);return{beta:D,lambda:T,basis:j}},q.prototype._getEndoRoots=function(L){var D=L===this.p?this.red:W.mont(L),T=new W(2).toRed(D).redInvm(),P=T.redNeg(),B=new W(3).toRed(D).redNeg().redSqrt().redMul(T),j=P.redAdd(B).fromRed(),S=P.redSub(B).fromRed();return[j,S]},q.prototype._getEndoBasis=function(L){var D=this.n.ushrn(Math.floor(this.n.bitLength()/2)),T=L,P=this.n.clone(),B=new W(1),j=new W(0),S=new W(0),N=new W(1),k,v,_,x,c,Y0,$0,e=0,p,X0;while(T.cmpn(0)!==0){var J=P.div(T);p=P.sub(J.mul(T)),X0=S.sub(J.mul(B));var U=N.sub(J.mul(j));if(!_&&p.cmp(D)<0)k=$0.neg(),v=B,_=p.neg(),x=X0;else if(_&&++e===2)break;$0=p,P=T,T=p,S=B,B=X0,N=j,j=U}c=p.neg(),Y0=X0;var V=_.sqr().add(x.sqr()),H=c.sqr().add(Y0.sqr());if(H.cmp(V)>=0)c=k,Y0=v;if(_.negative)_=_.neg(),x=x.neg();if(c.negative)c=c.neg(),Y0=Y0.neg();return[{a:_,b:x},{a:c,b:Y0}]},q.prototype._endoSplit=function(L){var D=this.endo.basis,T=D[0],P=D[1],B=P.b.mul(L).divRound(this.n),j=T.b.neg().mul(L).divRound(this.n),S=B.mul(T.a),N=j.mul(P.a),k=B.mul(T.b),v=j.mul(P.b),_=L.sub(S).sub(N),x=k.add(v).neg();return{k1:_,k2:x}},q.prototype.pointFromX=function(L,D){if(L=new W(L,16),!L.red)L=L.toRed(this.red);var T=L.redSqr().redMul(L).redIAdd(L.redMul(this.a)).redIAdd(this.b),P=T.redSqrt();if(P.redSqr().redSub(T).cmp(this.zero)!==0)throw Error("invalid point");var B=P.fromRed().isOdd();if(D&&!B||!D&&B)P=P.redNeg();return this.point(L,P)},q.prototype.validate=function(L){if(L.inf)return!0;var{x:D,y:T}=L,P=this.a.redMul(D),B=D.redSqr().redMul(D).redIAdd(P).redIAdd(this.b);return T.redSqr().redISub(B).cmpn(0)===0},q.prototype._endoWnafMulAdd=function(L,D,T){var P=this._endoWnafT1,B=this._endoWnafT2;for(var j=0;j<L.length;j++){var S=this._endoSplit(D[j]),N=L[j],k=N._getBeta();if(S.k1.negative)S.k1.ineg(),N=N.neg(!0);if(S.k2.negative)S.k2.ineg(),k=k.neg(!0);P[j*2]=N,P[j*2+1]=k,B[j*2]=S.k1,B[j*2+1]=S.k2}var v=this._wnafMulAdd(1,P,B,j*2,T);for(var _=0;_<j*2;_++)P[_]=null,B[_]=null;return v};function E(L,D,T,P){if(K.BasePoint.call(this,L,"affine"),D===null&&T===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new W(D,16),this.y=new W(T,16),P)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}G(E,K.BasePoint),q.prototype.point=function(L,D,T){return new E(this,L,D,T)},q.prototype.pointFromJSON=function(L,D){return E.fromJSON(this,L,D)},E.prototype._getBeta=function(){if(!this.curve.endo)return;var L=this.precomputed;if(L&&L.beta)return L.beta;var D=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(L){var T=this.curve,P=function(B){return T.point(B.x.redMul(T.endo.beta),B.y)};L.beta=D,D.precomputed={beta:null,naf:L.naf&&{wnd:L.naf.wnd,points:L.naf.points.map(P)},doubles:L.doubles&&{step:L.doubles.step,points:L.doubles.points.map(P)}}}return D},E.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},E.fromJSON=function(L,D,T){if(typeof D==="string")D=JSON.parse(D);var P=L.point(D[0],D[1],T);if(!D[2])return P;function B(S){return L.point(S[0],S[1],T)}var j=D[2];return P.precomputed={beta:null,doubles:j.doubles&&{step:j.doubles.step,points:[P].concat(j.doubles.points.map(B))},naf:j.naf&&{wnd:j.naf.wnd,points:[P].concat(j.naf.points.map(B))}},P},E.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},E.prototype.isInfinity=function(){return this.inf},E.prototype.add=function(L){if(this.inf)return L;if(L.inf)return this;if(this.eq(L))return this.dbl();if(this.neg().eq(L))return this.curve.point(null,null);if(this.x.cmp(L.x)===0)return this.curve.point(null,null);var D=this.y.redSub(L.y);if(D.cmpn(0)!==0)D=D.redMul(this.x.redSub(L.x).redInvm());var T=D.redSqr().redISub(this.x).redISub(L.x),P=D.redMul(this.x.redSub(T)).redISub(this.y);return this.curve.point(T,P)},E.prototype.dbl=function(){if(this.inf)return this;var L=this.y.redAdd(this.y);if(L.cmpn(0)===0)return this.curve.point(null,null);var D=this.curve.a,T=this.x.redSqr(),P=L.redInvm(),B=T.redAdd(T).redIAdd(T).redIAdd(D).redMul(P),j=B.redSqr().redISub(this.x.redAdd(this.x)),S=B.redMul(this.x.redSub(j)).redISub(this.y);return this.curve.point(j,S)},E.prototype.getX=function(){return this.x.fromRed()},E.prototype.getY=function(){return this.y.fromRed()},E.prototype.mul=function(L){if(L=new W(L,16),this.isInfinity())return this;else if(this._hasDoubles(L))return this.curve._fixedNafMul(this,L);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[L]);else return this.curve._wnafMul(this,L)},E.prototype.mulAdd=function(L,D,T){var P=[this,D],B=[L,T];if(this.curve.endo)return this.curve._endoWnafMulAdd(P,B);else return this.curve._wnafMulAdd(1,P,B,2)},E.prototype.jmulAdd=function(L,D,T){var P=[this,D],B=[L,T];if(this.curve.endo)return this.curve._endoWnafMulAdd(P,B,!0);else return this.curve._wnafMulAdd(1,P,B,2,!0)},E.prototype.eq=function(L){return this===L||this.inf===L.inf&&(this.inf||this.x.cmp(L.x)===0&&this.y.cmp(L.y)===0)},E.prototype.neg=function(L){if(this.inf)return this;var D=this.curve.point(this.x,this.y.redNeg());if(L&&this.precomputed){var T=this.precomputed,P=function(B){return B.neg()};D.precomputed={naf:T.naf&&{wnd:T.naf.wnd,points:T.naf.points.map(P)},doubles:T.doubles&&{step:T.doubles.step,points:T.doubles.points.map(P)}}}return D},E.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var L=this.curve.jpoint(this.x,this.y,this.curve.one);return L};function I(L,D,T,P){if(K.BasePoint.call(this,L,"jacobian"),D===null&&T===null&&P===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new W(0);else this.x=new W(D,16),this.y=new W(T,16),this.z=new W(P,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}G(I,K.BasePoint),q.prototype.jpoint=function(L,D,T){return new I(this,L,D,T)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var L=this.z.redInvm(),D=L.redSqr(),T=this.x.redMul(D),P=this.y.redMul(D).redMul(L);return this.curve.point(T,P)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(L){if(this.isInfinity())return L;if(L.isInfinity())return this;var D=L.z.redSqr(),T=this.z.redSqr(),P=this.x.redMul(D),B=L.x.redMul(T),j=this.y.redMul(D.redMul(L.z)),S=L.y.redMul(T.redMul(this.z)),N=P.redSub(B),k=j.redSub(S);if(N.cmpn(0)===0)if(k.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var v=N.redSqr(),_=v.redMul(N),x=P.redMul(v),c=k.redSqr().redIAdd(_).redISub(x).redISub(x),Y0=k.redMul(x.redISub(c)).redISub(j.redMul(_)),$0=this.z.redMul(L.z).redMul(N);return this.curve.jpoint(c,Y0,$0)},I.prototype.mixedAdd=function(L){if(this.isInfinity())return L.toJ();if(L.isInfinity())return this;var D=this.z.redSqr(),T=this.x,P=L.x.redMul(D),B=this.y,j=L.y.redMul(D).redMul(this.z),S=T.redSub(P),N=B.redSub(j);if(S.cmpn(0)===0)if(N.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var k=S.redSqr(),v=k.redMul(S),_=T.redMul(k),x=N.redSqr().redIAdd(v).redISub(_).redISub(_),c=N.redMul(_.redISub(x)).redISub(B.redMul(v)),Y0=this.z.redMul(S);return this.curve.jpoint(x,c,Y0)},I.prototype.dblp=function(L){if(L===0)return this;if(this.isInfinity())return this;if(!L)return this.dbl();var D;if(this.curve.zeroA||this.curve.threeA){var T=this;for(D=0;D<L;D++)T=T.dbl();return T}var P=this.curve.a,B=this.curve.tinv,j=this.x,S=this.y,N=this.z,k=N.redSqr().redSqr(),v=S.redAdd(S);for(D=0;D<L;D++){var _=j.redSqr(),x=v.redSqr(),c=x.redSqr(),Y0=_.redAdd(_).redIAdd(_).redIAdd(P.redMul(k)),$0=j.redMul(x),e=Y0.redSqr().redISub($0.redAdd($0)),p=$0.redISub(e),X0=Y0.redMul(p);X0=X0.redIAdd(X0).redISub(c);var J=v.redMul(N);if(D+1<L)k=k.redMul(c);j=e,N=J,v=X0}return this.curve.jpoint(j,v.redMul(B),N)},I.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},I.prototype._zeroDbl=function(){var L,D,T;if(this.zOne){var P=this.x.redSqr(),B=this.y.redSqr(),j=B.redSqr(),S=this.x.redAdd(B).redSqr().redISub(P).redISub(j);S=S.redIAdd(S);var N=P.redAdd(P).redIAdd(P),k=N.redSqr().redISub(S).redISub(S),v=j.redIAdd(j);v=v.redIAdd(v),v=v.redIAdd(v),L=k,D=N.redMul(S.redISub(k)).redISub(v),T=this.y.redAdd(this.y)}else{var _=this.x.redSqr(),x=this.y.redSqr(),c=x.redSqr(),Y0=this.x.redAdd(x).redSqr().redISub(_).redISub(c);Y0=Y0.redIAdd(Y0);var $0=_.redAdd(_).redIAdd(_),e=$0.redSqr(),p=c.redIAdd(c);p=p.redIAdd(p),p=p.redIAdd(p),L=e.redISub(Y0).redISub(Y0),D=$0.redMul(Y0.redISub(L)).redISub(p),T=this.y.redMul(this.z),T=T.redIAdd(T)}return this.curve.jpoint(L,D,T)},I.prototype._threeDbl=function(){var L,D,T;if(this.zOne){var P=this.x.redSqr(),B=this.y.redSqr(),j=B.redSqr(),S=this.x.redAdd(B).redSqr().redISub(P).redISub(j);S=S.redIAdd(S);var N=P.redAdd(P).redIAdd(P).redIAdd(this.curve.a),k=N.redSqr().redISub(S).redISub(S);L=k;var v=j.redIAdd(j);v=v.redIAdd(v),v=v.redIAdd(v),D=N.redMul(S.redISub(k)).redISub(v),T=this.y.redAdd(this.y)}else{var _=this.z.redSqr(),x=this.y.redSqr(),c=this.x.redMul(x),Y0=this.x.redSub(_).redMul(this.x.redAdd(_));Y0=Y0.redAdd(Y0).redIAdd(Y0);var $0=c.redIAdd(c);$0=$0.redIAdd($0);var e=$0.redAdd($0);L=Y0.redSqr().redISub(e),T=this.y.redAdd(this.z).redSqr().redISub(x).redISub(_);var p=x.redSqr();p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p),D=Y0.redMul($0.redISub(L)).redISub(p)}return this.curve.jpoint(L,D,T)},I.prototype._dbl=function(){var L=this.curve.a,D=this.x,T=this.y,P=this.z,B=P.redSqr().redSqr(),j=D.redSqr(),S=T.redSqr(),N=j.redAdd(j).redIAdd(j).redIAdd(L.redMul(B)),k=D.redAdd(D);k=k.redIAdd(k);var v=k.redMul(S),_=N.redSqr().redISub(v.redAdd(v)),x=v.redISub(_),c=S.redSqr();c=c.redIAdd(c),c=c.redIAdd(c),c=c.redIAdd(c);var Y0=N.redMul(x).redISub(c),$0=T.redAdd(T).redMul(P);return this.curve.jpoint(_,Y0,$0)},I.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var L=this.x.redSqr(),D=this.y.redSqr(),T=this.z.redSqr(),P=D.redSqr(),B=L.redAdd(L).redIAdd(L),j=B.redSqr(),S=this.x.redAdd(D).redSqr().redISub(L).redISub(P);S=S.redIAdd(S),S=S.redAdd(S).redIAdd(S),S=S.redISub(j);var N=S.redSqr(),k=P.redIAdd(P);k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var v=B.redIAdd(S).redSqr().redISub(j).redISub(N).redISub(k),_=D.redMul(v);_=_.redIAdd(_),_=_.redIAdd(_);var x=this.x.redMul(N).redISub(_);x=x.redIAdd(x),x=x.redIAdd(x);var c=this.y.redMul(v.redMul(k.redISub(v)).redISub(S.redMul(N)));c=c.redIAdd(c),c=c.redIAdd(c),c=c.redIAdd(c);var Y0=this.z.redAdd(S).redSqr().redISub(T).redISub(N);return this.curve.jpoint(x,c,Y0)},I.prototype.mul=function(L,D){return L=new W(L,D),this.curve._wnafMul(this,L)},I.prototype.eq=function(L){if(L.type==="affine")return this.eq(L.toJ());if(this===L)return!0;var D=this.z.redSqr(),T=L.z.redSqr();if(this.x.redMul(T).redISub(L.x.redMul(D)).cmpn(0)!==0)return!1;var P=D.redMul(this.z),B=T.redMul(L.z);return this.y.redMul(B).redISub(L.y.redMul(P)).cmpn(0)===0},I.prototype.eqXToP=function(L){var D=this.z.redSqr(),T=L.toRed(this.curve.red).redMul(D);if(this.x.cmp(T)===0)return!0;var P=L.clone(),B=this.curve.redN.redMul(D);for(;;){if(P.iadd(this.curve.n),P.cmp(this.curve.p)>=0)return!1;if(T.redIAdd(B),this.x.cmp(T)===0)return!0}},I.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},I.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),tR=H0((Q,X)=>{var Y=BY(),W=hX(),G=DG(),K=mX();function Z(E){G.call(this,"mont",E),this.a=new Y(E.a,16).toRed(this.red),this.b=new Y(E.b,16).toRed(this.red),this.i4=new Y(4).toRed(this.red).redInvm(),this.two=new Y(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}W(Z,G),X.exports=Z,Z.prototype.validate=function(E){var I=E.normalize().x,L=I.redSqr(),D=L.redMul(I).redAdd(L.redMul(this.a)).redAdd(I),T=D.redSqrt();return T.redSqr().cmp(D)===0};function q(E,I,L){if(G.BasePoint.call(this,E,"projective"),I===null&&L===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new Y(I,16),this.z=new Y(L,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}W(q,G.BasePoint),Z.prototype.decodePoint=function(E,I){return this.point(K.toArray(E,I),1)},Z.prototype.point=function(E,I){return new q(this,E,I)},Z.prototype.pointFromJSON=function(E){return q.fromJSON(this,E)},q.prototype.precompute=function(){},q.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},q.fromJSON=function(E,I){return new q(E,I[0],I[1]||E.one)},q.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},q.prototype.isInfinity=function(){return this.z.cmpn(0)===0},q.prototype.dbl=function(){var E=this.x.redAdd(this.z),I=E.redSqr(),L=this.x.redSub(this.z),D=L.redSqr(),T=I.redSub(D),P=I.redMul(D),B=T.redMul(D.redAdd(this.curve.a24.redMul(T)));return this.curve.point(P,B)},q.prototype.add=function(){throw Error("Not supported on Montgomery curve")},q.prototype.diffAdd=function(E,I){var L=this.x.redAdd(this.z),D=this.x.redSub(this.z),T=E.x.redAdd(E.z),P=E.x.redSub(E.z),B=P.redMul(L),j=T.redMul(D),S=I.z.redMul(B.redAdd(j).redSqr()),N=I.x.redMul(B.redISub(j).redSqr());return this.curve.point(S,N)},q.prototype.mul=function(E){var I=E.clone(),L=this,D=this.curve.point(null,null),T=this;for(var P=[];I.cmpn(0)!==0;I.iushrn(1))P.push(I.andln(1));for(var B=P.length-1;B>=0;B--)if(P[B]===0)L=L.diffAdd(D,T),D=D.dbl();else D=L.diffAdd(D,T),L=L.dbl();return D},q.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},q.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},q.prototype.eq=function(E){return this.getX().cmp(E.getX())===0},q.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},q.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),sR=H0((Q,X)=>{var Y=mX(),W=BY(),G=hX(),K=DG(),Z=Y.assert;function q(I){this.twisted=(I.a|0)!==1,this.mOneA=this.twisted&&(I.a|0)===-1,this.extended=this.mOneA,K.call(this,"edwards",I),this.a=new W(I.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new W(I.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new W(I.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Z(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(I.c|0)===1}G(q,K),X.exports=q,q.prototype._mulA=function(I){if(this.mOneA)return I.redNeg();else return this.a.redMul(I)},q.prototype._mulC=function(I){if(this.oneC)return I;else return this.c.redMul(I)},q.prototype.jpoint=function(I,L,D,T){return this.point(I,L,D,T)},q.prototype.pointFromX=function(I,L){if(I=new W(I,16),!I.red)I=I.toRed(this.red);var D=I.redSqr(),T=this.c2.redSub(this.a.redMul(D)),P=this.one.redSub(this.c2.redMul(this.d).redMul(D)),B=T.redMul(P.redInvm()),j=B.redSqrt();if(j.redSqr().redSub(B).cmp(this.zero)!==0)throw Error("invalid point");var S=j.fromRed().isOdd();if(L&&!S||!L&&S)j=j.redNeg();return this.point(I,j)},q.prototype.pointFromY=function(I,L){if(I=new W(I,16),!I.red)I=I.toRed(this.red);var D=I.redSqr(),T=D.redSub(this.c2),P=D.redMul(this.d).redMul(this.c2).redSub(this.a),B=T.redMul(P.redInvm());if(B.cmp(this.zero)===0)if(L)throw Error("invalid point");else return this.point(this.zero,I);var j=B.redSqrt();if(j.redSqr().redSub(B).cmp(this.zero)!==0)throw Error("invalid point");if(j.fromRed().isOdd()!==L)j=j.redNeg();return this.point(j,I)},q.prototype.validate=function(I){if(I.isInfinity())return!0;I.normalize();var L=I.x.redSqr(),D=I.y.redSqr(),T=L.redMul(this.a).redAdd(D),P=this.c2.redMul(this.one.redAdd(this.d.redMul(L).redMul(D)));return T.cmp(P)===0};function E(I,L,D,T,P){if(K.BasePoint.call(this,I,"projective"),L===null&&D===null&&T===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new W(L,16),this.y=new W(D,16),this.z=T?new W(T,16):this.curve.one,this.t=P&&new W(P,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}G(E,K.BasePoint),q.prototype.pointFromJSON=function(I){return E.fromJSON(this,I)},q.prototype.point=function(I,L,D,T){return new E(this,I,L,D,T)},E.fromJSON=function(I,L){return new E(I,L[0],L[1],L[2])},E.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},E.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},E.prototype._extDbl=function(){var I=this.x.redSqr(),L=this.y.redSqr(),D=this.z.redSqr();D=D.redIAdd(D);var T=this.curve._mulA(I),P=this.x.redAdd(this.y).redSqr().redISub(I).redISub(L),B=T.redAdd(L),j=B.redSub(D),S=T.redSub(L),N=P.redMul(j),k=B.redMul(S),v=P.redMul(S),_=j.redMul(B);return this.curve.point(N,k,_,v)},E.prototype._projDbl=function(){var I=this.x.redAdd(this.y).redSqr(),L=this.x.redSqr(),D=this.y.redSqr(),T,P,B,j,S,N;if(this.curve.twisted){j=this.curve._mulA(L);var k=j.redAdd(D);if(this.zOne)T=I.redSub(L).redSub(D).redMul(k.redSub(this.curve.two)),P=k.redMul(j.redSub(D)),B=k.redSqr().redSub(k).redSub(k);else S=this.z.redSqr(),N=k.redSub(S).redISub(S),T=I.redSub(L).redISub(D).redMul(N),P=k.redMul(j.redSub(D)),B=k.redMul(N)}else j=L.redAdd(D),S=this.curve._mulC(this.z).redSqr(),N=j.redSub(S).redSub(S),T=this.curve._mulC(I.redISub(j)).redMul(N),P=this.curve._mulC(j).redMul(L.redISub(D)),B=j.redMul(N);return this.curve.point(T,P,B)},E.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},E.prototype._extAdd=function(I){var L=this.y.redSub(this.x).redMul(I.y.redSub(I.x)),D=this.y.redAdd(this.x).redMul(I.y.redAdd(I.x)),T=this.t.redMul(this.curve.dd).redMul(I.t),P=this.z.redMul(I.z.redAdd(I.z)),B=D.redSub(L),j=P.redSub(T),S=P.redAdd(T),N=D.redAdd(L),k=B.redMul(j),v=S.redMul(N),_=B.redMul(N),x=j.redMul(S);return this.curve.point(k,v,x,_)},E.prototype._projAdd=function(I){var L=this.z.redMul(I.z),D=L.redSqr(),T=this.x.redMul(I.x),P=this.y.redMul(I.y),B=this.curve.d.redMul(T).redMul(P),j=D.redSub(B),S=D.redAdd(B),N=this.x.redAdd(this.y).redMul(I.x.redAdd(I.y)).redISub(T).redISub(P),k=L.redMul(j).redMul(N),v,_;if(this.curve.twisted)v=L.redMul(S).redMul(P.redSub(this.curve._mulA(T))),_=j.redMul(S);else v=L.redMul(S).redMul(P.redSub(T)),_=this.curve._mulC(j).redMul(S);return this.curve.point(k,v,_)},E.prototype.add=function(I){if(this.isInfinity())return I;if(I.isInfinity())return this;if(this.curve.extended)return this._extAdd(I);else return this._projAdd(I)},E.prototype.mul=function(I){if(this._hasDoubles(I))return this.curve._fixedNafMul(this,I);else return this.curve._wnafMul(this,I)},E.prototype.mulAdd=function(I,L,D){return this.curve._wnafMulAdd(1,[this,L],[I,D],2,!1)},E.prototype.jmulAdd=function(I,L,D){return this.curve._wnafMulAdd(1,[this,L],[I,D],2,!0)},E.prototype.normalize=function(){if(this.zOne)return this;var I=this.z.redInvm();if(this.x=this.x.redMul(I),this.y=this.y.redMul(I),this.t)this.t=this.t.redMul(I);return this.z=this.curve.one,this.zOne=!0,this},E.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},E.prototype.getX=function(){return this.normalize(),this.x.fromRed()},E.prototype.getY=function(){return this.normalize(),this.y.fromRed()},E.prototype.eq=function(I){return this===I||this.getX().cmp(I.getX())===0&&this.getY().cmp(I.getY())===0},E.prototype.eqXToP=function(I){var L=I.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(L)===0)return!0;var D=I.clone(),T=this.curve.redN.redMul(this.z);for(;;){if(D.iadd(this.curve.n),D.cmp(this.curve.p)>=0)return!1;if(L.redIAdd(T),this.x.cmp(L)===0)return!0}},E.prototype.toP=E.prototype.normalize,E.prototype.mixedAdd=E.prototype.add}),HF=H0((Q)=>{var X=Q;X.base=DG(),X.short=iR(),X.mont=tR(),X.edwards=sR()}),AY=H0((Q)=>{var X=mY(),Y=hX();Q.inherits=Y;function W(U,V){if((U.charCodeAt(V)&64512)!==55296)return!1;if(V<0||V+1>=U.length)return!1;return(U.charCodeAt(V+1)&64512)===56320}function G(U,V){if(Array.isArray(U))return U.slice();if(!U)return[];var H=[];if(typeof U==="string"){if(!V){var F=0;for(var A=0;A<U.length;A++){var M=U.charCodeAt(A);if(M<128)H[F++]=M;else if(M<2048)H[F++]=M>>6|192,H[F++]=M&63|128;else if(W(U,A))M=65536+((M&1023)<<10)+(U.charCodeAt(++A)&1023),H[F++]=M>>18|240,H[F++]=M>>12&63|128,H[F++]=M>>6&63|128,H[F++]=M&63|128;else H[F++]=M>>12|224,H[F++]=M>>6&63|128,H[F++]=M&63|128}}else if(V==="hex"){if(U=U.replace(/[^a-z0-9]+/ig,""),U.length%2!==0)U="0"+U;for(A=0;A<U.length;A+=2)H.push(parseInt(U[A]+U[A+1],16))}}else for(A=0;A<U.length;A++)H[A]=U[A]|0;return H}Q.toArray=G;function K(U){var V="";for(var H=0;H<U.length;H++)V+=E(U[H].toString(16));return V}Q.toHex=K;function Z(U){var V=U>>>24|U>>>8&65280|U<<8&16711680|(U&255)<<24;return V>>>0}Q.htonl=Z;function q(U,V){var H="";for(var F=0;F<U.length;F++){var A=U[F];if(V==="little")A=Z(A);H+=I(A.toString(16))}return H}Q.toHex32=q;function E(U){if(U.length===1)return"0"+U;else return U}Q.zero2=E;function I(U){if(U.length===7)return"0"+U;else if(U.length===6)return"00"+U;else if(U.length===5)return"000"+U;else if(U.length===4)return"0000"+U;else if(U.length===3)return"00000"+U;else if(U.length===2)return"000000"+U;else if(U.length===1)return"0000000"+U;else return U}Q.zero8=I;function L(U,V,H,F){var A=H-V;X(A%4===0);var M=Array(A/4);for(var z=0,$=V;z<M.length;z++,$+=4){var O;if(F==="big")O=U[$]<<24|U[$+1]<<16|U[$+2]<<8|U[$+3];else O=U[$+3]<<24|U[$+2]<<16|U[$+1]<<8|U[$];M[z]=O>>>0}return M}Q.join32=L;function D(U,V){var H=Array(U.length*4);for(var F=0,A=0;F<U.length;F++,A+=4){var M=U[F];if(V==="big")H[A]=M>>>24,H[A+1]=M>>>16&255,H[A+2]=M>>>8&255,H[A+3]=M&255;else H[A+3]=M>>>24,H[A+2]=M>>>16&255,H[A+1]=M>>>8&255,H[A]=M&255}return H}Q.split32=D;function T(U,V){return U>>>V|U<<32-V}Q.rotr32=T;function P(U,V){return U<<V|U>>>32-V}Q.rotl32=P;function B(U,V){return U+V>>>0}Q.sum32=B;function j(U,V,H){return U+V+H>>>0}Q.sum32_3=j;function S(U,V,H,F){return U+V+H+F>>>0}Q.sum32_4=S;function N(U,V,H,F,A){return U+V+H+F+A>>>0}Q.sum32_5=N;function k(U,V,H,F){var A=U[V],M=U[V+1],z=F+M>>>0,$=(z<F?1:0)+H+A;U[V]=$>>>0,U[V+1]=z}Q.sum64=k;function v(U,V,H,F){var A=V+F>>>0,M=(A<V?1:0)+U+H;return M>>>0}Q.sum64_hi=v;function _(U,V,H,F){var A=V+F;return A>>>0}Q.sum64_lo=_;function x(U,V,H,F,A,M,z,$){var O=0,C=V;C=C+F>>>0,O+=C<V?1:0,C=C+M>>>0,O+=C<M?1:0,C=C+$>>>0,O+=C<$?1:0;var R=U+H+A+z+O;return R>>>0}Q.sum64_4_hi=x;function c(U,V,H,F,A,M,z,$){var O=V+F+M+$;return O>>>0}Q.sum64_4_lo=c;function Y0(U,V,H,F,A,M,z,$,O,C){var R=0,w=V;w=w+F>>>0,R+=w<V?1:0,w=w+M>>>0,R+=w<M?1:0,w=w+$>>>0,R+=w<$?1:0,w=w+C>>>0,R+=w<C?1:0;var g=U+H+A+z+O+R;return g>>>0}Q.sum64_5_hi=Y0;function $0(U,V,H,F,A,M,z,$,O,C){var R=V+F+M+$+C;return R>>>0}Q.sum64_5_lo=$0;function e(U,V,H){var F=V<<32-H|U>>>H;return F>>>0}Q.rotr64_hi=e;function p(U,V,H){var F=U<<32-H|V>>>H;return F>>>0}Q.rotr64_lo=p;function X0(U,V,H){return U>>>H}Q.shr64_hi=X0;function J(U,V,H){var F=U<<32-H|V>>>H;return F>>>0}Q.shr64_lo=J}),NJ=H0((Q)=>{var X=AY(),Y=mY();function W(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Q.BlockHash=W,W.prototype.update=function(G,K){if(G=X.toArray(G,K),!this.pending)this.pending=G;else this.pending=this.pending.concat(G);if(this.pendingTotal+=G.length,this.pending.length>=this._delta8){G=this.pending;var Z=G.length%this._delta8;if(this.pending=G.slice(G.length-Z,G.length),this.pending.length===0)this.pending=null;G=X.join32(G,0,G.length-Z,this.endian);for(var q=0;q<G.length;q+=this._delta32)this._update(G,q,q+this._delta32)}return this},W.prototype.digest=function(G){return this.update(this._pad()),Y(this.pending===null),this._digest(G)},W.prototype._pad=function(){var G=this.pendingTotal,K=this._delta8,Z=K-(G+this.padLength)%K,q=Array(Z+this.padLength);q[0]=128;for(var E=1;E<Z;E++)q[E]=0;if(G<<=3,this.endian==="big"){for(var I=8;I<this.padLength;I++)q[E++]=0;q[E++]=0,q[E++]=0,q[E++]=0,q[E++]=0,q[E++]=G>>>24&255,q[E++]=G>>>16&255,q[E++]=G>>>8&255,q[E++]=G&255}else{q[E++]=G&255,q[E++]=G>>>8&255,q[E++]=G>>>16&255,q[E++]=G>>>24&255,q[E++]=0,q[E++]=0,q[E++]=0,q[E++]=0;for(I=8;I<this.padLength;I++)q[E++]=0}return q}}),UF=H0((Q)=>{var X=AY(),Y=X.rotr32;function W(D,T,P,B){if(D===0)return G(T,P,B);if(D===1||D===3)return Z(T,P,B);if(D===2)return K(T,P,B)}Q.ft_1=W;function G(D,T,P){return D&T^~D&P}Q.ch32=G;function K(D,T,P){return D&T^D&P^T&P}Q.maj32=K;function Z(D,T,P){return D^T^P}Q.p32=Z;function q(D){return Y(D,2)^Y(D,13)^Y(D,22)}Q.s0_256=q;function E(D){return Y(D,6)^Y(D,11)^Y(D,25)}Q.s1_256=E;function I(D){return Y(D,7)^Y(D,18)^D>>>3}Q.g0_256=I;function L(D){return Y(D,17)^Y(D,19)^D>>>10}Q.g1_256=L}),aR=H0((Q,X)=>{var Y=AY(),W=NJ(),G=UF(),K=Y.rotl32,Z=Y.sum32,q=Y.sum32_5,E=G.ft_1,I=W.BlockHash,L=[1518500249,1859775393,2400959708,3395469782];function D(){if(!(this instanceof D))return new D;I.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}Y.inherits(D,I),X.exports=D,D.blockSize=512,D.outSize=160,D.hmacStrength=80,D.padLength=64,D.prototype._update=function(T,P){var B=this.W;for(var j=0;j<16;j++)B[j]=T[P+j];for(;j<B.length;j++)B[j]=K(B[j-3]^B[j-8]^B[j-14]^B[j-16],1);var S=this.h[0],N=this.h[1],k=this.h[2],v=this.h[3],_=this.h[4];for(j=0;j<B.length;j++){var x=~~(j/20),c=q(K(S,5),E(x,N,k,v),_,B[j],L[x]);_=v,v=k,k=K(N,30),N=S,S=c}this.h[0]=Z(this.h[0],S),this.h[1]=Z(this.h[1],N),this.h[2]=Z(this.h[2],k),this.h[3]=Z(this.h[3],v),this.h[4]=Z(this.h[4],_)},D.prototype._digest=function(T){if(T==="hex")return Y.toHex32(this.h,"big");else return Y.split32(this.h,"big")}}),KF=H0((Q,X)=>{var Y=AY(),W=NJ(),G=UF(),K=mY(),Z=Y.sum32,q=Y.sum32_4,E=Y.sum32_5,I=G.ch32,L=G.maj32,D=G.s0_256,T=G.s1_256,P=G.g0_256,B=G.g1_256,j=W.BlockHash,S=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function N(){if(!(this instanceof N))return new N;j.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=S,this.W=Array(64)}Y.inherits(N,j),X.exports=N,N.blockSize=512,N.outSize=256,N.hmacStrength=192,N.padLength=64,N.prototype._update=function(k,v){var _=this.W;for(var x=0;x<16;x++)_[x]=k[v+x];for(;x<_.length;x++)_[x]=q(B(_[x-2]),_[x-7],P(_[x-15]),_[x-16]);var c=this.h[0],Y0=this.h[1],$0=this.h[2],e=this.h[3],p=this.h[4],X0=this.h[5],J=this.h[6],U=this.h[7];K(this.k.length===_.length);for(x=0;x<_.length;x++){var V=E(U,T(p),I(p,X0,J),this.k[x],_[x]),H=Z(D(c),L(c,Y0,$0));U=J,J=X0,X0=p,p=Z(e,V),e=$0,$0=Y0,Y0=c,c=Z(V,H)}this.h[0]=Z(this.h[0],c),this.h[1]=Z(this.h[1],Y0),this.h[2]=Z(this.h[2],$0),this.h[3]=Z(this.h[3],e),this.h[4]=Z(this.h[4],p),this.h[5]=Z(this.h[5],X0),this.h[6]=Z(this.h[6],J),this.h[7]=Z(this.h[7],U)},N.prototype._digest=function(k){if(k==="hex")return Y.toHex32(this.h,"big");else return Y.split32(this.h,"big")}}),eR=H0((Q,X)=>{var Y=AY(),W=KF();function G(){if(!(this instanceof G))return new G;W.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Y.inherits(G,W),X.exports=G,G.blockSize=512,G.outSize=224,G.hmacStrength=192,G.padLength=64,G.prototype._digest=function(K){if(K==="hex")return Y.toHex32(this.h.slice(0,7),"big");else return Y.split32(this.h.slice(0,7),"big")}}),FF=H0((Q,X)=>{var Y=AY(),W=NJ(),G=mY(),K=Y.rotr64_hi,Z=Y.rotr64_lo,q=Y.shr64_hi,E=Y.shr64_lo,I=Y.sum64,L=Y.sum64_hi,D=Y.sum64_lo,T=Y.sum64_4_hi,P=Y.sum64_4_lo,B=Y.sum64_5_hi,j=Y.sum64_5_lo,S=W.BlockHash,N=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function k(){if(!(this instanceof k))return new k;S.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=N,this.W=Array(160)}Y.inherits(k,S),X.exports=k,k.blockSize=1024,k.outSize=512,k.hmacStrength=192,k.padLength=128,k.prototype._prepareBlock=function(H,F){var A=this.W;for(var M=0;M<32;M++)A[M]=H[F+M];for(;M<A.length;M+=2){var z=U(A[M-4],A[M-3]),$=V(A[M-4],A[M-3]),O=A[M-14],C=A[M-13],R=X0(A[M-30],A[M-29]),w=J(A[M-30],A[M-29]),g=A[M-32],h=A[M-31];A[M]=T(z,$,O,C,R,w,g,h),A[M+1]=P(z,$,O,C,R,w,g,h)}},k.prototype._update=function(H,F){this._prepareBlock(H,F);var A=this.W,M=this.h[0],z=this.h[1],$=this.h[2],O=this.h[3],C=this.h[4],R=this.h[5],w=this.h[6],g=this.h[7],h=this.h[8],d=this.h[9],K0=this.h[10],i=this.h[11],m=this.h[12],G0=this.h[13],o=this.h[14],Q0=this.h[15];G(this.k.length===A.length);for(var f0=0;f0<A.length;f0+=2){var f=o,u=Q0,Z0=e(h,d),t=p(h,d),a=v(h,d,K0,i,m,G0),R0=_(h,d,K0,i,m,G0),b=this.k[f0],n=this.k[f0+1],g0=A[f0],r=A[f0+1],W0=B(f,u,Z0,t,a,R0,b,n,g0,r),m0=j(f,u,Z0,t,a,R0,b,n,g0,r);f=Y0(M,z),u=$0(M,z),Z0=x(M,z,$,O,C,R),t=c(M,z,$,O,C,R);var D0=L(f,u,Z0,t),q0=D(f,u,Z0,t);o=m,Q0=G0,m=K0,G0=i,K0=h,i=d,h=L(w,g,W0,m0),d=D(g,g,W0,m0),w=C,g=R,C=$,R=O,$=M,O=z,M=L(W0,m0,D0,q0),z=D(W0,m0,D0,q0)}I(this.h,0,M,z),I(this.h,2,$,O),I(this.h,4,C,R),I(this.h,6,w,g),I(this.h,8,h,d),I(this.h,10,K0,i),I(this.h,12,m,G0),I(this.h,14,o,Q0)},k.prototype._digest=function(H){if(H==="hex")return Y.toHex32(this.h,"big");else return Y.split32(this.h,"big")};function v(H,F,A,M,z){var $=H&A^~H&z;if($<0)$+=4294967296;return $}function _(H,F,A,M,z,$){var O=F&M^~F&$;if(O<0)O+=4294967296;return O}function x(H,F,A,M,z){var $=H&A^H&z^A&z;if($<0)$+=4294967296;return $}function c(H,F,A,M,z,$){var O=F&M^F&$^M&$;if(O<0)O+=4294967296;return O}function Y0(H,F){var A=K(H,F,28),M=K(F,H,2),z=K(F,H,7),$=A^M^z;if($<0)$+=4294967296;return $}function $0(H,F){var A=Z(H,F,28),M=Z(F,H,2),z=Z(F,H,7),$=A^M^z;if($<0)$+=4294967296;return $}function e(H,F){var A=K(H,F,14),M=K(H,F,18),z=K(F,H,9),$=A^M^z;if($<0)$+=4294967296;return $}function p(H,F){var A=Z(H,F,14),M=Z(H,F,18),z=Z(F,H,9),$=A^M^z;if($<0)$+=4294967296;return $}function X0(H,F){var A=K(H,F,1),M=K(H,F,8),z=q(H,F,7),$=A^M^z;if($<0)$+=4294967296;return $}function J(H,F){var A=Z(H,F,1),M=Z(H,F,8),z=E(H,F,7),$=A^M^z;if($<0)$+=4294967296;return $}function U(H,F){var A=K(H,F,19),M=K(F,H,29),z=q(H,F,6),$=A^M^z;if($<0)$+=4294967296;return $}function V(H,F){var A=Z(H,F,19),M=Z(F,H,29),z=E(H,F,6),$=A^M^z;if($<0)$+=4294967296;return $}}),QP=H0((Q,X)=>{var Y=AY(),W=FF();function G(){if(!(this instanceof G))return new G;W.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Y.inherits(G,W),X.exports=G,G.blockSize=1024,G.outSize=384,G.hmacStrength=192,G.padLength=128,G.prototype._digest=function(K){if(K==="hex")return Y.toHex32(this.h.slice(0,12),"big");else return Y.split32(this.h.slice(0,12),"big")}}),XP=H0((Q)=>{Q.sha1=aR(),Q.sha224=eR(),Q.sha256=KF(),Q.sha384=QP(),Q.sha512=FF()}),YP=H0((Q)=>{var X=AY(),Y=NJ(),W=X.rotl32,G=X.sum32,K=X.sum32_3,Z=X.sum32_4,q=Y.BlockHash;function E(){if(!(this instanceof E))return new E;q.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}X.inherits(E,q),Q.ripemd160=E,E.blockSize=512,E.outSize=160,E.hmacStrength=192,E.padLength=64,E.prototype._update=function(S,N){var k=this.h[0],v=this.h[1],_=this.h[2],x=this.h[3],c=this.h[4],Y0=k,$0=v,e=_,p=x,X0=c;for(var J=0;J<80;J++){var U=G(W(Z(k,I(J,v,_,x),S[T[J]+N],L(J)),B[J]),c);k=c,c=x,x=W(_,10),_=v,v=U,U=G(W(Z(Y0,I(79-J,$0,e,p),S[P[J]+N],D(J)),j[J]),X0),Y0=X0,X0=p,p=W(e,10),e=$0,$0=U}U=K(this.h[1],_,p),this.h[1]=K(this.h[2],x,X0),this.h[2]=K(this.h[3],c,Y0),this.h[3]=K(this.h[4],k,$0),this.h[4]=K(this.h[0],v,e),this.h[0]=U},E.prototype._digest=function(S){if(S==="hex")return X.toHex32(this.h,"little");else return X.split32(this.h,"little")};function I(S,N,k,v){if(S<=15)return N^k^v;else if(S<=31)return N&k|~N&v;else if(S<=47)return(N|~k)^v;else if(S<=63)return N&v|k&~v;else return N^(k|~v)}function L(S){if(S<=15)return 0;else if(S<=31)return 1518500249;else if(S<=47)return 1859775393;else if(S<=63)return 2400959708;else return 2840853838}function D(S){if(S<=15)return 1352829926;else if(S<=31)return 1548603684;else if(S<=47)return 1836072691;else if(S<=63)return 2053994217;else return 0}var T=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],P=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],B=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],j=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),JP=H0((Q,X)=>{var Y=AY(),W=mY();function G(K,Z,q){if(!(this instanceof G))return new G(K,Z,q);this.Hash=K,this.blockSize=K.blockSize/8,this.outSize=K.outSize/8,this.inner=null,this.outer=null,this._init(Y.toArray(Z,q))}X.exports=G,G.prototype._init=function(K){if(K.length>this.blockSize)K=new this.Hash().update(K).digest();W(K.length<=this.blockSize);for(var Z=K.length;Z<this.blockSize;Z++)K.push(0);for(Z=0;Z<K.length;Z++)K[Z]^=54;this.inner=new this.Hash().update(K);for(Z=0;Z<K.length;Z++)K[Z]^=106;this.outer=new this.Hash().update(K)},G.prototype.update=function(K,Z){return this.inner.update(K,Z),this},G.prototype.digest=function(K){return this.outer.update(this.inner.digest()),this.outer.digest(K)}}),HH=H0((Q)=>{var X=Q;X.utils=AY(),X.common=NJ(),X.sha=XP(),X.ripemd=YP(),X.hmac=JP(),X.sha1=X.sha.sha1,X.sha256=X.sha.sha256,X.sha224=X.sha.sha224,X.sha384=X.sha.sha384,X.sha512=X.sha.sha512,X.ripemd160=X.ripemd.ripemd160}),WP=H0((Q,X)=>{X.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),UH=H0((Q)=>{var X=Q,Y=HH(),W=HF(),G=mX(),K=G.assert;function Z(I){if(I.type==="short")this.curve=new W.short(I);else if(I.type==="edwards")this.curve=new W.edwards(I);else this.curve=new W.mont(I);this.g=this.curve.g,this.n=this.curve.n,this.hash=I.hash,K(this.g.validate(),"Invalid curve"),K(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}X.PresetCurve=Z;function q(I,L){Object.defineProperty(X,I,{configurable:!0,enumerable:!0,get:function(){var D=new Z(L);return Object.defineProperty(X,I,{configurable:!0,enumerable:!0,value:D}),D}})}q("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Y.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),q("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Y.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),q("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Y.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),q("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Y.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),q("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Y.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),q("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Y.sha256,gRed:!1,g:["9"]}),q("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Y.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var E;try{E=WP()}catch(I){E=void 0}q("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Y.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",E]})}),GP=H0((Q,X)=>{var Y=HH(),W=$F(),G=mY();function K(Z){if(!(this instanceof K))return new K(Z);this.hash=Z.hash,this.predResist=!!Z.predResist,this.outLen=this.hash.outSize,this.minEntropy=Z.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var q=W.toArray(Z.entropy,Z.entropyEnc||"hex"),E=W.toArray(Z.nonce,Z.nonceEnc||"hex"),I=W.toArray(Z.pers,Z.persEnc||"hex");G(q.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(q,E,I)}X.exports=K,K.prototype._init=function(Z,q,E){var I=Z.concat(q).concat(E);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var L=0;L<this.V.length;L++)this.K[L]=0,this.V[L]=1;this._update(I),this._reseed=1,this.reseedInterval=281474976710656},K.prototype._hmac=function(){return new Y.hmac(this.hash,this.K)},K.prototype._update=function(Z){var q=this._hmac().update(this.V).update([0]);if(Z)q=q.update(Z);if(this.K=q.digest(),this.V=this._hmac().update(this.V).digest(),!Z)return;this.K=this._hmac().update(this.V).update([1]).update(Z).digest(),this.V=this._hmac().update(this.V).digest()},K.prototype.reseed=function(Z,q,E,I){if(typeof q!=="string")I=E,E=q,q=null;Z=W.toArray(Z,q),E=W.toArray(E,I),G(Z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Z.concat(E||[])),this._reseed=1},K.prototype.generate=function(Z,q,E,I){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof q!=="string")I=E,E=q,q=null;if(E)E=W.toArray(E,I||"hex"),this._update(E);var L=[];while(L.length<Z)this.V=this._hmac().update(this.V).digest(),L=L.concat(this.V);var D=L.slice(0,Z);return this._update(E),this._reseed++,W.encode(D,q)}}),$P=H0((Q,X)=>{var Y=BY(),W=mX(),G=W.assert;function K(Z,q){if(this.ec=Z,this.priv=null,this.pub=null,q.priv)this._importPrivate(q.priv,q.privEnc);if(q.pub)this._importPublic(q.pub,q.pubEnc)}X.exports=K,K.fromPublic=function(Z,q,E){if(q instanceof K)return q;return new K(Z,{pub:q,pubEnc:E})},K.fromPrivate=function(Z,q,E){if(q instanceof K)return q;return new K(Z,{priv:q,privEnc:E})},K.prototype.validate=function(){var Z=this.getPublic();if(Z.isInfinity())return{result:!1,reason:"Invalid public key"};if(!Z.validate())return{result:!1,reason:"Public key is not a point"};if(!Z.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},K.prototype.getPublic=function(Z,q){if(typeof Z==="string")q=Z,Z=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!q)return this.pub;return this.pub.encode(q,Z)},K.prototype.getPrivate=function(Z){if(Z==="hex")return this.priv.toString(16,2);else return this.priv},K.prototype._importPrivate=function(Z,q){this.priv=new Y(Z,q||16),this.priv=this.priv.umod(this.ec.curve.n)},K.prototype._importPublic=function(Z,q){if(Z.x||Z.y){if(this.ec.curve.type==="mont")G(Z.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")G(Z.x&&Z.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(Z.x,Z.y);return}this.pub=this.ec.curve.decodePoint(Z,q)},K.prototype.derive=function(Z){if(!Z.validate())G(Z.validate(),"public point not validated");return Z.mul(this.priv).getX()},K.prototype.sign=function(Z,q,E){return this.ec.sign(Z,this,q,E)},K.prototype.verify=function(Z,q,E){return this.ec.verify(Z,q,this,void 0,E)},K.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),ZP=H0((Q,X)=>{var Y=BY(),W=mX(),G=W.assert;function K(L,D){if(L instanceof K)return L;if(this._importDER(L,D))return;if(G(L.r&&L.s,"Signature without r or s"),this.r=new Y(L.r,16),this.s=new Y(L.s,16),L.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=L.recoveryParam}X.exports=K;function Z(){this.place=0}function q(L,D){var T=L[D.place++];if(!(T&128))return T;var P=T&15;if(P===0||P>4)return!1;if(L[D.place]===0)return!1;var B=0;for(var j=0,S=D.place;j<P;j++,S++)B<<=8,B|=L[S],B>>>=0;if(B<=127)return!1;return D.place=S,B}function E(L){var D=0,T=L.length-1;while(!L[D]&&!(L[D+1]&128)&&D<T)D++;if(D===0)return L;return L.slice(D)}K.prototype._importDER=function(L,D){L=W.toArray(L,D);var T=new Z;if(L[T.place++]!==48)return!1;var P=q(L,T);if(P===!1)return!1;if(P+T.place!==L.length)return!1;if(L[T.place++]!==2)return!1;var B=q(L,T);if(B===!1)return!1;if((L[T.place]&128)!==0)return!1;var j=L.slice(T.place,B+T.place);if(T.place+=B,L[T.place++]!==2)return!1;var S=q(L,T);if(S===!1)return!1;if(L.length!==S+T.place)return!1;if((L[T.place]&128)!==0)return!1;var N=L.slice(T.place,S+T.place);if(j[0]===0)if(j[1]&128)j=j.slice(1);else return!1;if(N[0]===0)if(N[1]&128)N=N.slice(1);else return!1;return this.r=new Y(j),this.s=new Y(N),this.recoveryParam=null,!0};function I(L,D){if(D<128){L.push(D);return}var T=1+(Math.log(D)/Math.LN2>>>3);L.push(T|128);while(--T)L.push(D>>>(T<<3)&255);L.push(D)}K.prototype.toDER=function(L){var D=this.r.toArray(),T=this.s.toArray();if(D[0]&128)D=[0].concat(D);if(T[0]&128)T=[0].concat(T);D=E(D),T=E(T);while(!T[0]&&!(T[1]&128))T=T.slice(1);var P=[2];I(P,D.length),P=P.concat(D),P.push(2),I(P,T.length);var B=P.concat(T),j=[48];return I(j,B.length),j=j.concat(B),W.encode(j,L)}}),HP=H0((Q,X)=>{var Y=BY(),W=GP(),G=mX(),K=UH(),Z=ZF(),q=G.assert,E=$P(),I=ZP();function L(D){if(!(this instanceof L))return new L(D);if(typeof D==="string")q(Object.prototype.hasOwnProperty.call(K,D),"Unknown curve "+D),D=K[D];if(D instanceof K.PresetCurve)D={curve:D};this.curve=D.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=D.curve.g,this.g.precompute(D.curve.n.bitLength()+1),this.hash=D.hash||D.curve.hash}X.exports=L,L.prototype.keyPair=function(D){return new E(this,D)},L.prototype.keyFromPrivate=function(D,T){return E.fromPrivate(this,D,T)},L.prototype.keyFromPublic=function(D,T){return E.fromPublic(this,D,T)},L.prototype.genKeyPair=function(D){if(!D)D={};var T=new W({hash:this.hash,pers:D.pers,persEnc:D.persEnc||"utf8",entropy:D.entropy||Z(this.hash.hmacStrength),entropyEnc:D.entropy&&D.entropyEnc||"utf8",nonce:this.n.toArray()}),P=this.n.byteLength(),B=this.n.sub(new Y(2));for(;;){var j=new Y(T.generate(P));if(j.cmp(B)>0)continue;return j.iaddn(1),this.keyFromPrivate(j)}},L.prototype._truncateToN=function(D,T,P){var B;if(Y.isBN(D)||typeof D==="number")D=new Y(D,16),B=D.byteLength();else if(typeof D==="object")B=D.length,D=new Y(D,16);else{var j=D.toString();B=j.length+1>>>1,D=new Y(j,16)}if(typeof P!=="number")P=B*8;var S=P-this.n.bitLength();if(S>0)D=D.ushrn(S);if(!T&&D.cmp(this.n)>=0)return D.sub(this.n);else return D},L.prototype.sign=function(D,T,P,B){if(typeof P==="object")B=P,P=null;if(!B)B={};if(typeof D!=="string"&&typeof D!=="number"&&!Y.isBN(D)){q(typeof D==="object"&&D&&typeof D.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),q(D.length>>>0===D.length);for(var j=0;j<D.length;j++)q((D[j]&255)===D[j])}T=this.keyFromPrivate(T,P),D=this._truncateToN(D,!1,B.msgBitLength),q(!D.isNeg(),"Can not sign a negative message");var S=this.n.byteLength(),N=T.getPrivate().toArray("be",S),k=D.toArray("be",S);q(new Y(k).eq(D),"Can not sign message");var v=new W({hash:this.hash,entropy:N,nonce:k,pers:B.pers,persEnc:B.persEnc||"utf8"}),_=this.n.sub(new Y(1));for(var x=0;;x++){var c=B.k?B.k(x):new Y(v.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),c.cmpn(1)<=0||c.cmp(_)>=0)continue;var Y0=this.g.mul(c);if(Y0.isInfinity())continue;var $0=Y0.getX(),e=$0.umod(this.n);if(e.cmpn(0)===0)continue;var p=c.invm(this.n).mul(e.mul(T.getPrivate()).iadd(D));if(p=p.umod(this.n),p.cmpn(0)===0)continue;var X0=(Y0.getY().isOdd()?1:0)|($0.cmp(e)!==0?2:0);if(B.canonical&&p.cmp(this.nh)>0)p=this.n.sub(p),X0^=1;return new I({r:e,s:p,recoveryParam:X0})}},L.prototype.verify=function(D,T,P,B,j){if(!j)j={};D=this._truncateToN(D,!1,j.msgBitLength),P=this.keyFromPublic(P,B),T=new I(T,"hex");var{r:S,s:N}=T;if(S.cmpn(1)<0||S.cmp(this.n)>=0)return!1;if(N.cmpn(1)<0||N.cmp(this.n)>=0)return!1;var k=N.invm(this.n),v=k.mul(D).umod(this.n),_=k.mul(S).umod(this.n),x;if(!this.curve._maxwellTrick){if(x=this.g.mulAdd(v,P.getPublic(),_),x.isInfinity())return!1;return x.getX().umod(this.n).cmp(S)===0}if(x=this.g.jmulAdd(v,P.getPublic(),_),x.isInfinity())return!1;return x.eqXToP(S)},L.prototype.recoverPubKey=function(D,T,P,B){q((3&P)===P,"The recovery param is more than two bits"),T=new I(T,B);var j=this.n,S=new Y(D),N=T.r,k=T.s,v=P&1,_=P>>1;if(N.cmp(this.curve.p.umod(this.curve.n))>=0&&_)throw Error("Unable to find sencond key candinate");if(_)N=this.curve.pointFromX(N.add(this.curve.n),v);else N=this.curve.pointFromX(N,v);var x=T.r.invm(j),c=j.sub(S).mul(x).umod(j),Y0=k.mul(x).umod(j);return this.g.mulAdd(c,N,Y0)},L.prototype.getKeyRecoveryParam=function(D,T,P,B){if(T=new I(T,B),T.recoveryParam!==null)return T.recoveryParam;for(var j=0;j<4;j++){var S;try{S=this.recoverPubKey(D,T,j)}catch(N){continue}if(S.eq(P))return j}throw Error("Unable to find valid recovery factor")}}),UP=H0((Q,X)=>{var Y=mX(),W=Y.assert,G=Y.parseBytes,K=Y.cachedProperty;function Z(q,E){if(this.eddsa=q,this._secret=G(E.secret),q.isPoint(E.pub))this._pub=E.pub;else this._pubBytes=G(E.pub)}Z.fromPublic=function(q,E){if(E instanceof Z)return E;return new Z(q,{pub:E})},Z.fromSecret=function(q,E){if(E instanceof Z)return E;return new Z(q,{secret:E})},Z.prototype.secret=function(){return this._secret},K(Z,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),K(Z,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),K(Z,"privBytes",function(){var q=this.eddsa,E=this.hash(),I=q.encodingLength-1,L=E.slice(0,q.encodingLength);return L[0]&=248,L[I]&=127,L[I]|=64,L}),K(Z,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),K(Z,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),K(Z,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Z.prototype.sign=function(q){return W(this._secret,"KeyPair can only verify"),this.eddsa.sign(q,this)},Z.prototype.verify=function(q,E){return this.eddsa.verify(q,E,this)},Z.prototype.getSecret=function(q){return W(this._secret,"KeyPair is public only"),Y.encode(this.secret(),q)},Z.prototype.getPublic=function(q){return Y.encode(this.pubBytes(),q)},X.exports=Z}),KP=H0((Q,X)=>{var Y=BY(),W=mX(),G=W.assert,K=W.cachedProperty,Z=W.parseBytes;function q(E,I){if(this.eddsa=E,typeof I!=="object")I=Z(I);if(Array.isArray(I))G(I.length===E.encodingLength*2,"Signature has invalid size"),I={R:I.slice(0,E.encodingLength),S:I.slice(E.encodingLength)};if(G(I.R&&I.S,"Signature without R or S"),E.isPoint(I.R))this._R=I.R;if(I.S instanceof Y)this._S=I.S;this._Rencoded=Array.isArray(I.R)?I.R:I.Rencoded,this._Sencoded=Array.isArray(I.S)?I.S:I.Sencoded}K(q,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),K(q,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),K(q,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),K(q,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),q.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},q.prototype.toHex=function(){return W.encode(this.toBytes(),"hex").toUpperCase()},X.exports=q}),FP=H0((Q,X)=>{var Y=HH(),W=UH(),G=mX(),K=G.assert,Z=G.parseBytes,q=UP(),E=KP();function I(L){if(K(L==="ed25519","only tested with ed25519 so far"),!(this instanceof I))return new I(L);L=W[L].curve,this.curve=L,this.g=L.g,this.g.precompute(L.n.bitLength()+1),this.pointClass=L.point().constructor,this.encodingLength=Math.ceil(L.n.bitLength()/8),this.hash=Y.sha512}X.exports=I,I.prototype.sign=function(L,D){L=Z(L);var T=this.keyFromSecret(D),P=this.hashInt(T.messagePrefix(),L),B=this.g.mul(P),j=this.encodePoint(B),S=this.hashInt(j,T.pubBytes(),L).mul(T.priv()),N=P.add(S).umod(this.curve.n);return this.makeSignature({R:B,S:N,Rencoded:j})},I.prototype.verify=function(L,D,T){if(L=Z(L),D=this.makeSignature(D),D.S().gte(D.eddsa.curve.n)||D.S().isNeg())return!1;var P=this.keyFromPublic(T),B=this.hashInt(D.Rencoded(),P.pubBytes(),L),j=this.g.mul(D.S()),S=D.R().add(P.pub().mul(B));return S.eq(j)},I.prototype.hashInt=function(){var L=this.hash();for(var D=0;D<arguments.length;D++)L.update(arguments[D]);return G.intFromLE(L.digest()).umod(this.curve.n)},I.prototype.keyFromPublic=function(L){return q.fromPublic(this,L)},I.prototype.keyFromSecret=function(L){return q.fromSecret(this,L)},I.prototype.makeSignature=function(L){if(L instanceof E)return L;return new E(this,L)},I.prototype.encodePoint=function(L){var D=L.getY().toArray("le",this.encodingLength);return D[this.encodingLength-1]|=L.getX().isOdd()?128:0,D},I.prototype.decodePoint=function(L){L=G.parseBytes(L);var D=L.length-1,T=L.slice(0,D).concat(L[D]&-129),P=(L[D]&128)!==0,B=G.intFromLE(T);return this.curve.pointFromY(B,P)},I.prototype.encodeInt=function(L){return L.toArray("le",this.encodingLength)},I.prototype.decodeInt=function(L){return G.intFromLE(L)},I.prototype.isPoint=function(L){return L instanceof this.pointClass}}),VP=H0((Q)=>{var X=Q;X.version=oR().version,X.utils=mX(),X.rand=ZF(),X.curve=HF(),X.curves=UH(),X.ec=HP(),X.eddsa=FP()}),zP=H0((Q,X)=>{(function(Y,W){function G(J,U){if(!J)throw Error(U||"Assertion failed")}function K(J,U){J.super_=U;var V=function(){};V.prototype=U.prototype,J.prototype=new V,J.prototype.constructor=J}function Z(J,U,V){if(Z.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(U==="le"||U==="be")V=U,U=10;this._init(J||0,U||10,V||"be")}}if(typeof Y==="object")Y.exports=Z;else W.BN=Z;Z.BN=Z,Z.wordSize=26;var q;try{if(typeof window<"u"&&typeof window.Buffer<"u")q=window.Buffer;else q=(JX(),WQ(YX)).Buffer}catch(J){}Z.isBN=function(J){if(J instanceof Z)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Z.wordSize&&Array.isArray(J.words)},Z.max=function(J,U){if(J.cmp(U)>0)return J;return U},Z.min=function(J,U){if(J.cmp(U)<0)return J;return U},Z.prototype._init=function(J,U,V){if(typeof J==="number")return this._initNumber(J,U,V);if(typeof J==="object")return this._initArray(J,U,V);if(U==="hex")U=16;G(U===(U|0)&&U>=2&&U<=36),J=J.toString().replace(/\s+/g,"");var H=0;if(J[0]==="-")H++,this.negative=1;if(H<J.length){if(U===16)this._parseHex(J,H,V);else if(this._parseBase(J,U,H),V==="le")this._initArray(this.toArray(),U,V)}},Z.prototype._initNumber=function(J,U,V){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(V!=="le")return;this._initArray(this.toArray(),U,V)},Z.prototype._initArray=function(J,U,V){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F,A,M=0;if(V==="be"){for(H=J.length-1,F=0;H>=0;H-=3)if(A=J[H]|J[H-1]<<8|J[H-2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}else if(V==="le"){for(H=0,F=0;H<J.length;H+=3)if(A=J[H]|J[H+1]<<8|J[H+2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}return this.strip()};function E(J,U){var V=J.charCodeAt(U);if(V>=65&&V<=70)return V-55;else if(V>=97&&V<=102)return V-87;else return V-48&15}function I(J,U,V){var H=E(J,V);if(V-1>=U)H|=E(J,V-1)<<4;return H}Z.prototype._parseHex=function(J,U,V){this.length=Math.ceil((J.length-U)/6),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F=0,A=0,M;if(V==="be")for(H=J.length-1;H>=U;H-=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8;else{var z=J.length-U;for(H=z%2===0?U+1:U;H<J.length;H+=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8}this.strip()};function L(J,U,V,H){var F=0,A=Math.min(J.length,V);for(var M=U;M<A;M++){var z=J.charCodeAt(M)-48;if(F*=H,z>=49)F+=z-49+10;else if(z>=17)F+=z-17+10;else F+=z}return F}Z.prototype._parseBase=function(J,U,V){this.words=[0],this.length=1;for(var H=0,F=1;F<=67108863;F*=U)H++;H--,F=F/U|0;var A=J.length-V,M=A%H,z=Math.min(A,A-M)+V,$=0;for(var O=V;O<z;O+=H)if($=L(J,O,O+H,U),this.imuln(F),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(M!==0){var C=1;$=L(J,O,J.length,U);for(O=0;O<M;O++)C*=U;if(this.imuln(C),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Z.prototype.copy=function(J){J.words=Array(this.length);for(var U=0;U<this.length;U++)J.words[U]=this.words[U];J.length=this.length,J.negative=this.negative,J.red=this.red},Z.prototype.clone=function(){var J=new Z(null);return this.copy(J),J},Z.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Z.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Z.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Z.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var D=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],T=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Z.prototype.toString=function(J,U){J=J||10,U=U|0||1;var V;if(J===16||J==="hex"){V="";var H=0,F=0;for(var A=0;A<this.length;A++){var M=this.words[A],z=((M<<H|F)&16777215).toString(16);if(F=M>>>24-H&16777215,H+=2,H>=26)H-=26,A--;if(F!==0||A!==this.length-1)V=D[6-z.length]+z+V;else V=z+V}if(F!==0)V=F.toString(16)+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}if(J===(J|0)&&J>=2&&J<=36){var $=T[J],O=P[J];V="";var C=this.clone();C.negative=0;while(!C.isZero()){var R=C.modn(O).toString(J);if(C=C.idivn(O),!C.isZero())V=D[$-R.length]+R+V;else V=R+V}if(this.isZero())V="0"+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}G(!1,"Base should be between 2 and 36")},Z.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Z.prototype.toJSON=function(){return this.toString(16)},Z.prototype.toBuffer=function(J,U){return G(typeof q<"u"),this.toArrayLike(q,J,U)},Z.prototype.toArray=function(J,U){return this.toArrayLike(Array,J,U)},Z.prototype.toArrayLike=function(J,U,V){var H=this.byteLength(),F=V||Math.max(1,H);G(H<=F,"byte array longer than desired length"),G(F>0,"Requested array length <= 0"),this.strip();var A=U==="le",M=new J(F),z,$,O=this.clone();if(!A){for($=0;$<F-H;$++)M[$]=0;for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[F-$-1]=z}else{for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[$]=z;for(;$<F;$++)M[$]=0}return M},Math.clz32)Z.prototype._countBits=function(J){return 32-Math.clz32(J)};else Z.prototype._countBits=function(J){var U=J,V=0;if(U>=4096)V+=13,U>>>=13;if(U>=64)V+=7,U>>>=7;if(U>=8)V+=4,U>>>=4;if(U>=2)V+=2,U>>>=2;return V+U};Z.prototype._zeroBits=function(J){if(J===0)return 26;var U=J,V=0;if((U&8191)===0)V+=13,U>>>=13;if((U&127)===0)V+=7,U>>>=7;if((U&15)===0)V+=4,U>>>=4;if((U&3)===0)V+=2,U>>>=2;if((U&1)===0)V++;return V},Z.prototype.bitLength=function(){var J=this.words[this.length-1],U=this._countBits(J);return(this.length-1)*26+U};function B(J){var U=Array(J.bitLength());for(var V=0;V<U.length;V++){var H=V/26|0,F=V%26;U[V]=(J.words[H]&1<<F)>>>F}return U}Z.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var U=0;U<this.length;U++){var V=this._zeroBits(this.words[U]);if(J+=V,V!==26)break}return J},Z.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Z.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Z.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Z.prototype.isNeg=function(){return this.negative!==0},Z.prototype.neg=function(){return this.clone().ineg()},Z.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Z.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var U=0;U<J.length;U++)this.words[U]=this.words[U]|J.words[U];return this.strip()},Z.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Z.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Z.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Z.prototype.iuand=function(J){var U;if(this.length>J.length)U=J;else U=this;for(var V=0;V<U.length;V++)this.words[V]=this.words[V]&J.words[V];return this.length=U.length,this.strip()},Z.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Z.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Z.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Z.prototype.iuxor=function(J){var U,V;if(this.length>J.length)U=this,V=J;else U=J,V=this;for(var H=0;H<V.length;H++)this.words[H]=U.words[H]^V.words[H];if(this!==U)for(;H<U.length;H++)this.words[H]=U.words[H];return this.length=U.length,this.strip()},Z.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Z.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Z.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Z.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var U=Math.ceil(J/26)|0,V=J%26;if(this._expand(U),V>0)U--;for(var H=0;H<U;H++)this.words[H]=~this.words[H]&67108863;if(V>0)this.words[H]=~this.words[H]&67108863>>26-V;return this.strip()},Z.prototype.notn=function(J){return this.clone().inotn(J)},Z.prototype.setn=function(J,U){G(typeof J==="number"&&J>=0);var V=J/26|0,H=J%26;if(this._expand(V+1),U)this.words[V]=this.words[V]|1<<H;else this.words[V]=this.words[V]&~(1<<H);return this.strip()},Z.prototype.iadd=function(J){var U;if(this.negative!==0&&J.negative===0)return this.negative=0,U=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,U=this.isub(J),J.negative=1,U._normSign();var V,H;if(this.length>J.length)V=this,H=J;else V=J,H=this;var F=0;for(var A=0;A<H.length;A++)U=(V.words[A]|0)+(H.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;for(;F!==0&&A<V.length;A++)U=(V.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;if(this.length=V.length,F!==0)this.words[this.length]=F,this.length++;else if(V!==this)for(;A<V.length;A++)this.words[A]=V.words[A];return this},Z.prototype.add=function(J){var U;if(J.negative!==0&&this.negative===0)return J.negative=0,U=this.sub(J),J.negative^=1,U;else if(J.negative===0&&this.negative!==0)return this.negative=0,U=J.sub(this),this.negative=1,U;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Z.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var U=this.iadd(J);return J.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var V=this.cmp(J);if(V===0)return this.negative=0,this.length=1,this.words[0]=0,this;var H,F;if(V>0)H=this,F=J;else H=J,F=this;var A=0;for(var M=0;M<F.length;M++)U=(H.words[M]|0)-(F.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;for(;A!==0&&M<H.length;M++)U=(H.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;if(A===0&&M<H.length&&H!==this)for(;M<H.length;M++)this.words[M]=H.words[M];if(this.length=Math.max(this.length,M),H!==this)this.negative=1;return this.strip()},Z.prototype.sub=function(J){return this.clone().isub(J)};function j(J,U,V){V.negative=U.negative^J.negative;var H=J.length+U.length|0;V.length=H,H=H-1|0;var F=J.words[0]|0,A=U.words[0]|0,M=F*A,z=M&67108863,$=M/67108864|0;V.words[0]=z;for(var O=1;O<H;O++){var C=$>>>26,R=$&67108863,w=Math.min(O,U.length-1);for(var g=Math.max(0,O-J.length+1);g<=w;g++){var h=O-g|0;F=J.words[h]|0,A=U.words[g]|0,M=F*A+R,C+=M/67108864|0,R=M&67108863}V.words[O]=R|0,$=C|0}if($!==0)V.words[O]=$|0;else V.length--;return V.strip()}var S=function(J,U,V){var H=J.words,F=U.words,A=V.words,M=0,z,$,O,C=H[0]|0,R=C&8191,w=C>>>13,g=H[1]|0,h=g&8191,d=g>>>13,K0=H[2]|0,i=K0&8191,m=K0>>>13,G0=H[3]|0,o=G0&8191,Q0=G0>>>13,f0=H[4]|0,f=f0&8191,u=f0>>>13,Z0=H[5]|0,t=Z0&8191,a=Z0>>>13,R0=H[6]|0,b=R0&8191,n=R0>>>13,g0=H[7]|0,r=g0&8191,W0=g0>>>13,m0=H[8]|0,D0=m0&8191,q0=m0>>>13,kQ=H[9]|0,O0=kQ&8191,I0=kQ>>>13,yQ=F[0]|0,E0=yQ&8191,L0=yQ>>>13,OX=F[1]|0,P0=OX&8191,k0=OX>>>13,AX=F[2]|0,w0=AX&8191,B0=AX>>>13,GX=F[3]|0,v0=GX&8191,S0=GX>>>13,eQ=F[4]|0,_0=eQ&8191,x0=eQ>>>13,QX=F[5]|0,C0=QX&8191,y=QX>>>13,l=F[6]|0,s=l&8191,J0=l>>>13,b0=F[7]|0,A0=b0&8191,M0=b0>>>13,wQ=F[8]|0,j0=wQ&8191,y0=wQ>>>13,$X=F[9]|0,N0=$X&8191,T0=$X>>>13;V.negative=J.negative^U.negative,V.length=19,z=Math.imul(R,E0),$=Math.imul(R,L0),$=$+Math.imul(w,E0)|0,O=Math.imul(w,L0);var vQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(vQ>>>26)|0,vQ&=67108863,z=Math.imul(h,E0),$=Math.imul(h,L0),$=$+Math.imul(d,E0)|0,O=Math.imul(d,L0),z=z+Math.imul(R,P0)|0,$=$+Math.imul(R,k0)|0,$=$+Math.imul(w,P0)|0,O=O+Math.imul(w,k0)|0;var s0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(s0>>>26)|0,s0&=67108863,z=Math.imul(i,E0),$=Math.imul(i,L0),$=$+Math.imul(m,E0)|0,O=Math.imul(m,L0),z=z+Math.imul(h,P0)|0,$=$+Math.imul(h,k0)|0,$=$+Math.imul(d,P0)|0,O=O+Math.imul(d,k0)|0,z=z+Math.imul(R,w0)|0,$=$+Math.imul(R,B0)|0,$=$+Math.imul(w,w0)|0,O=O+Math.imul(w,B0)|0;var r0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(r0>>>26)|0,r0&=67108863,z=Math.imul(o,E0),$=Math.imul(o,L0),$=$+Math.imul(Q0,E0)|0,O=Math.imul(Q0,L0),z=z+Math.imul(i,P0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(m,P0)|0,O=O+Math.imul(m,k0)|0,z=z+Math.imul(h,w0)|0,$=$+Math.imul(h,B0)|0,$=$+Math.imul(d,w0)|0,O=O+Math.imul(d,B0)|0,z=z+Math.imul(R,v0)|0,$=$+Math.imul(R,S0)|0,$=$+Math.imul(w,v0)|0,O=O+Math.imul(w,S0)|0;var OQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(OQ>>>26)|0,OQ&=67108863,z=Math.imul(f,E0),$=Math.imul(f,L0),$=$+Math.imul(u,E0)|0,O=Math.imul(u,L0),z=z+Math.imul(o,P0)|0,$=$+Math.imul(o,k0)|0,$=$+Math.imul(Q0,P0)|0,O=O+Math.imul(Q0,k0)|0,z=z+Math.imul(i,w0)|0,$=$+Math.imul(i,B0)|0,$=$+Math.imul(m,w0)|0,O=O+Math.imul(m,B0)|0,z=z+Math.imul(h,v0)|0,$=$+Math.imul(h,S0)|0,$=$+Math.imul(d,v0)|0,O=O+Math.imul(d,S0)|0,z=z+Math.imul(R,_0)|0,$=$+Math.imul(R,x0)|0,$=$+Math.imul(w,_0)|0,O=O+Math.imul(w,x0)|0;var FQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(FQ>>>26)|0,FQ&=67108863,z=Math.imul(t,E0),$=Math.imul(t,L0),$=$+Math.imul(a,E0)|0,O=Math.imul(a,L0),z=z+Math.imul(f,P0)|0,$=$+Math.imul(f,k0)|0,$=$+Math.imul(u,P0)|0,O=O+Math.imul(u,k0)|0,z=z+Math.imul(o,w0)|0,$=$+Math.imul(o,B0)|0,$=$+Math.imul(Q0,w0)|0,O=O+Math.imul(Q0,B0)|0,z=z+Math.imul(i,v0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(m,v0)|0,O=O+Math.imul(m,S0)|0,z=z+Math.imul(h,_0)|0,$=$+Math.imul(h,x0)|0,$=$+Math.imul(d,_0)|0,O=O+Math.imul(d,x0)|0,z=z+Math.imul(R,C0)|0,$=$+Math.imul(R,y)|0,$=$+Math.imul(w,C0)|0,O=O+Math.imul(w,y)|0;var hQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(hQ>>>26)|0,hQ&=67108863,z=Math.imul(b,E0),$=Math.imul(b,L0),$=$+Math.imul(n,E0)|0,O=Math.imul(n,L0),z=z+Math.imul(t,P0)|0,$=$+Math.imul(t,k0)|0,$=$+Math.imul(a,P0)|0,O=O+Math.imul(a,k0)|0,z=z+Math.imul(f,w0)|0,$=$+Math.imul(f,B0)|0,$=$+Math.imul(u,w0)|0,O=O+Math.imul(u,B0)|0,z=z+Math.imul(o,v0)|0,$=$+Math.imul(o,S0)|0,$=$+Math.imul(Q0,v0)|0,O=O+Math.imul(Q0,S0)|0,z=z+Math.imul(i,_0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(m,_0)|0,O=O+Math.imul(m,x0)|0,z=z+Math.imul(h,C0)|0,$=$+Math.imul(h,y)|0,$=$+Math.imul(d,C0)|0,O=O+Math.imul(d,y)|0,z=z+Math.imul(R,s)|0,$=$+Math.imul(R,J0)|0,$=$+Math.imul(w,s)|0,O=O+Math.imul(w,J0)|0;var uQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(uQ>>>26)|0,uQ&=67108863,z=Math.imul(r,E0),$=Math.imul(r,L0),$=$+Math.imul(W0,E0)|0,O=Math.imul(W0,L0),z=z+Math.imul(b,P0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(n,P0)|0,O=O+Math.imul(n,k0)|0,z=z+Math.imul(t,w0)|0,$=$+Math.imul(t,B0)|0,$=$+Math.imul(a,w0)|0,O=O+Math.imul(a,B0)|0,z=z+Math.imul(f,v0)|0,$=$+Math.imul(f,S0)|0,$=$+Math.imul(u,v0)|0,O=O+Math.imul(u,S0)|0,z=z+Math.imul(o,_0)|0,$=$+Math.imul(o,x0)|0,$=$+Math.imul(Q0,_0)|0,O=O+Math.imul(Q0,x0)|0,z=z+Math.imul(i,C0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(m,C0)|0,O=O+Math.imul(m,y)|0,z=z+Math.imul(h,s)|0,$=$+Math.imul(h,J0)|0,$=$+Math.imul(d,s)|0,O=O+Math.imul(d,J0)|0,z=z+Math.imul(R,A0)|0,$=$+Math.imul(R,M0)|0,$=$+Math.imul(w,A0)|0,O=O+Math.imul(w,M0)|0;var pQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(pQ>>>26)|0,pQ&=67108863,z=Math.imul(D0,E0),$=Math.imul(D0,L0),$=$+Math.imul(q0,E0)|0,O=Math.imul(q0,L0),z=z+Math.imul(r,P0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(W0,P0)|0,O=O+Math.imul(W0,k0)|0,z=z+Math.imul(b,w0)|0,$=$+Math.imul(b,B0)|0,$=$+Math.imul(n,w0)|0,O=O+Math.imul(n,B0)|0,z=z+Math.imul(t,v0)|0,$=$+Math.imul(t,S0)|0,$=$+Math.imul(a,v0)|0,O=O+Math.imul(a,S0)|0,z=z+Math.imul(f,_0)|0,$=$+Math.imul(f,x0)|0,$=$+Math.imul(u,_0)|0,O=O+Math.imul(u,x0)|0,z=z+Math.imul(o,C0)|0,$=$+Math.imul(o,y)|0,$=$+Math.imul(Q0,C0)|0,O=O+Math.imul(Q0,y)|0,z=z+Math.imul(i,s)|0,$=$+Math.imul(i,J0)|0,$=$+Math.imul(m,s)|0,O=O+Math.imul(m,J0)|0,z=z+Math.imul(h,A0)|0,$=$+Math.imul(h,M0)|0,$=$+Math.imul(d,A0)|0,O=O+Math.imul(d,M0)|0,z=z+Math.imul(R,j0)|0,$=$+Math.imul(R,y0)|0,$=$+Math.imul(w,j0)|0,O=O+Math.imul(w,y0)|0;var cQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(cQ>>>26)|0,cQ&=67108863,z=Math.imul(O0,E0),$=Math.imul(O0,L0),$=$+Math.imul(I0,E0)|0,O=Math.imul(I0,L0),z=z+Math.imul(D0,P0)|0,$=$+Math.imul(D0,k0)|0,$=$+Math.imul(q0,P0)|0,O=O+Math.imul(q0,k0)|0,z=z+Math.imul(r,w0)|0,$=$+Math.imul(r,B0)|0,$=$+Math.imul(W0,w0)|0,O=O+Math.imul(W0,B0)|0,z=z+Math.imul(b,v0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(n,v0)|0,O=O+Math.imul(n,S0)|0,z=z+Math.imul(t,_0)|0,$=$+Math.imul(t,x0)|0,$=$+Math.imul(a,_0)|0,O=O+Math.imul(a,x0)|0,z=z+Math.imul(f,C0)|0,$=$+Math.imul(f,y)|0,$=$+Math.imul(u,C0)|0,O=O+Math.imul(u,y)|0,z=z+Math.imul(o,s)|0,$=$+Math.imul(o,J0)|0,$=$+Math.imul(Q0,s)|0,O=O+Math.imul(Q0,J0)|0,z=z+Math.imul(i,A0)|0,$=$+Math.imul(i,M0)|0,$=$+Math.imul(m,A0)|0,O=O+Math.imul(m,M0)|0,z=z+Math.imul(h,j0)|0,$=$+Math.imul(h,y0)|0,$=$+Math.imul(d,j0)|0,O=O+Math.imul(d,y0)|0,z=z+Math.imul(R,N0)|0,$=$+Math.imul(R,T0)|0,$=$+Math.imul(w,N0)|0,O=O+Math.imul(w,T0)|0;var lQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(lQ>>>26)|0,lQ&=67108863,z=Math.imul(O0,P0),$=Math.imul(O0,k0),$=$+Math.imul(I0,P0)|0,O=Math.imul(I0,k0),z=z+Math.imul(D0,w0)|0,$=$+Math.imul(D0,B0)|0,$=$+Math.imul(q0,w0)|0,O=O+Math.imul(q0,B0)|0,z=z+Math.imul(r,v0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(W0,v0)|0,O=O+Math.imul(W0,S0)|0,z=z+Math.imul(b,_0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(n,_0)|0,O=O+Math.imul(n,x0)|0,z=z+Math.imul(t,C0)|0,$=$+Math.imul(t,y)|0,$=$+Math.imul(a,C0)|0,O=O+Math.imul(a,y)|0,z=z+Math.imul(f,s)|0,$=$+Math.imul(f,J0)|0,$=$+Math.imul(u,s)|0,O=O+Math.imul(u,J0)|0,z=z+Math.imul(o,A0)|0,$=$+Math.imul(o,M0)|0,$=$+Math.imul(Q0,A0)|0,O=O+Math.imul(Q0,M0)|0,z=z+Math.imul(i,j0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(m,j0)|0,O=O+Math.imul(m,y0)|0,z=z+Math.imul(h,N0)|0,$=$+Math.imul(h,T0)|0,$=$+Math.imul(d,N0)|0,O=O+Math.imul(d,T0)|0;var mQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(mQ>>>26)|0,mQ&=67108863,z=Math.imul(O0,w0),$=Math.imul(O0,B0),$=$+Math.imul(I0,w0)|0,O=Math.imul(I0,B0),z=z+Math.imul(D0,v0)|0,$=$+Math.imul(D0,S0)|0,$=$+Math.imul(q0,v0)|0,O=O+Math.imul(q0,S0)|0,z=z+Math.imul(r,_0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(W0,_0)|0,O=O+Math.imul(W0,x0)|0,z=z+Math.imul(b,C0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(n,C0)|0,O=O+Math.imul(n,y)|0,z=z+Math.imul(t,s)|0,$=$+Math.imul(t,J0)|0,$=$+Math.imul(a,s)|0,O=O+Math.imul(a,J0)|0,z=z+Math.imul(f,A0)|0,$=$+Math.imul(f,M0)|0,$=$+Math.imul(u,A0)|0,O=O+Math.imul(u,M0)|0,z=z+Math.imul(o,j0)|0,$=$+Math.imul(o,y0)|0,$=$+Math.imul(Q0,j0)|0,O=O+Math.imul(Q0,y0)|0,z=z+Math.imul(i,N0)|0,$=$+Math.imul(i,T0)|0,$=$+Math.imul(m,N0)|0,O=O+Math.imul(m,T0)|0;var dQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(dQ>>>26)|0,dQ&=67108863,z=Math.imul(O0,v0),$=Math.imul(O0,S0),$=$+Math.imul(I0,v0)|0,O=Math.imul(I0,S0),z=z+Math.imul(D0,_0)|0,$=$+Math.imul(D0,x0)|0,$=$+Math.imul(q0,_0)|0,O=O+Math.imul(q0,x0)|0,z=z+Math.imul(r,C0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(W0,C0)|0,O=O+Math.imul(W0,y)|0,z=z+Math.imul(b,s)|0,$=$+Math.imul(b,J0)|0,$=$+Math.imul(n,s)|0,O=O+Math.imul(n,J0)|0,z=z+Math.imul(t,A0)|0,$=$+Math.imul(t,M0)|0,$=$+Math.imul(a,A0)|0,O=O+Math.imul(a,M0)|0,z=z+Math.imul(f,j0)|0,$=$+Math.imul(f,y0)|0,$=$+Math.imul(u,j0)|0,O=O+Math.imul(u,y0)|0,z=z+Math.imul(o,N0)|0,$=$+Math.imul(o,T0)|0,$=$+Math.imul(Q0,N0)|0,O=O+Math.imul(Q0,T0)|0;var nQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(nQ>>>26)|0,nQ&=67108863,z=Math.imul(O0,_0),$=Math.imul(O0,x0),$=$+Math.imul(I0,_0)|0,O=Math.imul(I0,x0),z=z+Math.imul(D0,C0)|0,$=$+Math.imul(D0,y)|0,$=$+Math.imul(q0,C0)|0,O=O+Math.imul(q0,y)|0,z=z+Math.imul(r,s)|0,$=$+Math.imul(r,J0)|0,$=$+Math.imul(W0,s)|0,O=O+Math.imul(W0,J0)|0,z=z+Math.imul(b,A0)|0,$=$+Math.imul(b,M0)|0,$=$+Math.imul(n,A0)|0,O=O+Math.imul(n,M0)|0,z=z+Math.imul(t,j0)|0,$=$+Math.imul(t,y0)|0,$=$+Math.imul(a,j0)|0,O=O+Math.imul(a,y0)|0,z=z+Math.imul(f,N0)|0,$=$+Math.imul(f,T0)|0,$=$+Math.imul(u,N0)|0,O=O+Math.imul(u,T0)|0;var oQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(oQ>>>26)|0,oQ&=67108863,z=Math.imul(O0,C0),$=Math.imul(O0,y),$=$+Math.imul(I0,C0)|0,O=Math.imul(I0,y),z=z+Math.imul(D0,s)|0,$=$+Math.imul(D0,J0)|0,$=$+Math.imul(q0,s)|0,O=O+Math.imul(q0,J0)|0,z=z+Math.imul(r,A0)|0,$=$+Math.imul(r,M0)|0,$=$+Math.imul(W0,A0)|0,O=O+Math.imul(W0,M0)|0,z=z+Math.imul(b,j0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(n,j0)|0,O=O+Math.imul(n,y0)|0,z=z+Math.imul(t,N0)|0,$=$+Math.imul(t,T0)|0,$=$+Math.imul(a,N0)|0,O=O+Math.imul(a,T0)|0;var rQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(rQ>>>26)|0,rQ&=67108863,z=Math.imul(O0,s),$=Math.imul(O0,J0),$=$+Math.imul(I0,s)|0,O=Math.imul(I0,J0),z=z+Math.imul(D0,A0)|0,$=$+Math.imul(D0,M0)|0,$=$+Math.imul(q0,A0)|0,O=O+Math.imul(q0,M0)|0,z=z+Math.imul(r,j0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(W0,j0)|0,O=O+Math.imul(W0,y0)|0,z=z+Math.imul(b,N0)|0,$=$+Math.imul(b,T0)|0,$=$+Math.imul(n,N0)|0,O=O+Math.imul(n,T0)|0;var iQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(iQ>>>26)|0,iQ&=67108863,z=Math.imul(O0,A0),$=Math.imul(O0,M0),$=$+Math.imul(I0,A0)|0,O=Math.imul(I0,M0),z=z+Math.imul(D0,j0)|0,$=$+Math.imul(D0,y0)|0,$=$+Math.imul(q0,j0)|0,O=O+Math.imul(q0,y0)|0,z=z+Math.imul(r,N0)|0,$=$+Math.imul(r,T0)|0,$=$+Math.imul(W0,N0)|0,O=O+Math.imul(W0,T0)|0;var tQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(tQ>>>26)|0,tQ&=67108863,z=Math.imul(O0,j0),$=Math.imul(O0,y0),$=$+Math.imul(I0,j0)|0,O=Math.imul(I0,y0),z=z+Math.imul(D0,N0)|0,$=$+Math.imul(D0,T0)|0,$=$+Math.imul(q0,N0)|0,O=O+Math.imul(q0,T0)|0;var sQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(sQ>>>26)|0,sQ&=67108863,z=Math.imul(O0,N0),$=Math.imul(O0,T0),$=$+Math.imul(I0,N0)|0,O=Math.imul(I0,T0);var aQ=(M+z|0)+(($&8191)<<13)|0;if(M=(O+($>>>13)|0)+(aQ>>>26)|0,aQ&=67108863,A[0]=vQ,A[1]=s0,A[2]=r0,A[3]=OQ,A[4]=FQ,A[5]=hQ,A[6]=uQ,A[7]=pQ,A[8]=cQ,A[9]=lQ,A[10]=mQ,A[11]=dQ,A[12]=nQ,A[13]=oQ,A[14]=rQ,A[15]=iQ,A[16]=tQ,A[17]=sQ,A[18]=aQ,M!==0)A[19]=M,V.length++;return V};if(!Math.imul)S=j;function N(J,U,V){V.negative=U.negative^J.negative,V.length=J.length+U.length;var H=0,F=0;for(var A=0;A<V.length-1;A++){var M=F;F=0;var z=H&67108863,$=Math.min(A,U.length-1);for(var O=Math.max(0,A-J.length+1);O<=$;O++){var C=A-O,R=J.words[C]|0,w=U.words[O]|0,g=R*w,h=g&67108863;M=M+(g/67108864|0)|0,h=h+z|0,z=h&67108863,M=M+(h>>>26)|0,F+=M>>>26,M&=67108863}V.words[A]=z,H=M,M=F}if(H!==0)V.words[A]=H;else V.length--;return V.strip()}function k(J,U,V){var H=new v;return H.mulp(J,U,V)}Z.prototype.mulTo=function(J,U){var V,H=this.length+J.length;if(this.length===10&&J.length===10)V=S(this,J,U);else if(H<63)V=j(this,J,U);else if(H<1024)V=N(this,J,U);else V=k(this,J,U);return V};function v(J,U){this.x=J,this.y=U}v.prototype.makeRBT=function(J){var U=Array(J),V=Z.prototype._countBits(J)-1;for(var H=0;H<J;H++)U[H]=this.revBin(H,V,J);return U},v.prototype.revBin=function(J,U,V){if(J===0||J===V-1)return J;var H=0;for(var F=0;F<U;F++)H|=(J&1)<<U-F-1,J>>=1;return H},v.prototype.permute=function(J,U,V,H,F,A){for(var M=0;M<A;M++)H[M]=U[J[M]],F[M]=V[J[M]]},v.prototype.transform=function(J,U,V,H,F,A){this.permute(A,J,U,V,H,F);for(var M=1;M<F;M<<=1){var z=M<<1,$=Math.cos(2*Math.PI/z),O=Math.sin(2*Math.PI/z);for(var C=0;C<F;C+=z){var R=$,w=O;for(var g=0;g<M;g++){var h=V[C+g],d=H[C+g],K0=V[C+g+M],i=H[C+g+M],m=R*K0-w*i;if(i=R*i+w*K0,K0=m,V[C+g]=h+K0,H[C+g]=d+i,V[C+g+M]=h-K0,H[C+g+M]=d-i,g!==z)m=$*R-O*w,w=$*w+O*R,R=m}}}},v.prototype.guessLen13b=function(J,U){var V=Math.max(U,J)|1,H=V&1,F=0;for(V=V/2|0;V;V=V>>>1)F++;return 1<<F+1+H},v.prototype.conjugate=function(J,U,V){if(V<=1)return;for(var H=0;H<V/2;H++){var F=J[H];J[H]=J[V-H-1],J[V-H-1]=F,F=U[H],U[H]=-U[V-H-1],U[V-H-1]=-F}},v.prototype.normalize13b=function(J,U){var V=0;for(var H=0;H<U/2;H++){var F=Math.round(J[2*H+1]/U)*8192+Math.round(J[2*H]/U)+V;if(J[H]=F&67108863,F<67108864)V=0;else V=F/67108864|0}return J},v.prototype.convert13b=function(J,U,V,H){var F=0;for(var A=0;A<U;A++)F=F+(J[A]|0),V[2*A]=F&8191,F=F>>>13,V[2*A+1]=F&8191,F=F>>>13;for(A=2*U;A<H;++A)V[A]=0;G(F===0),G((F&-8192)===0)},v.prototype.stub=function(J){var U=Array(J);for(var V=0;V<J;V++)U[V]=0;return U},v.prototype.mulp=function(J,U,V){var H=2*this.guessLen13b(J.length,U.length),F=this.makeRBT(H),A=this.stub(H),M=Array(H),z=Array(H),$=Array(H),O=Array(H),C=Array(H),R=Array(H),w=V.words;w.length=H,this.convert13b(J.words,J.length,M,H),this.convert13b(U.words,U.length,O,H),this.transform(M,A,z,$,H,F),this.transform(O,A,C,R,H,F);for(var g=0;g<H;g++){var h=z[g]*C[g]-$[g]*R[g];$[g]=z[g]*R[g]+$[g]*C[g],z[g]=h}return this.conjugate(z,$,H),this.transform(z,$,w,A,H,F),this.conjugate(w,A,H),this.normalize13b(w,H),V.negative=J.negative^U.negative,V.length=J.length+U.length,V.strip()},Z.prototype.mul=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),this.mulTo(J,U)},Z.prototype.mulf=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),k(this,J,U)},Z.prototype.imul=function(J){return this.clone().mulTo(J,this)},Z.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var U=0;for(var V=0;V<this.length;V++){var H=(this.words[V]|0)*J,F=(H&67108863)+(U&67108863);U>>=26,U+=H/67108864|0,U+=F>>>26,this.words[V]=F&67108863}if(U!==0)this.words[V]=U,this.length++;return this.length=J===0?1:this.length,this},Z.prototype.muln=function(J){return this.clone().imuln(J)},Z.prototype.sqr=function(){return this.mul(this)},Z.prototype.isqr=function(){return this.imul(this.clone())},Z.prototype.pow=function(J){var U=B(J);if(U.length===0)return new Z(1);var V=this;for(var H=0;H<U.length;H++,V=V.sqr())if(U[H]!==0)break;if(++H<U.length)for(var F=V.sqr();H<U.length;H++,F=F.sqr()){if(U[H]===0)continue;V=V.mul(F)}return V},Z.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=67108863>>>26-U<<26-U,F;if(U!==0){var A=0;for(F=0;F<this.length;F++){var M=this.words[F]&H,z=(this.words[F]|0)-M<<U;this.words[F]=z|A,A=M>>>26-U}if(A)this.words[F]=A,this.length++}if(V!==0){for(F=this.length-1;F>=0;F--)this.words[F+V]=this.words[F];for(F=0;F<V;F++)this.words[F]=0;this.length+=V}return this.strip()},Z.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Z.prototype.iushrn=function(J,U,V){G(typeof J==="number"&&J>=0);var H;if(U)H=(U-U%26)/26;else H=0;var F=J%26,A=Math.min((J-F)/26,this.length),M=67108863^67108863>>>F<<F,z=V;if(H-=A,H=Math.max(0,H),z){for(var $=0;$<A;$++)z.words[$]=this.words[$];z.length=A}if(A===0);else if(this.length>A){this.length-=A;for($=0;$<this.length;$++)this.words[$]=this.words[$+A]}else this.words[0]=0,this.length=1;var O=0;for($=this.length-1;$>=0&&(O!==0||$>=H);$--){var C=this.words[$]|0;this.words[$]=O<<26-F|C>>>F,O=C&M}if(z&&O!==0)z.words[z.length++]=O;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Z.prototype.ishrn=function(J,U,V){return G(this.negative===0),this.iushrn(J,U,V)},Z.prototype.shln=function(J){return this.clone().ishln(J)},Z.prototype.ushln=function(J){return this.clone().iushln(J)},Z.prototype.shrn=function(J){return this.clone().ishrn(J)},Z.prototype.ushrn=function(J){return this.clone().iushrn(J)},Z.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return!1;var F=this.words[V];return!!(F&H)},Z.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=V)return this;if(U!==0)V++;if(this.length=Math.min(V,this.length),U!==0){var H=67108863^67108863>>>U<<U;this.words[this.length-1]&=H}return this.strip()},Z.prototype.maskn=function(J){return this.clone().imaskn(J)},Z.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Z.prototype._iaddn=function(J){this.words[0]+=J;for(var U=0;U<this.length&&this.words[U]>=67108864;U++)if(this.words[U]-=67108864,U===this.length-1)this.words[U+1]=1;else this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},Z.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U<this.length&&this.words[U]<0;U++)this.words[U]+=67108864,this.words[U+1]-=1;return this.strip()},Z.prototype.addn=function(J){return this.clone().iaddn(J)},Z.prototype.subn=function(J){return this.clone().isubn(J)},Z.prototype.iabs=function(){return this.negative=0,this},Z.prototype.abs=function(){return this.clone().iabs()},Z.prototype._ishlnsubmul=function(J,U,V){var H=J.length+V,F;this._expand(H);var A,M=0;for(F=0;F<J.length;F++){A=(this.words[F+V]|0)+M;var z=(J.words[F]|0)*U;A-=z&67108863,M=(A>>26)-(z/67108864|0),this.words[F+V]=A&67108863}for(;F<this.length-V;F++)A=(this.words[F+V]|0)+M,M=A>>26,this.words[F+V]=A&67108863;if(M===0)return this.strip();G(M===-1),M=0;for(F=0;F<this.length;F++)A=-(this.words[F]|0)+M,M=A>>26,this.words[F]=A&67108863;return this.negative=1,this.strip()},Z.prototype._wordDiv=function(J,U){var V=this.length-J.length,H=this.clone(),F=J,A=F.words[F.length-1]|0,M=this._countBits(A);if(V=26-M,V!==0)F=F.ushln(V),H.iushln(V),A=F.words[F.length-1]|0;var z=H.length-F.length,$;if(U!=="mod"){$=new Z(null),$.length=z+1,$.words=Array($.length);for(var O=0;O<$.length;O++)$.words[O]=0}var C=H.clone()._ishlnsubmul(F,1,z);if(C.negative===0){if(H=C,$)$.words[z]=1}for(var R=z-1;R>=0;R--){var w=(H.words[F.length+R]|0)*67108864+(H.words[F.length+R-1]|0);w=Math.min(w/A|0,67108863),H._ishlnsubmul(F,w,R);while(H.negative!==0)if(w--,H.negative=0,H._ishlnsubmul(F,1,R),!H.isZero())H.negative^=1;if($)$.words[R]=w}if($)$.strip();if(H.strip(),U!=="div"&&V!==0)H.iushrn(V);return{div:$||null,mod:H}},Z.prototype.divmod=function(J,U,V){if(G(!J.isZero()),this.isZero())return{div:new Z(0),mod:new Z(0)};var H,F,A;if(this.negative!==0&&J.negative===0){if(A=this.neg().divmod(J,U),U!=="mod")H=A.div.neg();if(U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.iadd(J)}return{div:H,mod:F}}if(this.negative===0&&J.negative!==0){if(A=this.divmod(J.neg(),U),U!=="mod")H=A.div.neg();return{div:H,mod:A.mod}}if((this.negative&J.negative)!==0){if(A=this.neg().divmod(J.neg(),U),U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.isub(J)}return{div:A.div,mod:F}}if(J.length>this.length||this.cmp(J)<0)return{div:new Z(0),mod:this};if(J.length===1){if(U==="div")return{div:this.divn(J.words[0]),mod:null};if(U==="mod")return{div:null,mod:new Z(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Z(this.modn(J.words[0]))}}return this._wordDiv(J,U)},Z.prototype.div=function(J){return this.divmod(J,"div",!1).div},Z.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Z.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Z.prototype.divRound=function(J){var U=this.divmod(J);if(U.mod.isZero())return U.div;var V=U.div.negative!==0?U.mod.isub(J):U.mod,H=J.ushrn(1),F=J.andln(1),A=V.cmp(H);if(A<0||F===1&&A===0)return U.div;return U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},Z.prototype.modn=function(J){G(J<=67108863);var U=67108864%J,V=0;for(var H=this.length-1;H>=0;H--)V=(U*V+(this.words[H]|0))%J;return V},Z.prototype.idivn=function(J){G(J<=67108863);var U=0;for(var V=this.length-1;V>=0;V--){var H=(this.words[V]|0)+U*67108864;this.words[V]=H/J|0,U=H%J}return this.strip()},Z.prototype.divn=function(J){return this.clone().idivn(J)},Z.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=new Z(0),M=new Z(1),z=0;while(U.isEven()&&V.isEven())U.iushrn(1),V.iushrn(1),++z;var $=V.clone(),O=U.clone();while(!U.isZero()){for(var C=0,R=1;(U.words[0]&R)===0&&C<26;++C,R<<=1);if(C>0){U.iushrn(C);while(C-- >0){if(H.isOdd()||F.isOdd())H.iadd($),F.isub(O);H.iushrn(1),F.iushrn(1)}}for(var w=0,g=1;(V.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0){V.iushrn(w);while(w-- >0){if(A.isOdd()||M.isOdd())A.iadd($),M.isub(O);A.iushrn(1),M.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(A),F.isub(M);else V.isub(U),A.isub(H),M.isub(F)}return{a:A,b:M,gcd:V.iushln(z)}},Z.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=V.clone();while(U.cmpn(1)>0&&V.cmpn(1)>0){for(var M=0,z=1;(U.words[0]&z)===0&&M<26;++M,z<<=1);if(M>0){U.iushrn(M);while(M-- >0){if(H.isOdd())H.iadd(A);H.iushrn(1)}}for(var $=0,O=1;(V.words[0]&O)===0&&$<26;++$,O<<=1);if($>0){V.iushrn($);while($-- >0){if(F.isOdd())F.iadd(A);F.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(F);else V.isub(U),F.isub(H)}var C;if(U.cmpn(1)===0)C=H;else C=F;if(C.cmpn(0)<0)C.iadd(J);return C},Z.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var U=this.clone(),V=J.clone();U.negative=0,V.negative=0;for(var H=0;U.isEven()&&V.isEven();H++)U.iushrn(1),V.iushrn(1);do{while(U.isEven())U.iushrn(1);while(V.isEven())V.iushrn(1);var F=U.cmp(V);if(F<0){var A=U;U=V,V=A}else if(F===0||V.cmpn(1)===0)break;U.isub(V)}while(!0);return V.iushln(H)},Z.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Z.prototype.isEven=function(){return(this.words[0]&1)===0},Z.prototype.isOdd=function(){return(this.words[0]&1)===1},Z.prototype.andln=function(J){return this.words[0]&J},Z.prototype.bincn=function(J){G(typeof J==="number");var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return this._expand(V+1),this.words[V]|=H,this;var F=H;for(var A=V;F!==0&&A<this.length;A++){var M=this.words[A]|0;M+=F,F=M>>>26,M&=67108863,this.words[A]=M}if(F!==0)this.words[A]=F,this.length++;return this},Z.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Z.prototype.cmpn=function(J){var U=J<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var V;if(this.length>1)V=1;else{if(U)J=-J;G(J<=67108863,"Number is too big");var H=this.words[0]|0;V=H===J?0:H<J?-1:1}if(this.negative!==0)return-V|0;return V},Z.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var U=this.ucmp(J);if(this.negative!==0)return-U|0;return U},Z.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var U=0;for(var V=this.length-1;V>=0;V--){var H=this.words[V]|0,F=J.words[V]|0;if(H===F)continue;if(H<F)U=-1;else if(H>F)U=1;break}return U},Z.prototype.gtn=function(J){return this.cmpn(J)===1},Z.prototype.gt=function(J){return this.cmp(J)===1},Z.prototype.gten=function(J){return this.cmpn(J)>=0},Z.prototype.gte=function(J){return this.cmp(J)>=0},Z.prototype.ltn=function(J){return this.cmpn(J)===-1},Z.prototype.lt=function(J){return this.cmp(J)===-1},Z.prototype.lten=function(J){return this.cmpn(J)<=0},Z.prototype.lte=function(J){return this.cmp(J)<=0},Z.prototype.eqn=function(J){return this.cmpn(J)===0},Z.prototype.eq=function(J){return this.cmp(J)===0},Z.red=function(J){return new p(J)},Z.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Z.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Z.prototype._forceRed=function(J){return this.red=J,this},Z.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Z.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Z.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Z.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Z.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Z.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Z.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Z.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Z.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Z.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Z.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Z.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Z.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Z.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var _={k256:null,p224:null,p192:null,p25519:null};function x(J,U){this.name=J,this.p=new Z(U,16),this.n=this.p.bitLength(),this.k=new Z(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}x.prototype._tmp=function(){var J=new Z(null);return J.words=Array(Math.ceil(this.n/13)),J},x.prototype.ireduce=function(J){var U=J,V;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),V=U.bitLength();while(V>this.n);var H=V<this.n?-1:U.ucmp(this.p);if(H===0)U.words[0]=0,U.length=1;else if(H>0)U.isub(this.p);else if(U.strip!==void 0)U.strip();else U._strip();return U},x.prototype.split=function(J,U){J.iushrn(this.n,0,U)},x.prototype.imulK=function(J){return J.imul(this.k)};function c(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(c,x),c.prototype.split=function(J,U){var V=4194303,H=Math.min(J.length,9);for(var F=0;F<H;F++)U.words[F]=J.words[F];if(U.length=H,J.length<=9){J.words[0]=0,J.length=1;return}var A=J.words[9];U.words[U.length++]=A&V;for(F=10;F<J.length;F++){var M=J.words[F]|0;J.words[F-10]=(M&V)<<4|A>>>22,A=M}if(A>>>=22,J.words[F-10]=A,A===0&&J.length>10)J.length-=10;else J.length-=9},c.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var U=0;for(var V=0;V<J.length;V++){var H=J.words[V]|0;U+=H*977,J.words[V]=U&67108863,U=H*64+(U/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function Y0(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(Y0,x);function $0(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K($0,x);function e(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(e,x),e.prototype.imulK=function(J){var U=0;for(var V=0;V<J.length;V++){var H=(J.words[V]|0)*19+U,F=H&67108863;H>>>=26,J.words[V]=F,U=H}if(U!==0)J.words[J.length++]=U;return J},Z._prime=function(J){if(_[J])return _[J];var U;if(J==="k256")U=new c;else if(J==="p224")U=new Y0;else if(J==="p192")U=new $0;else if(J==="p25519")U=new e;else throw Error("Unknown prime "+J);return _[J]=U,U};function p(J){if(typeof J==="string"){var U=Z._prime(J);this.m=U.p,this.prime=U}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}p.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},p.prototype._verify2=function(J,U){G((J.negative|U.negative)===0,"red works only with positives"),G(J.red&&J.red===U.red,"red works only with red numbers")},p.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},p.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},p.prototype.add=function(J,U){this._verify2(J,U);var V=J.add(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V._forceRed(this)},p.prototype.iadd=function(J,U){this._verify2(J,U);var V=J.iadd(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V},p.prototype.sub=function(J,U){this._verify2(J,U);var V=J.sub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V._forceRed(this)},p.prototype.isub=function(J,U){this._verify2(J,U);var V=J.isub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V},p.prototype.shl=function(J,U){return this._verify1(J),this.imod(J.ushln(U))},p.prototype.imul=function(J,U){return this._verify2(J,U),this.imod(J.imul(U))},p.prototype.mul=function(J,U){return this._verify2(J,U),this.imod(J.mul(U))},p.prototype.isqr=function(J){return this.imul(J,J.clone())},p.prototype.sqr=function(J){return this.mul(J,J)},p.prototype.sqrt=function(J){if(J.isZero())return J.clone();var U=this.m.andln(3);if(G(U%2===1),U===3){var V=this.m.add(new Z(1)).iushrn(2);return this.pow(J,V)}var H=this.m.subn(1),F=0;while(!H.isZero()&&H.andln(1)===0)F++,H.iushrn(1);G(!H.isZero());var A=new Z(1).toRed(this),M=A.redNeg(),z=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Z(2*$*$).toRed(this);while(this.pow($,z).cmp(M)!==0)$.redIAdd(M);var O=this.pow($,H),C=this.pow(J,H.addn(1).iushrn(1)),R=this.pow(J,H),w=F;while(R.cmp(A)!==0){var g=R;for(var h=0;g.cmp(A)!==0;h++)g=g.redSqr();G(h<w);var d=this.pow(O,new Z(1).iushln(w-h-1));C=C.redMul(d),O=d.redSqr(),R=R.redMul(O),w=h}return C},p.prototype.invm=function(J){var U=J._invmp(this.m);if(U.negative!==0)return U.negative=0,this.imod(U).redNeg();else return this.imod(U)},p.prototype.pow=function(J,U){if(U.isZero())return new Z(1).toRed(this);if(U.cmpn(1)===0)return J.clone();var V=4,H=Array(1<<V);H[0]=new Z(1).toRed(this),H[1]=J;for(var F=2;F<H.length;F++)H[F]=this.mul(H[F-1],J);var A=H[0],M=0,z=0,$=U.bitLength()%26;if($===0)$=26;for(F=U.length-1;F>=0;F--){var O=U.words[F];for(var C=$-1;C>=0;C--){var R=O>>C&1;if(A!==H[0])A=this.sqr(A);if(R===0&&M===0){z=0;continue}if(M<<=1,M|=R,z++,z!==V&&(F!==0||C!==0))continue;A=this.mul(A,H[M]),z=0,M=0}$=26}return A},p.prototype.convertTo=function(J){var U=J.umod(this.m);return U===J?U.clone():U},p.prototype.convertFrom=function(J){var U=J.clone();return U.red=null,U},Z.mont=function(J){return new X0(J)};function X0(J){if(p.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Z(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(X0,p),X0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},X0.prototype.convertFrom=function(J){var U=this.imod(J.mul(this.rinv));return U.red=null,U},X0.prototype.imul=function(J,U){if(J.isZero()||U.isZero())return J.words[0]=0,J.length=1,J;var V=J.imul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.mul=function(J,U){if(J.isZero()||U.isZero())return new Z(0)._forceRed(this);var V=J.mul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.invm=function(J){var U=this.imod(J._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(typeof X>"u"||X,Q)}),OP=H0((Q,X)=>{var Y=VP(),W=zP();X.exports=function(q){return new K(q)};var G={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};G.p224=G.secp224r1,G.p256=G.secp256r1=G.prime256v1,G.p192=G.secp192r1=G.prime192v1,G.p384=G.secp384r1,G.p521=G.secp521r1;function K(q){if(this.curveType=G[q],!this.curveType)this.curveType={name:q};this.curve=new Y.ec(this.curveType.name),this.keys=void 0}K.prototype.generateKeys=function(q,E){return this.keys=this.curve.genKeyPair(),this.getPublicKey(q,E)},K.prototype.computeSecret=function(q,E,I){if(E=E||"utf8",!Buffer.isBuffer(q))q=new Buffer(q,E);var L=this.curve.keyFromPublic(q).getPublic(),D=L.mul(this.keys.getPrivate()).getX();return Z(D,I,this.curveType.byteLength)},K.prototype.getPublicKey=function(q,E){var I=this.keys.getPublic(E==="compressed",!0);if(E==="hybrid")if(I[I.length-1]%2)I[0]=7;else I[0]=6;return Z(I,q)},K.prototype.getPrivateKey=function(q){return Z(this.keys.getPrivate(),q)},K.prototype.setPublicKey=function(q,E){if(E=E||"utf8",!Buffer.isBuffer(q))q=new Buffer(q,E);return this.keys._importPublic(q),this},K.prototype.setPrivateKey=function(q,E){if(E=E||"utf8",!Buffer.isBuffer(q))q=new Buffer(q,E);var I=new W(q);return I=I.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(I),this};function Z(q,E,I){if(!Array.isArray(q))q=q.toArray();var L=new Buffer(q);if(I&&L.length<I){var D=new Buffer(I-L.length);D.fill(0),L=Buffer.concat([D,L])}if(!E)return L;else return L.toString(E)}}),AP=H0((Q,X)=>{var Y=(EX(),WQ(uX)).createECDH;X.exports=Y||OP()}),DP=H0((Q,X)=>{(function(Y,W){function G(J,U){if(!J)throw Error(U||"Assertion failed")}function K(J,U){J.super_=U;var V=function(){};V.prototype=U.prototype,J.prototype=new V,J.prototype.constructor=J}function Z(J,U,V){if(Z.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(U==="le"||U==="be")V=U,U=10;this._init(J||0,U||10,V||"be")}}if(typeof Y==="object")Y.exports=Z;else W.BN=Z;Z.BN=Z,Z.wordSize=26;var q;try{if(typeof window<"u"&&typeof window.Buffer<"u")q=window.Buffer;else q=(JX(),WQ(YX)).Buffer}catch(J){}Z.isBN=function(J){if(J instanceof Z)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Z.wordSize&&Array.isArray(J.words)},Z.max=function(J,U){if(J.cmp(U)>0)return J;return U},Z.min=function(J,U){if(J.cmp(U)<0)return J;return U},Z.prototype._init=function(J,U,V){if(typeof J==="number")return this._initNumber(J,U,V);if(typeof J==="object")return this._initArray(J,U,V);if(U==="hex")U=16;G(U===(U|0)&&U>=2&&U<=36),J=J.toString().replace(/\s+/g,"");var H=0;if(J[0]==="-")H++,this.negative=1;if(H<J.length){if(U===16)this._parseHex(J,H,V);else if(this._parseBase(J,U,H),V==="le")this._initArray(this.toArray(),U,V)}},Z.prototype._initNumber=function(J,U,V){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(V!=="le")return;this._initArray(this.toArray(),U,V)},Z.prototype._initArray=function(J,U,V){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F,A,M=0;if(V==="be"){for(H=J.length-1,F=0;H>=0;H-=3)if(A=J[H]|J[H-1]<<8|J[H-2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}else if(V==="le"){for(H=0,F=0;H<J.length;H+=3)if(A=J[H]|J[H+1]<<8|J[H+2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}return this.strip()};function E(J,U){var V=J.charCodeAt(U);if(V>=65&&V<=70)return V-55;else if(V>=97&&V<=102)return V-87;else return V-48&15}function I(J,U,V){var H=E(J,V);if(V-1>=U)H|=E(J,V-1)<<4;return H}Z.prototype._parseHex=function(J,U,V){this.length=Math.ceil((J.length-U)/6),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F=0,A=0,M;if(V==="be")for(H=J.length-1;H>=U;H-=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8;else{var z=J.length-U;for(H=z%2===0?U+1:U;H<J.length;H+=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8}this.strip()};function L(J,U,V,H){var F=0,A=Math.min(J.length,V);for(var M=U;M<A;M++){var z=J.charCodeAt(M)-48;if(F*=H,z>=49)F+=z-49+10;else if(z>=17)F+=z-17+10;else F+=z}return F}Z.prototype._parseBase=function(J,U,V){this.words=[0],this.length=1;for(var H=0,F=1;F<=67108863;F*=U)H++;H--,F=F/U|0;var A=J.length-V,M=A%H,z=Math.min(A,A-M)+V,$=0;for(var O=V;O<z;O+=H)if($=L(J,O,O+H,U),this.imuln(F),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(M!==0){var C=1;$=L(J,O,J.length,U);for(O=0;O<M;O++)C*=U;if(this.imuln(C),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Z.prototype.copy=function(J){J.words=Array(this.length);for(var U=0;U<this.length;U++)J.words[U]=this.words[U];J.length=this.length,J.negative=this.negative,J.red=this.red},Z.prototype.clone=function(){var J=new Z(null);return this.copy(J),J},Z.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Z.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Z.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Z.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var D=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],T=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Z.prototype.toString=function(J,U){J=J||10,U=U|0||1;var V;if(J===16||J==="hex"){V="";var H=0,F=0;for(var A=0;A<this.length;A++){var M=this.words[A],z=((M<<H|F)&16777215).toString(16);if(F=M>>>24-H&16777215,H+=2,H>=26)H-=26,A--;if(F!==0||A!==this.length-1)V=D[6-z.length]+z+V;else V=z+V}if(F!==0)V=F.toString(16)+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}if(J===(J|0)&&J>=2&&J<=36){var $=T[J],O=P[J];V="";var C=this.clone();C.negative=0;while(!C.isZero()){var R=C.modn(O).toString(J);if(C=C.idivn(O),!C.isZero())V=D[$-R.length]+R+V;else V=R+V}if(this.isZero())V="0"+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}G(!1,"Base should be between 2 and 36")},Z.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Z.prototype.toJSON=function(){return this.toString(16)},Z.prototype.toBuffer=function(J,U){return G(typeof q<"u"),this.toArrayLike(q,J,U)},Z.prototype.toArray=function(J,U){return this.toArrayLike(Array,J,U)},Z.prototype.toArrayLike=function(J,U,V){var H=this.byteLength(),F=V||Math.max(1,H);G(H<=F,"byte array longer than desired length"),G(F>0,"Requested array length <= 0"),this.strip();var A=U==="le",M=new J(F),z,$,O=this.clone();if(!A){for($=0;$<F-H;$++)M[$]=0;for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[F-$-1]=z}else{for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[$]=z;for(;$<F;$++)M[$]=0}return M},Math.clz32)Z.prototype._countBits=function(J){return 32-Math.clz32(J)};else Z.prototype._countBits=function(J){var U=J,V=0;if(U>=4096)V+=13,U>>>=13;if(U>=64)V+=7,U>>>=7;if(U>=8)V+=4,U>>>=4;if(U>=2)V+=2,U>>>=2;return V+U};Z.prototype._zeroBits=function(J){if(J===0)return 26;var U=J,V=0;if((U&8191)===0)V+=13,U>>>=13;if((U&127)===0)V+=7,U>>>=7;if((U&15)===0)V+=4,U>>>=4;if((U&3)===0)V+=2,U>>>=2;if((U&1)===0)V++;return V},Z.prototype.bitLength=function(){var J=this.words[this.length-1],U=this._countBits(J);return(this.length-1)*26+U};function B(J){var U=Array(J.bitLength());for(var V=0;V<U.length;V++){var H=V/26|0,F=V%26;U[V]=(J.words[H]&1<<F)>>>F}return U}Z.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var U=0;U<this.length;U++){var V=this._zeroBits(this.words[U]);if(J+=V,V!==26)break}return J},Z.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Z.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Z.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Z.prototype.isNeg=function(){return this.negative!==0},Z.prototype.neg=function(){return this.clone().ineg()},Z.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Z.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var U=0;U<J.length;U++)this.words[U]=this.words[U]|J.words[U];return this.strip()},Z.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Z.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Z.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Z.prototype.iuand=function(J){var U;if(this.length>J.length)U=J;else U=this;for(var V=0;V<U.length;V++)this.words[V]=this.words[V]&J.words[V];return this.length=U.length,this.strip()},Z.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Z.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Z.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Z.prototype.iuxor=function(J){var U,V;if(this.length>J.length)U=this,V=J;else U=J,V=this;for(var H=0;H<V.length;H++)this.words[H]=U.words[H]^V.words[H];if(this!==U)for(;H<U.length;H++)this.words[H]=U.words[H];return this.length=U.length,this.strip()},Z.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Z.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Z.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Z.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var U=Math.ceil(J/26)|0,V=J%26;if(this._expand(U),V>0)U--;for(var H=0;H<U;H++)this.words[H]=~this.words[H]&67108863;if(V>0)this.words[H]=~this.words[H]&67108863>>26-V;return this.strip()},Z.prototype.notn=function(J){return this.clone().inotn(J)},Z.prototype.setn=function(J,U){G(typeof J==="number"&&J>=0);var V=J/26|0,H=J%26;if(this._expand(V+1),U)this.words[V]=this.words[V]|1<<H;else this.words[V]=this.words[V]&~(1<<H);return this.strip()},Z.prototype.iadd=function(J){var U;if(this.negative!==0&&J.negative===0)return this.negative=0,U=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,U=this.isub(J),J.negative=1,U._normSign();var V,H;if(this.length>J.length)V=this,H=J;else V=J,H=this;var F=0;for(var A=0;A<H.length;A++)U=(V.words[A]|0)+(H.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;for(;F!==0&&A<V.length;A++)U=(V.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;if(this.length=V.length,F!==0)this.words[this.length]=F,this.length++;else if(V!==this)for(;A<V.length;A++)this.words[A]=V.words[A];return this},Z.prototype.add=function(J){var U;if(J.negative!==0&&this.negative===0)return J.negative=0,U=this.sub(J),J.negative^=1,U;else if(J.negative===0&&this.negative!==0)return this.negative=0,U=J.sub(this),this.negative=1,U;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Z.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var U=this.iadd(J);return J.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var V=this.cmp(J);if(V===0)return this.negative=0,this.length=1,this.words[0]=0,this;var H,F;if(V>0)H=this,F=J;else H=J,F=this;var A=0;for(var M=0;M<F.length;M++)U=(H.words[M]|0)-(F.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;for(;A!==0&&M<H.length;M++)U=(H.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;if(A===0&&M<H.length&&H!==this)for(;M<H.length;M++)this.words[M]=H.words[M];if(this.length=Math.max(this.length,M),H!==this)this.negative=1;return this.strip()},Z.prototype.sub=function(J){return this.clone().isub(J)};function j(J,U,V){V.negative=U.negative^J.negative;var H=J.length+U.length|0;V.length=H,H=H-1|0;var F=J.words[0]|0,A=U.words[0]|0,M=F*A,z=M&67108863,$=M/67108864|0;V.words[0]=z;for(var O=1;O<H;O++){var C=$>>>26,R=$&67108863,w=Math.min(O,U.length-1);for(var g=Math.max(0,O-J.length+1);g<=w;g++){var h=O-g|0;F=J.words[h]|0,A=U.words[g]|0,M=F*A+R,C+=M/67108864|0,R=M&67108863}V.words[O]=R|0,$=C|0}if($!==0)V.words[O]=$|0;else V.length--;return V.strip()}var S=function(J,U,V){var H=J.words,F=U.words,A=V.words,M=0,z,$,O,C=H[0]|0,R=C&8191,w=C>>>13,g=H[1]|0,h=g&8191,d=g>>>13,K0=H[2]|0,i=K0&8191,m=K0>>>13,G0=H[3]|0,o=G0&8191,Q0=G0>>>13,f0=H[4]|0,f=f0&8191,u=f0>>>13,Z0=H[5]|0,t=Z0&8191,a=Z0>>>13,R0=H[6]|0,b=R0&8191,n=R0>>>13,g0=H[7]|0,r=g0&8191,W0=g0>>>13,m0=H[8]|0,D0=m0&8191,q0=m0>>>13,kQ=H[9]|0,O0=kQ&8191,I0=kQ>>>13,yQ=F[0]|0,E0=yQ&8191,L0=yQ>>>13,OX=F[1]|0,P0=OX&8191,k0=OX>>>13,AX=F[2]|0,w0=AX&8191,B0=AX>>>13,GX=F[3]|0,v0=GX&8191,S0=GX>>>13,eQ=F[4]|0,_0=eQ&8191,x0=eQ>>>13,QX=F[5]|0,C0=QX&8191,y=QX>>>13,l=F[6]|0,s=l&8191,J0=l>>>13,b0=F[7]|0,A0=b0&8191,M0=b0>>>13,wQ=F[8]|0,j0=wQ&8191,y0=wQ>>>13,$X=F[9]|0,N0=$X&8191,T0=$X>>>13;V.negative=J.negative^U.negative,V.length=19,z=Math.imul(R,E0),$=Math.imul(R,L0),$=$+Math.imul(w,E0)|0,O=Math.imul(w,L0);var vQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(vQ>>>26)|0,vQ&=67108863,z=Math.imul(h,E0),$=Math.imul(h,L0),$=$+Math.imul(d,E0)|0,O=Math.imul(d,L0),z=z+Math.imul(R,P0)|0,$=$+Math.imul(R,k0)|0,$=$+Math.imul(w,P0)|0,O=O+Math.imul(w,k0)|0;var s0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(s0>>>26)|0,s0&=67108863,z=Math.imul(i,E0),$=Math.imul(i,L0),$=$+Math.imul(m,E0)|0,O=Math.imul(m,L0),z=z+Math.imul(h,P0)|0,$=$+Math.imul(h,k0)|0,$=$+Math.imul(d,P0)|0,O=O+Math.imul(d,k0)|0,z=z+Math.imul(R,w0)|0,$=$+Math.imul(R,B0)|0,$=$+Math.imul(w,w0)|0,O=O+Math.imul(w,B0)|0;var r0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(r0>>>26)|0,r0&=67108863,z=Math.imul(o,E0),$=Math.imul(o,L0),$=$+Math.imul(Q0,E0)|0,O=Math.imul(Q0,L0),z=z+Math.imul(i,P0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(m,P0)|0,O=O+Math.imul(m,k0)|0,z=z+Math.imul(h,w0)|0,$=$+Math.imul(h,B0)|0,$=$+Math.imul(d,w0)|0,O=O+Math.imul(d,B0)|0,z=z+Math.imul(R,v0)|0,$=$+Math.imul(R,S0)|0,$=$+Math.imul(w,v0)|0,O=O+Math.imul(w,S0)|0;var OQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(OQ>>>26)|0,OQ&=67108863,z=Math.imul(f,E0),$=Math.imul(f,L0),$=$+Math.imul(u,E0)|0,O=Math.imul(u,L0),z=z+Math.imul(o,P0)|0,$=$+Math.imul(o,k0)|0,$=$+Math.imul(Q0,P0)|0,O=O+Math.imul(Q0,k0)|0,z=z+Math.imul(i,w0)|0,$=$+Math.imul(i,B0)|0,$=$+Math.imul(m,w0)|0,O=O+Math.imul(m,B0)|0,z=z+Math.imul(h,v0)|0,$=$+Math.imul(h,S0)|0,$=$+Math.imul(d,v0)|0,O=O+Math.imul(d,S0)|0,z=z+Math.imul(R,_0)|0,$=$+Math.imul(R,x0)|0,$=$+Math.imul(w,_0)|0,O=O+Math.imul(w,x0)|0;var FQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(FQ>>>26)|0,FQ&=67108863,z=Math.imul(t,E0),$=Math.imul(t,L0),$=$+Math.imul(a,E0)|0,O=Math.imul(a,L0),z=z+Math.imul(f,P0)|0,$=$+Math.imul(f,k0)|0,$=$+Math.imul(u,P0)|0,O=O+Math.imul(u,k0)|0,z=z+Math.imul(o,w0)|0,$=$+Math.imul(o,B0)|0,$=$+Math.imul(Q0,w0)|0,O=O+Math.imul(Q0,B0)|0,z=z+Math.imul(i,v0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(m,v0)|0,O=O+Math.imul(m,S0)|0,z=z+Math.imul(h,_0)|0,$=$+Math.imul(h,x0)|0,$=$+Math.imul(d,_0)|0,O=O+Math.imul(d,x0)|0,z=z+Math.imul(R,C0)|0,$=$+Math.imul(R,y)|0,$=$+Math.imul(w,C0)|0,O=O+Math.imul(w,y)|0;var hQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(hQ>>>26)|0,hQ&=67108863,z=Math.imul(b,E0),$=Math.imul(b,L0),$=$+Math.imul(n,E0)|0,O=Math.imul(n,L0),z=z+Math.imul(t,P0)|0,$=$+Math.imul(t,k0)|0,$=$+Math.imul(a,P0)|0,O=O+Math.imul(a,k0)|0,z=z+Math.imul(f,w0)|0,$=$+Math.imul(f,B0)|0,$=$+Math.imul(u,w0)|0,O=O+Math.imul(u,B0)|0,z=z+Math.imul(o,v0)|0,$=$+Math.imul(o,S0)|0,$=$+Math.imul(Q0,v0)|0,O=O+Math.imul(Q0,S0)|0,z=z+Math.imul(i,_0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(m,_0)|0,O=O+Math.imul(m,x0)|0,z=z+Math.imul(h,C0)|0,$=$+Math.imul(h,y)|0,$=$+Math.imul(d,C0)|0,O=O+Math.imul(d,y)|0,z=z+Math.imul(R,s)|0,$=$+Math.imul(R,J0)|0,$=$+Math.imul(w,s)|0,O=O+Math.imul(w,J0)|0;var uQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(uQ>>>26)|0,uQ&=67108863,z=Math.imul(r,E0),$=Math.imul(r,L0),$=$+Math.imul(W0,E0)|0,O=Math.imul(W0,L0),z=z+Math.imul(b,P0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(n,P0)|0,O=O+Math.imul(n,k0)|0,z=z+Math.imul(t,w0)|0,$=$+Math.imul(t,B0)|0,$=$+Math.imul(a,w0)|0,O=O+Math.imul(a,B0)|0,z=z+Math.imul(f,v0)|0,$=$+Math.imul(f,S0)|0,$=$+Math.imul(u,v0)|0,O=O+Math.imul(u,S0)|0,z=z+Math.imul(o,_0)|0,$=$+Math.imul(o,x0)|0,$=$+Math.imul(Q0,_0)|0,O=O+Math.imul(Q0,x0)|0,z=z+Math.imul(i,C0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(m,C0)|0,O=O+Math.imul(m,y)|0,z=z+Math.imul(h,s)|0,$=$+Math.imul(h,J0)|0,$=$+Math.imul(d,s)|0,O=O+Math.imul(d,J0)|0,z=z+Math.imul(R,A0)|0,$=$+Math.imul(R,M0)|0,$=$+Math.imul(w,A0)|0,O=O+Math.imul(w,M0)|0;var pQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(pQ>>>26)|0,pQ&=67108863,z=Math.imul(D0,E0),$=Math.imul(D0,L0),$=$+Math.imul(q0,E0)|0,O=Math.imul(q0,L0),z=z+Math.imul(r,P0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(W0,P0)|0,O=O+Math.imul(W0,k0)|0,z=z+Math.imul(b,w0)|0,$=$+Math.imul(b,B0)|0,$=$+Math.imul(n,w0)|0,O=O+Math.imul(n,B0)|0,z=z+Math.imul(t,v0)|0,$=$+Math.imul(t,S0)|0,$=$+Math.imul(a,v0)|0,O=O+Math.imul(a,S0)|0,z=z+Math.imul(f,_0)|0,$=$+Math.imul(f,x0)|0,$=$+Math.imul(u,_0)|0,O=O+Math.imul(u,x0)|0,z=z+Math.imul(o,C0)|0,$=$+Math.imul(o,y)|0,$=$+Math.imul(Q0,C0)|0,O=O+Math.imul(Q0,y)|0,z=z+Math.imul(i,s)|0,$=$+Math.imul(i,J0)|0,$=$+Math.imul(m,s)|0,O=O+Math.imul(m,J0)|0,z=z+Math.imul(h,A0)|0,$=$+Math.imul(h,M0)|0,$=$+Math.imul(d,A0)|0,O=O+Math.imul(d,M0)|0,z=z+Math.imul(R,j0)|0,$=$+Math.imul(R,y0)|0,$=$+Math.imul(w,j0)|0,O=O+Math.imul(w,y0)|0;var cQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(cQ>>>26)|0,cQ&=67108863,z=Math.imul(O0,E0),$=Math.imul(O0,L0),$=$+Math.imul(I0,E0)|0,O=Math.imul(I0,L0),z=z+Math.imul(D0,P0)|0,$=$+Math.imul(D0,k0)|0,$=$+Math.imul(q0,P0)|0,O=O+Math.imul(q0,k0)|0,z=z+Math.imul(r,w0)|0,$=$+Math.imul(r,B0)|0,$=$+Math.imul(W0,w0)|0,O=O+Math.imul(W0,B0)|0,z=z+Math.imul(b,v0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(n,v0)|0,O=O+Math.imul(n,S0)|0,z=z+Math.imul(t,_0)|0,$=$+Math.imul(t,x0)|0,$=$+Math.imul(a,_0)|0,O=O+Math.imul(a,x0)|0,z=z+Math.imul(f,C0)|0,$=$+Math.imul(f,y)|0,$=$+Math.imul(u,C0)|0,O=O+Math.imul(u,y)|0,z=z+Math.imul(o,s)|0,$=$+Math.imul(o,J0)|0,$=$+Math.imul(Q0,s)|0,O=O+Math.imul(Q0,J0)|0,z=z+Math.imul(i,A0)|0,$=$+Math.imul(i,M0)|0,$=$+Math.imul(m,A0)|0,O=O+Math.imul(m,M0)|0,z=z+Math.imul(h,j0)|0,$=$+Math.imul(h,y0)|0,$=$+Math.imul(d,j0)|0,O=O+Math.imul(d,y0)|0,z=z+Math.imul(R,N0)|0,$=$+Math.imul(R,T0)|0,$=$+Math.imul(w,N0)|0,O=O+Math.imul(w,T0)|0;var lQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(lQ>>>26)|0,lQ&=67108863,z=Math.imul(O0,P0),$=Math.imul(O0,k0),$=$+Math.imul(I0,P0)|0,O=Math.imul(I0,k0),z=z+Math.imul(D0,w0)|0,$=$+Math.imul(D0,B0)|0,$=$+Math.imul(q0,w0)|0,O=O+Math.imul(q0,B0)|0,z=z+Math.imul(r,v0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(W0,v0)|0,O=O+Math.imul(W0,S0)|0,z=z+Math.imul(b,_0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(n,_0)|0,O=O+Math.imul(n,x0)|0,z=z+Math.imul(t,C0)|0,$=$+Math.imul(t,y)|0,$=$+Math.imul(a,C0)|0,O=O+Math.imul(a,y)|0,z=z+Math.imul(f,s)|0,$=$+Math.imul(f,J0)|0,$=$+Math.imul(u,s)|0,O=O+Math.imul(u,J0)|0,z=z+Math.imul(o,A0)|0,$=$+Math.imul(o,M0)|0,$=$+Math.imul(Q0,A0)|0,O=O+Math.imul(Q0,M0)|0,z=z+Math.imul(i,j0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(m,j0)|0,O=O+Math.imul(m,y0)|0,z=z+Math.imul(h,N0)|0,$=$+Math.imul(h,T0)|0,$=$+Math.imul(d,N0)|0,O=O+Math.imul(d,T0)|0;var mQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(mQ>>>26)|0,mQ&=67108863,z=Math.imul(O0,w0),$=Math.imul(O0,B0),$=$+Math.imul(I0,w0)|0,O=Math.imul(I0,B0),z=z+Math.imul(D0,v0)|0,$=$+Math.imul(D0,S0)|0,$=$+Math.imul(q0,v0)|0,O=O+Math.imul(q0,S0)|0,z=z+Math.imul(r,_0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(W0,_0)|0,O=O+Math.imul(W0,x0)|0,z=z+Math.imul(b,C0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(n,C0)|0,O=O+Math.imul(n,y)|0,z=z+Math.imul(t,s)|0,$=$+Math.imul(t,J0)|0,$=$+Math.imul(a,s)|0,O=O+Math.imul(a,J0)|0,z=z+Math.imul(f,A0)|0,$=$+Math.imul(f,M0)|0,$=$+Math.imul(u,A0)|0,O=O+Math.imul(u,M0)|0,z=z+Math.imul(o,j0)|0,$=$+Math.imul(o,y0)|0,$=$+Math.imul(Q0,j0)|0,O=O+Math.imul(Q0,y0)|0,z=z+Math.imul(i,N0)|0,$=$+Math.imul(i,T0)|0,$=$+Math.imul(m,N0)|0,O=O+Math.imul(m,T0)|0;var dQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(dQ>>>26)|0,dQ&=67108863,z=Math.imul(O0,v0),$=Math.imul(O0,S0),$=$+Math.imul(I0,v0)|0,O=Math.imul(I0,S0),z=z+Math.imul(D0,_0)|0,$=$+Math.imul(D0,x0)|0,$=$+Math.imul(q0,_0)|0,O=O+Math.imul(q0,x0)|0,z=z+Math.imul(r,C0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(W0,C0)|0,O=O+Math.imul(W0,y)|0,z=z+Math.imul(b,s)|0,$=$+Math.imul(b,J0)|0,$=$+Math.imul(n,s)|0,O=O+Math.imul(n,J0)|0,z=z+Math.imul(t,A0)|0,$=$+Math.imul(t,M0)|0,$=$+Math.imul(a,A0)|0,O=O+Math.imul(a,M0)|0,z=z+Math.imul(f,j0)|0,$=$+Math.imul(f,y0)|0,$=$+Math.imul(u,j0)|0,O=O+Math.imul(u,y0)|0,z=z+Math.imul(o,N0)|0,$=$+Math.imul(o,T0)|0,$=$+Math.imul(Q0,N0)|0,O=O+Math.imul(Q0,T0)|0;var nQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(nQ>>>26)|0,nQ&=67108863,z=Math.imul(O0,_0),$=Math.imul(O0,x0),$=$+Math.imul(I0,_0)|0,O=Math.imul(I0,x0),z=z+Math.imul(D0,C0)|0,$=$+Math.imul(D0,y)|0,$=$+Math.imul(q0,C0)|0,O=O+Math.imul(q0,y)|0,z=z+Math.imul(r,s)|0,$=$+Math.imul(r,J0)|0,$=$+Math.imul(W0,s)|0,O=O+Math.imul(W0,J0)|0,z=z+Math.imul(b,A0)|0,$=$+Math.imul(b,M0)|0,$=$+Math.imul(n,A0)|0,O=O+Math.imul(n,M0)|0,z=z+Math.imul(t,j0)|0,$=$+Math.imul(t,y0)|0,$=$+Math.imul(a,j0)|0,O=O+Math.imul(a,y0)|0,z=z+Math.imul(f,N0)|0,$=$+Math.imul(f,T0)|0,$=$+Math.imul(u,N0)|0,O=O+Math.imul(u,T0)|0;var oQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(oQ>>>26)|0,oQ&=67108863,z=Math.imul(O0,C0),$=Math.imul(O0,y),$=$+Math.imul(I0,C0)|0,O=Math.imul(I0,y),z=z+Math.imul(D0,s)|0,$=$+Math.imul(D0,J0)|0,$=$+Math.imul(q0,s)|0,O=O+Math.imul(q0,J0)|0,z=z+Math.imul(r,A0)|0,$=$+Math.imul(r,M0)|0,$=$+Math.imul(W0,A0)|0,O=O+Math.imul(W0,M0)|0,z=z+Math.imul(b,j0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(n,j0)|0,O=O+Math.imul(n,y0)|0,z=z+Math.imul(t,N0)|0,$=$+Math.imul(t,T0)|0,$=$+Math.imul(a,N0)|0,O=O+Math.imul(a,T0)|0;var rQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(rQ>>>26)|0,rQ&=67108863,z=Math.imul(O0,s),$=Math.imul(O0,J0),$=$+Math.imul(I0,s)|0,O=Math.imul(I0,J0),z=z+Math.imul(D0,A0)|0,$=$+Math.imul(D0,M0)|0,$=$+Math.imul(q0,A0)|0,O=O+Math.imul(q0,M0)|0,z=z+Math.imul(r,j0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(W0,j0)|0,O=O+Math.imul(W0,y0)|0,z=z+Math.imul(b,N0)|0,$=$+Math.imul(b,T0)|0,$=$+Math.imul(n,N0)|0,O=O+Math.imul(n,T0)|0;var iQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(iQ>>>26)|0,iQ&=67108863,z=Math.imul(O0,A0),$=Math.imul(O0,M0),$=$+Math.imul(I0,A0)|0,O=Math.imul(I0,M0),z=z+Math.imul(D0,j0)|0,$=$+Math.imul(D0,y0)|0,$=$+Math.imul(q0,j0)|0,O=O+Math.imul(q0,y0)|0,z=z+Math.imul(r,N0)|0,$=$+Math.imul(r,T0)|0,$=$+Math.imul(W0,N0)|0,O=O+Math.imul(W0,T0)|0;var tQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(tQ>>>26)|0,tQ&=67108863,z=Math.imul(O0,j0),$=Math.imul(O0,y0),$=$+Math.imul(I0,j0)|0,O=Math.imul(I0,y0),z=z+Math.imul(D0,N0)|0,$=$+Math.imul(D0,T0)|0,$=$+Math.imul(q0,N0)|0,O=O+Math.imul(q0,T0)|0;var sQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(sQ>>>26)|0,sQ&=67108863,z=Math.imul(O0,N0),$=Math.imul(O0,T0),$=$+Math.imul(I0,N0)|0,O=Math.imul(I0,T0);var aQ=(M+z|0)+(($&8191)<<13)|0;if(M=(O+($>>>13)|0)+(aQ>>>26)|0,aQ&=67108863,A[0]=vQ,A[1]=s0,A[2]=r0,A[3]=OQ,A[4]=FQ,A[5]=hQ,A[6]=uQ,A[7]=pQ,A[8]=cQ,A[9]=lQ,A[10]=mQ,A[11]=dQ,A[12]=nQ,A[13]=oQ,A[14]=rQ,A[15]=iQ,A[16]=tQ,A[17]=sQ,A[18]=aQ,M!==0)A[19]=M,V.length++;return V};if(!Math.imul)S=j;function N(J,U,V){V.negative=U.negative^J.negative,V.length=J.length+U.length;var H=0,F=0;for(var A=0;A<V.length-1;A++){var M=F;F=0;var z=H&67108863,$=Math.min(A,U.length-1);for(var O=Math.max(0,A-J.length+1);O<=$;O++){var C=A-O,R=J.words[C]|0,w=U.words[O]|0,g=R*w,h=g&67108863;M=M+(g/67108864|0)|0,h=h+z|0,z=h&67108863,M=M+(h>>>26)|0,F+=M>>>26,M&=67108863}V.words[A]=z,H=M,M=F}if(H!==0)V.words[A]=H;else V.length--;return V.strip()}function k(J,U,V){var H=new v;return H.mulp(J,U,V)}Z.prototype.mulTo=function(J,U){var V,H=this.length+J.length;if(this.length===10&&J.length===10)V=S(this,J,U);else if(H<63)V=j(this,J,U);else if(H<1024)V=N(this,J,U);else V=k(this,J,U);return V};function v(J,U){this.x=J,this.y=U}v.prototype.makeRBT=function(J){var U=Array(J),V=Z.prototype._countBits(J)-1;for(var H=0;H<J;H++)U[H]=this.revBin(H,V,J);return U},v.prototype.revBin=function(J,U,V){if(J===0||J===V-1)return J;var H=0;for(var F=0;F<U;F++)H|=(J&1)<<U-F-1,J>>=1;return H},v.prototype.permute=function(J,U,V,H,F,A){for(var M=0;M<A;M++)H[M]=U[J[M]],F[M]=V[J[M]]},v.prototype.transform=function(J,U,V,H,F,A){this.permute(A,J,U,V,H,F);for(var M=1;M<F;M<<=1){var z=M<<1,$=Math.cos(2*Math.PI/z),O=Math.sin(2*Math.PI/z);for(var C=0;C<F;C+=z){var R=$,w=O;for(var g=0;g<M;g++){var h=V[C+g],d=H[C+g],K0=V[C+g+M],i=H[C+g+M],m=R*K0-w*i;if(i=R*i+w*K0,K0=m,V[C+g]=h+K0,H[C+g]=d+i,V[C+g+M]=h-K0,H[C+g+M]=d-i,g!==z)m=$*R-O*w,w=$*w+O*R,R=m}}}},v.prototype.guessLen13b=function(J,U){var V=Math.max(U,J)|1,H=V&1,F=0;for(V=V/2|0;V;V=V>>>1)F++;return 1<<F+1+H},v.prototype.conjugate=function(J,U,V){if(V<=1)return;for(var H=0;H<V/2;H++){var F=J[H];J[H]=J[V-H-1],J[V-H-1]=F,F=U[H],U[H]=-U[V-H-1],U[V-H-1]=-F}},v.prototype.normalize13b=function(J,U){var V=0;for(var H=0;H<U/2;H++){var F=Math.round(J[2*H+1]/U)*8192+Math.round(J[2*H]/U)+V;if(J[H]=F&67108863,F<67108864)V=0;else V=F/67108864|0}return J},v.prototype.convert13b=function(J,U,V,H){var F=0;for(var A=0;A<U;A++)F=F+(J[A]|0),V[2*A]=F&8191,F=F>>>13,V[2*A+1]=F&8191,F=F>>>13;for(A=2*U;A<H;++A)V[A]=0;G(F===0),G((F&-8192)===0)},v.prototype.stub=function(J){var U=Array(J);for(var V=0;V<J;V++)U[V]=0;return U},v.prototype.mulp=function(J,U,V){var H=2*this.guessLen13b(J.length,U.length),F=this.makeRBT(H),A=this.stub(H),M=Array(H),z=Array(H),$=Array(H),O=Array(H),C=Array(H),R=Array(H),w=V.words;w.length=H,this.convert13b(J.words,J.length,M,H),this.convert13b(U.words,U.length,O,H),this.transform(M,A,z,$,H,F),this.transform(O,A,C,R,H,F);for(var g=0;g<H;g++){var h=z[g]*C[g]-$[g]*R[g];$[g]=z[g]*R[g]+$[g]*C[g],z[g]=h}return this.conjugate(z,$,H),this.transform(z,$,w,A,H,F),this.conjugate(w,A,H),this.normalize13b(w,H),V.negative=J.negative^U.negative,V.length=J.length+U.length,V.strip()},Z.prototype.mul=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),this.mulTo(J,U)},Z.prototype.mulf=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),k(this,J,U)},Z.prototype.imul=function(J){return this.clone().mulTo(J,this)},Z.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var U=0;for(var V=0;V<this.length;V++){var H=(this.words[V]|0)*J,F=(H&67108863)+(U&67108863);U>>=26,U+=H/67108864|0,U+=F>>>26,this.words[V]=F&67108863}if(U!==0)this.words[V]=U,this.length++;return this.length=J===0?1:this.length,this},Z.prototype.muln=function(J){return this.clone().imuln(J)},Z.prototype.sqr=function(){return this.mul(this)},Z.prototype.isqr=function(){return this.imul(this.clone())},Z.prototype.pow=function(J){var U=B(J);if(U.length===0)return new Z(1);var V=this;for(var H=0;H<U.length;H++,V=V.sqr())if(U[H]!==0)break;if(++H<U.length)for(var F=V.sqr();H<U.length;H++,F=F.sqr()){if(U[H]===0)continue;V=V.mul(F)}return V},Z.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=67108863>>>26-U<<26-U,F;if(U!==0){var A=0;for(F=0;F<this.length;F++){var M=this.words[F]&H,z=(this.words[F]|0)-M<<U;this.words[F]=z|A,A=M>>>26-U}if(A)this.words[F]=A,this.length++}if(V!==0){for(F=this.length-1;F>=0;F--)this.words[F+V]=this.words[F];for(F=0;F<V;F++)this.words[F]=0;this.length+=V}return this.strip()},Z.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Z.prototype.iushrn=function(J,U,V){G(typeof J==="number"&&J>=0);var H;if(U)H=(U-U%26)/26;else H=0;var F=J%26,A=Math.min((J-F)/26,this.length),M=67108863^67108863>>>F<<F,z=V;if(H-=A,H=Math.max(0,H),z){for(var $=0;$<A;$++)z.words[$]=this.words[$];z.length=A}if(A===0);else if(this.length>A){this.length-=A;for($=0;$<this.length;$++)this.words[$]=this.words[$+A]}else this.words[0]=0,this.length=1;var O=0;for($=this.length-1;$>=0&&(O!==0||$>=H);$--){var C=this.words[$]|0;this.words[$]=O<<26-F|C>>>F,O=C&M}if(z&&O!==0)z.words[z.length++]=O;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Z.prototype.ishrn=function(J,U,V){return G(this.negative===0),this.iushrn(J,U,V)},Z.prototype.shln=function(J){return this.clone().ishln(J)},Z.prototype.ushln=function(J){return this.clone().iushln(J)},Z.prototype.shrn=function(J){return this.clone().ishrn(J)},Z.prototype.ushrn=function(J){return this.clone().iushrn(J)},Z.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return!1;var F=this.words[V];return!!(F&H)},Z.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=V)return this;if(U!==0)V++;if(this.length=Math.min(V,this.length),U!==0){var H=67108863^67108863>>>U<<U;this.words[this.length-1]&=H}return this.strip()},Z.prototype.maskn=function(J){return this.clone().imaskn(J)},Z.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Z.prototype._iaddn=function(J){this.words[0]+=J;for(var U=0;U<this.length&&this.words[U]>=67108864;U++)if(this.words[U]-=67108864,U===this.length-1)this.words[U+1]=1;else this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},Z.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U<this.length&&this.words[U]<0;U++)this.words[U]+=67108864,this.words[U+1]-=1;return this.strip()},Z.prototype.addn=function(J){return this.clone().iaddn(J)},Z.prototype.subn=function(J){return this.clone().isubn(J)},Z.prototype.iabs=function(){return this.negative=0,this},Z.prototype.abs=function(){return this.clone().iabs()},Z.prototype._ishlnsubmul=function(J,U,V){var H=J.length+V,F;this._expand(H);var A,M=0;for(F=0;F<J.length;F++){A=(this.words[F+V]|0)+M;var z=(J.words[F]|0)*U;A-=z&67108863,M=(A>>26)-(z/67108864|0),this.words[F+V]=A&67108863}for(;F<this.length-V;F++)A=(this.words[F+V]|0)+M,M=A>>26,this.words[F+V]=A&67108863;if(M===0)return this.strip();G(M===-1),M=0;for(F=0;F<this.length;F++)A=-(this.words[F]|0)+M,M=A>>26,this.words[F]=A&67108863;return this.negative=1,this.strip()},Z.prototype._wordDiv=function(J,U){var V=this.length-J.length,H=this.clone(),F=J,A=F.words[F.length-1]|0,M=this._countBits(A);if(V=26-M,V!==0)F=F.ushln(V),H.iushln(V),A=F.words[F.length-1]|0;var z=H.length-F.length,$;if(U!=="mod"){$=new Z(null),$.length=z+1,$.words=Array($.length);for(var O=0;O<$.length;O++)$.words[O]=0}var C=H.clone()._ishlnsubmul(F,1,z);if(C.negative===0){if(H=C,$)$.words[z]=1}for(var R=z-1;R>=0;R--){var w=(H.words[F.length+R]|0)*67108864+(H.words[F.length+R-1]|0);w=Math.min(w/A|0,67108863),H._ishlnsubmul(F,w,R);while(H.negative!==0)if(w--,H.negative=0,H._ishlnsubmul(F,1,R),!H.isZero())H.negative^=1;if($)$.words[R]=w}if($)$.strip();if(H.strip(),U!=="div"&&V!==0)H.iushrn(V);return{div:$||null,mod:H}},Z.prototype.divmod=function(J,U,V){if(G(!J.isZero()),this.isZero())return{div:new Z(0),mod:new Z(0)};var H,F,A;if(this.negative!==0&&J.negative===0){if(A=this.neg().divmod(J,U),U!=="mod")H=A.div.neg();if(U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.iadd(J)}return{div:H,mod:F}}if(this.negative===0&&J.negative!==0){if(A=this.divmod(J.neg(),U),U!=="mod")H=A.div.neg();return{div:H,mod:A.mod}}if((this.negative&J.negative)!==0){if(A=this.neg().divmod(J.neg(),U),U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.isub(J)}return{div:A.div,mod:F}}if(J.length>this.length||this.cmp(J)<0)return{div:new Z(0),mod:this};if(J.length===1){if(U==="div")return{div:this.divn(J.words[0]),mod:null};if(U==="mod")return{div:null,mod:new Z(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Z(this.modn(J.words[0]))}}return this._wordDiv(J,U)},Z.prototype.div=function(J){return this.divmod(J,"div",!1).div},Z.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Z.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Z.prototype.divRound=function(J){var U=this.divmod(J);if(U.mod.isZero())return U.div;var V=U.div.negative!==0?U.mod.isub(J):U.mod,H=J.ushrn(1),F=J.andln(1),A=V.cmp(H);if(A<0||F===1&&A===0)return U.div;return U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},Z.prototype.modn=function(J){G(J<=67108863);var U=67108864%J,V=0;for(var H=this.length-1;H>=0;H--)V=(U*V+(this.words[H]|0))%J;return V},Z.prototype.idivn=function(J){G(J<=67108863);var U=0;for(var V=this.length-1;V>=0;V--){var H=(this.words[V]|0)+U*67108864;this.words[V]=H/J|0,U=H%J}return this.strip()},Z.prototype.divn=function(J){return this.clone().idivn(J)},Z.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=new Z(0),M=new Z(1),z=0;while(U.isEven()&&V.isEven())U.iushrn(1),V.iushrn(1),++z;var $=V.clone(),O=U.clone();while(!U.isZero()){for(var C=0,R=1;(U.words[0]&R)===0&&C<26;++C,R<<=1);if(C>0){U.iushrn(C);while(C-- >0){if(H.isOdd()||F.isOdd())H.iadd($),F.isub(O);H.iushrn(1),F.iushrn(1)}}for(var w=0,g=1;(V.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0){V.iushrn(w);while(w-- >0){if(A.isOdd()||M.isOdd())A.iadd($),M.isub(O);A.iushrn(1),M.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(A),F.isub(M);else V.isub(U),A.isub(H),M.isub(F)}return{a:A,b:M,gcd:V.iushln(z)}},Z.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=V.clone();while(U.cmpn(1)>0&&V.cmpn(1)>0){for(var M=0,z=1;(U.words[0]&z)===0&&M<26;++M,z<<=1);if(M>0){U.iushrn(M);while(M-- >0){if(H.isOdd())H.iadd(A);H.iushrn(1)}}for(var $=0,O=1;(V.words[0]&O)===0&&$<26;++$,O<<=1);if($>0){V.iushrn($);while($-- >0){if(F.isOdd())F.iadd(A);F.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(F);else V.isub(U),F.isub(H)}var C;if(U.cmpn(1)===0)C=H;else C=F;if(C.cmpn(0)<0)C.iadd(J);return C},Z.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var U=this.clone(),V=J.clone();U.negative=0,V.negative=0;for(var H=0;U.isEven()&&V.isEven();H++)U.iushrn(1),V.iushrn(1);do{while(U.isEven())U.iushrn(1);while(V.isEven())V.iushrn(1);var F=U.cmp(V);if(F<0){var A=U;U=V,V=A}else if(F===0||V.cmpn(1)===0)break;U.isub(V)}while(!0);return V.iushln(H)},Z.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Z.prototype.isEven=function(){return(this.words[0]&1)===0},Z.prototype.isOdd=function(){return(this.words[0]&1)===1},Z.prototype.andln=function(J){return this.words[0]&J},Z.prototype.bincn=function(J){G(typeof J==="number");var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return this._expand(V+1),this.words[V]|=H,this;var F=H;for(var A=V;F!==0&&A<this.length;A++){var M=this.words[A]|0;M+=F,F=M>>>26,M&=67108863,this.words[A]=M}if(F!==0)this.words[A]=F,this.length++;return this},Z.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Z.prototype.cmpn=function(J){var U=J<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var V;if(this.length>1)V=1;else{if(U)J=-J;G(J<=67108863,"Number is too big");var H=this.words[0]|0;V=H===J?0:H<J?-1:1}if(this.negative!==0)return-V|0;return V},Z.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var U=this.ucmp(J);if(this.negative!==0)return-U|0;return U},Z.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var U=0;for(var V=this.length-1;V>=0;V--){var H=this.words[V]|0,F=J.words[V]|0;if(H===F)continue;if(H<F)U=-1;else if(H>F)U=1;break}return U},Z.prototype.gtn=function(J){return this.cmpn(J)===1},Z.prototype.gt=function(J){return this.cmp(J)===1},Z.prototype.gten=function(J){return this.cmpn(J)>=0},Z.prototype.gte=function(J){return this.cmp(J)>=0},Z.prototype.ltn=function(J){return this.cmpn(J)===-1},Z.prototype.lt=function(J){return this.cmp(J)===-1},Z.prototype.lten=function(J){return this.cmpn(J)<=0},Z.prototype.lte=function(J){return this.cmp(J)<=0},Z.prototype.eqn=function(J){return this.cmpn(J)===0},Z.prototype.eq=function(J){return this.cmp(J)===0},Z.red=function(J){return new p(J)},Z.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Z.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Z.prototype._forceRed=function(J){return this.red=J,this},Z.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Z.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Z.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Z.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Z.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Z.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Z.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Z.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Z.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Z.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Z.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Z.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Z.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Z.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var _={k256:null,p224:null,p192:null,p25519:null};function x(J,U){this.name=J,this.p=new Z(U,16),this.n=this.p.bitLength(),this.k=new Z(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}x.prototype._tmp=function(){var J=new Z(null);return J.words=Array(Math.ceil(this.n/13)),J},x.prototype.ireduce=function(J){var U=J,V;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),V=U.bitLength();while(V>this.n);var H=V<this.n?-1:U.ucmp(this.p);if(H===0)U.words[0]=0,U.length=1;else if(H>0)U.isub(this.p);else if(U.strip!==void 0)U.strip();else U._strip();return U},x.prototype.split=function(J,U){J.iushrn(this.n,0,U)},x.prototype.imulK=function(J){return J.imul(this.k)};function c(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(c,x),c.prototype.split=function(J,U){var V=4194303,H=Math.min(J.length,9);for(var F=0;F<H;F++)U.words[F]=J.words[F];if(U.length=H,J.length<=9){J.words[0]=0,J.length=1;return}var A=J.words[9];U.words[U.length++]=A&V;for(F=10;F<J.length;F++){var M=J.words[F]|0;J.words[F-10]=(M&V)<<4|A>>>22,A=M}if(A>>>=22,J.words[F-10]=A,A===0&&J.length>10)J.length-=10;else J.length-=9},c.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var U=0;for(var V=0;V<J.length;V++){var H=J.words[V]|0;U+=H*977,J.words[V]=U&67108863,U=H*64+(U/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function Y0(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(Y0,x);function $0(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K($0,x);function e(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(e,x),e.prototype.imulK=function(J){var U=0;for(var V=0;V<J.length;V++){var H=(J.words[V]|0)*19+U,F=H&67108863;H>>>=26,J.words[V]=F,U=H}if(U!==0)J.words[J.length++]=U;return J},Z._prime=function(J){if(_[J])return _[J];var U;if(J==="k256")U=new c;else if(J==="p224")U=new Y0;else if(J==="p192")U=new $0;else if(J==="p25519")U=new e;else throw Error("Unknown prime "+J);return _[J]=U,U};function p(J){if(typeof J==="string"){var U=Z._prime(J);this.m=U.p,this.prime=U}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}p.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},p.prototype._verify2=function(J,U){G((J.negative|U.negative)===0,"red works only with positives"),G(J.red&&J.red===U.red,"red works only with red numbers")},p.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},p.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},p.prototype.add=function(J,U){this._verify2(J,U);var V=J.add(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V._forceRed(this)},p.prototype.iadd=function(J,U){this._verify2(J,U);var V=J.iadd(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V},p.prototype.sub=function(J,U){this._verify2(J,U);var V=J.sub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V._forceRed(this)},p.prototype.isub=function(J,U){this._verify2(J,U);var V=J.isub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V},p.prototype.shl=function(J,U){return this._verify1(J),this.imod(J.ushln(U))},p.prototype.imul=function(J,U){return this._verify2(J,U),this.imod(J.imul(U))},p.prototype.mul=function(J,U){return this._verify2(J,U),this.imod(J.mul(U))},p.prototype.isqr=function(J){return this.imul(J,J.clone())},p.prototype.sqr=function(J){return this.mul(J,J)},p.prototype.sqrt=function(J){if(J.isZero())return J.clone();var U=this.m.andln(3);if(G(U%2===1),U===3){var V=this.m.add(new Z(1)).iushrn(2);return this.pow(J,V)}var H=this.m.subn(1),F=0;while(!H.isZero()&&H.andln(1)===0)F++,H.iushrn(1);G(!H.isZero());var A=new Z(1).toRed(this),M=A.redNeg(),z=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Z(2*$*$).toRed(this);while(this.pow($,z).cmp(M)!==0)$.redIAdd(M);var O=this.pow($,H),C=this.pow(J,H.addn(1).iushrn(1)),R=this.pow(J,H),w=F;while(R.cmp(A)!==0){var g=R;for(var h=0;g.cmp(A)!==0;h++)g=g.redSqr();G(h<w);var d=this.pow(O,new Z(1).iushln(w-h-1));C=C.redMul(d),O=d.redSqr(),R=R.redMul(O),w=h}return C},p.prototype.invm=function(J){var U=J._invmp(this.m);if(U.negative!==0)return U.negative=0,this.imod(U).redNeg();else return this.imod(U)},p.prototype.pow=function(J,U){if(U.isZero())return new Z(1).toRed(this);if(U.cmpn(1)===0)return J.clone();var V=4,H=Array(1<<V);H[0]=new Z(1).toRed(this),H[1]=J;for(var F=2;F<H.length;F++)H[F]=this.mul(H[F-1],J);var A=H[0],M=0,z=0,$=U.bitLength()%26;if($===0)$=26;for(F=U.length-1;F>=0;F--){var O=U.words[F];for(var C=$-1;C>=0;C--){var R=O>>C&1;if(A!==H[0])A=this.sqr(A);if(R===0&&M===0){z=0;continue}if(M<<=1,M|=R,z++,z!==V&&(F!==0||C!==0))continue;A=this.mul(A,H[M]),z=0,M=0}$=26}return A},p.prototype.convertTo=function(J){var U=J.umod(this.m);return U===J?U.clone():U},p.prototype.convertFrom=function(J){var U=J.clone();return U.red=null,U},Z.mont=function(J){return new X0(J)};function X0(J){if(p.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Z(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(X0,p),X0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},X0.prototype.convertFrom=function(J){var U=this.imod(J.mul(this.rinv));return U.red=null,U},X0.prototype.imul=function(J,U){if(J.isZero()||U.isZero())return J.words[0]=0,J.length=1,J;var V=J.imul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.mul=function(J,U){if(J.isZero()||U.isZero())return new Z(0)._forceRed(this);var V=J.mul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.invm=function(J){var U=this.imod(J._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(typeof X>"u"||X,Q)}),qP=H0((Q)=>{var X=kJ(),Y=hX(),W=Q;W.define=function(K,Z){return new G(K,Z)};function G(K,Z){this.name=K,this.body=Z,this.decoders={},this.encoders={}}G.prototype._createNamed=function(K){var Z;try{Z=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
12
|
+
this._initNamed(entity);
|
|
13
|
+
})`)}catch(q){Z=function(E){this._initNamed(E)}}return Y(Z,K),Z.prototype._initNamed=function(q){K.call(this,q)},new Z(this)},G.prototype._getDecoder=function(K){if(K=K||"der",!this.decoders.hasOwnProperty(K))this.decoders[K]=this._createNamed(X.decoders[K]);return this.decoders[K]},G.prototype.decode=function(K,Z,q){return this._getDecoder(Z).decode(K,q)},G.prototype._getEncoder=function(K){if(K=K||"der",!this.encoders.hasOwnProperty(K))this.encoders[K]=this._createNamed(X.encoders[K]);return this.encoders[K]},G.prototype.encode=function(K,Z,q){return this._getEncoder(Z).encode(K,q)}}),IP=H0((Q)=>{var X=hX();function Y(G){this._reporterState={obj:null,path:[],options:G||{},errors:[]}}Q.Reporter=Y,Y.prototype.isError=function(G){return G instanceof W},Y.prototype.save=function(){var G=this._reporterState;return{obj:G.obj,pathLen:G.path.length}},Y.prototype.restore=function(G){var K=this._reporterState;K.obj=G.obj,K.path=K.path.slice(0,G.pathLen)},Y.prototype.enterKey=function(G){return this._reporterState.path.push(G)},Y.prototype.exitKey=function(G){var K=this._reporterState;K.path=K.path.slice(0,G-1)},Y.prototype.leaveKey=function(G,K,Z){var q=this._reporterState;if(this.exitKey(G),q.obj!==null)q.obj[K]=Z},Y.prototype.path=function(){return this._reporterState.path.join("/")},Y.prototype.enterObject=function(){var G=this._reporterState,K=G.obj;return G.obj={},K},Y.prototype.leaveObject=function(G){var K=this._reporterState,Z=K.obj;return K.obj=G,Z},Y.prototype.error=function(G){var K,Z=this._reporterState,q=G instanceof W;if(q)K=G;else K=new W(Z.path.map(function(E){return"["+JSON.stringify(E)+"]"}).join(""),G.message||G,G.stack);if(!Z.options.partial)throw K;if(!q)Z.errors.push(K);return K},Y.prototype.wrapResult=function(G){var K=this._reporterState;if(!K.options.partial)return G;return{result:this.isError(G)?null:G,errors:K.errors}};function W(G,K){this.path=G,this.rethrow(K)}X(W,Error),W.prototype.rethrow=function(G){if(this.message=G+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,W);if(!this.stack)try{throw Error(this.message)}catch(K){this.stack=K.stack}return this}}),oK=H0((Q)=>{var X=hX(),Y=BJ().Reporter,W=(JX(),WQ(YX)).Buffer;function G(Z,q){if(Y.call(this,q),!W.isBuffer(Z)){this.error("Input not Buffer");return}this.base=Z,this.offset=0,this.length=Z.length}X(G,Y),Q.DecoderBuffer=G,G.prototype.save=function(){return{offset:this.offset,reporter:Y.prototype.save.call(this)}},G.prototype.restore=function(Z){var q=new G(this.base);return q.offset=Z.offset,q.length=this.offset,this.offset=Z.offset,Y.prototype.restore.call(this,Z.reporter),q},G.prototype.isEmpty=function(){return this.offset===this.length},G.prototype.readUInt8=function(Z){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(Z||"DecoderBuffer overrun")},G.prototype.skip=function(Z,q){if(!(this.offset+Z<=this.length))return this.error(q||"DecoderBuffer overrun");var E=new G(this.base);return E._reporterState=this._reporterState,E.offset=this.offset,E.length=this.offset+Z,this.offset+=Z,E},G.prototype.raw=function(Z){return this.base.slice(Z?Z.offset:this.offset,this.length)};function K(Z,q){if(Array.isArray(Z))this.length=0,this.value=Z.map(function(E){if(!(E instanceof K))E=new K(E,q);return this.length+=E.length,E},this);else if(typeof Z==="number"){if(!(0<=Z&&Z<=255))return q.error("non-byte EncoderBuffer value");this.value=Z,this.length=1}else if(typeof Z==="string")this.value=Z,this.length=W.byteLength(Z);else if(W.isBuffer(Z))this.value=Z,this.length=Z.length;else return q.error("Unsupported type: "+typeof Z)}Q.EncoderBuffer=K,K.prototype.join=function(Z,q){if(!Z)Z=new W(this.length);if(!q)q=0;if(this.length===0)return Z;if(Array.isArray(this.value))this.value.forEach(function(E){E.join(Z,q),q+=E.length});else{if(typeof this.value==="number")Z[q]=this.value;else if(typeof this.value==="string")Z.write(this.value,q);else if(W.isBuffer(this.value))this.value.copy(Z,q);q+=this.length}return Z}}),MP=H0((Q,X)=>{var Y=BJ().Reporter,W=BJ().EncoderBuffer,G=BJ().DecoderBuffer,K=mY(),Z=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],q=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Z),E=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function I(D,T){var P={};if(this._baseState=P,P.enc=D,P.parent=T||null,P.children=null,P.tag=null,P.args=null,P.reverseArgs=null,P.choice=null,P.optional=!1,P.any=!1,P.obj=!1,P.use=null,P.useDecoder=null,P.key=null,P.default=null,P.explicit=null,P.implicit=null,P.contains=null,!P.parent)P.children=[],this._wrap()}X.exports=I;var L=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];I.prototype.clone=function(){var D=this._baseState,T={};L.forEach(function(B){T[B]=D[B]});var P=new this.constructor(T.parent);return P._baseState=T,P},I.prototype._wrap=function(){var D=this._baseState;q.forEach(function(T){this[T]=function(){var P=new this.constructor(this);return D.children.push(P),P[T].apply(P,arguments)}},this)},I.prototype._init=function(D){var T=this._baseState;K(T.parent===null),D.call(this),T.children=T.children.filter(function(P){return P._baseState.parent===this},this),K.equal(T.children.length,1,"Root node can have only one child")},I.prototype._useArgs=function(D){var T=this._baseState,P=D.filter(function(B){return B instanceof this.constructor},this);if(D=D.filter(function(B){return!(B instanceof this.constructor)},this),P.length!==0)K(T.children===null),T.children=P,P.forEach(function(B){B._baseState.parent=this},this);if(D.length!==0)K(T.args===null),T.args=D,T.reverseArgs=D.map(function(B){if(typeof B!=="object"||B.constructor!==Object)return B;var j={};return Object.keys(B).forEach(function(S){if(S==(S|0))S|=0;var N=B[S];j[N]=S}),j})},E.forEach(function(D){I.prototype[D]=function(){var T=this._baseState;throw Error(D+" not implemented for encoding: "+T.enc)}}),Z.forEach(function(D){I.prototype[D]=function(){var T=this._baseState,P=Array.prototype.slice.call(arguments);return K(T.tag===null),T.tag=D,this._useArgs(P),this}}),I.prototype.use=function(D){K(D);var T=this._baseState;return K(T.use===null),T.use=D,this},I.prototype.optional=function(){var D=this._baseState;return D.optional=!0,this},I.prototype.def=function(D){var T=this._baseState;return K(T.default===null),T.default=D,T.optional=!0,this},I.prototype.explicit=function(D){var T=this._baseState;return K(T.explicit===null&&T.implicit===null),T.explicit=D,this},I.prototype.implicit=function(D){var T=this._baseState;return K(T.explicit===null&&T.implicit===null),T.implicit=D,this},I.prototype.obj=function(){var D=this._baseState,T=Array.prototype.slice.call(arguments);if(D.obj=!0,T.length!==0)this._useArgs(T);return this},I.prototype.key=function(D){var T=this._baseState;return K(T.key===null),T.key=D,this},I.prototype.any=function(){var D=this._baseState;return D.any=!0,this},I.prototype.choice=function(D){var T=this._baseState;return K(T.choice===null),T.choice=D,this._useArgs(Object.keys(D).map(function(P){return D[P]})),this},I.prototype.contains=function(D){var T=this._baseState;return K(T.use===null),T.contains=D,this},I.prototype._decode=function(D,T){var P=this._baseState;if(P.parent===null)return D.wrapResult(P.children[0]._decode(D,T));var B=P.default,j=!0,S=null;if(P.key!==null)S=D.enterKey(P.key);if(P.optional){var N=null;if(P.explicit!==null)N=P.explicit;else if(P.implicit!==null)N=P.implicit;else if(P.tag!==null)N=P.tag;if(N===null&&!P.any){var k=D.save();try{if(P.choice===null)this._decodeGeneric(P.tag,D,T);else this._decodeChoice(D,T);j=!0}catch($0){j=!1}D.restore(k)}else if(j=this._peekTag(D,N,P.any),D.isError(j))return j}var v;if(P.obj&&j)v=D.enterObject();if(j){if(P.explicit!==null){var _=this._decodeTag(D,P.explicit);if(D.isError(_))return _;D=_}var x=D.offset;if(P.use===null&&P.choice===null){if(P.any)var k=D.save();var c=this._decodeTag(D,P.implicit!==null?P.implicit:P.tag,P.any);if(D.isError(c))return c;if(P.any)B=D.raw(k);else D=c}if(T&&T.track&&P.tag!==null)T.track(D.path(),x,D.length,"tagged");if(T&&T.track&&P.tag!==null)T.track(D.path(),D.offset,D.length,"content");if(P.any)B=B;else if(P.choice===null)B=this._decodeGeneric(P.tag,D,T);else B=this._decodeChoice(D,T);if(D.isError(B))return B;if(!P.any&&P.choice===null&&P.children!==null)P.children.forEach(function($0){$0._decode(D,T)});if(P.contains&&(P.tag==="octstr"||P.tag==="bitstr")){var Y0=new G(B);B=this._getUse(P.contains,D._reporterState.obj)._decode(Y0,T)}}if(P.obj&&j)B=D.leaveObject(v);if(P.key!==null&&(B!==null||j===!0))D.leaveKey(S,P.key,B);else if(S!==null)D.exitKey(S);return B},I.prototype._decodeGeneric=function(D,T,P){var B=this._baseState;if(D==="seq"||D==="set")return null;if(D==="seqof"||D==="setof")return this._decodeList(T,D,B.args[0],P);else if(/str$/.test(D))return this._decodeStr(T,D,P);else if(D==="objid"&&B.args)return this._decodeObjid(T,B.args[0],B.args[1],P);else if(D==="objid")return this._decodeObjid(T,null,null,P);else if(D==="gentime"||D==="utctime")return this._decodeTime(T,D,P);else if(D==="null_")return this._decodeNull(T,P);else if(D==="bool")return this._decodeBool(T,P);else if(D==="objDesc")return this._decodeStr(T,D,P);else if(D==="int"||D==="enum")return this._decodeInt(T,B.args&&B.args[0],P);if(B.use!==null)return this._getUse(B.use,T._reporterState.obj)._decode(T,P);else return T.error("unknown tag: "+D)},I.prototype._getUse=function(D,T){var P=this._baseState;if(P.useDecoder=this._use(D,T),K(P.useDecoder._baseState.parent===null),P.useDecoder=P.useDecoder._baseState.children[0],P.implicit!==P.useDecoder._baseState.implicit)P.useDecoder=P.useDecoder.clone(),P.useDecoder._baseState.implicit=P.implicit;return P.useDecoder},I.prototype._decodeChoice=function(D,T){var P=this._baseState,B=null,j=!1;if(Object.keys(P.choice).some(function(S){var N=D.save(),k=P.choice[S];try{var v=k._decode(D,T);if(D.isError(v))return!1;B={type:S,value:v},j=!0}catch(_){return D.restore(N),!1}return!0},this),!j)return D.error("Choice not matched");return B},I.prototype._createEncoderBuffer=function(D){return new W(D,this.reporter)},I.prototype._encode=function(D,T,P){var B=this._baseState;if(B.default!==null&&B.default===D)return;var j=this._encodeValue(D,T,P);if(j===void 0)return;if(this._skipDefault(j,T,P))return;return j},I.prototype._encodeValue=function(D,T,P){var B=this._baseState;if(B.parent===null)return B.children[0]._encode(D,T||new Y);var k=null;if(this.reporter=T,B.optional&&D===void 0)if(B.default!==null)D=B.default;else return;var j=null,S=!1;if(B.any)k=this._createEncoderBuffer(D);else if(B.choice)k=this._encodeChoice(D,T);else if(B.contains)j=this._getUse(B.contains,P)._encode(D,T),S=!0;else if(B.children)j=B.children.map(function(x){if(x._baseState.tag==="null_")return x._encode(null,T,D);if(x._baseState.key===null)return T.error("Child should have a key");var c=T.enterKey(x._baseState.key);if(typeof D!=="object")return T.error("Child expected, but input is not object");var Y0=x._encode(D[x._baseState.key],T,D);return T.leaveKey(c),Y0},this).filter(function(x){return x}),j=this._createEncoderBuffer(j);else if(B.tag==="seqof"||B.tag==="setof"){if(!(B.args&&B.args.length===1))return T.error("Too many args for : "+B.tag);if(!Array.isArray(D))return T.error("seqof/setof, but data is not Array");var N=this.clone();N._baseState.implicit=null,j=this._createEncoderBuffer(D.map(function(x){var c=this._baseState;return this._getUse(c.args[0],D)._encode(x,T)},N))}else if(B.use!==null)k=this._getUse(B.use,P)._encode(D,T);else j=this._encodePrimitive(B.tag,D),S=!0;var k;if(!B.any&&B.choice===null){var v=B.implicit!==null?B.implicit:B.tag,_=B.implicit===null?"universal":"context";if(v===null){if(B.use===null)T.error("Tag could be omitted only for .use()")}else if(B.use===null)k=this._encodeComposite(v,S,_,j)}if(B.explicit!==null)k=this._encodeComposite(B.explicit,!1,"context",k);return k},I.prototype._encodeChoice=function(D,T){var P=this._baseState,B=P.choice[D.type];if(!B)K(!1,D.type+" not found in "+JSON.stringify(Object.keys(P.choice)));return B._encode(D.value,T)},I.prototype._encodePrimitive=function(D,T){var P=this._baseState;if(/str$/.test(D))return this._encodeStr(T,D);else if(D==="objid"&&P.args)return this._encodeObjid(T,P.reverseArgs[0],P.args[1]);else if(D==="objid")return this._encodeObjid(T,null,null);else if(D==="gentime"||D==="utctime")return this._encodeTime(T,D);else if(D==="null_")return this._encodeNull();else if(D==="int"||D==="enum")return this._encodeInt(T,P.args&&P.reverseArgs[0]);else if(D==="bool")return this._encodeBool(T);else if(D==="objDesc")return this._encodeStr(T,D);else throw Error("Unsupported tag: "+D)},I.prototype._isNumstr=function(D){return/^[0-9 ]*$/.test(D)},I.prototype._isPrintstr=function(D){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(D)}}),BJ=H0((Q)=>{var X=Q;X.Reporter=IP().Reporter,X.DecoderBuffer=oK().DecoderBuffer,X.EncoderBuffer=oK().EncoderBuffer,X.Node=MP()}),LP=H0((Q)=>{var X=VF();Q.tagClass={0:"universal",1:"application",2:"context",3:"private"},Q.tagClassByName=X._reverse(Q.tagClass),Q.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},Q.tagByName=X._reverse(Q.tag)}),VF=H0((Q)=>{var X=Q;X._reverse=function(Y){var W={};return Object.keys(Y).forEach(function(G){if((G|0)==G)G=G|0;var K=Y[G];W[K]=G}),W},X.der=LP()}),zF=H0((Q,X)=>{var Y=hX(),W=kJ(),G=W.base,K=W.bignum,Z=W.constants.der;function q(D){this.enc="der",this.name=D.name,this.entity=D,this.tree=new E,this.tree._init(D.body)}X.exports=q,q.prototype.decode=function(D,T){if(!(D instanceof G.DecoderBuffer))D=new G.DecoderBuffer(D,T);return this.tree._decode(D,T)};function E(D){G.Node.call(this,"der",D)}Y(E,G.Node),E.prototype._peekTag=function(D,T,P){if(D.isEmpty())return!1;var B=D.save(),j=I(D,'Failed to peek tag: "'+T+'"');if(D.isError(j))return j;return D.restore(B),j.tag===T||j.tagStr===T||j.tagStr+"of"===T||P},E.prototype._decodeTag=function(D,T,P){var B=I(D,'Failed to decode tag of "'+T+'"');if(D.isError(B))return B;var j=L(D,B.primitive,'Failed to get length of "'+T+'"');if(D.isError(j))return j;if(!P&&B.tag!==T&&B.tagStr!==T&&B.tagStr+"of"!==T)return D.error('Failed to match tag: "'+T+'"');if(B.primitive||j!==null)return D.skip(j,'Failed to match body of: "'+T+'"');var S=D.save(),N=this._skipUntilEnd(D,'Failed to skip indefinite length body: "'+this.tag+'"');if(D.isError(N))return N;return j=D.offset-S.offset,D.restore(S),D.skip(j,'Failed to match body of: "'+T+'"')},E.prototype._skipUntilEnd=function(D,T){while(!0){var P=I(D,T);if(D.isError(P))return P;var B=L(D,P.primitive,T);if(D.isError(B))return B;var j;if(P.primitive||B!==null)j=D.skip(B);else j=this._skipUntilEnd(D,T);if(D.isError(j))return j;if(P.tagStr==="end")break}},E.prototype._decodeList=function(D,T,P,B){var j=[];while(!D.isEmpty()){var S=this._peekTag(D,"end");if(D.isError(S))return S;var N=P.decode(D,"der",B);if(D.isError(N)&&S)break;j.push(N)}return j},E.prototype._decodeStr=function(D,T){if(T==="bitstr"){var P=D.readUInt8();if(D.isError(P))return P;return{unused:P,data:D.raw()}}else if(T==="bmpstr"){var B=D.raw();if(B.length%2===1)return D.error("Decoding of string type: bmpstr length mismatch");var j="";for(var S=0;S<B.length/2;S++)j+=String.fromCharCode(B.readUInt16BE(S*2));return j}else if(T==="numstr"){var N=D.raw().toString("ascii");if(!this._isNumstr(N))return D.error("Decoding of string type: numstr unsupported characters");return N}else if(T==="octstr")return D.raw();else if(T==="objDesc")return D.raw();else if(T==="printstr"){var k=D.raw().toString("ascii");if(!this._isPrintstr(k))return D.error("Decoding of string type: printstr unsupported characters");return k}else if(/str$/.test(T))return D.raw().toString();else return D.error("Decoding of string type: "+T+" unsupported")},E.prototype._decodeObjid=function(D,T,P){var B,j=[],S=0;while(!D.isEmpty()){var N=D.readUInt8();if(S<<=7,S|=N&127,(N&128)===0)j.push(S),S=0}if(N&128)j.push(S);var k=j[0]/40|0,v=j[0]%40;if(P)B=j;else B=[k,v].concat(j.slice(1));if(T){var _=T[B.join(" ")];if(_===void 0)_=T[B.join(".")];if(_!==void 0)B=_}return B},E.prototype._decodeTime=function(D,T){var P=D.raw().toString();if(T==="gentime")var B=P.slice(0,4)|0,j=P.slice(4,6)|0,S=P.slice(6,8)|0,N=P.slice(8,10)|0,k=P.slice(10,12)|0,v=P.slice(12,14)|0;else if(T==="utctime"){var B=P.slice(0,2)|0,j=P.slice(2,4)|0,S=P.slice(4,6)|0,N=P.slice(6,8)|0,k=P.slice(8,10)|0,v=P.slice(10,12)|0;if(B<70)B=2000+B;else B=1900+B}else return D.error("Decoding "+T+" time is not supported yet");return Date.UTC(B,j-1,S,N,k,v,0)},E.prototype._decodeNull=function(D){return null},E.prototype._decodeBool=function(D){var T=D.readUInt8();if(D.isError(T))return T;else return T!==0},E.prototype._decodeInt=function(D,T){var P=D.raw(),B=new K(P);if(T)B=T[B.toString(10)]||B;return B},E.prototype._use=function(D,T){if(typeof D==="function")D=D(T);return D._getDecoder("der").tree};function I(D,T){var P=D.readUInt8(T);if(D.isError(P))return P;var B=Z.tagClass[P>>6],j=(P&32)===0;if((P&31)===31){var S=P;P=0;while((S&128)===128){if(S=D.readUInt8(T),D.isError(S))return S;P<<=7,P|=S&127}}else P&=31;var N=Z.tag[P];return{cls:B,primitive:j,tag:P,tagStr:N}}function L(D,T,P){var B=D.readUInt8(P);if(D.isError(B))return B;if(!T&&B===128)return null;if((B&128)===0)return B;var j=B&127;if(j>4)return D.error("length octect is too long");B=0;for(var S=0;S<j;S++){B<<=8;var N=D.readUInt8(P);if(D.isError(N))return N;B|=N}return B}}),EP=H0((Q,X)=>{var Y=hX(),W=(JX(),WQ(YX)).Buffer,G=zF();function K(Z){G.call(this,Z),this.enc="pem"}Y(K,G),X.exports=K,K.prototype.decode=function(Z,q){var E=Z.toString().split(/[\r\n]+/g),I=q.label.toUpperCase(),L=/^-----(BEGIN|END) ([^-]+)-----$/,D=-1,T=-1;for(var P=0;P<E.length;P++){var B=E[P].match(L);if(B===null)continue;if(B[2]!==I)continue;if(D===-1){if(B[1]!=="BEGIN")break;D=P}else{if(B[1]!=="END")break;T=P;break}}if(D===-1||T===-1)throw Error("PEM section not found for: "+I);var j=E.slice(D+1,T).join("");j.replace(/[^a-z0-9\+\/=]+/gi,"");var S=new W(j,"base64");return G.prototype.decode.call(this,S,q)}}),TP=H0((Q)=>{var X=Q;X.der=zF(),X.pem=EP()}),OF=H0((Q,X)=>{var Y=hX(),W=(JX(),WQ(YX)).Buffer,G=kJ(),K=G.base,Z=G.constants.der;function q(D){this.enc="der",this.name=D.name,this.entity=D,this.tree=new E,this.tree._init(D.body)}X.exports=q,q.prototype.encode=function(D,T){return this.tree._encode(D,T).join()};function E(D){K.Node.call(this,"der",D)}Y(E,K.Node),E.prototype._encodeComposite=function(D,T,P,B){var j=L(D,T,P,this.reporter);if(B.length<128){var k=new W(2);return k[0]=j,k[1]=B.length,this._createEncoderBuffer([k,B])}var S=1;for(var N=B.length;N>=256;N>>=8)S++;var k=new W(2+S);k[0]=j,k[1]=128|S;for(var N=1+S,v=B.length;v>0;N--,v>>=8)k[N]=v&255;return this._createEncoderBuffer([k,B])},E.prototype._encodeStr=function(D,T){if(T==="bitstr")return this._createEncoderBuffer([D.unused|0,D.data]);else if(T==="bmpstr"){var P=new W(D.length*2);for(var B=0;B<D.length;B++)P.writeUInt16BE(D.charCodeAt(B),B*2);return this._createEncoderBuffer(P)}else if(T==="numstr"){if(!this._isNumstr(D))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(D)}else if(T==="printstr"){if(!this._isPrintstr(D))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(D)}else if(/str$/.test(T))return this._createEncoderBuffer(D);else if(T==="objDesc")return this._createEncoderBuffer(D);else return this.reporter.error("Encoding of string type: "+T+" unsupported")},E.prototype._encodeObjid=function(D,T,P){if(typeof D==="string"){if(!T)return this.reporter.error("string objid given, but no values map found");if(!T.hasOwnProperty(D))return this.reporter.error("objid not found in values map");D=T[D].split(/[\s\.]+/g);for(var B=0;B<D.length;B++)D[B]|=0}else if(Array.isArray(D)){D=D.slice();for(var B=0;B<D.length;B++)D[B]|=0}if(!Array.isArray(D))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(D));if(!P){if(D[1]>=40)return this.reporter.error("Second objid identifier OOB");D.splice(0,2,D[0]*40+D[1])}var j=0;for(var B=0;B<D.length;B++){var S=D[B];for(j++;S>=128;S>>=7)j++}var N=new W(j),k=N.length-1;for(var B=D.length-1;B>=0;B--){var S=D[B];N[k--]=S&127;while((S>>=7)>0)N[k--]=128|S&127}return this._createEncoderBuffer(N)};function I(D){if(D<10)return"0"+D;else return D}E.prototype._encodeTime=function(D,T){var P,B=new Date(D);if(T==="gentime")P=[I(B.getFullYear()),I(B.getUTCMonth()+1),I(B.getUTCDate()),I(B.getUTCHours()),I(B.getUTCMinutes()),I(B.getUTCSeconds()),"Z"].join("");else if(T==="utctime")P=[I(B.getFullYear()%100),I(B.getUTCMonth()+1),I(B.getUTCDate()),I(B.getUTCHours()),I(B.getUTCMinutes()),I(B.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+T+" time is not supported yet");return this._encodeStr(P,"octstr")},E.prototype._encodeNull=function(){return this._createEncoderBuffer("")},E.prototype._encodeInt=function(D,T){if(typeof D==="string"){if(!T)return this.reporter.error("String int or enum given, but no values map");if(!T.hasOwnProperty(D))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(D));D=T[D]}if(typeof D!=="number"&&!W.isBuffer(D)){var P=D.toArray();if(!D.sign&&P[0]&128)P.unshift(0);D=new W(P)}if(W.isBuffer(D)){var B=D.length;if(D.length===0)B++;var S=new W(B);if(D.copy(S),D.length===0)S[0]=0;return this._createEncoderBuffer(S)}if(D<128)return this._createEncoderBuffer(D);if(D<256)return this._createEncoderBuffer([0,D]);var B=1;for(var j=D;j>=256;j>>=8)B++;var S=Array(B);for(var j=S.length-1;j>=0;j--)S[j]=D&255,D>>=8;if(S[0]&128)S.unshift(0);return this._createEncoderBuffer(new W(S))},E.prototype._encodeBool=function(D){return this._createEncoderBuffer(D?255:0)},E.prototype._use=function(D,T){if(typeof D==="function")D=D(T);return D._getEncoder("der").tree},E.prototype._skipDefault=function(D,T,P){var B=this._baseState,j;if(B.default===null)return!1;var S=D.join();if(B.defaultBuffer===void 0)B.defaultBuffer=this._encodeValue(B.default,T,P).join();if(S.length!==B.defaultBuffer.length)return!1;for(j=0;j<S.length;j++)if(S[j]!==B.defaultBuffer[j])return!1;return!0};function L(D,T,P,B){var j;if(D==="seqof")D="seq";else if(D==="setof")D="set";if(Z.tagByName.hasOwnProperty(D))j=Z.tagByName[D];else if(typeof D==="number"&&(D|0)===D)j=D;else return B.error("Unknown tag: "+D);if(j>=31)return B.error("Multi-octet tag encoding unsupported");if(!T)j|=32;return j|=Z.tagClassByName[P||"universal"]<<6,j}}),RP=H0((Q,X)=>{var Y=hX(),W=OF();function G(K){W.call(this,K),this.enc="pem"}Y(G,W),X.exports=G,G.prototype.encode=function(K,Z){var q=W.prototype.encode.call(this,K),E=q.toString("base64"),I=["-----BEGIN "+Z.label+"-----"];for(var L=0;L<E.length;L+=64)I.push(E.slice(L,L+64));return I.push("-----END "+Z.label+"-----"),I.join(`
|
|
14
|
+
`)}}),PP=H0((Q)=>{var X=Q;X.der=OF(),X.pem=RP()}),kJ=H0((Q)=>{var X=Q;X.bignum=DP(),X.define=qP().define,X.base=BJ(),X.constants=VF(),X.decoders=TP(),X.encoders=PP()}),BP=H0((Q,X)=>{var Y=kJ(),W=Y.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),G=Y.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),K=Y.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),Z=Y.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(K),this.key("subjectPublicKey").bitstr())}),q=Y.define("RelativeDistinguishedName",function(){this.setof(G)}),E=Y.define("RDNSequence",function(){this.seqof(q)}),I=Y.define("Name",function(){this.choice({rdnSequence:this.use(E)})}),L=Y.define("Validity",function(){this.seq().obj(this.key("notBefore").use(W),this.key("notAfter").use(W))}),D=Y.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),T=Y.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(K),this.key("issuer").use(I),this.key("validity").use(L),this.key("subject").use(I),this.key("subjectPublicKeyInfo").use(Z),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(D).optional())}),P=Y.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(T),this.key("signatureAlgorithm").use(K),this.key("signatureValue").bitstr())});X.exports=P}),SP=H0((Q)=>{var X=kJ();Q.certificate=BP();var Y=X.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});Q.RSAPrivateKey=Y;var W=X.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});Q.RSAPublicKey=W;var G=X.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),K=X.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(G),this.key("subjectPublicKey").bitstr())});Q.PublicKey=K;var Z=X.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(G),this.key("subjectPrivateKey").octstr())});Q.PrivateKey=Z;var q=X.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});Q.EncryptedPrivateKey=q;var E=X.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});Q.DSAPrivateKey=E,Q.DSAparam=X.define("DSAparam",function(){this.int()});var I=X.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),L=X.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(I),this.key("publicKey").optional().explicit(1).bitstr())});Q.ECPrivateKey=L,Q.signature=X.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),CP=H0((Q,X)=>{X.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),jP=H0((Q,X)=>{var Y=LX().Buffer,W=QH().Transform,G=hX();function K(I){W.call(this),this._block=Y.allocUnsafe(I),this._blockSize=I,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}G(K,W),K.prototype._transform=function(I,L,D){var T=null;try{this.update(I,L)}catch(P){T=P}D(T)},K.prototype._flush=function(I){var L=null;try{this.push(this.digest())}catch(D){L=D}I(L)};var Z=typeof Uint8Array<"u",q=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(Y.prototype instanceof Uint8Array||Y.TYPED_ARRAY_SUPPORT);function E(I,L){if(I instanceof Y)return I;if(typeof I==="string")return Y.from(I,L);if(q&&ArrayBuffer.isView(I)){if(I.byteLength===0)return Y.alloc(0);var D=Y.from(I.buffer,I.byteOffset,I.byteLength);if(D.byteLength===I.byteLength)return D}if(Z&&I instanceof Uint8Array)return Y.from(I);if(Y.isBuffer(I)&&I.constructor&&typeof I.constructor.isBuffer==="function"&&I.constructor.isBuffer(I))return Y.from(I);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}K.prototype.update=function(I,L){if(this._finalized)throw Error("Digest already called");I=E(I,L);var D=this._block,T=0;while(this._blockOffset+I.length-T>=this._blockSize){for(var P=this._blockOffset;P<this._blockSize;)D[P++]=I[T++];this._update(),this._blockOffset=0}while(T<I.length)D[this._blockOffset++]=I[T++];for(var B=0,j=I.length*8;j>0;++B)if(this._length[B]+=j,j=this._length[B]/4294967296|0,j>0)this._length[B]-=4294967296*j;return this},K.prototype._update=function(){throw Error("_update is not implemented")},K.prototype.digest=function(I){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var L=this._digest();if(I!==void 0)L=L.toString(I);this._block.fill(0),this._blockOffset=0;for(var D=0;D<4;++D)this._length[D]=0;return L},K.prototype._digest=function(){throw Error("_digest is not implemented")},X.exports=K}),NP=H0((Q,X)=>{var Y=hX(),W=jP(),G=LX().Buffer,K=Array(16);function Z(){W.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}Y(Z,W),Z.prototype._update=function(){var T=K;for(var P=0;P<16;++P)T[P]=this._block.readInt32LE(P*4);var B=this._a,j=this._b,S=this._c,N=this._d;B=E(B,j,S,N,T[0],3614090360,7),N=E(N,B,j,S,T[1],3905402710,12),S=E(S,N,B,j,T[2],606105819,17),j=E(j,S,N,B,T[3],3250441966,22),B=E(B,j,S,N,T[4],4118548399,7),N=E(N,B,j,S,T[5],1200080426,12),S=E(S,N,B,j,T[6],2821735955,17),j=E(j,S,N,B,T[7],4249261313,22),B=E(B,j,S,N,T[8],1770035416,7),N=E(N,B,j,S,T[9],2336552879,12),S=E(S,N,B,j,T[10],4294925233,17),j=E(j,S,N,B,T[11],2304563134,22),B=E(B,j,S,N,T[12],1804603682,7),N=E(N,B,j,S,T[13],4254626195,12),S=E(S,N,B,j,T[14],2792965006,17),j=E(j,S,N,B,T[15],1236535329,22),B=I(B,j,S,N,T[1],4129170786,5),N=I(N,B,j,S,T[6],3225465664,9),S=I(S,N,B,j,T[11],643717713,14),j=I(j,S,N,B,T[0],3921069994,20),B=I(B,j,S,N,T[5],3593408605,5),N=I(N,B,j,S,T[10],38016083,9),S=I(S,N,B,j,T[15],3634488961,14),j=I(j,S,N,B,T[4],3889429448,20),B=I(B,j,S,N,T[9],568446438,5),N=I(N,B,j,S,T[14],3275163606,9),S=I(S,N,B,j,T[3],4107603335,14),j=I(j,S,N,B,T[8],1163531501,20),B=I(B,j,S,N,T[13],2850285829,5),N=I(N,B,j,S,T[2],4243563512,9),S=I(S,N,B,j,T[7],1735328473,14),j=I(j,S,N,B,T[12],2368359562,20),B=L(B,j,S,N,T[5],4294588738,4),N=L(N,B,j,S,T[8],2272392833,11),S=L(S,N,B,j,T[11],1839030562,16),j=L(j,S,N,B,T[14],4259657740,23),B=L(B,j,S,N,T[1],2763975236,4),N=L(N,B,j,S,T[4],1272893353,11),S=L(S,N,B,j,T[7],4139469664,16),j=L(j,S,N,B,T[10],3200236656,23),B=L(B,j,S,N,T[13],681279174,4),N=L(N,B,j,S,T[0],3936430074,11),S=L(S,N,B,j,T[3],3572445317,16),j=L(j,S,N,B,T[6],76029189,23),B=L(B,j,S,N,T[9],3654602809,4),N=L(N,B,j,S,T[12],3873151461,11),S=L(S,N,B,j,T[15],530742520,16),j=L(j,S,N,B,T[2],3299628645,23),B=D(B,j,S,N,T[0],4096336452,6),N=D(N,B,j,S,T[7],1126891415,10),S=D(S,N,B,j,T[14],2878612391,15),j=D(j,S,N,B,T[5],4237533241,21),B=D(B,j,S,N,T[12],1700485571,6),N=D(N,B,j,S,T[3],2399980690,10),S=D(S,N,B,j,T[10],4293915773,15),j=D(j,S,N,B,T[1],2240044497,21),B=D(B,j,S,N,T[8],1873313359,6),N=D(N,B,j,S,T[15],4264355552,10),S=D(S,N,B,j,T[6],2734768916,15),j=D(j,S,N,B,T[13],1309151649,21),B=D(B,j,S,N,T[4],4149444226,6),N=D(N,B,j,S,T[11],3174756917,10),S=D(S,N,B,j,T[2],718787259,15),j=D(j,S,N,B,T[9],3951481745,21),this._a=this._a+B|0,this._b=this._b+j|0,this._c=this._c+S|0,this._d=this._d+N|0},Z.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var T=G.allocUnsafe(16);return T.writeInt32LE(this._a,0),T.writeInt32LE(this._b,4),T.writeInt32LE(this._c,8),T.writeInt32LE(this._d,12),T};function q(T,P){return T<<P|T>>>32-P}function E(T,P,B,j,S,N,k){return q(T+(P&B|~P&j)+S+N|0,k)+P|0}function I(T,P,B,j,S,N,k){return q(T+(P&j|B&~j)+S+N|0,k)+P|0}function L(T,P,B,j,S,N,k){return q(T+(P^B^j)+S+N|0,k)+P|0}function D(T,P,B,j,S,N,k){return q(T+(B^(P|~j))+S+N|0,k)+P|0}X.exports=Z}),kP=H0((Q,X)=>{var Y=LX().Buffer,W=NP();function G(K,Z,q,E){if(!Y.isBuffer(K))K=Y.from(K,"binary");if(Z){if(!Y.isBuffer(Z))Z=Y.from(Z,"binary");if(Z.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var I=q/8,L=Y.alloc(I),D=Y.alloc(E||0),T=Y.alloc(0);while(I>0||E>0){var P=new W;if(P.update(T),P.update(K),Z)P.update(Z);T=P.digest();var B=0;if(I>0){var j=L.length-I;B=Math.min(I,T.length),T.copy(L,j,0,B),I-=B}if(B<T.length&&E>0){var S=D.length-E,N=Math.min(E,T.length-B);T.copy(D,S,B,B+N),E-=N}}return T.fill(0),{key:L,iv:D}}X.exports=G}),AF=H0((Q)=>{var X=(EX(),WQ(uX));Q.createCipher=Q.Cipher=X.createCipher,Q.createCipheriv=Q.Cipheriv=X.createCipheriv,Q.createDecipher=Q.Decipher=X.createDecipher,Q.createDecipheriv=Q.Decipheriv=X.createDecipheriv,Q.listCiphers=Q.getCiphers=X.getCiphers}),wP=H0((Q,X)=>{var Y=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,W=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,G=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,K=kP(),Z=AF(),q=LX().Buffer;X.exports=function(E,I){var L=E.toString(),D=L.match(Y),T;if(!D){var P=L.match(G);T=q.from(P[2].replace(/[\r\n]/g,""),"base64")}else{var B="aes"+D[1],j=q.from(D[2],"hex"),S=q.from(D[3].replace(/[\r\n]/g,""),"base64"),N=K(I,j.slice(0,8),parseInt(D[1],10)).key,k=[],v=Z.createDecipheriv(B,N,j);k.push(v.update(S)),k.push(v.final()),T=q.concat(k)}var _=L.match(W)[1];return{tag:_,data:T}}}),DF=H0((Q,X)=>{var Y=SP(),W=CP(),G=wP(),K=AF(),Z=GF().pbkdf2Sync,q=LX().Buffer;function E(L,D){var T=L.algorithm.decrypt.kde.kdeparams.salt,P=parseInt(L.algorithm.decrypt.kde.kdeparams.iters.toString(),10),B=W[L.algorithm.decrypt.cipher.algo.join(".")],j=L.algorithm.decrypt.cipher.iv,S=L.subjectPrivateKey,N=parseInt(B.split("-")[1],10)/8,k=Z(D,T,P,N,"sha1"),v=K.createDecipheriv(B,k,j),_=[];return _.push(v.update(S)),_.push(v.final()),q.concat(_)}function I(L){var D;if(typeof L==="object"&&!q.isBuffer(L))D=L.passphrase,L=L.key;if(typeof L==="string")L=q.from(L);var T=G(L,D),P=T.tag,B=T.data,j,S;switch(P){case"CERTIFICATE":S=Y.certificate.decode(B,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!S)S=Y.PublicKey.decode(B,"der");switch(j=S.algorithm.algorithm.join("."),j){case"1.2.840.113549.1.1.1":return Y.RSAPublicKey.decode(S.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return S.subjectPrivateKey=S.subjectPublicKey,{type:"ec",data:S};case"1.2.840.10040.4.1":return S.algorithm.params.pub_key=Y.DSAparam.decode(S.subjectPublicKey.data,"der"),{type:"dsa",data:S.algorithm.params};default:throw Error("unknown key id "+j)}case"ENCRYPTED PRIVATE KEY":B=Y.EncryptedPrivateKey.decode(B,"der"),B=E(B,D);case"PRIVATE KEY":switch(S=Y.PrivateKey.decode(B,"der"),j=S.algorithm.algorithm.join("."),j){case"1.2.840.113549.1.1.1":return Y.RSAPrivateKey.decode(S.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:S.algorithm.curve,privateKey:Y.ECPrivateKey.decode(S.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return S.algorithm.params.priv_key=Y.DSAparam.decode(S.subjectPrivateKey,"der"),{type:"dsa",params:S.algorithm.params};default:throw Error("unknown key id "+j)}case"RSA PUBLIC KEY":return Y.RSAPublicKey.decode(B,"der");case"RSA PRIVATE KEY":return Y.RSAPrivateKey.decode(B,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:Y.DSAPrivateKey.decode(B,"der")};case"EC PRIVATE KEY":return B=Y.ECPrivateKey.decode(B,"der"),{curve:B.parameters.value,privateKey:B.privateKey};default:throw Error("unknown key type "+P)}}I.signature=Y.signature,X.exports=I}),qF=H0((Q,X)=>{var Y=OG(),W=LX().Buffer;X.exports=function(K,Z){var q=W.alloc(0),E=0,I;while(q.length<Z)I=G(E++),q=W.concat([q,Y("sha1").update(K).update(I).digest()]);return q.slice(0,Z)};function G(K){var Z=W.allocUnsafe(4);return Z.writeUInt32BE(K,0),Z}}),IF=H0((Q,X)=>{X.exports=function(Y,W){var G=Y.length,K=-1;while(++K<G)Y[K]^=W[K];return Y}}),KH=H0((Q,X)=>{(function(Y,W){function G(J,U){if(!J)throw Error(U||"Assertion failed")}function K(J,U){J.super_=U;var V=function(){};V.prototype=U.prototype,J.prototype=new V,J.prototype.constructor=J}function Z(J,U,V){if(Z.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(U==="le"||U==="be")V=U,U=10;this._init(J||0,U||10,V||"be")}}if(typeof Y==="object")Y.exports=Z;else W.BN=Z;Z.BN=Z,Z.wordSize=26;var q;try{if(typeof window<"u"&&typeof window.Buffer<"u")q=window.Buffer;else q=(JX(),WQ(YX)).Buffer}catch(J){}Z.isBN=function(J){if(J instanceof Z)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===Z.wordSize&&Array.isArray(J.words)},Z.max=function(J,U){if(J.cmp(U)>0)return J;return U},Z.min=function(J,U){if(J.cmp(U)<0)return J;return U},Z.prototype._init=function(J,U,V){if(typeof J==="number")return this._initNumber(J,U,V);if(typeof J==="object")return this._initArray(J,U,V);if(U==="hex")U=16;G(U===(U|0)&&U>=2&&U<=36),J=J.toString().replace(/\s+/g,"");var H=0;if(J[0]==="-")H++,this.negative=1;if(H<J.length){if(U===16)this._parseHex(J,H,V);else if(this._parseBase(J,U,H),V==="le")this._initArray(this.toArray(),U,V)}},Z.prototype._initNumber=function(J,U,V){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else G(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(V!=="le")return;this._initArray(this.toArray(),U,V)},Z.prototype._initArray=function(J,U,V){if(G(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F,A,M=0;if(V==="be"){for(H=J.length-1,F=0;H>=0;H-=3)if(A=J[H]|J[H-1]<<8|J[H-2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}else if(V==="le"){for(H=0,F=0;H<J.length;H+=3)if(A=J[H]|J[H+1]<<8|J[H+2]<<16,this.words[F]|=A<<M&67108863,this.words[F+1]=A>>>26-M&67108863,M+=24,M>=26)M-=26,F++}return this.strip()};function E(J,U){var V=J.charCodeAt(U);if(V>=65&&V<=70)return V-55;else if(V>=97&&V<=102)return V-87;else return V-48&15}function I(J,U,V){var H=E(J,V);if(V-1>=U)H|=E(J,V-1)<<4;return H}Z.prototype._parseHex=function(J,U,V){this.length=Math.ceil((J.length-U)/6),this.words=Array(this.length);for(var H=0;H<this.length;H++)this.words[H]=0;var F=0,A=0,M;if(V==="be")for(H=J.length-1;H>=U;H-=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8;else{var z=J.length-U;for(H=z%2===0?U+1:U;H<J.length;H+=2)if(M=I(J,U,H)<<F,this.words[A]|=M&67108863,F>=18)F-=18,A+=1,this.words[A]|=M>>>26;else F+=8}this.strip()};function L(J,U,V,H){var F=0,A=Math.min(J.length,V);for(var M=U;M<A;M++){var z=J.charCodeAt(M)-48;if(F*=H,z>=49)F+=z-49+10;else if(z>=17)F+=z-17+10;else F+=z}return F}Z.prototype._parseBase=function(J,U,V){this.words=[0],this.length=1;for(var H=0,F=1;F<=67108863;F*=U)H++;H--,F=F/U|0;var A=J.length-V,M=A%H,z=Math.min(A,A-M)+V,$=0;for(var O=V;O<z;O+=H)if($=L(J,O,O+H,U),this.imuln(F),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($);if(M!==0){var C=1;$=L(J,O,J.length,U);for(O=0;O<M;O++)C*=U;if(this.imuln(C),this.words[0]+$<67108864)this.words[0]+=$;else this._iaddn($)}this.strip()},Z.prototype.copy=function(J){J.words=Array(this.length);for(var U=0;U<this.length;U++)J.words[U]=this.words[U];J.length=this.length,J.negative=this.negative,J.red=this.red},Z.prototype.clone=function(){var J=new Z(null);return this.copy(J),J},Z.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},Z.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Z.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Z.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var D=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],T=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Z.prototype.toString=function(J,U){J=J||10,U=U|0||1;var V;if(J===16||J==="hex"){V="";var H=0,F=0;for(var A=0;A<this.length;A++){var M=this.words[A],z=((M<<H|F)&16777215).toString(16);if(F=M>>>24-H&16777215,H+=2,H>=26)H-=26,A--;if(F!==0||A!==this.length-1)V=D[6-z.length]+z+V;else V=z+V}if(F!==0)V=F.toString(16)+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}if(J===(J|0)&&J>=2&&J<=36){var $=T[J],O=P[J];V="";var C=this.clone();C.negative=0;while(!C.isZero()){var R=C.modn(O).toString(J);if(C=C.idivn(O),!C.isZero())V=D[$-R.length]+R+V;else V=R+V}if(this.isZero())V="0"+V;while(V.length%U!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}G(!1,"Base should be between 2 and 36")},Z.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},Z.prototype.toJSON=function(){return this.toString(16)},Z.prototype.toBuffer=function(J,U){return G(typeof q<"u"),this.toArrayLike(q,J,U)},Z.prototype.toArray=function(J,U){return this.toArrayLike(Array,J,U)},Z.prototype.toArrayLike=function(J,U,V){var H=this.byteLength(),F=V||Math.max(1,H);G(H<=F,"byte array longer than desired length"),G(F>0,"Requested array length <= 0"),this.strip();var A=U==="le",M=new J(F),z,$,O=this.clone();if(!A){for($=0;$<F-H;$++)M[$]=0;for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[F-$-1]=z}else{for($=0;!O.isZero();$++)z=O.andln(255),O.iushrn(8),M[$]=z;for(;$<F;$++)M[$]=0}return M},Math.clz32)Z.prototype._countBits=function(J){return 32-Math.clz32(J)};else Z.prototype._countBits=function(J){var U=J,V=0;if(U>=4096)V+=13,U>>>=13;if(U>=64)V+=7,U>>>=7;if(U>=8)V+=4,U>>>=4;if(U>=2)V+=2,U>>>=2;return V+U};Z.prototype._zeroBits=function(J){if(J===0)return 26;var U=J,V=0;if((U&8191)===0)V+=13,U>>>=13;if((U&127)===0)V+=7,U>>>=7;if((U&15)===0)V+=4,U>>>=4;if((U&3)===0)V+=2,U>>>=2;if((U&1)===0)V++;return V},Z.prototype.bitLength=function(){var J=this.words[this.length-1],U=this._countBits(J);return(this.length-1)*26+U};function B(J){var U=Array(J.bitLength());for(var V=0;V<U.length;V++){var H=V/26|0,F=V%26;U[V]=(J.words[H]&1<<F)>>>F}return U}Z.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var U=0;U<this.length;U++){var V=this._zeroBits(this.words[U]);if(J+=V,V!==26)break}return J},Z.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Z.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},Z.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},Z.prototype.isNeg=function(){return this.negative!==0},Z.prototype.neg=function(){return this.clone().ineg()},Z.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Z.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var U=0;U<J.length;U++)this.words[U]=this.words[U]|J.words[U];return this.strip()},Z.prototype.ior=function(J){return G((this.negative|J.negative)===0),this.iuor(J)},Z.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},Z.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},Z.prototype.iuand=function(J){var U;if(this.length>J.length)U=J;else U=this;for(var V=0;V<U.length;V++)this.words[V]=this.words[V]&J.words[V];return this.length=U.length,this.strip()},Z.prototype.iand=function(J){return G((this.negative|J.negative)===0),this.iuand(J)},Z.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},Z.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},Z.prototype.iuxor=function(J){var U,V;if(this.length>J.length)U=this,V=J;else U=J,V=this;for(var H=0;H<V.length;H++)this.words[H]=U.words[H]^V.words[H];if(this!==U)for(;H<U.length;H++)this.words[H]=U.words[H];return this.length=U.length,this.strip()},Z.prototype.ixor=function(J){return G((this.negative|J.negative)===0),this.iuxor(J)},Z.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},Z.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},Z.prototype.inotn=function(J){G(typeof J==="number"&&J>=0);var U=Math.ceil(J/26)|0,V=J%26;if(this._expand(U),V>0)U--;for(var H=0;H<U;H++)this.words[H]=~this.words[H]&67108863;if(V>0)this.words[H]=~this.words[H]&67108863>>26-V;return this.strip()},Z.prototype.notn=function(J){return this.clone().inotn(J)},Z.prototype.setn=function(J,U){G(typeof J==="number"&&J>=0);var V=J/26|0,H=J%26;if(this._expand(V+1),U)this.words[V]=this.words[V]|1<<H;else this.words[V]=this.words[V]&~(1<<H);return this.strip()},Z.prototype.iadd=function(J){var U;if(this.negative!==0&&J.negative===0)return this.negative=0,U=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,U=this.isub(J),J.negative=1,U._normSign();var V,H;if(this.length>J.length)V=this,H=J;else V=J,H=this;var F=0;for(var A=0;A<H.length;A++)U=(V.words[A]|0)+(H.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;for(;F!==0&&A<V.length;A++)U=(V.words[A]|0)+F,this.words[A]=U&67108863,F=U>>>26;if(this.length=V.length,F!==0)this.words[this.length]=F,this.length++;else if(V!==this)for(;A<V.length;A++)this.words[A]=V.words[A];return this},Z.prototype.add=function(J){var U;if(J.negative!==0&&this.negative===0)return J.negative=0,U=this.sub(J),J.negative^=1,U;else if(J.negative===0&&this.negative!==0)return this.negative=0,U=J.sub(this),this.negative=1,U;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},Z.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var U=this.iadd(J);return J.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var V=this.cmp(J);if(V===0)return this.negative=0,this.length=1,this.words[0]=0,this;var H,F;if(V>0)H=this,F=J;else H=J,F=this;var A=0;for(var M=0;M<F.length;M++)U=(H.words[M]|0)-(F.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;for(;A!==0&&M<H.length;M++)U=(H.words[M]|0)+A,A=U>>26,this.words[M]=U&67108863;if(A===0&&M<H.length&&H!==this)for(;M<H.length;M++)this.words[M]=H.words[M];if(this.length=Math.max(this.length,M),H!==this)this.negative=1;return this.strip()},Z.prototype.sub=function(J){return this.clone().isub(J)};function j(J,U,V){V.negative=U.negative^J.negative;var H=J.length+U.length|0;V.length=H,H=H-1|0;var F=J.words[0]|0,A=U.words[0]|0,M=F*A,z=M&67108863,$=M/67108864|0;V.words[0]=z;for(var O=1;O<H;O++){var C=$>>>26,R=$&67108863,w=Math.min(O,U.length-1);for(var g=Math.max(0,O-J.length+1);g<=w;g++){var h=O-g|0;F=J.words[h]|0,A=U.words[g]|0,M=F*A+R,C+=M/67108864|0,R=M&67108863}V.words[O]=R|0,$=C|0}if($!==0)V.words[O]=$|0;else V.length--;return V.strip()}var S=function(J,U,V){var H=J.words,F=U.words,A=V.words,M=0,z,$,O,C=H[0]|0,R=C&8191,w=C>>>13,g=H[1]|0,h=g&8191,d=g>>>13,K0=H[2]|0,i=K0&8191,m=K0>>>13,G0=H[3]|0,o=G0&8191,Q0=G0>>>13,f0=H[4]|0,f=f0&8191,u=f0>>>13,Z0=H[5]|0,t=Z0&8191,a=Z0>>>13,R0=H[6]|0,b=R0&8191,n=R0>>>13,g0=H[7]|0,r=g0&8191,W0=g0>>>13,m0=H[8]|0,D0=m0&8191,q0=m0>>>13,kQ=H[9]|0,O0=kQ&8191,I0=kQ>>>13,yQ=F[0]|0,E0=yQ&8191,L0=yQ>>>13,OX=F[1]|0,P0=OX&8191,k0=OX>>>13,AX=F[2]|0,w0=AX&8191,B0=AX>>>13,GX=F[3]|0,v0=GX&8191,S0=GX>>>13,eQ=F[4]|0,_0=eQ&8191,x0=eQ>>>13,QX=F[5]|0,C0=QX&8191,y=QX>>>13,l=F[6]|0,s=l&8191,J0=l>>>13,b0=F[7]|0,A0=b0&8191,M0=b0>>>13,wQ=F[8]|0,j0=wQ&8191,y0=wQ>>>13,$X=F[9]|0,N0=$X&8191,T0=$X>>>13;V.negative=J.negative^U.negative,V.length=19,z=Math.imul(R,E0),$=Math.imul(R,L0),$=$+Math.imul(w,E0)|0,O=Math.imul(w,L0);var vQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(vQ>>>26)|0,vQ&=67108863,z=Math.imul(h,E0),$=Math.imul(h,L0),$=$+Math.imul(d,E0)|0,O=Math.imul(d,L0),z=z+Math.imul(R,P0)|0,$=$+Math.imul(R,k0)|0,$=$+Math.imul(w,P0)|0,O=O+Math.imul(w,k0)|0;var s0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(s0>>>26)|0,s0&=67108863,z=Math.imul(i,E0),$=Math.imul(i,L0),$=$+Math.imul(m,E0)|0,O=Math.imul(m,L0),z=z+Math.imul(h,P0)|0,$=$+Math.imul(h,k0)|0,$=$+Math.imul(d,P0)|0,O=O+Math.imul(d,k0)|0,z=z+Math.imul(R,w0)|0,$=$+Math.imul(R,B0)|0,$=$+Math.imul(w,w0)|0,O=O+Math.imul(w,B0)|0;var r0=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(r0>>>26)|0,r0&=67108863,z=Math.imul(o,E0),$=Math.imul(o,L0),$=$+Math.imul(Q0,E0)|0,O=Math.imul(Q0,L0),z=z+Math.imul(i,P0)|0,$=$+Math.imul(i,k0)|0,$=$+Math.imul(m,P0)|0,O=O+Math.imul(m,k0)|0,z=z+Math.imul(h,w0)|0,$=$+Math.imul(h,B0)|0,$=$+Math.imul(d,w0)|0,O=O+Math.imul(d,B0)|0,z=z+Math.imul(R,v0)|0,$=$+Math.imul(R,S0)|0,$=$+Math.imul(w,v0)|0,O=O+Math.imul(w,S0)|0;var OQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(OQ>>>26)|0,OQ&=67108863,z=Math.imul(f,E0),$=Math.imul(f,L0),$=$+Math.imul(u,E0)|0,O=Math.imul(u,L0),z=z+Math.imul(o,P0)|0,$=$+Math.imul(o,k0)|0,$=$+Math.imul(Q0,P0)|0,O=O+Math.imul(Q0,k0)|0,z=z+Math.imul(i,w0)|0,$=$+Math.imul(i,B0)|0,$=$+Math.imul(m,w0)|0,O=O+Math.imul(m,B0)|0,z=z+Math.imul(h,v0)|0,$=$+Math.imul(h,S0)|0,$=$+Math.imul(d,v0)|0,O=O+Math.imul(d,S0)|0,z=z+Math.imul(R,_0)|0,$=$+Math.imul(R,x0)|0,$=$+Math.imul(w,_0)|0,O=O+Math.imul(w,x0)|0;var FQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(FQ>>>26)|0,FQ&=67108863,z=Math.imul(t,E0),$=Math.imul(t,L0),$=$+Math.imul(a,E0)|0,O=Math.imul(a,L0),z=z+Math.imul(f,P0)|0,$=$+Math.imul(f,k0)|0,$=$+Math.imul(u,P0)|0,O=O+Math.imul(u,k0)|0,z=z+Math.imul(o,w0)|0,$=$+Math.imul(o,B0)|0,$=$+Math.imul(Q0,w0)|0,O=O+Math.imul(Q0,B0)|0,z=z+Math.imul(i,v0)|0,$=$+Math.imul(i,S0)|0,$=$+Math.imul(m,v0)|0,O=O+Math.imul(m,S0)|0,z=z+Math.imul(h,_0)|0,$=$+Math.imul(h,x0)|0,$=$+Math.imul(d,_0)|0,O=O+Math.imul(d,x0)|0,z=z+Math.imul(R,C0)|0,$=$+Math.imul(R,y)|0,$=$+Math.imul(w,C0)|0,O=O+Math.imul(w,y)|0;var hQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(hQ>>>26)|0,hQ&=67108863,z=Math.imul(b,E0),$=Math.imul(b,L0),$=$+Math.imul(n,E0)|0,O=Math.imul(n,L0),z=z+Math.imul(t,P0)|0,$=$+Math.imul(t,k0)|0,$=$+Math.imul(a,P0)|0,O=O+Math.imul(a,k0)|0,z=z+Math.imul(f,w0)|0,$=$+Math.imul(f,B0)|0,$=$+Math.imul(u,w0)|0,O=O+Math.imul(u,B0)|0,z=z+Math.imul(o,v0)|0,$=$+Math.imul(o,S0)|0,$=$+Math.imul(Q0,v0)|0,O=O+Math.imul(Q0,S0)|0,z=z+Math.imul(i,_0)|0,$=$+Math.imul(i,x0)|0,$=$+Math.imul(m,_0)|0,O=O+Math.imul(m,x0)|0,z=z+Math.imul(h,C0)|0,$=$+Math.imul(h,y)|0,$=$+Math.imul(d,C0)|0,O=O+Math.imul(d,y)|0,z=z+Math.imul(R,s)|0,$=$+Math.imul(R,J0)|0,$=$+Math.imul(w,s)|0,O=O+Math.imul(w,J0)|0;var uQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(uQ>>>26)|0,uQ&=67108863,z=Math.imul(r,E0),$=Math.imul(r,L0),$=$+Math.imul(W0,E0)|0,O=Math.imul(W0,L0),z=z+Math.imul(b,P0)|0,$=$+Math.imul(b,k0)|0,$=$+Math.imul(n,P0)|0,O=O+Math.imul(n,k0)|0,z=z+Math.imul(t,w0)|0,$=$+Math.imul(t,B0)|0,$=$+Math.imul(a,w0)|0,O=O+Math.imul(a,B0)|0,z=z+Math.imul(f,v0)|0,$=$+Math.imul(f,S0)|0,$=$+Math.imul(u,v0)|0,O=O+Math.imul(u,S0)|0,z=z+Math.imul(o,_0)|0,$=$+Math.imul(o,x0)|0,$=$+Math.imul(Q0,_0)|0,O=O+Math.imul(Q0,x0)|0,z=z+Math.imul(i,C0)|0,$=$+Math.imul(i,y)|0,$=$+Math.imul(m,C0)|0,O=O+Math.imul(m,y)|0,z=z+Math.imul(h,s)|0,$=$+Math.imul(h,J0)|0,$=$+Math.imul(d,s)|0,O=O+Math.imul(d,J0)|0,z=z+Math.imul(R,A0)|0,$=$+Math.imul(R,M0)|0,$=$+Math.imul(w,A0)|0,O=O+Math.imul(w,M0)|0;var pQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(pQ>>>26)|0,pQ&=67108863,z=Math.imul(D0,E0),$=Math.imul(D0,L0),$=$+Math.imul(q0,E0)|0,O=Math.imul(q0,L0),z=z+Math.imul(r,P0)|0,$=$+Math.imul(r,k0)|0,$=$+Math.imul(W0,P0)|0,O=O+Math.imul(W0,k0)|0,z=z+Math.imul(b,w0)|0,$=$+Math.imul(b,B0)|0,$=$+Math.imul(n,w0)|0,O=O+Math.imul(n,B0)|0,z=z+Math.imul(t,v0)|0,$=$+Math.imul(t,S0)|0,$=$+Math.imul(a,v0)|0,O=O+Math.imul(a,S0)|0,z=z+Math.imul(f,_0)|0,$=$+Math.imul(f,x0)|0,$=$+Math.imul(u,_0)|0,O=O+Math.imul(u,x0)|0,z=z+Math.imul(o,C0)|0,$=$+Math.imul(o,y)|0,$=$+Math.imul(Q0,C0)|0,O=O+Math.imul(Q0,y)|0,z=z+Math.imul(i,s)|0,$=$+Math.imul(i,J0)|0,$=$+Math.imul(m,s)|0,O=O+Math.imul(m,J0)|0,z=z+Math.imul(h,A0)|0,$=$+Math.imul(h,M0)|0,$=$+Math.imul(d,A0)|0,O=O+Math.imul(d,M0)|0,z=z+Math.imul(R,j0)|0,$=$+Math.imul(R,y0)|0,$=$+Math.imul(w,j0)|0,O=O+Math.imul(w,y0)|0;var cQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(cQ>>>26)|0,cQ&=67108863,z=Math.imul(O0,E0),$=Math.imul(O0,L0),$=$+Math.imul(I0,E0)|0,O=Math.imul(I0,L0),z=z+Math.imul(D0,P0)|0,$=$+Math.imul(D0,k0)|0,$=$+Math.imul(q0,P0)|0,O=O+Math.imul(q0,k0)|0,z=z+Math.imul(r,w0)|0,$=$+Math.imul(r,B0)|0,$=$+Math.imul(W0,w0)|0,O=O+Math.imul(W0,B0)|0,z=z+Math.imul(b,v0)|0,$=$+Math.imul(b,S0)|0,$=$+Math.imul(n,v0)|0,O=O+Math.imul(n,S0)|0,z=z+Math.imul(t,_0)|0,$=$+Math.imul(t,x0)|0,$=$+Math.imul(a,_0)|0,O=O+Math.imul(a,x0)|0,z=z+Math.imul(f,C0)|0,$=$+Math.imul(f,y)|0,$=$+Math.imul(u,C0)|0,O=O+Math.imul(u,y)|0,z=z+Math.imul(o,s)|0,$=$+Math.imul(o,J0)|0,$=$+Math.imul(Q0,s)|0,O=O+Math.imul(Q0,J0)|0,z=z+Math.imul(i,A0)|0,$=$+Math.imul(i,M0)|0,$=$+Math.imul(m,A0)|0,O=O+Math.imul(m,M0)|0,z=z+Math.imul(h,j0)|0,$=$+Math.imul(h,y0)|0,$=$+Math.imul(d,j0)|0,O=O+Math.imul(d,y0)|0,z=z+Math.imul(R,N0)|0,$=$+Math.imul(R,T0)|0,$=$+Math.imul(w,N0)|0,O=O+Math.imul(w,T0)|0;var lQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(lQ>>>26)|0,lQ&=67108863,z=Math.imul(O0,P0),$=Math.imul(O0,k0),$=$+Math.imul(I0,P0)|0,O=Math.imul(I0,k0),z=z+Math.imul(D0,w0)|0,$=$+Math.imul(D0,B0)|0,$=$+Math.imul(q0,w0)|0,O=O+Math.imul(q0,B0)|0,z=z+Math.imul(r,v0)|0,$=$+Math.imul(r,S0)|0,$=$+Math.imul(W0,v0)|0,O=O+Math.imul(W0,S0)|0,z=z+Math.imul(b,_0)|0,$=$+Math.imul(b,x0)|0,$=$+Math.imul(n,_0)|0,O=O+Math.imul(n,x0)|0,z=z+Math.imul(t,C0)|0,$=$+Math.imul(t,y)|0,$=$+Math.imul(a,C0)|0,O=O+Math.imul(a,y)|0,z=z+Math.imul(f,s)|0,$=$+Math.imul(f,J0)|0,$=$+Math.imul(u,s)|0,O=O+Math.imul(u,J0)|0,z=z+Math.imul(o,A0)|0,$=$+Math.imul(o,M0)|0,$=$+Math.imul(Q0,A0)|0,O=O+Math.imul(Q0,M0)|0,z=z+Math.imul(i,j0)|0,$=$+Math.imul(i,y0)|0,$=$+Math.imul(m,j0)|0,O=O+Math.imul(m,y0)|0,z=z+Math.imul(h,N0)|0,$=$+Math.imul(h,T0)|0,$=$+Math.imul(d,N0)|0,O=O+Math.imul(d,T0)|0;var mQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(mQ>>>26)|0,mQ&=67108863,z=Math.imul(O0,w0),$=Math.imul(O0,B0),$=$+Math.imul(I0,w0)|0,O=Math.imul(I0,B0),z=z+Math.imul(D0,v0)|0,$=$+Math.imul(D0,S0)|0,$=$+Math.imul(q0,v0)|0,O=O+Math.imul(q0,S0)|0,z=z+Math.imul(r,_0)|0,$=$+Math.imul(r,x0)|0,$=$+Math.imul(W0,_0)|0,O=O+Math.imul(W0,x0)|0,z=z+Math.imul(b,C0)|0,$=$+Math.imul(b,y)|0,$=$+Math.imul(n,C0)|0,O=O+Math.imul(n,y)|0,z=z+Math.imul(t,s)|0,$=$+Math.imul(t,J0)|0,$=$+Math.imul(a,s)|0,O=O+Math.imul(a,J0)|0,z=z+Math.imul(f,A0)|0,$=$+Math.imul(f,M0)|0,$=$+Math.imul(u,A0)|0,O=O+Math.imul(u,M0)|0,z=z+Math.imul(o,j0)|0,$=$+Math.imul(o,y0)|0,$=$+Math.imul(Q0,j0)|0,O=O+Math.imul(Q0,y0)|0,z=z+Math.imul(i,N0)|0,$=$+Math.imul(i,T0)|0,$=$+Math.imul(m,N0)|0,O=O+Math.imul(m,T0)|0;var dQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(dQ>>>26)|0,dQ&=67108863,z=Math.imul(O0,v0),$=Math.imul(O0,S0),$=$+Math.imul(I0,v0)|0,O=Math.imul(I0,S0),z=z+Math.imul(D0,_0)|0,$=$+Math.imul(D0,x0)|0,$=$+Math.imul(q0,_0)|0,O=O+Math.imul(q0,x0)|0,z=z+Math.imul(r,C0)|0,$=$+Math.imul(r,y)|0,$=$+Math.imul(W0,C0)|0,O=O+Math.imul(W0,y)|0,z=z+Math.imul(b,s)|0,$=$+Math.imul(b,J0)|0,$=$+Math.imul(n,s)|0,O=O+Math.imul(n,J0)|0,z=z+Math.imul(t,A0)|0,$=$+Math.imul(t,M0)|0,$=$+Math.imul(a,A0)|0,O=O+Math.imul(a,M0)|0,z=z+Math.imul(f,j0)|0,$=$+Math.imul(f,y0)|0,$=$+Math.imul(u,j0)|0,O=O+Math.imul(u,y0)|0,z=z+Math.imul(o,N0)|0,$=$+Math.imul(o,T0)|0,$=$+Math.imul(Q0,N0)|0,O=O+Math.imul(Q0,T0)|0;var nQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(nQ>>>26)|0,nQ&=67108863,z=Math.imul(O0,_0),$=Math.imul(O0,x0),$=$+Math.imul(I0,_0)|0,O=Math.imul(I0,x0),z=z+Math.imul(D0,C0)|0,$=$+Math.imul(D0,y)|0,$=$+Math.imul(q0,C0)|0,O=O+Math.imul(q0,y)|0,z=z+Math.imul(r,s)|0,$=$+Math.imul(r,J0)|0,$=$+Math.imul(W0,s)|0,O=O+Math.imul(W0,J0)|0,z=z+Math.imul(b,A0)|0,$=$+Math.imul(b,M0)|0,$=$+Math.imul(n,A0)|0,O=O+Math.imul(n,M0)|0,z=z+Math.imul(t,j0)|0,$=$+Math.imul(t,y0)|0,$=$+Math.imul(a,j0)|0,O=O+Math.imul(a,y0)|0,z=z+Math.imul(f,N0)|0,$=$+Math.imul(f,T0)|0,$=$+Math.imul(u,N0)|0,O=O+Math.imul(u,T0)|0;var oQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(oQ>>>26)|0,oQ&=67108863,z=Math.imul(O0,C0),$=Math.imul(O0,y),$=$+Math.imul(I0,C0)|0,O=Math.imul(I0,y),z=z+Math.imul(D0,s)|0,$=$+Math.imul(D0,J0)|0,$=$+Math.imul(q0,s)|0,O=O+Math.imul(q0,J0)|0,z=z+Math.imul(r,A0)|0,$=$+Math.imul(r,M0)|0,$=$+Math.imul(W0,A0)|0,O=O+Math.imul(W0,M0)|0,z=z+Math.imul(b,j0)|0,$=$+Math.imul(b,y0)|0,$=$+Math.imul(n,j0)|0,O=O+Math.imul(n,y0)|0,z=z+Math.imul(t,N0)|0,$=$+Math.imul(t,T0)|0,$=$+Math.imul(a,N0)|0,O=O+Math.imul(a,T0)|0;var rQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(rQ>>>26)|0,rQ&=67108863,z=Math.imul(O0,s),$=Math.imul(O0,J0),$=$+Math.imul(I0,s)|0,O=Math.imul(I0,J0),z=z+Math.imul(D0,A0)|0,$=$+Math.imul(D0,M0)|0,$=$+Math.imul(q0,A0)|0,O=O+Math.imul(q0,M0)|0,z=z+Math.imul(r,j0)|0,$=$+Math.imul(r,y0)|0,$=$+Math.imul(W0,j0)|0,O=O+Math.imul(W0,y0)|0,z=z+Math.imul(b,N0)|0,$=$+Math.imul(b,T0)|0,$=$+Math.imul(n,N0)|0,O=O+Math.imul(n,T0)|0;var iQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(iQ>>>26)|0,iQ&=67108863,z=Math.imul(O0,A0),$=Math.imul(O0,M0),$=$+Math.imul(I0,A0)|0,O=Math.imul(I0,M0),z=z+Math.imul(D0,j0)|0,$=$+Math.imul(D0,y0)|0,$=$+Math.imul(q0,j0)|0,O=O+Math.imul(q0,y0)|0,z=z+Math.imul(r,N0)|0,$=$+Math.imul(r,T0)|0,$=$+Math.imul(W0,N0)|0,O=O+Math.imul(W0,T0)|0;var tQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(tQ>>>26)|0,tQ&=67108863,z=Math.imul(O0,j0),$=Math.imul(O0,y0),$=$+Math.imul(I0,j0)|0,O=Math.imul(I0,y0),z=z+Math.imul(D0,N0)|0,$=$+Math.imul(D0,T0)|0,$=$+Math.imul(q0,N0)|0,O=O+Math.imul(q0,T0)|0;var sQ=(M+z|0)+(($&8191)<<13)|0;M=(O+($>>>13)|0)+(sQ>>>26)|0,sQ&=67108863,z=Math.imul(O0,N0),$=Math.imul(O0,T0),$=$+Math.imul(I0,N0)|0,O=Math.imul(I0,T0);var aQ=(M+z|0)+(($&8191)<<13)|0;if(M=(O+($>>>13)|0)+(aQ>>>26)|0,aQ&=67108863,A[0]=vQ,A[1]=s0,A[2]=r0,A[3]=OQ,A[4]=FQ,A[5]=hQ,A[6]=uQ,A[7]=pQ,A[8]=cQ,A[9]=lQ,A[10]=mQ,A[11]=dQ,A[12]=nQ,A[13]=oQ,A[14]=rQ,A[15]=iQ,A[16]=tQ,A[17]=sQ,A[18]=aQ,M!==0)A[19]=M,V.length++;return V};if(!Math.imul)S=j;function N(J,U,V){V.negative=U.negative^J.negative,V.length=J.length+U.length;var H=0,F=0;for(var A=0;A<V.length-1;A++){var M=F;F=0;var z=H&67108863,$=Math.min(A,U.length-1);for(var O=Math.max(0,A-J.length+1);O<=$;O++){var C=A-O,R=J.words[C]|0,w=U.words[O]|0,g=R*w,h=g&67108863;M=M+(g/67108864|0)|0,h=h+z|0,z=h&67108863,M=M+(h>>>26)|0,F+=M>>>26,M&=67108863}V.words[A]=z,H=M,M=F}if(H!==0)V.words[A]=H;else V.length--;return V.strip()}function k(J,U,V){var H=new v;return H.mulp(J,U,V)}Z.prototype.mulTo=function(J,U){var V,H=this.length+J.length;if(this.length===10&&J.length===10)V=S(this,J,U);else if(H<63)V=j(this,J,U);else if(H<1024)V=N(this,J,U);else V=k(this,J,U);return V};function v(J,U){this.x=J,this.y=U}v.prototype.makeRBT=function(J){var U=Array(J),V=Z.prototype._countBits(J)-1;for(var H=0;H<J;H++)U[H]=this.revBin(H,V,J);return U},v.prototype.revBin=function(J,U,V){if(J===0||J===V-1)return J;var H=0;for(var F=0;F<U;F++)H|=(J&1)<<U-F-1,J>>=1;return H},v.prototype.permute=function(J,U,V,H,F,A){for(var M=0;M<A;M++)H[M]=U[J[M]],F[M]=V[J[M]]},v.prototype.transform=function(J,U,V,H,F,A){this.permute(A,J,U,V,H,F);for(var M=1;M<F;M<<=1){var z=M<<1,$=Math.cos(2*Math.PI/z),O=Math.sin(2*Math.PI/z);for(var C=0;C<F;C+=z){var R=$,w=O;for(var g=0;g<M;g++){var h=V[C+g],d=H[C+g],K0=V[C+g+M],i=H[C+g+M],m=R*K0-w*i;if(i=R*i+w*K0,K0=m,V[C+g]=h+K0,H[C+g]=d+i,V[C+g+M]=h-K0,H[C+g+M]=d-i,g!==z)m=$*R-O*w,w=$*w+O*R,R=m}}}},v.prototype.guessLen13b=function(J,U){var V=Math.max(U,J)|1,H=V&1,F=0;for(V=V/2|0;V;V=V>>>1)F++;return 1<<F+1+H},v.prototype.conjugate=function(J,U,V){if(V<=1)return;for(var H=0;H<V/2;H++){var F=J[H];J[H]=J[V-H-1],J[V-H-1]=F,F=U[H],U[H]=-U[V-H-1],U[V-H-1]=-F}},v.prototype.normalize13b=function(J,U){var V=0;for(var H=0;H<U/2;H++){var F=Math.round(J[2*H+1]/U)*8192+Math.round(J[2*H]/U)+V;if(J[H]=F&67108863,F<67108864)V=0;else V=F/67108864|0}return J},v.prototype.convert13b=function(J,U,V,H){var F=0;for(var A=0;A<U;A++)F=F+(J[A]|0),V[2*A]=F&8191,F=F>>>13,V[2*A+1]=F&8191,F=F>>>13;for(A=2*U;A<H;++A)V[A]=0;G(F===0),G((F&-8192)===0)},v.prototype.stub=function(J){var U=Array(J);for(var V=0;V<J;V++)U[V]=0;return U},v.prototype.mulp=function(J,U,V){var H=2*this.guessLen13b(J.length,U.length),F=this.makeRBT(H),A=this.stub(H),M=Array(H),z=Array(H),$=Array(H),O=Array(H),C=Array(H),R=Array(H),w=V.words;w.length=H,this.convert13b(J.words,J.length,M,H),this.convert13b(U.words,U.length,O,H),this.transform(M,A,z,$,H,F),this.transform(O,A,C,R,H,F);for(var g=0;g<H;g++){var h=z[g]*C[g]-$[g]*R[g];$[g]=z[g]*R[g]+$[g]*C[g],z[g]=h}return this.conjugate(z,$,H),this.transform(z,$,w,A,H,F),this.conjugate(w,A,H),this.normalize13b(w,H),V.negative=J.negative^U.negative,V.length=J.length+U.length,V.strip()},Z.prototype.mul=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),this.mulTo(J,U)},Z.prototype.mulf=function(J){var U=new Z(null);return U.words=Array(this.length+J.length),k(this,J,U)},Z.prototype.imul=function(J){return this.clone().mulTo(J,this)},Z.prototype.imuln=function(J){G(typeof J==="number"),G(J<67108864);var U=0;for(var V=0;V<this.length;V++){var H=(this.words[V]|0)*J,F=(H&67108863)+(U&67108863);U>>=26,U+=H/67108864|0,U+=F>>>26,this.words[V]=F&67108863}if(U!==0)this.words[V]=U,this.length++;return this.length=J===0?1:this.length,this},Z.prototype.muln=function(J){return this.clone().imuln(J)},Z.prototype.sqr=function(){return this.mul(this)},Z.prototype.isqr=function(){return this.imul(this.clone())},Z.prototype.pow=function(J){var U=B(J);if(U.length===0)return new Z(1);var V=this;for(var H=0;H<U.length;H++,V=V.sqr())if(U[H]!==0)break;if(++H<U.length)for(var F=V.sqr();H<U.length;H++,F=F.sqr()){if(U[H]===0)continue;V=V.mul(F)}return V},Z.prototype.iushln=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=67108863>>>26-U<<26-U,F;if(U!==0){var A=0;for(F=0;F<this.length;F++){var M=this.words[F]&H,z=(this.words[F]|0)-M<<U;this.words[F]=z|A,A=M>>>26-U}if(A)this.words[F]=A,this.length++}if(V!==0){for(F=this.length-1;F>=0;F--)this.words[F+V]=this.words[F];for(F=0;F<V;F++)this.words[F]=0;this.length+=V}return this.strip()},Z.prototype.ishln=function(J){return G(this.negative===0),this.iushln(J)},Z.prototype.iushrn=function(J,U,V){G(typeof J==="number"&&J>=0);var H;if(U)H=(U-U%26)/26;else H=0;var F=J%26,A=Math.min((J-F)/26,this.length),M=67108863^67108863>>>F<<F,z=V;if(H-=A,H=Math.max(0,H),z){for(var $=0;$<A;$++)z.words[$]=this.words[$];z.length=A}if(A===0);else if(this.length>A){this.length-=A;for($=0;$<this.length;$++)this.words[$]=this.words[$+A]}else this.words[0]=0,this.length=1;var O=0;for($=this.length-1;$>=0&&(O!==0||$>=H);$--){var C=this.words[$]|0;this.words[$]=O<<26-F|C>>>F,O=C&M}if(z&&O!==0)z.words[z.length++]=O;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Z.prototype.ishrn=function(J,U,V){return G(this.negative===0),this.iushrn(J,U,V)},Z.prototype.shln=function(J){return this.clone().ishln(J)},Z.prototype.ushln=function(J){return this.clone().iushln(J)},Z.prototype.shrn=function(J){return this.clone().ishrn(J)},Z.prototype.ushrn=function(J){return this.clone().iushrn(J)},Z.prototype.testn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return!1;var F=this.words[V];return!!(F&H)},Z.prototype.imaskn=function(J){G(typeof J==="number"&&J>=0);var U=J%26,V=(J-U)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=V)return this;if(U!==0)V++;if(this.length=Math.min(V,this.length),U!==0){var H=67108863^67108863>>>U<<U;this.words[this.length-1]&=H}return this.strip()},Z.prototype.maskn=function(J){return this.clone().imaskn(J)},Z.prototype.iaddn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},Z.prototype._iaddn=function(J){this.words[0]+=J;for(var U=0;U<this.length&&this.words[U]>=67108864;U++)if(this.words[U]-=67108864,U===this.length-1)this.words[U+1]=1;else this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},Z.prototype.isubn=function(J){if(G(typeof J==="number"),G(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U<this.length&&this.words[U]<0;U++)this.words[U]+=67108864,this.words[U+1]-=1;return this.strip()},Z.prototype.addn=function(J){return this.clone().iaddn(J)},Z.prototype.subn=function(J){return this.clone().isubn(J)},Z.prototype.iabs=function(){return this.negative=0,this},Z.prototype.abs=function(){return this.clone().iabs()},Z.prototype._ishlnsubmul=function(J,U,V){var H=J.length+V,F;this._expand(H);var A,M=0;for(F=0;F<J.length;F++){A=(this.words[F+V]|0)+M;var z=(J.words[F]|0)*U;A-=z&67108863,M=(A>>26)-(z/67108864|0),this.words[F+V]=A&67108863}for(;F<this.length-V;F++)A=(this.words[F+V]|0)+M,M=A>>26,this.words[F+V]=A&67108863;if(M===0)return this.strip();G(M===-1),M=0;for(F=0;F<this.length;F++)A=-(this.words[F]|0)+M,M=A>>26,this.words[F]=A&67108863;return this.negative=1,this.strip()},Z.prototype._wordDiv=function(J,U){var V=this.length-J.length,H=this.clone(),F=J,A=F.words[F.length-1]|0,M=this._countBits(A);if(V=26-M,V!==0)F=F.ushln(V),H.iushln(V),A=F.words[F.length-1]|0;var z=H.length-F.length,$;if(U!=="mod"){$=new Z(null),$.length=z+1,$.words=Array($.length);for(var O=0;O<$.length;O++)$.words[O]=0}var C=H.clone()._ishlnsubmul(F,1,z);if(C.negative===0){if(H=C,$)$.words[z]=1}for(var R=z-1;R>=0;R--){var w=(H.words[F.length+R]|0)*67108864+(H.words[F.length+R-1]|0);w=Math.min(w/A|0,67108863),H._ishlnsubmul(F,w,R);while(H.negative!==0)if(w--,H.negative=0,H._ishlnsubmul(F,1,R),!H.isZero())H.negative^=1;if($)$.words[R]=w}if($)$.strip();if(H.strip(),U!=="div"&&V!==0)H.iushrn(V);return{div:$||null,mod:H}},Z.prototype.divmod=function(J,U,V){if(G(!J.isZero()),this.isZero())return{div:new Z(0),mod:new Z(0)};var H,F,A;if(this.negative!==0&&J.negative===0){if(A=this.neg().divmod(J,U),U!=="mod")H=A.div.neg();if(U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.iadd(J)}return{div:H,mod:F}}if(this.negative===0&&J.negative!==0){if(A=this.divmod(J.neg(),U),U!=="mod")H=A.div.neg();return{div:H,mod:A.mod}}if((this.negative&J.negative)!==0){if(A=this.neg().divmod(J.neg(),U),U!=="div"){if(F=A.mod.neg(),V&&F.negative!==0)F.isub(J)}return{div:A.div,mod:F}}if(J.length>this.length||this.cmp(J)<0)return{div:new Z(0),mod:this};if(J.length===1){if(U==="div")return{div:this.divn(J.words[0]),mod:null};if(U==="mod")return{div:null,mod:new Z(this.modn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new Z(this.modn(J.words[0]))}}return this._wordDiv(J,U)},Z.prototype.div=function(J){return this.divmod(J,"div",!1).div},Z.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},Z.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},Z.prototype.divRound=function(J){var U=this.divmod(J);if(U.mod.isZero())return U.div;var V=U.div.negative!==0?U.mod.isub(J):U.mod,H=J.ushrn(1),F=J.andln(1),A=V.cmp(H);if(A<0||F===1&&A===0)return U.div;return U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},Z.prototype.modn=function(J){G(J<=67108863);var U=67108864%J,V=0;for(var H=this.length-1;H>=0;H--)V=(U*V+(this.words[H]|0))%J;return V},Z.prototype.idivn=function(J){G(J<=67108863);var U=0;for(var V=this.length-1;V>=0;V--){var H=(this.words[V]|0)+U*67108864;this.words[V]=H/J|0,U=H%J}return this.strip()},Z.prototype.divn=function(J){return this.clone().idivn(J)},Z.prototype.egcd=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=new Z(0),M=new Z(1),z=0;while(U.isEven()&&V.isEven())U.iushrn(1),V.iushrn(1),++z;var $=V.clone(),O=U.clone();while(!U.isZero()){for(var C=0,R=1;(U.words[0]&R)===0&&C<26;++C,R<<=1);if(C>0){U.iushrn(C);while(C-- >0){if(H.isOdd()||F.isOdd())H.iadd($),F.isub(O);H.iushrn(1),F.iushrn(1)}}for(var w=0,g=1;(V.words[0]&g)===0&&w<26;++w,g<<=1);if(w>0){V.iushrn(w);while(w-- >0){if(A.isOdd()||M.isOdd())A.iadd($),M.isub(O);A.iushrn(1),M.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(A),F.isub(M);else V.isub(U),A.isub(H),M.isub(F)}return{a:A,b:M,gcd:V.iushln(z)}},Z.prototype._invmp=function(J){G(J.negative===0),G(!J.isZero());var U=this,V=J.clone();if(U.negative!==0)U=U.umod(J);else U=U.clone();var H=new Z(1),F=new Z(0),A=V.clone();while(U.cmpn(1)>0&&V.cmpn(1)>0){for(var M=0,z=1;(U.words[0]&z)===0&&M<26;++M,z<<=1);if(M>0){U.iushrn(M);while(M-- >0){if(H.isOdd())H.iadd(A);H.iushrn(1)}}for(var $=0,O=1;(V.words[0]&O)===0&&$<26;++$,O<<=1);if($>0){V.iushrn($);while($-- >0){if(F.isOdd())F.iadd(A);F.iushrn(1)}}if(U.cmp(V)>=0)U.isub(V),H.isub(F);else V.isub(U),F.isub(H)}var C;if(U.cmpn(1)===0)C=H;else C=F;if(C.cmpn(0)<0)C.iadd(J);return C},Z.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var U=this.clone(),V=J.clone();U.negative=0,V.negative=0;for(var H=0;U.isEven()&&V.isEven();H++)U.iushrn(1),V.iushrn(1);do{while(U.isEven())U.iushrn(1);while(V.isEven())V.iushrn(1);var F=U.cmp(V);if(F<0){var A=U;U=V,V=A}else if(F===0||V.cmpn(1)===0)break;U.isub(V)}while(!0);return V.iushln(H)},Z.prototype.invm=function(J){return this.egcd(J).a.umod(J)},Z.prototype.isEven=function(){return(this.words[0]&1)===0},Z.prototype.isOdd=function(){return(this.words[0]&1)===1},Z.prototype.andln=function(J){return this.words[0]&J},Z.prototype.bincn=function(J){G(typeof J==="number");var U=J%26,V=(J-U)/26,H=1<<U;if(this.length<=V)return this._expand(V+1),this.words[V]|=H,this;var F=H;for(var A=V;F!==0&&A<this.length;A++){var M=this.words[A]|0;M+=F,F=M>>>26,M&=67108863,this.words[A]=M}if(F!==0)this.words[A]=F,this.length++;return this},Z.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Z.prototype.cmpn=function(J){var U=J<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var V;if(this.length>1)V=1;else{if(U)J=-J;G(J<=67108863,"Number is too big");var H=this.words[0]|0;V=H===J?0:H<J?-1:1}if(this.negative!==0)return-V|0;return V},Z.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var U=this.ucmp(J);if(this.negative!==0)return-U|0;return U},Z.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var U=0;for(var V=this.length-1;V>=0;V--){var H=this.words[V]|0,F=J.words[V]|0;if(H===F)continue;if(H<F)U=-1;else if(H>F)U=1;break}return U},Z.prototype.gtn=function(J){return this.cmpn(J)===1},Z.prototype.gt=function(J){return this.cmp(J)===1},Z.prototype.gten=function(J){return this.cmpn(J)>=0},Z.prototype.gte=function(J){return this.cmp(J)>=0},Z.prototype.ltn=function(J){return this.cmpn(J)===-1},Z.prototype.lt=function(J){return this.cmp(J)===-1},Z.prototype.lten=function(J){return this.cmpn(J)<=0},Z.prototype.lte=function(J){return this.cmp(J)<=0},Z.prototype.eqn=function(J){return this.cmpn(J)===0},Z.prototype.eq=function(J){return this.cmp(J)===0},Z.red=function(J){return new p(J)},Z.prototype.toRed=function(J){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},Z.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Z.prototype._forceRed=function(J){return this.red=J,this},Z.prototype.forceRed=function(J){return G(!this.red,"Already a number in reduction context"),this._forceRed(J)},Z.prototype.redAdd=function(J){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},Z.prototype.redIAdd=function(J){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},Z.prototype.redSub=function(J){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},Z.prototype.redISub=function(J){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},Z.prototype.redShl=function(J){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},Z.prototype.redMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},Z.prototype.redIMul=function(J){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},Z.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Z.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Z.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Z.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Z.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Z.prototype.redPow=function(J){return G(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var _={k256:null,p224:null,p192:null,p25519:null};function x(J,U){this.name=J,this.p=new Z(U,16),this.n=this.p.bitLength(),this.k=new Z(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}x.prototype._tmp=function(){var J=new Z(null);return J.words=Array(Math.ceil(this.n/13)),J},x.prototype.ireduce=function(J){var U=J,V;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),V=U.bitLength();while(V>this.n);var H=V<this.n?-1:U.ucmp(this.p);if(H===0)U.words[0]=0,U.length=1;else if(H>0)U.isub(this.p);else if(U.strip!==void 0)U.strip();else U._strip();return U},x.prototype.split=function(J,U){J.iushrn(this.n,0,U)},x.prototype.imulK=function(J){return J.imul(this.k)};function c(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(c,x),c.prototype.split=function(J,U){var V=4194303,H=Math.min(J.length,9);for(var F=0;F<H;F++)U.words[F]=J.words[F];if(U.length=H,J.length<=9){J.words[0]=0,J.length=1;return}var A=J.words[9];U.words[U.length++]=A&V;for(F=10;F<J.length;F++){var M=J.words[F]|0;J.words[F-10]=(M&V)<<4|A>>>22,A=M}if(A>>>=22,J.words[F-10]=A,A===0&&J.length>10)J.length-=10;else J.length-=9},c.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var U=0;for(var V=0;V<J.length;V++){var H=J.words[V]|0;U+=H*977,J.words[V]=U&67108863,U=H*64+(U/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function Y0(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(Y0,x);function $0(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K($0,x);function e(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(e,x),e.prototype.imulK=function(J){var U=0;for(var V=0;V<J.length;V++){var H=(J.words[V]|0)*19+U,F=H&67108863;H>>>=26,J.words[V]=F,U=H}if(U!==0)J.words[J.length++]=U;return J},Z._prime=function(J){if(_[J])return _[J];var U;if(J==="k256")U=new c;else if(J==="p224")U=new Y0;else if(J==="p192")U=new $0;else if(J==="p25519")U=new e;else throw Error("Unknown prime "+J);return _[J]=U,U};function p(J){if(typeof J==="string"){var U=Z._prime(J);this.m=U.p,this.prime=U}else G(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}p.prototype._verify1=function(J){G(J.negative===0,"red works only with positives"),G(J.red,"red works only with red numbers")},p.prototype._verify2=function(J,U){G((J.negative|U.negative)===0,"red works only with positives"),G(J.red&&J.red===U.red,"red works only with red numbers")},p.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return J.umod(this.m)._forceRed(this)},p.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},p.prototype.add=function(J,U){this._verify2(J,U);var V=J.add(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V._forceRed(this)},p.prototype.iadd=function(J,U){this._verify2(J,U);var V=J.iadd(U);if(V.cmp(this.m)>=0)V.isub(this.m);return V},p.prototype.sub=function(J,U){this._verify2(J,U);var V=J.sub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V._forceRed(this)},p.prototype.isub=function(J,U){this._verify2(J,U);var V=J.isub(U);if(V.cmpn(0)<0)V.iadd(this.m);return V},p.prototype.shl=function(J,U){return this._verify1(J),this.imod(J.ushln(U))},p.prototype.imul=function(J,U){return this._verify2(J,U),this.imod(J.imul(U))},p.prototype.mul=function(J,U){return this._verify2(J,U),this.imod(J.mul(U))},p.prototype.isqr=function(J){return this.imul(J,J.clone())},p.prototype.sqr=function(J){return this.mul(J,J)},p.prototype.sqrt=function(J){if(J.isZero())return J.clone();var U=this.m.andln(3);if(G(U%2===1),U===3){var V=this.m.add(new Z(1)).iushrn(2);return this.pow(J,V)}var H=this.m.subn(1),F=0;while(!H.isZero()&&H.andln(1)===0)F++,H.iushrn(1);G(!H.isZero());var A=new Z(1).toRed(this),M=A.redNeg(),z=this.m.subn(1).iushrn(1),$=this.m.bitLength();$=new Z(2*$*$).toRed(this);while(this.pow($,z).cmp(M)!==0)$.redIAdd(M);var O=this.pow($,H),C=this.pow(J,H.addn(1).iushrn(1)),R=this.pow(J,H),w=F;while(R.cmp(A)!==0){var g=R;for(var h=0;g.cmp(A)!==0;h++)g=g.redSqr();G(h<w);var d=this.pow(O,new Z(1).iushln(w-h-1));C=C.redMul(d),O=d.redSqr(),R=R.redMul(O),w=h}return C},p.prototype.invm=function(J){var U=J._invmp(this.m);if(U.negative!==0)return U.negative=0,this.imod(U).redNeg();else return this.imod(U)},p.prototype.pow=function(J,U){if(U.isZero())return new Z(1).toRed(this);if(U.cmpn(1)===0)return J.clone();var V=4,H=Array(1<<V);H[0]=new Z(1).toRed(this),H[1]=J;for(var F=2;F<H.length;F++)H[F]=this.mul(H[F-1],J);var A=H[0],M=0,z=0,$=U.bitLength()%26;if($===0)$=26;for(F=U.length-1;F>=0;F--){var O=U.words[F];for(var C=$-1;C>=0;C--){var R=O>>C&1;if(A!==H[0])A=this.sqr(A);if(R===0&&M===0){z=0;continue}if(M<<=1,M|=R,z++,z!==V&&(F!==0||C!==0))continue;A=this.mul(A,H[M]),z=0,M=0}$=26}return A},p.prototype.convertTo=function(J){var U=J.umod(this.m);return U===J?U.clone():U},p.prototype.convertFrom=function(J){var U=J.clone();return U.red=null,U},Z.mont=function(J){return new X0(J)};function X0(J){if(p.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Z(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(X0,p),X0.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},X0.prototype.convertFrom=function(J){var U=this.imod(J.mul(this.rinv));return U.red=null,U},X0.prototype.imul=function(J,U){if(J.isZero()||U.isZero())return J.words[0]=0,J.length=1,J;var V=J.imul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.mul=function(J,U){if(J.isZero()||U.isZero())return new Z(0)._forceRed(this);var V=J.mul(U),H=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=V.isub(H).iushrn(this.shift),A=F;if(F.cmp(this.m)>=0)A=F.isub(this.m);else if(F.cmpn(0)<0)A=F.iadd(this.m);return A._forceRed(this)},X0.prototype.invm=function(J){var U=this.imod(J._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(typeof X>"u"||X,Q)}),MF=H0((Q,X)=>{var Y=KH(),W=LX().Buffer;function G(K,Z){return W.from(K.toRed(Y.mont(Z.modulus)).redPow(new Y(Z.publicExponent)).fromRed().toArray())}X.exports=G}),vP=H0((Q,X)=>{(function(Y,W){function G(H,F){if(!H)throw Error(F||"Assertion failed")}function K(H,F){H.super_=F;var A=function(){};A.prototype=F.prototype,H.prototype=new A,H.prototype.constructor=H}function Z(H,F,A){if(Z.isBN(H))return H;if(this.negative=0,this.words=null,this.length=0,this.red=null,H!==null){if(F==="le"||F==="be")A=F,F=10;this._init(H||0,F||10,A||"be")}}if(typeof Y==="object")Y.exports=Z;else W.BN=Z;Z.BN=Z,Z.wordSize=26;var q;try{if(typeof window<"u"&&typeof window.Buffer<"u")q=window.Buffer;else q=(JX(),WQ(YX)).Buffer}catch(H){}Z.isBN=function(H){if(H instanceof Z)return!0;return H!==null&&typeof H==="object"&&H.constructor.wordSize===Z.wordSize&&Array.isArray(H.words)},Z.max=function(H,F){if(H.cmp(F)>0)return H;return F},Z.min=function(H,F){if(H.cmp(F)<0)return H;return F},Z.prototype._init=function(H,F,A){if(typeof H==="number")return this._initNumber(H,F,A);if(typeof H==="object")return this._initArray(H,F,A);if(F==="hex")F=16;G(F===(F|0)&&F>=2&&F<=36),H=H.toString().replace(/\s+/g,"");var M=0;if(H[0]==="-")M++,this.negative=1;if(M<H.length){if(F===16)this._parseHex(H,M,A);else if(this._parseBase(H,F,M),A==="le")this._initArray(this.toArray(),F,A)}},Z.prototype._initNumber=function(H,F,A){if(H<0)this.negative=1,H=-H;if(H<67108864)this.words=[H&67108863],this.length=1;else if(H<4503599627370496)this.words=[H&67108863,H/67108864&67108863],this.length=2;else G(H<9007199254740992),this.words=[H&67108863,H/67108864&67108863,1],this.length=3;if(A!=="le")return;this._initArray(this.toArray(),F,A)},Z.prototype._initArray=function(H,F,A){if(G(typeof H.length==="number"),H.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(H.length/3),this.words=Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var z,$,O=0;if(A==="be"){for(M=H.length-1,z=0;M>=0;M-=3)if($=H[M]|H[M-1]<<8|H[M-2]<<16,this.words[z]|=$<<O&67108863,this.words[z+1]=$>>>26-O&67108863,O+=24,O>=26)O-=26,z++}else if(A==="le"){for(M=0,z=0;M<H.length;M+=3)if($=H[M]|H[M+1]<<8|H[M+2]<<16,this.words[z]|=$<<O&67108863,this.words[z+1]=$>>>26-O&67108863,O+=24,O>=26)O-=26,z++}return this._strip()};function E(H,F){var A=H.charCodeAt(F);if(A>=48&&A<=57)return A-48;else if(A>=65&&A<=70)return A-55;else if(A>=97&&A<=102)return A-87;else G(!1,"Invalid character in "+H)}function I(H,F,A){var M=E(H,A);if(A-1>=F)M|=E(H,A-1)<<4;return M}Z.prototype._parseHex=function(H,F,A){this.length=Math.ceil((H.length-F)/6),this.words=Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var z=0,$=0,O;if(A==="be")for(M=H.length-1;M>=F;M-=2)if(O=I(H,F,M)<<z,this.words[$]|=O&67108863,z>=18)z-=18,$+=1,this.words[$]|=O>>>26;else z+=8;else{var C=H.length-F;for(M=C%2===0?F+1:F;M<H.length;M+=2)if(O=I(H,F,M)<<z,this.words[$]|=O&67108863,z>=18)z-=18,$+=1,this.words[$]|=O>>>26;else z+=8}this._strip()};function L(H,F,A,M){var z=0,$=0,O=Math.min(H.length,A);for(var C=F;C<O;C++){var R=H.charCodeAt(C)-48;if(z*=M,R>=49)$=R-49+10;else if(R>=17)$=R-17+10;else $=R;G(R>=0&&$<M,"Invalid character"),z+=$}return z}Z.prototype._parseBase=function(H,F,A){this.words=[0],this.length=1;for(var M=0,z=1;z<=67108863;z*=F)M++;M--,z=z/F|0;var $=H.length-A,O=$%M,C=Math.min($,$-O)+A,R=0;for(var w=A;w<C;w+=M)if(R=L(H,w,w+M,F),this.imuln(z),this.words[0]+R<67108864)this.words[0]+=R;else this._iaddn(R);if(O!==0){var g=1;R=L(H,w,H.length,F);for(w=0;w<O;w++)g*=F;if(this.imuln(g),this.words[0]+R<67108864)this.words[0]+=R;else this._iaddn(R)}this._strip()},Z.prototype.copy=function(H){H.words=Array(this.length);for(var F=0;F<this.length;F++)H.words[F]=this.words[F];H.length=this.length,H.negative=this.negative,H.red=this.red};function D(H,F){H.words=F.words,H.length=F.length,H.negative=F.negative,H.red=F.red}if(Z.prototype._move=function(H){D(H,this)},Z.prototype.clone=function(){var H=new Z(null);return this.copy(H),H},Z.prototype._expand=function(H){while(this.length<H)this.words[this.length++]=0;return this},Z.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Z.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{Z.prototype[Symbol.for("nodejs.util.inspect.custom")]=T}catch(H){Z.prototype.inspect=T}else Z.prototype.inspect=T;function T(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var P=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],B=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],j=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Z.prototype.toString=function(H,F){H=H||10,F=F|0||1;var A;if(H===16||H==="hex"){A="";var M=0,z=0;for(var $=0;$<this.length;$++){var O=this.words[$],C=((O<<M|z)&16777215).toString(16);if(z=O>>>24-M&16777215,M+=2,M>=26)M-=26,$--;if(z!==0||$!==this.length-1)A=P[6-C.length]+C+A;else A=C+A}if(z!==0)A=z.toString(16)+A;while(A.length%F!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}if(H===(H|0)&&H>=2&&H<=36){var R=B[H],w=j[H];A="";var g=this.clone();g.negative=0;while(!g.isZero()){var h=g.modrn(w).toString(H);if(g=g.idivn(w),!g.isZero())A=P[R-h.length]+h+A;else A=h+A}if(this.isZero())A="0"+A;while(A.length%F!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}G(!1,"Base should be between 2 and 36")},Z.prototype.toNumber=function(){var H=this.words[0];if(this.length===2)H+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)H+=4503599627370496+this.words[1]*67108864;else if(this.length>2)G(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-H:H},Z.prototype.toJSON=function(){return this.toString(16,2)},q)Z.prototype.toBuffer=function(H,F){return this.toArrayLike(q,H,F)};Z.prototype.toArray=function(H,F){return this.toArrayLike(Array,H,F)};var S=function(H,F){if(H.allocUnsafe)return H.allocUnsafe(F);return new H(F)};if(Z.prototype.toArrayLike=function(H,F,A){this._strip();var M=this.byteLength(),z=A||Math.max(1,M);G(M<=z,"byte array longer than desired length"),G(z>0,"Requested array length <= 0");var $=S(H,z),O=F==="le"?"LE":"BE";return this["_toArrayLike"+O]($,M),$},Z.prototype._toArrayLikeLE=function(H,F){var A=0,M=0;for(var z=0,$=0;z<this.length;z++){var O=this.words[z]<<$|M;if(H[A++]=O&255,A<H.length)H[A++]=O>>8&255;if(A<H.length)H[A++]=O>>16&255;if($===6){if(A<H.length)H[A++]=O>>24&255;M=0,$=0}else M=O>>>24,$+=2}if(A<H.length){H[A++]=M;while(A<H.length)H[A++]=0}},Z.prototype._toArrayLikeBE=function(H,F){var A=H.length-1,M=0;for(var z=0,$=0;z<this.length;z++){var O=this.words[z]<<$|M;if(H[A--]=O&255,A>=0)H[A--]=O>>8&255;if(A>=0)H[A--]=O>>16&255;if($===6){if(A>=0)H[A--]=O>>24&255;M=0,$=0}else M=O>>>24,$+=2}if(A>=0){H[A--]=M;while(A>=0)H[A--]=0}},Math.clz32)Z.prototype._countBits=function(H){return 32-Math.clz32(H)};else Z.prototype._countBits=function(H){var F=H,A=0;if(F>=4096)A+=13,F>>>=13;if(F>=64)A+=7,F>>>=7;if(F>=8)A+=4,F>>>=4;if(F>=2)A+=2,F>>>=2;return A+F};Z.prototype._zeroBits=function(H){if(H===0)return 26;var F=H,A=0;if((F&8191)===0)A+=13,F>>>=13;if((F&127)===0)A+=7,F>>>=7;if((F&15)===0)A+=4,F>>>=4;if((F&3)===0)A+=2,F>>>=2;if((F&1)===0)A++;return A},Z.prototype.bitLength=function(){var H=this.words[this.length-1],F=this._countBits(H);return(this.length-1)*26+F};function N(H){var F=Array(H.bitLength());for(var A=0;A<F.length;A++){var M=A/26|0,z=A%26;F[A]=H.words[M]>>>z&1}return F}Z.prototype.zeroBits=function(){if(this.isZero())return 0;var H=0;for(var F=0;F<this.length;F++){var A=this._zeroBits(this.words[F]);if(H+=A,A!==26)break}return H},Z.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Z.prototype.toTwos=function(H){if(this.negative!==0)return this.abs().inotn(H).iaddn(1);return this.clone()},Z.prototype.fromTwos=function(H){if(this.testn(H-1))return this.notn(H).iaddn(1).ineg();return this.clone()},Z.prototype.isNeg=function(){return this.negative!==0},Z.prototype.neg=function(){return this.clone().ineg()},Z.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Z.prototype.iuor=function(H){while(this.length<H.length)this.words[this.length++]=0;for(var F=0;F<H.length;F++)this.words[F]=this.words[F]|H.words[F];return this._strip()},Z.prototype.ior=function(H){return G((this.negative|H.negative)===0),this.iuor(H)},Z.prototype.or=function(H){if(this.length>H.length)return this.clone().ior(H);return H.clone().ior(this)},Z.prototype.uor=function(H){if(this.length>H.length)return this.clone().iuor(H);return H.clone().iuor(this)},Z.prototype.iuand=function(H){var F;if(this.length>H.length)F=H;else F=this;for(var A=0;A<F.length;A++)this.words[A]=this.words[A]&H.words[A];return this.length=F.length,this._strip()},Z.prototype.iand=function(H){return G((this.negative|H.negative)===0),this.iuand(H)},Z.prototype.and=function(H){if(this.length>H.length)return this.clone().iand(H);return H.clone().iand(this)},Z.prototype.uand=function(H){if(this.length>H.length)return this.clone().iuand(H);return H.clone().iuand(this)},Z.prototype.iuxor=function(H){var F,A;if(this.length>H.length)F=this,A=H;else F=H,A=this;for(var M=0;M<A.length;M++)this.words[M]=F.words[M]^A.words[M];if(this!==F)for(;M<F.length;M++)this.words[M]=F.words[M];return this.length=F.length,this._strip()},Z.prototype.ixor=function(H){return G((this.negative|H.negative)===0),this.iuxor(H)},Z.prototype.xor=function(H){if(this.length>H.length)return this.clone().ixor(H);return H.clone().ixor(this)},Z.prototype.uxor=function(H){if(this.length>H.length)return this.clone().iuxor(H);return H.clone().iuxor(this)},Z.prototype.inotn=function(H){G(typeof H==="number"&&H>=0);var F=Math.ceil(H/26)|0,A=H%26;if(this._expand(F),A>0)F--;for(var M=0;M<F;M++)this.words[M]=~this.words[M]&67108863;if(A>0)this.words[M]=~this.words[M]&67108863>>26-A;return this._strip()},Z.prototype.notn=function(H){return this.clone().inotn(H)},Z.prototype.setn=function(H,F){G(typeof H==="number"&&H>=0);var A=H/26|0,M=H%26;if(this._expand(A+1),F)this.words[A]=this.words[A]|1<<M;else this.words[A]=this.words[A]&~(1<<M);return this._strip()},Z.prototype.iadd=function(H){var F;if(this.negative!==0&&H.negative===0)return this.negative=0,F=this.isub(H),this.negative^=1,this._normSign();else if(this.negative===0&&H.negative!==0)return H.negative=0,F=this.isub(H),H.negative=1,F._normSign();var A,M;if(this.length>H.length)A=this,M=H;else A=H,M=this;var z=0;for(var $=0;$<M.length;$++)F=(A.words[$]|0)+(M.words[$]|0)+z,this.words[$]=F&67108863,z=F>>>26;for(;z!==0&&$<A.length;$++)F=(A.words[$]|0)+z,this.words[$]=F&67108863,z=F>>>26;if(this.length=A.length,z!==0)this.words[this.length]=z,this.length++;else if(A!==this)for(;$<A.length;$++)this.words[$]=A.words[$];return this},Z.prototype.add=function(H){var F;if(H.negative!==0&&this.negative===0)return H.negative=0,F=this.sub(H),H.negative^=1,F;else if(H.negative===0&&this.negative!==0)return this.negative=0,F=H.sub(this),this.negative=1,F;if(this.length>H.length)return this.clone().iadd(H);return H.clone().iadd(this)},Z.prototype.isub=function(H){if(H.negative!==0){H.negative=0;var F=this.iadd(H);return H.negative=1,F._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(H),this.negative=1,this._normSign();var A=this.cmp(H);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,z;if(A>0)M=this,z=H;else M=H,z=this;var $=0;for(var O=0;O<z.length;O++)F=(M.words[O]|0)-(z.words[O]|0)+$,$=F>>26,this.words[O]=F&67108863;for(;$!==0&&O<M.length;O++)F=(M.words[O]|0)+$,$=F>>26,this.words[O]=F&67108863;if($===0&&O<M.length&&M!==this)for(;O<M.length;O++)this.words[O]=M.words[O];if(this.length=Math.max(this.length,O),M!==this)this.negative=1;return this._strip()},Z.prototype.sub=function(H){return this.clone().isub(H)};function k(H,F,A){A.negative=F.negative^H.negative;var M=H.length+F.length|0;A.length=M,M=M-1|0;var z=H.words[0]|0,$=F.words[0]|0,O=z*$,C=O&67108863,R=O/67108864|0;A.words[0]=C;for(var w=1;w<M;w++){var g=R>>>26,h=R&67108863,d=Math.min(w,F.length-1);for(var K0=Math.max(0,w-H.length+1);K0<=d;K0++){var i=w-K0|0;z=H.words[i]|0,$=F.words[K0]|0,O=z*$+h,g+=O/67108864|0,h=O&67108863}A.words[w]=h|0,R=g|0}if(R!==0)A.words[w]=R|0;else A.length--;return A._strip()}var v=function(H,F,A){var M=H.words,z=F.words,$=A.words,O=0,C,R,w,g=M[0]|0,h=g&8191,d=g>>>13,K0=M[1]|0,i=K0&8191,m=K0>>>13,G0=M[2]|0,o=G0&8191,Q0=G0>>>13,f0=M[3]|0,f=f0&8191,u=f0>>>13,Z0=M[4]|0,t=Z0&8191,a=Z0>>>13,R0=M[5]|0,b=R0&8191,n=R0>>>13,g0=M[6]|0,r=g0&8191,W0=g0>>>13,m0=M[7]|0,D0=m0&8191,q0=m0>>>13,kQ=M[8]|0,O0=kQ&8191,I0=kQ>>>13,yQ=M[9]|0,E0=yQ&8191,L0=yQ>>>13,OX=z[0]|0,P0=OX&8191,k0=OX>>>13,AX=z[1]|0,w0=AX&8191,B0=AX>>>13,GX=z[2]|0,v0=GX&8191,S0=GX>>>13,eQ=z[3]|0,_0=eQ&8191,x0=eQ>>>13,QX=z[4]|0,C0=QX&8191,y=QX>>>13,l=z[5]|0,s=l&8191,J0=l>>>13,b0=z[6]|0,A0=b0&8191,M0=b0>>>13,wQ=z[7]|0,j0=wQ&8191,y0=wQ>>>13,$X=z[8]|0,N0=$X&8191,T0=$X>>>13,vQ=z[9]|0,s0=vQ&8191,r0=vQ>>>13;A.negative=H.negative^F.negative,A.length=19,C=Math.imul(h,P0),R=Math.imul(h,k0),R=R+Math.imul(d,P0)|0,w=Math.imul(d,k0);var OQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(OQ>>>26)|0,OQ&=67108863,C=Math.imul(i,P0),R=Math.imul(i,k0),R=R+Math.imul(m,P0)|0,w=Math.imul(m,k0),C=C+Math.imul(h,w0)|0,R=R+Math.imul(h,B0)|0,R=R+Math.imul(d,w0)|0,w=w+Math.imul(d,B0)|0;var FQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(FQ>>>26)|0,FQ&=67108863,C=Math.imul(o,P0),R=Math.imul(o,k0),R=R+Math.imul(Q0,P0)|0,w=Math.imul(Q0,k0),C=C+Math.imul(i,w0)|0,R=R+Math.imul(i,B0)|0,R=R+Math.imul(m,w0)|0,w=w+Math.imul(m,B0)|0,C=C+Math.imul(h,v0)|0,R=R+Math.imul(h,S0)|0,R=R+Math.imul(d,v0)|0,w=w+Math.imul(d,S0)|0;var hQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(hQ>>>26)|0,hQ&=67108863,C=Math.imul(f,P0),R=Math.imul(f,k0),R=R+Math.imul(u,P0)|0,w=Math.imul(u,k0),C=C+Math.imul(o,w0)|0,R=R+Math.imul(o,B0)|0,R=R+Math.imul(Q0,w0)|0,w=w+Math.imul(Q0,B0)|0,C=C+Math.imul(i,v0)|0,R=R+Math.imul(i,S0)|0,R=R+Math.imul(m,v0)|0,w=w+Math.imul(m,S0)|0,C=C+Math.imul(h,_0)|0,R=R+Math.imul(h,x0)|0,R=R+Math.imul(d,_0)|0,w=w+Math.imul(d,x0)|0;var uQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(uQ>>>26)|0,uQ&=67108863,C=Math.imul(t,P0),R=Math.imul(t,k0),R=R+Math.imul(a,P0)|0,w=Math.imul(a,k0),C=C+Math.imul(f,w0)|0,R=R+Math.imul(f,B0)|0,R=R+Math.imul(u,w0)|0,w=w+Math.imul(u,B0)|0,C=C+Math.imul(o,v0)|0,R=R+Math.imul(o,S0)|0,R=R+Math.imul(Q0,v0)|0,w=w+Math.imul(Q0,S0)|0,C=C+Math.imul(i,_0)|0,R=R+Math.imul(i,x0)|0,R=R+Math.imul(m,_0)|0,w=w+Math.imul(m,x0)|0,C=C+Math.imul(h,C0)|0,R=R+Math.imul(h,y)|0,R=R+Math.imul(d,C0)|0,w=w+Math.imul(d,y)|0;var pQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(pQ>>>26)|0,pQ&=67108863,C=Math.imul(b,P0),R=Math.imul(b,k0),R=R+Math.imul(n,P0)|0,w=Math.imul(n,k0),C=C+Math.imul(t,w0)|0,R=R+Math.imul(t,B0)|0,R=R+Math.imul(a,w0)|0,w=w+Math.imul(a,B0)|0,C=C+Math.imul(f,v0)|0,R=R+Math.imul(f,S0)|0,R=R+Math.imul(u,v0)|0,w=w+Math.imul(u,S0)|0,C=C+Math.imul(o,_0)|0,R=R+Math.imul(o,x0)|0,R=R+Math.imul(Q0,_0)|0,w=w+Math.imul(Q0,x0)|0,C=C+Math.imul(i,C0)|0,R=R+Math.imul(i,y)|0,R=R+Math.imul(m,C0)|0,w=w+Math.imul(m,y)|0,C=C+Math.imul(h,s)|0,R=R+Math.imul(h,J0)|0,R=R+Math.imul(d,s)|0,w=w+Math.imul(d,J0)|0;var cQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(cQ>>>26)|0,cQ&=67108863,C=Math.imul(r,P0),R=Math.imul(r,k0),R=R+Math.imul(W0,P0)|0,w=Math.imul(W0,k0),C=C+Math.imul(b,w0)|0,R=R+Math.imul(b,B0)|0,R=R+Math.imul(n,w0)|0,w=w+Math.imul(n,B0)|0,C=C+Math.imul(t,v0)|0,R=R+Math.imul(t,S0)|0,R=R+Math.imul(a,v0)|0,w=w+Math.imul(a,S0)|0,C=C+Math.imul(f,_0)|0,R=R+Math.imul(f,x0)|0,R=R+Math.imul(u,_0)|0,w=w+Math.imul(u,x0)|0,C=C+Math.imul(o,C0)|0,R=R+Math.imul(o,y)|0,R=R+Math.imul(Q0,C0)|0,w=w+Math.imul(Q0,y)|0,C=C+Math.imul(i,s)|0,R=R+Math.imul(i,J0)|0,R=R+Math.imul(m,s)|0,w=w+Math.imul(m,J0)|0,C=C+Math.imul(h,A0)|0,R=R+Math.imul(h,M0)|0,R=R+Math.imul(d,A0)|0,w=w+Math.imul(d,M0)|0;var lQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(lQ>>>26)|0,lQ&=67108863,C=Math.imul(D0,P0),R=Math.imul(D0,k0),R=R+Math.imul(q0,P0)|0,w=Math.imul(q0,k0),C=C+Math.imul(r,w0)|0,R=R+Math.imul(r,B0)|0,R=R+Math.imul(W0,w0)|0,w=w+Math.imul(W0,B0)|0,C=C+Math.imul(b,v0)|0,R=R+Math.imul(b,S0)|0,R=R+Math.imul(n,v0)|0,w=w+Math.imul(n,S0)|0,C=C+Math.imul(t,_0)|0,R=R+Math.imul(t,x0)|0,R=R+Math.imul(a,_0)|0,w=w+Math.imul(a,x0)|0,C=C+Math.imul(f,C0)|0,R=R+Math.imul(f,y)|0,R=R+Math.imul(u,C0)|0,w=w+Math.imul(u,y)|0,C=C+Math.imul(o,s)|0,R=R+Math.imul(o,J0)|0,R=R+Math.imul(Q0,s)|0,w=w+Math.imul(Q0,J0)|0,C=C+Math.imul(i,A0)|0,R=R+Math.imul(i,M0)|0,R=R+Math.imul(m,A0)|0,w=w+Math.imul(m,M0)|0,C=C+Math.imul(h,j0)|0,R=R+Math.imul(h,y0)|0,R=R+Math.imul(d,j0)|0,w=w+Math.imul(d,y0)|0;var mQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(mQ>>>26)|0,mQ&=67108863,C=Math.imul(O0,P0),R=Math.imul(O0,k0),R=R+Math.imul(I0,P0)|0,w=Math.imul(I0,k0),C=C+Math.imul(D0,w0)|0,R=R+Math.imul(D0,B0)|0,R=R+Math.imul(q0,w0)|0,w=w+Math.imul(q0,B0)|0,C=C+Math.imul(r,v0)|0,R=R+Math.imul(r,S0)|0,R=R+Math.imul(W0,v0)|0,w=w+Math.imul(W0,S0)|0,C=C+Math.imul(b,_0)|0,R=R+Math.imul(b,x0)|0,R=R+Math.imul(n,_0)|0,w=w+Math.imul(n,x0)|0,C=C+Math.imul(t,C0)|0,R=R+Math.imul(t,y)|0,R=R+Math.imul(a,C0)|0,w=w+Math.imul(a,y)|0,C=C+Math.imul(f,s)|0,R=R+Math.imul(f,J0)|0,R=R+Math.imul(u,s)|0,w=w+Math.imul(u,J0)|0,C=C+Math.imul(o,A0)|0,R=R+Math.imul(o,M0)|0,R=R+Math.imul(Q0,A0)|0,w=w+Math.imul(Q0,M0)|0,C=C+Math.imul(i,j0)|0,R=R+Math.imul(i,y0)|0,R=R+Math.imul(m,j0)|0,w=w+Math.imul(m,y0)|0,C=C+Math.imul(h,N0)|0,R=R+Math.imul(h,T0)|0,R=R+Math.imul(d,N0)|0,w=w+Math.imul(d,T0)|0;var dQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(dQ>>>26)|0,dQ&=67108863,C=Math.imul(E0,P0),R=Math.imul(E0,k0),R=R+Math.imul(L0,P0)|0,w=Math.imul(L0,k0),C=C+Math.imul(O0,w0)|0,R=R+Math.imul(O0,B0)|0,R=R+Math.imul(I0,w0)|0,w=w+Math.imul(I0,B0)|0,C=C+Math.imul(D0,v0)|0,R=R+Math.imul(D0,S0)|0,R=R+Math.imul(q0,v0)|0,w=w+Math.imul(q0,S0)|0,C=C+Math.imul(r,_0)|0,R=R+Math.imul(r,x0)|0,R=R+Math.imul(W0,_0)|0,w=w+Math.imul(W0,x0)|0,C=C+Math.imul(b,C0)|0,R=R+Math.imul(b,y)|0,R=R+Math.imul(n,C0)|0,w=w+Math.imul(n,y)|0,C=C+Math.imul(t,s)|0,R=R+Math.imul(t,J0)|0,R=R+Math.imul(a,s)|0,w=w+Math.imul(a,J0)|0,C=C+Math.imul(f,A0)|0,R=R+Math.imul(f,M0)|0,R=R+Math.imul(u,A0)|0,w=w+Math.imul(u,M0)|0,C=C+Math.imul(o,j0)|0,R=R+Math.imul(o,y0)|0,R=R+Math.imul(Q0,j0)|0,w=w+Math.imul(Q0,y0)|0,C=C+Math.imul(i,N0)|0,R=R+Math.imul(i,T0)|0,R=R+Math.imul(m,N0)|0,w=w+Math.imul(m,T0)|0,C=C+Math.imul(h,s0)|0,R=R+Math.imul(h,r0)|0,R=R+Math.imul(d,s0)|0,w=w+Math.imul(d,r0)|0;var nQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(nQ>>>26)|0,nQ&=67108863,C=Math.imul(E0,w0),R=Math.imul(E0,B0),R=R+Math.imul(L0,w0)|0,w=Math.imul(L0,B0),C=C+Math.imul(O0,v0)|0,R=R+Math.imul(O0,S0)|0,R=R+Math.imul(I0,v0)|0,w=w+Math.imul(I0,S0)|0,C=C+Math.imul(D0,_0)|0,R=R+Math.imul(D0,x0)|0,R=R+Math.imul(q0,_0)|0,w=w+Math.imul(q0,x0)|0,C=C+Math.imul(r,C0)|0,R=R+Math.imul(r,y)|0,R=R+Math.imul(W0,C0)|0,w=w+Math.imul(W0,y)|0,C=C+Math.imul(b,s)|0,R=R+Math.imul(b,J0)|0,R=R+Math.imul(n,s)|0,w=w+Math.imul(n,J0)|0,C=C+Math.imul(t,A0)|0,R=R+Math.imul(t,M0)|0,R=R+Math.imul(a,A0)|0,w=w+Math.imul(a,M0)|0,C=C+Math.imul(f,j0)|0,R=R+Math.imul(f,y0)|0,R=R+Math.imul(u,j0)|0,w=w+Math.imul(u,y0)|0,C=C+Math.imul(o,N0)|0,R=R+Math.imul(o,T0)|0,R=R+Math.imul(Q0,N0)|0,w=w+Math.imul(Q0,T0)|0,C=C+Math.imul(i,s0)|0,R=R+Math.imul(i,r0)|0,R=R+Math.imul(m,s0)|0,w=w+Math.imul(m,r0)|0;var oQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(oQ>>>26)|0,oQ&=67108863,C=Math.imul(E0,v0),R=Math.imul(E0,S0),R=R+Math.imul(L0,v0)|0,w=Math.imul(L0,S0),C=C+Math.imul(O0,_0)|0,R=R+Math.imul(O0,x0)|0,R=R+Math.imul(I0,_0)|0,w=w+Math.imul(I0,x0)|0,C=C+Math.imul(D0,C0)|0,R=R+Math.imul(D0,y)|0,R=R+Math.imul(q0,C0)|0,w=w+Math.imul(q0,y)|0,C=C+Math.imul(r,s)|0,R=R+Math.imul(r,J0)|0,R=R+Math.imul(W0,s)|0,w=w+Math.imul(W0,J0)|0,C=C+Math.imul(b,A0)|0,R=R+Math.imul(b,M0)|0,R=R+Math.imul(n,A0)|0,w=w+Math.imul(n,M0)|0,C=C+Math.imul(t,j0)|0,R=R+Math.imul(t,y0)|0,R=R+Math.imul(a,j0)|0,w=w+Math.imul(a,y0)|0,C=C+Math.imul(f,N0)|0,R=R+Math.imul(f,T0)|0,R=R+Math.imul(u,N0)|0,w=w+Math.imul(u,T0)|0,C=C+Math.imul(o,s0)|0,R=R+Math.imul(o,r0)|0,R=R+Math.imul(Q0,s0)|0,w=w+Math.imul(Q0,r0)|0;var rQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(rQ>>>26)|0,rQ&=67108863,C=Math.imul(E0,_0),R=Math.imul(E0,x0),R=R+Math.imul(L0,_0)|0,w=Math.imul(L0,x0),C=C+Math.imul(O0,C0)|0,R=R+Math.imul(O0,y)|0,R=R+Math.imul(I0,C0)|0,w=w+Math.imul(I0,y)|0,C=C+Math.imul(D0,s)|0,R=R+Math.imul(D0,J0)|0,R=R+Math.imul(q0,s)|0,w=w+Math.imul(q0,J0)|0,C=C+Math.imul(r,A0)|0,R=R+Math.imul(r,M0)|0,R=R+Math.imul(W0,A0)|0,w=w+Math.imul(W0,M0)|0,C=C+Math.imul(b,j0)|0,R=R+Math.imul(b,y0)|0,R=R+Math.imul(n,j0)|0,w=w+Math.imul(n,y0)|0,C=C+Math.imul(t,N0)|0,R=R+Math.imul(t,T0)|0,R=R+Math.imul(a,N0)|0,w=w+Math.imul(a,T0)|0,C=C+Math.imul(f,s0)|0,R=R+Math.imul(f,r0)|0,R=R+Math.imul(u,s0)|0,w=w+Math.imul(u,r0)|0;var iQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(iQ>>>26)|0,iQ&=67108863,C=Math.imul(E0,C0),R=Math.imul(E0,y),R=R+Math.imul(L0,C0)|0,w=Math.imul(L0,y),C=C+Math.imul(O0,s)|0,R=R+Math.imul(O0,J0)|0,R=R+Math.imul(I0,s)|0,w=w+Math.imul(I0,J0)|0,C=C+Math.imul(D0,A0)|0,R=R+Math.imul(D0,M0)|0,R=R+Math.imul(q0,A0)|0,w=w+Math.imul(q0,M0)|0,C=C+Math.imul(r,j0)|0,R=R+Math.imul(r,y0)|0,R=R+Math.imul(W0,j0)|0,w=w+Math.imul(W0,y0)|0,C=C+Math.imul(b,N0)|0,R=R+Math.imul(b,T0)|0,R=R+Math.imul(n,N0)|0,w=w+Math.imul(n,T0)|0,C=C+Math.imul(t,s0)|0,R=R+Math.imul(t,r0)|0,R=R+Math.imul(a,s0)|0,w=w+Math.imul(a,r0)|0;var tQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(tQ>>>26)|0,tQ&=67108863,C=Math.imul(E0,s),R=Math.imul(E0,J0),R=R+Math.imul(L0,s)|0,w=Math.imul(L0,J0),C=C+Math.imul(O0,A0)|0,R=R+Math.imul(O0,M0)|0,R=R+Math.imul(I0,A0)|0,w=w+Math.imul(I0,M0)|0,C=C+Math.imul(D0,j0)|0,R=R+Math.imul(D0,y0)|0,R=R+Math.imul(q0,j0)|0,w=w+Math.imul(q0,y0)|0,C=C+Math.imul(r,N0)|0,R=R+Math.imul(r,T0)|0,R=R+Math.imul(W0,N0)|0,w=w+Math.imul(W0,T0)|0,C=C+Math.imul(b,s0)|0,R=R+Math.imul(b,r0)|0,R=R+Math.imul(n,s0)|0,w=w+Math.imul(n,r0)|0;var sQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(sQ>>>26)|0,sQ&=67108863,C=Math.imul(E0,A0),R=Math.imul(E0,M0),R=R+Math.imul(L0,A0)|0,w=Math.imul(L0,M0),C=C+Math.imul(O0,j0)|0,R=R+Math.imul(O0,y0)|0,R=R+Math.imul(I0,j0)|0,w=w+Math.imul(I0,y0)|0,C=C+Math.imul(D0,N0)|0,R=R+Math.imul(D0,T0)|0,R=R+Math.imul(q0,N0)|0,w=w+Math.imul(q0,T0)|0,C=C+Math.imul(r,s0)|0,R=R+Math.imul(r,r0)|0,R=R+Math.imul(W0,s0)|0,w=w+Math.imul(W0,r0)|0;var aQ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(aQ>>>26)|0,aQ&=67108863,C=Math.imul(E0,j0),R=Math.imul(E0,y0),R=R+Math.imul(L0,j0)|0,w=Math.imul(L0,y0),C=C+Math.imul(O0,N0)|0,R=R+Math.imul(O0,T0)|0,R=R+Math.imul(I0,N0)|0,w=w+Math.imul(I0,T0)|0,C=C+Math.imul(D0,s0)|0,R=R+Math.imul(D0,r0)|0,R=R+Math.imul(q0,s0)|0,w=w+Math.imul(q0,r0)|0;var WZ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(WZ>>>26)|0,WZ&=67108863,C=Math.imul(E0,N0),R=Math.imul(E0,T0),R=R+Math.imul(L0,N0)|0,w=Math.imul(L0,T0),C=C+Math.imul(O0,s0)|0,R=R+Math.imul(O0,r0)|0,R=R+Math.imul(I0,s0)|0,w=w+Math.imul(I0,r0)|0;var GZ=(O+C|0)+((R&8191)<<13)|0;O=(w+(R>>>13)|0)+(GZ>>>26)|0,GZ&=67108863,C=Math.imul(E0,s0),R=Math.imul(E0,r0),R=R+Math.imul(L0,s0)|0,w=Math.imul(L0,r0);var $Z=(O+C|0)+((R&8191)<<13)|0;if(O=(w+(R>>>13)|0)+($Z>>>26)|0,$Z&=67108863,$[0]=OQ,$[1]=FQ,$[2]=hQ,$[3]=uQ,$[4]=pQ,$[5]=cQ,$[6]=lQ,$[7]=mQ,$[8]=dQ,$[9]=nQ,$[10]=oQ,$[11]=rQ,$[12]=iQ,$[13]=tQ,$[14]=sQ,$[15]=aQ,$[16]=WZ,$[17]=GZ,$[18]=$Z,O!==0)$[19]=O,A.length++;return A};if(!Math.imul)v=k;function _(H,F,A){A.negative=F.negative^H.negative,A.length=H.length+F.length;var M=0,z=0;for(var $=0;$<A.length-1;$++){var O=z;z=0;var C=M&67108863,R=Math.min($,F.length-1);for(var w=Math.max(0,$-H.length+1);w<=R;w++){var g=$-w,h=H.words[g]|0,d=F.words[w]|0,K0=h*d,i=K0&67108863;O=O+(K0/67108864|0)|0,i=i+C|0,C=i&67108863,O=O+(i>>>26)|0,z+=O>>>26,O&=67108863}A.words[$]=C,M=O,O=z}if(M!==0)A.words[$]=M;else A.length--;return A._strip()}function x(H,F,A){return _(H,F,A)}Z.prototype.mulTo=function(H,F){var A,M=this.length+H.length;if(this.length===10&&H.length===10)A=v(this,H,F);else if(M<63)A=k(this,H,F);else if(M<1024)A=_(this,H,F);else A=x(this,H,F);return A};function c(H,F){this.x=H,this.y=F}c.prototype.makeRBT=function(H){var F=Array(H),A=Z.prototype._countBits(H)-1;for(var M=0;M<H;M++)F[M]=this.revBin(M,A,H);return F},c.prototype.revBin=function(H,F,A){if(H===0||H===A-1)return H;var M=0;for(var z=0;z<F;z++)M|=(H&1)<<F-z-1,H>>=1;return M},c.prototype.permute=function(H,F,A,M,z,$){for(var O=0;O<$;O++)M[O]=F[H[O]],z[O]=A[H[O]]},c.prototype.transform=function(H,F,A,M,z,$){this.permute($,H,F,A,M,z);for(var O=1;O<z;O<<=1){var C=O<<1,R=Math.cos(2*Math.PI/C),w=Math.sin(2*Math.PI/C);for(var g=0;g<z;g+=C){var h=R,d=w;for(var K0=0;K0<O;K0++){var i=A[g+K0],m=M[g+K0],G0=A[g+K0+O],o=M[g+K0+O],Q0=h*G0-d*o;if(o=h*o+d*G0,G0=Q0,A[g+K0]=i+G0,M[g+K0]=m+o,A[g+K0+O]=i-G0,M[g+K0+O]=m-o,K0!==C)Q0=R*h-w*d,d=R*d+w*h,h=Q0}}}},c.prototype.guessLen13b=function(H,F){var A=Math.max(F,H)|1,M=A&1,z=0;for(A=A/2|0;A;A=A>>>1)z++;return 1<<z+1+M},c.prototype.conjugate=function(H,F,A){if(A<=1)return;for(var M=0;M<A/2;M++){var z=H[M];H[M]=H[A-M-1],H[A-M-1]=z,z=F[M],F[M]=-F[A-M-1],F[A-M-1]=-z}},c.prototype.normalize13b=function(H,F){var A=0;for(var M=0;M<F/2;M++){var z=Math.round(H[2*M+1]/F)*8192+Math.round(H[2*M]/F)+A;if(H[M]=z&67108863,z<67108864)A=0;else A=z/67108864|0}return H},c.prototype.convert13b=function(H,F,A,M){var z=0;for(var $=0;$<F;$++)z=z+(H[$]|0),A[2*$]=z&8191,z=z>>>13,A[2*$+1]=z&8191,z=z>>>13;for($=2*F;$<M;++$)A[$]=0;G(z===0),G((z&-8192)===0)},c.prototype.stub=function(H){var F=Array(H);for(var A=0;A<H;A++)F[A]=0;return F},c.prototype.mulp=function(H,F,A){var M=2*this.guessLen13b(H.length,F.length),z=this.makeRBT(M),$=this.stub(M),O=Array(M),C=Array(M),R=Array(M),w=Array(M),g=Array(M),h=Array(M),d=A.words;d.length=M,this.convert13b(H.words,H.length,O,M),this.convert13b(F.words,F.length,w,M),this.transform(O,$,C,R,M,z),this.transform(w,$,g,h,M,z);for(var K0=0;K0<M;K0++){var i=C[K0]*g[K0]-R[K0]*h[K0];R[K0]=C[K0]*h[K0]+R[K0]*g[K0],C[K0]=i}return this.conjugate(C,R,M),this.transform(C,R,d,$,M,z),this.conjugate(d,$,M),this.normalize13b(d,M),A.negative=H.negative^F.negative,A.length=H.length+F.length,A._strip()},Z.prototype.mul=function(H){var F=new Z(null);return F.words=Array(this.length+H.length),this.mulTo(H,F)},Z.prototype.mulf=function(H){var F=new Z(null);return F.words=Array(this.length+H.length),x(this,H,F)},Z.prototype.imul=function(H){return this.clone().mulTo(H,this)},Z.prototype.imuln=function(H){var F=H<0;if(F)H=-H;G(typeof H==="number"),G(H<67108864);var A=0;for(var M=0;M<this.length;M++){var z=(this.words[M]|0)*H,$=(z&67108863)+(A&67108863);A>>=26,A+=z/67108864|0,A+=$>>>26,this.words[M]=$&67108863}if(A!==0)this.words[M]=A,this.length++;return this.length=H===0?1:this.length,F?this.ineg():this},Z.prototype.muln=function(H){return this.clone().imuln(H)},Z.prototype.sqr=function(){return this.mul(this)},Z.prototype.isqr=function(){return this.imul(this.clone())},Z.prototype.pow=function(H){var F=N(H);if(F.length===0)return new Z(1);var A=this;for(var M=0;M<F.length;M++,A=A.sqr())if(F[M]!==0)break;if(++M<F.length)for(var z=A.sqr();M<F.length;M++,z=z.sqr()){if(F[M]===0)continue;A=A.mul(z)}return A},Z.prototype.iushln=function(H){G(typeof H==="number"&&H>=0);var F=H%26,A=(H-F)/26,M=67108863>>>26-F<<26-F,z;if(F!==0){var $=0;for(z=0;z<this.length;z++){var O=this.words[z]&M,C=(this.words[z]|0)-O<<F;this.words[z]=C|$,$=O>>>26-F}if($)this.words[z]=$,this.length++}if(A!==0){for(z=this.length-1;z>=0;z--)this.words[z+A]=this.words[z];for(z=0;z<A;z++)this.words[z]=0;this.length+=A}return this._strip()},Z.prototype.ishln=function(H){return G(this.negative===0),this.iushln(H)},Z.prototype.iushrn=function(H,F,A){G(typeof H==="number"&&H>=0);var M;if(F)M=(F-F%26)/26;else M=0;var z=H%26,$=Math.min((H-z)/26,this.length),O=67108863^67108863>>>z<<z,C=A;if(M-=$,M=Math.max(0,M),C){for(var R=0;R<$;R++)C.words[R]=this.words[R];C.length=$}if($===0);else if(this.length>$){this.length-=$;for(R=0;R<this.length;R++)this.words[R]=this.words[R+$]}else this.words[0]=0,this.length=1;var w=0;for(R=this.length-1;R>=0&&(w!==0||R>=M);R--){var g=this.words[R]|0;this.words[R]=w<<26-z|g>>>z,w=g&O}if(C&&w!==0)C.words[C.length++]=w;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},Z.prototype.ishrn=function(H,F,A){return G(this.negative===0),this.iushrn(H,F,A)},Z.prototype.shln=function(H){return this.clone().ishln(H)},Z.prototype.ushln=function(H){return this.clone().iushln(H)},Z.prototype.shrn=function(H){return this.clone().ishrn(H)},Z.prototype.ushrn=function(H){return this.clone().iushrn(H)},Z.prototype.testn=function(H){G(typeof H==="number"&&H>=0);var F=H%26,A=(H-F)/26,M=1<<F;if(this.length<=A)return!1;var z=this.words[A];return!!(z&M)},Z.prototype.imaskn=function(H){G(typeof H==="number"&&H>=0);var F=H%26,A=(H-F)/26;if(G(this.negative===0,"imaskn works only with positive numbers"),this.length<=A)return this;if(F!==0)A++;if(this.length=Math.min(A,this.length),F!==0){var M=67108863^67108863>>>F<<F;this.words[this.length-1]&=M}return this._strip()},Z.prototype.maskn=function(H){return this.clone().imaskn(H)},Z.prototype.iaddn=function(H){if(G(typeof H==="number"),G(H<67108864),H<0)return this.isubn(-H);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=H)return this.words[0]=H-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(H),this.negative=1,this}return this._iaddn(H)},Z.prototype._iaddn=function(H){this.words[0]+=H;for(var F=0;F<this.length&&this.words[F]>=67108864;F++)if(this.words[F]-=67108864,F===this.length-1)this.words[F+1]=1;else this.words[F+1]++;return this.length=Math.max(this.length,F+1),this},Z.prototype.isubn=function(H){if(G(typeof H==="number"),G(H<67108864),H<0)return this.iaddn(-H);if(this.negative!==0)return this.negative=0,this.iaddn(H),this.negative=1,this;if(this.words[0]-=H,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var F=0;F<this.length&&this.words[F]<0;F++)this.words[F]+=67108864,this.words[F+1]-=1;return this._strip()},Z.prototype.addn=function(H){return this.clone().iaddn(H)},Z.prototype.subn=function(H){return this.clone().isubn(H)},Z.prototype.iabs=function(){return this.negative=0,this},Z.prototype.abs=function(){return this.clone().iabs()},Z.prototype._ishlnsubmul=function(H,F,A){var M=H.length+A,z;this._expand(M);var $,O=0;for(z=0;z<H.length;z++){$=(this.words[z+A]|0)+O;var C=(H.words[z]|0)*F;$-=C&67108863,O=($>>26)-(C/67108864|0),this.words[z+A]=$&67108863}for(;z<this.length-A;z++)$=(this.words[z+A]|0)+O,O=$>>26,this.words[z+A]=$&67108863;if(O===0)return this._strip();G(O===-1),O=0;for(z=0;z<this.length;z++)$=-(this.words[z]|0)+O,O=$>>26,this.words[z]=$&67108863;return this.negative=1,this._strip()},Z.prototype._wordDiv=function(H,F){var A=this.length-H.length,M=this.clone(),z=H,$=z.words[z.length-1]|0,O=this._countBits($);if(A=26-O,A!==0)z=z.ushln(A),M.iushln(A),$=z.words[z.length-1]|0;var C=M.length-z.length,R;if(F!=="mod"){R=new Z(null),R.length=C+1,R.words=Array(R.length);for(var w=0;w<R.length;w++)R.words[w]=0}var g=M.clone()._ishlnsubmul(z,1,C);if(g.negative===0){if(M=g,R)R.words[C]=1}for(var h=C-1;h>=0;h--){var d=(M.words[z.length+h]|0)*67108864+(M.words[z.length+h-1]|0);d=Math.min(d/$|0,67108863),M._ishlnsubmul(z,d,h);while(M.negative!==0)if(d--,M.negative=0,M._ishlnsubmul(z,1,h),!M.isZero())M.negative^=1;if(R)R.words[h]=d}if(R)R._strip();if(M._strip(),F!=="div"&&A!==0)M.iushrn(A);return{div:R||null,mod:M}},Z.prototype.divmod=function(H,F,A){if(G(!H.isZero()),this.isZero())return{div:new Z(0),mod:new Z(0)};var M,z,$;if(this.negative!==0&&H.negative===0){if($=this.neg().divmod(H,F),F!=="mod")M=$.div.neg();if(F!=="div"){if(z=$.mod.neg(),A&&z.negative!==0)z.iadd(H)}return{div:M,mod:z}}if(this.negative===0&&H.negative!==0){if($=this.divmod(H.neg(),F),F!=="mod")M=$.div.neg();return{div:M,mod:$.mod}}if((this.negative&H.negative)!==0){if($=this.neg().divmod(H.neg(),F),F!=="div"){if(z=$.mod.neg(),A&&z.negative!==0)z.isub(H)}return{div:$.div,mod:z}}if(H.length>this.length||this.cmp(H)<0)return{div:new Z(0),mod:this};if(H.length===1){if(F==="div")return{div:this.divn(H.words[0]),mod:null};if(F==="mod")return{div:null,mod:new Z(this.modrn(H.words[0]))};return{div:this.divn(H.words[0]),mod:new Z(this.modrn(H.words[0]))}}return this._wordDiv(H,F)},Z.prototype.div=function(H){return this.divmod(H,"div",!1).div},Z.prototype.mod=function(H){return this.divmod(H,"mod",!1).mod},Z.prototype.umod=function(H){return this.divmod(H,"mod",!0).mod},Z.prototype.divRound=function(H){var F=this.divmod(H);if(F.mod.isZero())return F.div;var A=F.div.negative!==0?F.mod.isub(H):F.mod,M=H.ushrn(1),z=H.andln(1),$=A.cmp(M);if($<0||z===1&&$===0)return F.div;return F.div.negative!==0?F.div.isubn(1):F.div.iaddn(1)},Z.prototype.modrn=function(H){var F=H<0;if(F)H=-H;G(H<=67108863);var A=67108864%H,M=0;for(var z=this.length-1;z>=0;z--)M=(A*M+(this.words[z]|0))%H;return F?-M:M},Z.prototype.modn=function(H){return this.modrn(H)},Z.prototype.idivn=function(H){var F=H<0;if(F)H=-H;G(H<=67108863);var A=0;for(var M=this.length-1;M>=0;M--){var z=(this.words[M]|0)+A*67108864;this.words[M]=z/H|0,A=z%H}return this._strip(),F?this.ineg():this},Z.prototype.divn=function(H){return this.clone().idivn(H)},Z.prototype.egcd=function(H){G(H.negative===0),G(!H.isZero());var F=this,A=H.clone();if(F.negative!==0)F=F.umod(H);else F=F.clone();var M=new Z(1),z=new Z(0),$=new Z(0),O=new Z(1),C=0;while(F.isEven()&&A.isEven())F.iushrn(1),A.iushrn(1),++C;var R=A.clone(),w=F.clone();while(!F.isZero()){for(var g=0,h=1;(F.words[0]&h)===0&&g<26;++g,h<<=1);if(g>0){F.iushrn(g);while(g-- >0){if(M.isOdd()||z.isOdd())M.iadd(R),z.isub(w);M.iushrn(1),z.iushrn(1)}}for(var d=0,K0=1;(A.words[0]&K0)===0&&d<26;++d,K0<<=1);if(d>0){A.iushrn(d);while(d-- >0){if($.isOdd()||O.isOdd())$.iadd(R),O.isub(w);$.iushrn(1),O.iushrn(1)}}if(F.cmp(A)>=0)F.isub(A),M.isub($),z.isub(O);else A.isub(F),$.isub(M),O.isub(z)}return{a:$,b:O,gcd:A.iushln(C)}},Z.prototype._invmp=function(H){G(H.negative===0),G(!H.isZero());var F=this,A=H.clone();if(F.negative!==0)F=F.umod(H);else F=F.clone();var M=new Z(1),z=new Z(0),$=A.clone();while(F.cmpn(1)>0&&A.cmpn(1)>0){for(var O=0,C=1;(F.words[0]&C)===0&&O<26;++O,C<<=1);if(O>0){F.iushrn(O);while(O-- >0){if(M.isOdd())M.iadd($);M.iushrn(1)}}for(var R=0,w=1;(A.words[0]&w)===0&&R<26;++R,w<<=1);if(R>0){A.iushrn(R);while(R-- >0){if(z.isOdd())z.iadd($);z.iushrn(1)}}if(F.cmp(A)>=0)F.isub(A),M.isub(z);else A.isub(F),z.isub(M)}var g;if(F.cmpn(1)===0)g=M;else g=z;if(g.cmpn(0)<0)g.iadd(H);return g},Z.prototype.gcd=function(H){if(this.isZero())return H.abs();if(H.isZero())return this.abs();var F=this.clone(),A=H.clone();F.negative=0,A.negative=0;for(var M=0;F.isEven()&&A.isEven();M++)F.iushrn(1),A.iushrn(1);do{while(F.isEven())F.iushrn(1);while(A.isEven())A.iushrn(1);var z=F.cmp(A);if(z<0){var $=F;F=A,A=$}else if(z===0||A.cmpn(1)===0)break;F.isub(A)}while(!0);return A.iushln(M)},Z.prototype.invm=function(H){return this.egcd(H).a.umod(H)},Z.prototype.isEven=function(){return(this.words[0]&1)===0},Z.prototype.isOdd=function(){return(this.words[0]&1)===1},Z.prototype.andln=function(H){return this.words[0]&H},Z.prototype.bincn=function(H){G(typeof H==="number");var F=H%26,A=(H-F)/26,M=1<<F;if(this.length<=A)return this._expand(A+1),this.words[A]|=M,this;var z=M;for(var $=A;z!==0&&$<this.length;$++){var O=this.words[$]|0;O+=z,z=O>>>26,O&=67108863,this.words[$]=O}if(z!==0)this.words[$]=z,this.length++;return this},Z.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Z.prototype.cmpn=function(H){var F=H<0;if(this.negative!==0&&!F)return-1;if(this.negative===0&&F)return 1;this._strip();var A;if(this.length>1)A=1;else{if(F)H=-H;G(H<=67108863,"Number is too big");var M=this.words[0]|0;A=M===H?0:M<H?-1:1}if(this.negative!==0)return-A|0;return A},Z.prototype.cmp=function(H){if(this.negative!==0&&H.negative===0)return-1;if(this.negative===0&&H.negative!==0)return 1;var F=this.ucmp(H);if(this.negative!==0)return-F|0;return F},Z.prototype.ucmp=function(H){if(this.length>H.length)return 1;if(this.length<H.length)return-1;var F=0;for(var A=this.length-1;A>=0;A--){var M=this.words[A]|0,z=H.words[A]|0;if(M===z)continue;if(M<z)F=-1;else if(M>z)F=1;break}return F},Z.prototype.gtn=function(H){return this.cmpn(H)===1},Z.prototype.gt=function(H){return this.cmp(H)===1},Z.prototype.gten=function(H){return this.cmpn(H)>=0},Z.prototype.gte=function(H){return this.cmp(H)>=0},Z.prototype.ltn=function(H){return this.cmpn(H)===-1},Z.prototype.lt=function(H){return this.cmp(H)===-1},Z.prototype.lten=function(H){return this.cmpn(H)<=0},Z.prototype.lte=function(H){return this.cmp(H)<=0},Z.prototype.eqn=function(H){return this.cmpn(H)===0},Z.prototype.eq=function(H){return this.cmp(H)===0},Z.red=function(H){return new U(H)},Z.prototype.toRed=function(H){return G(!this.red,"Already a number in reduction context"),G(this.negative===0,"red works only with positives"),H.convertTo(this)._forceRed(H)},Z.prototype.fromRed=function(){return G(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Z.prototype._forceRed=function(H){return this.red=H,this},Z.prototype.forceRed=function(H){return G(!this.red,"Already a number in reduction context"),this._forceRed(H)},Z.prototype.redAdd=function(H){return G(this.red,"redAdd works only with red numbers"),this.red.add(this,H)},Z.prototype.redIAdd=function(H){return G(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,H)},Z.prototype.redSub=function(H){return G(this.red,"redSub works only with red numbers"),this.red.sub(this,H)},Z.prototype.redISub=function(H){return G(this.red,"redISub works only with red numbers"),this.red.isub(this,H)},Z.prototype.redShl=function(H){return G(this.red,"redShl works only with red numbers"),this.red.shl(this,H)},Z.prototype.redMul=function(H){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,H),this.red.mul(this,H)},Z.prototype.redIMul=function(H){return G(this.red,"redMul works only with red numbers"),this.red._verify2(this,H),this.red.imul(this,H)},Z.prototype.redSqr=function(){return G(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Z.prototype.redISqr=function(){return G(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Z.prototype.redSqrt=function(){return G(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Z.prototype.redInvm=function(){return G(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Z.prototype.redNeg=function(){return G(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Z.prototype.redPow=function(H){return G(this.red&&!H.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,H)};var Y0={k256:null,p224:null,p192:null,p25519:null};function $0(H,F){this.name=H,this.p=new Z(F,16),this.n=this.p.bitLength(),this.k=new Z(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}$0.prototype._tmp=function(){var H=new Z(null);return H.words=Array(Math.ceil(this.n/13)),H},$0.prototype.ireduce=function(H){var F=H,A;do this.split(F,this.tmp),F=this.imulK(F),F=F.iadd(this.tmp),A=F.bitLength();while(A>this.n);var M=A<this.n?-1:F.ucmp(this.p);if(M===0)F.words[0]=0,F.length=1;else if(M>0)F.isub(this.p);else if(F.strip!==void 0)F.strip();else F._strip();return F},$0.prototype.split=function(H,F){H.iushrn(this.n,0,F)},$0.prototype.imulK=function(H){return H.imul(this.k)};function e(){$0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(e,$0),e.prototype.split=function(H,F){var A=4194303,M=Math.min(H.length,9);for(var z=0;z<M;z++)F.words[z]=H.words[z];if(F.length=M,H.length<=9){H.words[0]=0,H.length=1;return}var $=H.words[9];F.words[F.length++]=$&A;for(z=10;z<H.length;z++){var O=H.words[z]|0;H.words[z-10]=(O&A)<<4|$>>>22,$=O}if($>>>=22,H.words[z-10]=$,$===0&&H.length>10)H.length-=10;else H.length-=9},e.prototype.imulK=function(H){H.words[H.length]=0,H.words[H.length+1]=0,H.length+=2;var F=0;for(var A=0;A<H.length;A++){var M=H.words[A]|0;F+=M*977,H.words[A]=F&67108863,F=M*64+(F/67108864|0)}if(H.words[H.length-1]===0){if(H.length--,H.words[H.length-1]===0)H.length--}return H};function p(){$0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(p,$0);function X0(){$0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,$0);function J(){$0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(J,$0),J.prototype.imulK=function(H){var F=0;for(var A=0;A<H.length;A++){var M=(H.words[A]|0)*19+F,z=M&67108863;M>>>=26,H.words[A]=z,F=M}if(F!==0)H.words[H.length++]=F;return H},Z._prime=function(H){if(Y0[H])return Y0[H];var F;if(H==="k256")F=new e;else if(H==="p224")F=new p;else if(H==="p192")F=new X0;else if(H==="p25519")F=new J;else throw Error("Unknown prime "+H);return Y0[H]=F,F};function U(H){if(typeof H==="string"){var F=Z._prime(H);this.m=F.p,this.prime=F}else G(H.gtn(1),"modulus must be greater than 1"),this.m=H,this.prime=null}U.prototype._verify1=function(H){G(H.negative===0,"red works only with positives"),G(H.red,"red works only with red numbers")},U.prototype._verify2=function(H,F){G((H.negative|F.negative)===0,"red works only with positives"),G(H.red&&H.red===F.red,"red works only with red numbers")},U.prototype.imod=function(H){if(this.prime)return this.prime.ireduce(H)._forceRed(this);return D(H,H.umod(this.m)._forceRed(this)),H},U.prototype.neg=function(H){if(H.isZero())return H.clone();return this.m.sub(H)._forceRed(this)},U.prototype.add=function(H,F){this._verify2(H,F);var A=H.add(F);if(A.cmp(this.m)>=0)A.isub(this.m);return A._forceRed(this)},U.prototype.iadd=function(H,F){this._verify2(H,F);var A=H.iadd(F);if(A.cmp(this.m)>=0)A.isub(this.m);return A},U.prototype.sub=function(H,F){this._verify2(H,F);var A=H.sub(F);if(A.cmpn(0)<0)A.iadd(this.m);return A._forceRed(this)},U.prototype.isub=function(H,F){this._verify2(H,F);var A=H.isub(F);if(A.cmpn(0)<0)A.iadd(this.m);return A},U.prototype.shl=function(H,F){return this._verify1(H),this.imod(H.ushln(F))},U.prototype.imul=function(H,F){return this._verify2(H,F),this.imod(H.imul(F))},U.prototype.mul=function(H,F){return this._verify2(H,F),this.imod(H.mul(F))},U.prototype.isqr=function(H){return this.imul(H,H.clone())},U.prototype.sqr=function(H){return this.mul(H,H)},U.prototype.sqrt=function(H){if(H.isZero())return H.clone();var F=this.m.andln(3);if(G(F%2===1),F===3){var A=this.m.add(new Z(1)).iushrn(2);return this.pow(H,A)}var M=this.m.subn(1),z=0;while(!M.isZero()&&M.andln(1)===0)z++,M.iushrn(1);G(!M.isZero());var $=new Z(1).toRed(this),O=$.redNeg(),C=this.m.subn(1).iushrn(1),R=this.m.bitLength();R=new Z(2*R*R).toRed(this);while(this.pow(R,C).cmp(O)!==0)R.redIAdd(O);var w=this.pow(R,M),g=this.pow(H,M.addn(1).iushrn(1)),h=this.pow(H,M),d=z;while(h.cmp($)!==0){var K0=h;for(var i=0;K0.cmp($)!==0;i++)K0=K0.redSqr();G(i<d);var m=this.pow(w,new Z(1).iushln(d-i-1));g=g.redMul(m),w=m.redSqr(),h=h.redMul(w),d=i}return g},U.prototype.invm=function(H){var F=H._invmp(this.m);if(F.negative!==0)return F.negative=0,this.imod(F).redNeg();else return this.imod(F)},U.prototype.pow=function(H,F){if(F.isZero())return new Z(1).toRed(this);if(F.cmpn(1)===0)return H.clone();var A=4,M=Array(1<<A);M[0]=new Z(1).toRed(this),M[1]=H;for(var z=2;z<M.length;z++)M[z]=this.mul(M[z-1],H);var $=M[0],O=0,C=0,R=F.bitLength()%26;if(R===0)R=26;for(z=F.length-1;z>=0;z--){var w=F.words[z];for(var g=R-1;g>=0;g--){var h=w>>g&1;if($!==M[0])$=this.sqr($);if(h===0&&O===0){C=0;continue}if(O<<=1,O|=h,C++,C!==A&&(z!==0||g!==0))continue;$=this.mul($,M[O]),C=0,O=0}R=26}return $},U.prototype.convertTo=function(H){var F=H.umod(this.m);return F===H?F.clone():F},U.prototype.convertFrom=function(H){var F=H.clone();return F.red=null,F},Z.mont=function(H){return new V(H)};function V(H){if(U.call(this,H),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Z(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(V,U),V.prototype.convertTo=function(H){return this.imod(H.ushln(this.shift))},V.prototype.convertFrom=function(H){var F=this.imod(H.mul(this.rinv));return F.red=null,F},V.prototype.imul=function(H,F){if(H.isZero()||F.isZero())return H.words[0]=0,H.length=1,H;var A=H.imul(F),M=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),z=A.isub(M).iushrn(this.shift),$=z;if(z.cmp(this.m)>=0)$=z.isub(this.m);else if(z.cmpn(0)<0)$=z.iadd(this.m);return $._forceRed(this)},V.prototype.mul=function(H,F){if(H.isZero()||F.isZero())return new Z(0)._forceRed(this);var A=H.mul(F),M=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),z=A.isub(M).iushrn(this.shift),$=z;if(z.cmp(this.m)>=0)$=z.isub(this.m);else if(z.cmpn(0)<0)$=z.iadd(this.m);return $._forceRed(this)},V.prototype.invm=function(H){var F=this.imod(H._invmp(this.m).mul(this.r2));return F._forceRed(this)}})(typeof X>"u"||X,Q)}),LF=H0((Q,X)=>{var Y=vP(),W=zG(),G=LX().Buffer;function K(E){var I=E.modulus.byteLength(),L;do L=new Y(W(I));while(L.cmp(E.modulus)>=0||!L.umod(E.prime1)||!L.umod(E.prime2));return L}function Z(E){var I=K(E),L=I.toRed(Y.mont(E.modulus)).redPow(new Y(E.publicExponent)).fromRed();return{blinder:L,unblinder:I.invm(E.modulus)}}function q(E,I){var L=Z(I),D=I.modulus.byteLength(),T=new Y(E).mul(L.blinder).umod(I.modulus),P=T.toRed(Y.mont(I.prime1)),B=T.toRed(Y.mont(I.prime2)),j=I.coefficient,S=I.prime1,N=I.prime2,k=P.redPow(I.exponent1).fromRed(),v=B.redPow(I.exponent2).fromRed(),_=k.isub(v).imul(j).umod(S).imul(N);return v.iadd(_).imul(L.unblinder).umod(I.modulus).toArrayLike(G,"be",D)}q.getr=K,X.exports=q}),_P=H0((Q,X)=>{var Y=DF(),W=zG(),G=OG(),K=qF(),Z=IF(),q=KH(),E=MF(),I=LF(),L=LX().Buffer;X.exports=function(B,j,S){var N;if(B.padding)N=B.padding;else if(S)N=1;else N=4;var k=Y(B),v;if(N===4)v=D(k,j);else if(N===1)v=T(k,j,S);else if(N===3){if(v=new q(j),v.cmp(k.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(S)return I(v,k);else return E(v,k)};function D(B,j){var S=B.modulus.byteLength(),N=j.length,k=G("sha1").update(L.alloc(0)).digest(),v=k.length,_=2*v;if(N>S-_-2)throw Error("message too long");var x=L.alloc(S-N-_-2),c=S-v-1,Y0=W(v),$0=Z(L.concat([k,x,L.alloc(1,1),j],c),K(Y0,c)),e=Z(Y0,K($0,v));return new q(L.concat([L.alloc(1),e,$0],S))}function T(B,j,S){var N=j.length,k=B.modulus.byteLength();if(N>k-11)throw Error("message too long");var v;if(S)v=L.alloc(k-N-3,255);else v=P(k-N-3);return new q(L.concat([L.from([0,S?1:2]),v,L.alloc(1),j],k))}function P(B){var j=L.allocUnsafe(B),S=0,N=W(B*2),k=0,v;while(S<B){if(k===N.length)N=W(B*2),k=0;if(v=N[k++],v)j[S++]=v}return j}}),xP=H0((Q,X)=>{var Y=DF(),W=qF(),G=IF(),K=KH(),Z=LF(),q=OG(),E=MF(),I=LX().Buffer;X.exports=function(P,B,j){var S;if(P.padding)S=P.padding;else if(j)S=1;else S=4;var N=Y(P),k=N.modulus.byteLength();if(B.length>k||new K(B).cmp(N.modulus)>=0)throw Error("decryption error");var v;if(j)v=E(new K(B),N);else v=Z(B,N);var _=I.alloc(k-v.length);if(v=I.concat([_,v],k),S===4)return L(N,v);else if(S===1)return D(N,v,j);else if(S===3)return v;else throw Error("unknown padding")};function L(P,B){var j=P.modulus.byteLength(),S=q("sha1").update(I.alloc(0)).digest(),N=S.length;if(B[0]!==0)throw Error("decryption error");var k=B.slice(1,N+1),v=B.slice(N+1),_=G(k,W(v,N)),x=G(v,W(_,j-N-1));if(T(S,x.slice(0,N)))throw Error("decryption error");var c=N;while(x[c]===0)c++;if(x[c++]!==1)throw Error("decryption error");return x.slice(c)}function D(P,B,j){var S=B.slice(0,2),N=2,k=0;while(B[N++]!==0)if(N>=B.length){k++;break}var v=B.slice(2,N-1);if(S.toString("hex")!=="0002"&&!j||S.toString("hex")!=="0001"&&j)k++;if(v.length<8)k++;if(k)throw Error("decryption error");return B.slice(N)}function T(P,B){P=I.from(P),B=I.from(B);var j=0,S=P.length;if(P.length!==B.length)j++,S=Math.min(P.length,B.length);var N=-1;while(++N<S)j+=P[N]^B[N];return j}}),XH=H0((Q)=>{Q.publicEncrypt=_P(),Q.privateDecrypt=xP(),Q.privateEncrypt=function(X,Y){return Q.publicEncrypt(X,Y,!0)},Q.publicDecrypt=function(X,Y){return Q.privateDecrypt(X,Y,!0)}}),yP=H0((Q)=>{var X=(EX(),WQ(uX));if(typeof X.publicEncrypt!=="function")X=XH();if(Q.publicEncrypt=X.publicEncrypt,Q.privateDecrypt=X.privateDecrypt,typeof X.privateEncrypt!=="function")Q.privateEncrypt=XH().privateEncrypt;else Q.privateEncrypt=X.privateEncrypt;if(typeof X.publicDecrypt!=="function")Q.publicDecrypt=XH().publicDecrypt;else Q.publicDecrypt=X.publicDecrypt}),gP=H0((Q)=>{var X=LX(),Y=zG(),W=X.Buffer,G=X.kMaxLength,K=globalThis.crypto||globalThis.msCrypto,Z=Math.pow(2,32)-1;function q(T,P){if(typeof T!=="number"||T!==T)throw TypeError("offset must be a number");if(T>Z||T<0)throw TypeError("offset must be a uint32");if(T>G||T>P)throw RangeError("offset out of range")}function E(T,P,B){if(typeof T!=="number"||T!==T)throw TypeError("size must be a number");if(T>Z||T<0)throw TypeError("size must be a uint32");if(T+P>B||T>G)throw RangeError("buffer too small")}K&&K.getRandomValues,Q.randomFill=I,Q.randomFillSync=D;function I(T,P,B,j){if(!W.isBuffer(T)&&!(T instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof P==="function")j=P,P=0,B=T.length;else if(typeof B==="function")j=B,B=T.length-P;else if(typeof j!=="function")throw TypeError('"cb" argument must be a function');return q(P,T.length),E(B,P,T.length),L(T,P,B,j)}function L(T,P,B,j){if(!1)var S,N;if(j){Y(B,function(v,_){if(v)return j(v);_.copy(T,P),j(null,T)});return}var k=Y(B);return k.copy(T,P),T}function D(T,P,B){if(typeof P>"u")P=0;if(!W.isBuffer(T)&&!(T instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(q(P,T.length),B===void 0)B=T.length-P;return E(B,P,T.length),L(T,P,B)}}),fP=H0((Q,X)=>{var Y=(EX(),WQ(uX));if(typeof Y.randomFill==="function"&&typeof Y.randomFillSync==="function")Q.randomFill=Y.randomFill,Q.randomFillSync=Y.randomFillSync;else X.exports=gP()}),bP=H0((Q)=>{Q.randomBytes=Q.rng=Q.pseudoRandomBytes=Q.prng=zG(),Q.createHash=Q.Hash=OG(),Q.createHmac=Q.Hmac=rK();var X=HR(),Y=Object.keys(X),W=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Y);Q.getHashes=function(){return W};var G=GF();Q.pbkdf2=G.pbkdf2,Q.pbkdf2Sync=G.pbkdf2Sync;var K=mR();Q.Cipher=K.Cipher,Q.createCipher=K.createCipher,Q.Cipheriv=K.Cipheriv,Q.createCipheriv=K.createCipheriv,Q.Decipher=K.Decipher,Q.createDecipher=K.createDecipher,Q.Decipheriv=K.Decipheriv,Q.createDecipheriv=K.createDecipheriv,Q.getCiphers=K.getCiphers,Q.listCiphers=K.listCiphers;var Z=dR();Q.DiffieHellmanGroup=Z.DiffieHellmanGroup,Q.createDiffieHellmanGroup=Z.createDiffieHellmanGroup,Q.getDiffieHellman=Z.getDiffieHellman,Q.createDiffieHellman=Z.createDiffieHellman,Q.DiffieHellman=Z.DiffieHellman;var q=nR();Q.createSign=q.createSign,Q.Sign=q.Sign,Q.createVerify=q.createVerify,Q.Verify=q.Verify,Q.createECDH=AP();var E=yP();Q.publicEncrypt=E.publicEncrypt,Q.privateEncrypt=E.privateEncrypt,Q.publicDecrypt=E.publicDecrypt,Q.privateDecrypt=E.privateDecrypt;var I=fP();Q.randomFill=I.randomFill,Q.randomFillSync=I.randomFillSync,Q.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
15
|
+
we accept pull requests
|
|
16
|
+
https://github.com/browserify/crypto-browserify`)},Q.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),e0=ZR(bP(),1),hP=e0.prng,uP=e0.pseudoRandomBytes,pP=e0.rng,cP=e0.randomBytes,lP=e0.Hash,mP=e0.createHash,dP=e0.Hmac,nP=e0.createHmac,oP=e0.getHashes,rP=e0.pbkdf2,iP=e0.pbkdf2Sync,tP=e0.Cipher,sP=e0.createCipher,aP=e0.Cipheriv,eP=e0.createCipheriv,QB=e0.Decipher,XB=e0.createDecipher,YB=e0.Decipheriv,JB=e0.createDecipheriv,WB=e0.getCiphers,GB=e0.listCiphers,$B=e0.DiffieHellmanGroup,ZB=e0.createDiffieHellmanGroup,HB=e0.getDiffieHellman,UB=e0.createDiffieHellman,KB=e0.DiffieHellman,FB=e0.createSign,VB=e0.Sign,zB=e0.createVerify,OB=e0.Verify,AB=e0.createECDH,DB=e0.publicEncrypt,qB=e0.privateEncrypt,IB=e0.publicDecrypt,MB=e0.privateDecrypt,LB=e0.randomFill,EB=e0.randomFillSync,TB=e0.createCredentials,RB=e0.constants,SB=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];jB=crypto,NB=crypto});var DH=F0((OH,AH)=>{(function(Q,X){typeof OH=="object"&&typeof AH<"u"?AH.exports=X():typeof define=="function"&&define.amd?define(X):(Q=typeof globalThis<"u"?globalThis:Q||self).dayjs=X()})(OH,function(){var Q=1000,X=60000,Y=3600000,W="millisecond",G="second",K="minute",Z="hour",q="day",E="week",I="month",L="quarter",D="year",T="date",P="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(J){var U=["th","st","nd","rd"],V=J%100;return"["+J+(U[(V-20)%10]||U[V]||U[0])+"]"}},N=function(J,U,V){var H=String(J);return!H||H.length>=U?J:""+Array(U+1-H.length).join(V)+J},k={s:N,z:function(J){var U=-J.utcOffset(),V=Math.abs(U),H=Math.floor(V/60),F=V%60;return(U<=0?"+":"-")+N(H,2,"0")+":"+N(F,2,"0")},m:function J(U,V){if(U.date()<V.date())return-J(V,U);var H=12*(V.year()-U.year())+(V.month()-U.month()),F=U.clone().add(H,I),A=V-F<0,M=U.clone().add(H+(A?-1:1),I);return+(-(H+(V-F)/(A?F-M:M-F))||0)},a:function(J){return J<0?Math.ceil(J)||0:Math.floor(J)},p:function(J){return{M:I,y:D,w:E,d:q,D:T,h:Z,m:K,s:G,ms:W,Q:L}[J]||String(J||"").toLowerCase().replace(/s$/,"")},u:function(J){return J===void 0}},v="en",_={};_[v]=S;var x="$isDayjsObject",c=function(J){return J instanceof p||!(!J||!J[x])},Y0=function J(U,V,H){var F;if(!U)return v;if(typeof U=="string"){var A=U.toLowerCase();_[A]&&(F=A),V&&(_[A]=V,F=A);var M=U.split("-");if(!F&&M.length>1)return J(M[0])}else{var z=U.name;_[z]=U,F=z}return!H&&F&&(v=F),F||!H&&v},$0=function(J,U){if(c(J))return J.clone();var V=typeof U=="object"?U:{};return V.date=J,V.args=arguments,new p(V)},e=k;e.l=Y0,e.i=c,e.w=function(J,U){return $0(J,{locale:U.$L,utc:U.$u,x:U.$x,$offset:U.$offset})};var p=function(){function J(V){this.$L=Y0(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[x]=!0}var U=J.prototype;return U.parse=function(V){this.$d=function(H){var{date:F,utc:A}=H;if(F===null)return new Date(NaN);if(e.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var M=F.match(B);if(M){var z=M[2]-1||0,$=(M[7]||"0").substring(0,3);return A?new Date(Date.UTC(M[1],z,M[3]||1,M[4]||0,M[5]||0,M[6]||0,$)):new Date(M[1],z,M[3]||1,M[4]||0,M[5]||0,M[6]||0,$)}}return new Date(F)}(V),this.init()},U.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},U.$utils=function(){return e},U.isValid=function(){return this.$d.toString()!==P},U.isSame=function(V,H){var F=$0(V);return this.startOf(H)<=F&&F<=this.endOf(H)},U.isAfter=function(V,H){return $0(V)<this.startOf(H)},U.isBefore=function(V,H){return this.endOf(H)<$0(V)},U.$g=function(V,H,F){return e.u(V)?this[H]:this.set(F,V)},U.unix=function(){return Math.floor(this.valueOf()/1000)},U.valueOf=function(){return this.$d.getTime()},U.startOf=function(V,H){var F=this,A=!!e.u(H)||H,M=e.p(V),z=function(d,K0){var i=e.w(F.$u?Date.UTC(F.$y,K0,d):new Date(F.$y,K0,d),F);return A?i:i.endOf(q)},$=function(d,K0){return e.w(F.toDate()[d].apply(F.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(K0)),F)},O=this.$W,C=this.$M,R=this.$D,w="set"+(this.$u?"UTC":"");switch(M){case D:return A?z(1,0):z(31,11);case I:return A?z(1,C):z(0,C+1);case E:var g=this.$locale().weekStart||0,h=(O<g?O+7:O)-g;return z(A?R-h:R+(6-h),C);case q:case T:return $(w+"Hours",0);case Z:return $(w+"Minutes",1);case K:return $(w+"Seconds",2);case G:return $(w+"Milliseconds",3);default:return this.clone()}},U.endOf=function(V){return this.startOf(V,!1)},U.$set=function(V,H){var F,A=e.p(V),M="set"+(this.$u?"UTC":""),z=(F={},F[q]=M+"Date",F[T]=M+"Date",F[I]=M+"Month",F[D]=M+"FullYear",F[Z]=M+"Hours",F[K]=M+"Minutes",F[G]=M+"Seconds",F[W]=M+"Milliseconds",F)[A],$=A===q?this.$D+(H-this.$W):H;if(A===I||A===D){var O=this.clone().set(T,1);O.$d[z]($),O.init(),this.$d=O.set(T,Math.min(this.$D,O.daysInMonth())).$d}else z&&this.$d[z]($);return this.init(),this},U.set=function(V,H){return this.clone().$set(V,H)},U.get=function(V){return this[e.p(V)]()},U.add=function(V,H){var F,A=this;V=Number(V);var M=e.p(H),z=function(C){var R=$0(A);return e.w(R.date(R.date()+Math.round(C*V)),A)};if(M===I)return this.set(I,this.$M+V);if(M===D)return this.set(D,this.$y+V);if(M===q)return z(1);if(M===E)return z(7);var $=(F={},F[K]=X,F[Z]=Y,F[G]=Q,F)[M]||1,O=this.$d.getTime()+V*$;return e.w(O,this)},U.subtract=function(V,H){return this.add(-1*V,H)},U.format=function(V){var H=this,F=this.$locale();if(!this.isValid())return F.invalidDate||P;var A=V||"YYYY-MM-DDTHH:mm:ssZ",M=e.z(this),z=this.$H,$=this.$m,O=this.$M,C=F.weekdays,R=F.months,w=F.meridiem,g=function(K0,i,m,G0){return K0&&(K0[i]||K0(H,A))||m[i].slice(0,G0)},h=function(K0){return e.s(z%12||12,K0,"0")},d=w||function(K0,i,m){var G0=K0<12?"AM":"PM";return m?G0.toLowerCase():G0};return A.replace(j,function(K0,i){return i||function(m){switch(m){case"YY":return String(H.$y).slice(-2);case"YYYY":return e.s(H.$y,4,"0");case"M":return O+1;case"MM":return e.s(O+1,2,"0");case"MMM":return g(F.monthsShort,O,R,3);case"MMMM":return g(R,O);case"D":return H.$D;case"DD":return e.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return g(F.weekdaysMin,H.$W,C,2);case"ddd":return g(F.weekdaysShort,H.$W,C,3);case"dddd":return C[H.$W];case"H":return String(z);case"HH":return e.s(z,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return d(z,$,!0);case"A":return d(z,$,!1);case"m":return String($);case"mm":return e.s($,2,"0");case"s":return String(H.$s);case"ss":return e.s(H.$s,2,"0");case"SSS":return e.s(H.$ms,3,"0");case"Z":return M}return null}(K0)||M.replace(":","")})},U.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},U.diff=function(V,H,F){var A,M=this,z=e.p(H),$=$0(V),O=($.utcOffset()-this.utcOffset())*X,C=this-$,R=function(){return e.m(M,$)};switch(z){case D:A=R()/12;break;case I:A=R();break;case L:A=R()/3;break;case E:A=(C-O)/604800000;break;case q:A=(C-O)/86400000;break;case Z:A=C/Y;break;case K:A=C/X;break;case G:A=C/Q;break;default:A=C}return F?A:e.a(A)},U.daysInMonth=function(){return this.endOf(I).$D},U.$locale=function(){return _[this.$L]},U.locale=function(V,H){if(!V)return this.$L;var F=this.clone(),A=Y0(V,H,!0);return A&&(F.$L=A),F},U.clone=function(){return e.w(this.$d,this)},U.toDate=function(){return new Date(this.valueOf())},U.toJSON=function(){return this.isValid()?this.toISOString():null},U.toISOString=function(){return this.$d.toISOString()},U.toString=function(){return this.$d.toUTCString()},J}(),X0=p.prototype;return $0.prototype=X0,[["$ms",W],["$s",G],["$m",K],["$H",Z],["$W",q],["$M",I],["$y",D],["$D",T]].forEach(function(J){X0[J[1]]=function(U){return this.$g(U,J[0],J[1])}}),$0.extend=function(J,U){return J.$i||(J(U,p,$0),J.$i=!0),$0},$0.locale=Y0,$0.isDayjs=c,$0.unix=function(J){return $0(1000*J)},$0.en=_[v],$0.Ls=_,$0.p={},$0})});var QW=F0((t5)=>{Object.defineProperty(t5,"__esModule",{value:!0});t5.regexpCode=t5.getEsmExportName=t5.getProperty=t5.safeStringify=t5.stringify=t5.strConcat=t5.addCodeArg=t5.str=t5._=t5.nil=t5._Code=t5.Name=t5.IDENTIFIER=t5._CodeOrName=void 0;class pG{}t5._CodeOrName=pG;t5.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class d1 extends pG{constructor(Q){super();if(!t5.IDENTIFIER.test(Q))throw Error("CodeGen: name must be a valid identifier");this.str=Q}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t5.Name=d1;class YY extends pG{constructor(Q){super();this._items=typeof Q==="string"?[Q]:Q}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Q=this._items[0];return Q===""||Q==='""'}get str(){var Q;return(Q=this._str)!==null&&Q!==void 0?Q:this._str=this._items.reduce((X,Y)=>`${X}${Y}`,"")}get names(){var Q;return(Q=this._names)!==null&&Q!==void 0?Q:this._names=this._items.reduce((X,Y)=>{if(Y instanceof d1)X[Y.str]=(X[Y.str]||0)+1;return X},{})}}t5._Code=YY;t5.nil=new YY("");function r5(Q,...X){let Y=[Q[0]],W=0;while(W<X.length)j8(Y,X[W]),Y.push(Q[++W]);return new YY(Y)}t5._=r5;var C8=new YY("+");function i5(Q,...X){let Y=[eJ(Q[0])],W=0;while(W<X.length)Y.push(C8),j8(Y,X[W]),Y.push(C8,eJ(Q[++W]));return $j(Y),new YY(Y)}t5.str=i5;function j8(Q,X){if(X instanceof YY)Q.push(...X._items);else if(X instanceof d1)Q.push(X);else Q.push(Uj(X))}t5.addCodeArg=j8;function $j(Q){let X=1;while(X<Q.length-1){if(Q[X]===C8){let Y=Zj(Q[X-1],Q[X+1]);if(Y!==void 0){Q.splice(X-1,3,Y);continue}Q[X++]="+"}X++}}function Zj(Q,X){if(X==='""')return Q;if(Q==='""')return X;if(typeof Q=="string"){if(X instanceof d1||Q[Q.length-1]!=='"')return;if(typeof X!="string")return`${Q.slice(0,-1)}${X}"`;if(X[0]==='"')return Q.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!(Q instanceof d1))return`"${Q}${X.slice(1)}`;return}function Hj(Q,X){return X.emptyStr()?Q:Q.emptyStr()?X:i5`${Q}${X}`}t5.strConcat=Hj;function Uj(Q){return typeof Q=="number"||typeof Q=="boolean"||Q===null?Q:eJ(Array.isArray(Q)?Q.join(","):Q)}function Kj(Q){return new YY(eJ(Q))}t5.stringify=Kj;function eJ(Q){return JSON.stringify(Q).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t5.safeStringify=eJ;function Fj(Q){return typeof Q=="string"&&t5.IDENTIFIER.test(Q)?new YY(`.${Q}`):r5`[${Q}]`}t5.getProperty=Fj;function Vj(Q){if(typeof Q=="string"&&t5.IDENTIFIER.test(Q))return new YY(`${Q}`);throw Error(`CodeGen: invalid export name: ${Q}, use explicit $id name mapping`)}t5.getEsmExportName=Vj;function zj(Q){return new YY(Q.toString())}t5.regexpCode=zj});var v8=F0((Q9)=>{Object.defineProperty(Q9,"__esModule",{value:!0});Q9.ValueScope=Q9.ValueScopeName=Q9.Scope=Q9.varKinds=Q9.UsedValueState=void 0;var wX=QW();class a5 extends Error{constructor(Q){super(`CodeGen: "code" for ${Q} not defined`);this.value=Q.value}}var lG;(function(Q){Q[Q.Started=0]="Started",Q[Q.Completed=1]="Completed"})(lG||(Q9.UsedValueState=lG={}));Q9.varKinds={const:new wX.Name("const"),let:new wX.Name("let"),var:new wX.Name("var")};class k8{constructor({prefixes:Q,parent:X}={}){this._names={},this._prefixes=Q,this._parent=X}toName(Q){return Q instanceof wX.Name?Q:this.name(Q)}name(Q){return new wX.Name(this._newName(Q))}_newName(Q){let X=this._names[Q]||this._nameGroup(Q);return`${Q}${X.index++}`}_nameGroup(Q){var X,Y;if(((Y=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||Y===void 0?void 0:Y.has(Q))||this._prefixes&&!this._prefixes.has(Q))throw Error(`CodeGen: prefix "${Q}" is not allowed in this scope`);return this._names[Q]={prefix:Q,index:0}}}Q9.Scope=k8;class w8 extends wX.Name{constructor(Q,X){super(X);this.prefix=Q}setValue(Q,{property:X,itemIndex:Y}){this.value=Q,this.scopePath=wX._`.${new wX.Name(X)}[${Y}]`}}Q9.ValueScopeName=w8;var Sj=wX._`\n`;class e5 extends k8{constructor(Q){super(Q);this._values={},this._scope=Q.scope,this.opts={...Q,_n:Q.lines?Sj:wX.nil}}get(){return this._scope}name(Q){return new w8(Q,this._newName(Q))}value(Q,X){var Y;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let W=this.toName(Q),{prefix:G}=W,K=(Y=X.key)!==null&&Y!==void 0?Y:X.ref,Z=this._values[G];if(Z){let I=Z.get(K);if(I)return I}else Z=this._values[G]=new Map;Z.set(K,W);let q=this._scope[G]||(this._scope[G]=[]),E=q.length;return q[E]=X.ref,W.setValue(X,{property:G,itemIndex:E}),W}getValue(Q,X){let Y=this._values[Q];if(!Y)return;return Y.get(X)}scopeRefs(Q,X=this._values){return this._reduceValues(X,(Y)=>{if(Y.scopePath===void 0)throw Error(`CodeGen: name "${Y}" has no value`);return wX._`${Q}${Y.scopePath}`})}scopeCode(Q=this._values,X,Y){return this._reduceValues(Q,(W)=>{if(W.value===void 0)throw Error(`CodeGen: name "${W}" has no value`);return W.value.code},X,Y)}_reduceValues(Q,X,Y={},W){let G=wX.nil;for(let K in Q){let Z=Q[K];if(!Z)continue;let q=Y[K]=Y[K]||new Map;Z.forEach((E)=>{if(q.has(E))return;q.set(E,lG.Started);let I=X(E);if(I){let L=this.opts.es5?Q9.varKinds.var:Q9.varKinds.const;G=wX._`${G}${L} ${E} = ${I};${this.opts._n}`}else if(I=W===null||W===void 0?void 0:W(E))G=wX._`${G}${I}${this.opts._n}`;else throw new a5(E);q.set(E,lG.Completed)})}return G}}Q9.ValueScope=e5});var QQ=F0((vX)=>{Object.defineProperty(vX,"__esModule",{value:!0});vX.or=vX.and=vX.not=vX.CodeGen=vX.operators=vX.varKinds=vX.ValueScopeName=vX.ValueScope=vX.Scope=vX.Name=vX.regexpCode=vX.stringify=vX.getProperty=vX.nil=vX.strConcat=vX.str=vX._=void 0;var YQ=QW(),JY=v8(),tY=QW();Object.defineProperty(vX,"_",{enumerable:!0,get:function(){return tY._}});Object.defineProperty(vX,"str",{enumerable:!0,get:function(){return tY.str}});Object.defineProperty(vX,"strConcat",{enumerable:!0,get:function(){return tY.strConcat}});Object.defineProperty(vX,"nil",{enumerable:!0,get:function(){return tY.nil}});Object.defineProperty(vX,"getProperty",{enumerable:!0,get:function(){return tY.getProperty}});Object.defineProperty(vX,"stringify",{enumerable:!0,get:function(){return tY.stringify}});Object.defineProperty(vX,"regexpCode",{enumerable:!0,get:function(){return tY.regexpCode}});Object.defineProperty(vX,"Name",{enumerable:!0,get:function(){return tY.Name}});var iG=v8();Object.defineProperty(vX,"Scope",{enumerable:!0,get:function(){return iG.Scope}});Object.defineProperty(vX,"ValueScope",{enumerable:!0,get:function(){return iG.ValueScope}});Object.defineProperty(vX,"ValueScopeName",{enumerable:!0,get:function(){return iG.ValueScopeName}});Object.defineProperty(vX,"varKinds",{enumerable:!0,get:function(){return iG.varKinds}});vX.operators={GT:new YQ._Code(">"),GTE:new YQ._Code(">="),LT:new YQ._Code("<"),LTE:new YQ._Code("<="),EQ:new YQ._Code("==="),NEQ:new YQ._Code("!=="),NOT:new YQ._Code("!"),OR:new YQ._Code("||"),AND:new YQ._Code("&&"),ADD:new YQ._Code("+")};class sY{optimizeNodes(){return this}optimizeNames(Q,X){return this}}class Y9 extends sY{constructor(Q,X,Y){super();this.varKind=Q,this.name=X,this.rhs=Y}render({es5:Q,_n:X}){let Y=Q?JY.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${W};`+X}optimizeNames(Q,X){if(!Q[this.name.str])return;if(this.rhs)this.rhs=o1(this.rhs,Q,X);return this}get names(){return this.rhs instanceof YQ._CodeOrName?this.rhs.names:{}}}class y8 extends sY{constructor(Q,X,Y){super();this.lhs=Q,this.rhs=X,this.sideEffects=Y}render({_n:Q}){return`${this.lhs} = ${this.rhs};`+Q}optimizeNames(Q,X){if(this.lhs instanceof YQ.Name&&!Q[this.lhs.str]&&!this.sideEffects)return;return this.rhs=o1(this.rhs,Q,X),this}get names(){let Q=this.lhs instanceof YQ.Name?{}:{...this.lhs.names};return rG(Q,this.rhs)}}class J9 extends y8{constructor(Q,X,Y,W){super(Q,Y,W);this.op=X}render({_n:Q}){return`${this.lhs} ${this.op}= ${this.rhs};`+Q}}class W9 extends sY{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`${this.label}:`+Q}}class G9 extends sY{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`break${this.label?` ${this.label}`:""};`+Q}}class $9 extends sY{constructor(Q){super();this.error=Q}render({_n:Q}){return`throw ${this.error};`+Q}get names(){return this.error.names}}class Z9 extends sY{constructor(Q){super();this.code=Q}render({_n:Q}){return`${this.code};`+Q}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Q,X){return this.code=o1(this.code,Q,X),this}get names(){return this.code instanceof YQ._CodeOrName?this.code.names:{}}}class tG extends sY{constructor(Q=[]){super();this.nodes=Q}render(Q){return this.nodes.reduce((X,Y)=>X+Y.render(Q),"")}optimizeNodes(){let{nodes:Q}=this,X=Q.length;while(X--){let Y=Q[X].optimizeNodes();if(Array.isArray(Y))Q.splice(X,1,...Y);else if(Y)Q[X]=Y;else Q.splice(X,1)}return Q.length>0?this:void 0}optimizeNames(Q,X){let{nodes:Y}=this,W=Y.length;while(W--){let G=Y[W];if(G.optimizeNames(Q,X))continue;kj(Q,G.names),Y.splice(W,1)}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((Q,X)=>M1(Q,X.names),{})}}class aY extends tG{render(Q){return"{"+Q._n+super.render(Q)+"}"+Q._n}}class H9 extends tG{}class XW extends aY{}XW.kind="else";class kY extends aY{constructor(Q,X){super(X);this.condition=Q}render(Q){let X=`if(${this.condition})`+super.render(Q);if(this.else)X+="else "+this.else.render(Q);return X}optimizeNodes(){super.optimizeNodes();let Q=this.condition;if(Q===!0)return this.nodes;let X=this.else;if(X){let Y=X.optimizeNodes();X=this.else=Array.isArray(Y)?new XW(Y):Y}if(X){if(Q===!1)return X instanceof kY?X:X.nodes;if(this.nodes.length)return this;return new kY(z9(Q),X instanceof kY?[X]:X.nodes)}if(Q===!1||!this.nodes.length)return;return this}optimizeNames(Q,X){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(Q,X),!(super.optimizeNames(Q,X)||this.else))return;return this.condition=o1(this.condition,Q,X),this}get names(){let Q=super.names;if(rG(Q,this.condition),this.else)M1(Q,this.else.names);return Q}}kY.kind="if";class n1 extends aY{}n1.kind="for";class U9 extends n1{constructor(Q){super();this.iteration=Q}render(Q){return`for(${this.iteration})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iteration=o1(this.iteration,Q,X),this}get names(){return M1(super.names,this.iteration.names)}}class K9 extends n1{constructor(Q,X,Y,W){super();this.varKind=Q,this.name=X,this.from=Y,this.to=W}render(Q){let X=Q.es5?JY.varKinds.var:this.varKind,{name:Y,from:W,to:G}=this;return`for(${X} ${Y}=${W}; ${Y}<${G}; ${Y}++)`+super.render(Q)}get names(){let Q=rG(super.names,this.from);return rG(Q,this.to)}}class _8 extends n1{constructor(Q,X,Y,W){super();this.loop=Q,this.varKind=X,this.name=Y,this.iterable=W}render(Q){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iterable=o1(this.iterable,Q,X),this}get names(){return M1(super.names,this.iterable.names)}}class mG extends aY{constructor(Q,X,Y){super();this.name=Q,this.args=X,this.async=Y}render(Q){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Q)}}mG.kind="func";class dG extends tG{render(Q){return"return "+super.render(Q)}}dG.kind="return";class F9 extends aY{render(Q){let X="try"+super.render(Q);if(this.catch)X+=this.catch.render(Q);if(this.finally)X+=this.finally.render(Q);return X}optimizeNodes(){var Q,X;return super.optimizeNodes(),(Q=this.catch)===null||Q===void 0||Q.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(Q,X){var Y,W;return super.optimizeNames(Q,X),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(Q,X),(W=this.finally)===null||W===void 0||W.optimizeNames(Q,X),this}get names(){let Q=super.names;if(this.catch)M1(Q,this.catch.names);if(this.finally)M1(Q,this.finally.names);return Q}}class nG extends aY{constructor(Q){super();this.error=Q}render(Q){return`catch(${this.error})`+super.render(Q)}}nG.kind="catch";class oG extends aY{render(Q){return"finally"+super.render(Q)}}oG.kind="finally";class V9{constructor(Q,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
17
|
+
`:""},this._extScope=Q,this._scope=new JY.Scope({parent:Q}),this._nodes=[new H9]}toString(){return this._root.render(this.opts)}name(Q){return this._scope.name(Q)}scopeName(Q){return this._extScope.name(Q)}scopeValue(Q,X){let Y=this._extScope.value(Q,X);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}getScopeValue(Q,X){return this._extScope.getValue(Q,X)}scopeRefs(Q){return this._extScope.scopeRefs(Q,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Q,X,Y,W){let G=this._scope.toName(X);if(Y!==void 0&&W)this._constants[G.str]=Y;return this._leafNode(new Y9(Q,G,Y)),G}const(Q,X,Y){return this._def(JY.varKinds.const,Q,X,Y)}let(Q,X,Y){return this._def(JY.varKinds.let,Q,X,Y)}var(Q,X,Y){return this._def(JY.varKinds.var,Q,X,Y)}assign(Q,X,Y){return this._leafNode(new y8(Q,X,Y))}add(Q,X){return this._leafNode(new J9(Q,vX.operators.ADD,X))}code(Q){if(typeof Q=="function")Q();else if(Q!==YQ.nil)this._leafNode(new Z9(Q));return this}object(...Q){let X=["{"];for(let[Y,W]of Q){if(X.length>1)X.push(",");if(X.push(Y),Y!==W||this.opts.es5)X.push(":"),(0,YQ.addCodeArg)(X,W)}return X.push("}"),new YQ._Code(X)}if(Q,X,Y){if(this._blockNode(new kY(Q)),X&&Y)this.code(X).else().code(Y).endIf();else if(X)this.code(X).endIf();else if(Y)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Q){return this._elseNode(new kY(Q))}else(){return this._elseNode(new XW)}endIf(){return this._endBlockNode(kY,XW)}_for(Q,X){if(this._blockNode(Q),X)this.code(X).endFor();return this}for(Q,X){return this._for(new U9(Q),X)}forRange(Q,X,Y,W,G=this.opts.es5?JY.varKinds.var:JY.varKinds.let){let K=this._scope.toName(Q);return this._for(new K9(G,K,X,Y),()=>W(K))}forOf(Q,X,Y,W=JY.varKinds.const){let G=this._scope.toName(Q);if(this.opts.es5){let K=X instanceof YQ.Name?X:this.var("_arr",X);return this.forRange("_i",0,YQ._`${K}.length`,(Z)=>{this.var(G,YQ._`${K}[${Z}]`),Y(G)})}return this._for(new _8("of",W,G,X),()=>Y(G))}forIn(Q,X,Y,W=this.opts.es5?JY.varKinds.var:JY.varKinds.const){if(this.opts.ownProperties)return this.forOf(Q,YQ._`Object.keys(${X})`,Y);let G=this._scope.toName(Q);return this._for(new _8("in",W,G,X),()=>Y(G))}endFor(){return this._endBlockNode(n1)}label(Q){return this._leafNode(new W9(Q))}break(Q){return this._leafNode(new G9(Q))}return(Q){let X=new dG;if(this._blockNode(X),this.code(Q),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(dG)}try(Q,X,Y){if(!X&&!Y)throw Error('CodeGen: "try" without "catch" and "finally"');let W=new F9;if(this._blockNode(W),this.code(Q),X){let G=this.name("e");this._currNode=W.catch=new nG(G),X(G)}if(Y)this._currNode=W.finally=new oG,this.code(Y);return this._endBlockNode(nG,oG)}throw(Q){return this._leafNode(new $9(Q))}block(Q,X){if(this._blockStarts.push(this._nodes.length),Q)this.code(Q).endBlock(X);return this}endBlock(Q){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let Y=this._nodes.length-X;if(Y<0||Q!==void 0&&Y!==Q)throw Error(`CodeGen: wrong number of nodes: ${Y} vs ${Q} expected`);return this._nodes.length=X,this}func(Q,X=YQ.nil,Y,W){if(this._blockNode(new mG(Q,X,Y)),W)this.code(W).endFunc();return this}endFunc(){return this._endBlockNode(mG)}optimize(Q=1){while(Q-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Q){return this._currNode.nodes.push(Q),this}_blockNode(Q){this._currNode.nodes.push(Q),this._nodes.push(Q)}_endBlockNode(Q,X){let Y=this._currNode;if(Y instanceof Q||X&&Y instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${Q.kind}/${X.kind}`:Q.kind}"`)}_elseNode(Q){let X=this._currNode;if(!(X instanceof kY))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=Q,this}get _root(){return this._nodes[0]}get _currNode(){let Q=this._nodes;return Q[Q.length-1]}set _currNode(Q){let X=this._nodes;X[X.length-1]=Q}}vX.CodeGen=V9;function M1(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)+(X[Y]||0);return Q}function rG(Q,X){return X instanceof YQ._CodeOrName?M1(Q,X.names):Q}function o1(Q,X,Y){if(Q instanceof YQ.Name)return W(Q);if(!G(Q))return Q;return new YQ._Code(Q._items.reduce((K,Z)=>{if(Z instanceof YQ.Name)Z=W(Z);if(Z instanceof YQ._Code)K.push(...Z._items);else K.push(Z);return K},[]));function W(K){let Z=Y[K.str];if(Z===void 0||X[K.str]!==1)return K;return delete X[K.str],Z}function G(K){return K instanceof YQ._Code&&K._items.some((Z)=>Z instanceof YQ.Name&&X[Z.str]===1&&Y[Z.str]!==void 0)}}function kj(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)-(X[Y]||0)}function z9(Q){return typeof Q=="boolean"||typeof Q=="number"||Q===null?!Q:YQ._`!${x8(Q)}`}vX.not=z9;var wj=O9(vX.operators.AND);function vj(...Q){return Q.reduce(wj)}vX.and=vj;var _j=O9(vX.operators.OR);function xj(...Q){return Q.reduce(_j)}vX.or=xj;function O9(Q){return(X,Y)=>X===YQ.nil?Y:Y===YQ.nil?X:YQ._`${x8(X)} ${Q} ${x8(Y)}`}function x8(Q){return Q instanceof YQ.Name?Q:YQ._`(${Q})`}});var HQ=F0((R9)=>{Object.defineProperty(R9,"__esModule",{value:!0});R9.checkStrictMode=R9.getErrorPath=R9.Type=R9.useFunc=R9.setEvaluated=R9.evaluatedPropsToName=R9.mergeEvaluated=R9.eachItem=R9.unescapeJsonPointer=R9.escapeJsonPointer=R9.escapeFragment=R9.unescapeFragment=R9.schemaRefOrVal=R9.schemaHasRulesButRef=R9.schemaHasRules=R9.checkUnknownRules=R9.alwaysValidSchema=R9.toHash=void 0;var AQ=QQ(),bj=QW();function hj(Q){let X={};for(let Y of Q)X[Y]=!0;return X}R9.toHash=hj;function uj(Q,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return I9(Q,X),!M9(X,Q.self.RULES.all)}R9.alwaysValidSchema=uj;function I9(Q,X=Q.schema){let{opts:Y,self:W}=Q;if(!Y.strictSchema)return;if(typeof X==="boolean")return;let G=W.RULES.keywords;for(let K in X)if(!G[K])T9(Q,`unknown keyword: "${K}"`)}R9.checkUnknownRules=I9;function M9(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X[Y])return!0;return!1}R9.schemaHasRules=M9;function pj(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(Y!=="$ref"&&X.all[Y])return!0;return!1}R9.schemaHasRulesButRef=pj;function cj({topSchemaRef:Q,schemaPath:X},Y,W,G){if(!G){if(typeof Y=="number"||typeof Y=="boolean")return Y;if(typeof Y=="string")return AQ._`${Y}`}return AQ._`${Q}${X}${(0,AQ.getProperty)(W)}`}R9.schemaRefOrVal=cj;function lj(Q){return L9(decodeURIComponent(Q))}R9.unescapeFragment=lj;function mj(Q){return encodeURIComponent(f8(Q))}R9.escapeFragment=mj;function f8(Q){if(typeof Q=="number")return`${Q}`;return Q.replace(/~/g,"~0").replace(/\//g,"~1")}R9.escapeJsonPointer=f8;function L9(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}R9.unescapeJsonPointer=L9;function dj(Q,X){if(Array.isArray(Q))for(let Y of Q)X(Y);else X(Q)}R9.eachItem=dj;function D9({mergeNames:Q,mergeToName:X,mergeValues:Y,resultToName:W}){return(G,K,Z,q)=>{let E=Z===void 0?K:Z instanceof AQ.Name?(K instanceof AQ.Name?Q(G,K,Z):X(G,K,Z),Z):K instanceof AQ.Name?(X(G,Z,K),K):Y(K,Z);return q===AQ.Name&&!(E instanceof AQ.Name)?W(G,E):E}}R9.mergeEvaluated={props:D9({mergeNames:(Q,X,Y)=>Q.if(AQ._`${Y} !== true && ${X} !== undefined`,()=>{Q.if(AQ._`${X} === true`,()=>Q.assign(Y,!0),()=>Q.assign(Y,AQ._`${Y} || {}`).code(AQ._`Object.assign(${Y}, ${X})`))}),mergeToName:(Q,X,Y)=>Q.if(AQ._`${Y} !== true`,()=>{if(X===!0)Q.assign(Y,!0);else Q.assign(Y,AQ._`${Y} || {}`),b8(Q,Y,X)}),mergeValues:(Q,X)=>Q===!0?!0:{...Q,...X},resultToName:E9}),items:D9({mergeNames:(Q,X,Y)=>Q.if(AQ._`${Y} !== true && ${X} !== undefined`,()=>Q.assign(Y,AQ._`${X} === true ? true : ${Y} > ${X} ? ${Y} : ${X}`)),mergeToName:(Q,X,Y)=>Q.if(AQ._`${Y} !== true`,()=>Q.assign(Y,X===!0?!0:AQ._`${Y} > ${X} ? ${Y} : ${X}`)),mergeValues:(Q,X)=>Q===!0?!0:Math.max(Q,X),resultToName:(Q,X)=>Q.var("items",X)})};function E9(Q,X){if(X===!0)return Q.var("props",!0);let Y=Q.var("props",AQ._`{}`);if(X!==void 0)b8(Q,Y,X);return Y}R9.evaluatedPropsToName=E9;function b8(Q,X,Y){Object.keys(Y).forEach((W)=>Q.assign(AQ._`${X}${(0,AQ.getProperty)(W)}`,!0))}R9.setEvaluated=b8;var q9={};function nj(Q,X){return Q.scopeValue("func",{ref:X,code:q9[X.code]||(q9[X.code]=new bj._Code(X.code))})}R9.useFunc=nj;var g8;(function(Q){Q[Q.Num=0]="Num",Q[Q.Str=1]="Str"})(g8||(R9.Type=g8={}));function oj(Q,X,Y){if(Q instanceof AQ.Name){let W=X===g8.Num;return Y?W?AQ._`"[" + ${Q} + "]"`:AQ._`"['" + ${Q} + "']"`:W?AQ._`"/" + ${Q}`:AQ._`"/" + ${Q}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Y?(0,AQ.getProperty)(Q).toString():"/"+f8(Q)}R9.getErrorPath=oj;function T9(Q,X,Y=Q.opts.strictSchema){if(!Y)return;if(X=`strict mode: ${X}`,Y===!0)throw Error(X);Q.self.logger.warn(X)}R9.checkStrictMode=T9});var wY=F0((B9)=>{Object.defineProperty(B9,"__esModule",{value:!0});var DX=QQ(),FN={data:new DX.Name("data"),valCxt:new DX.Name("valCxt"),instancePath:new DX.Name("instancePath"),parentData:new DX.Name("parentData"),parentDataProperty:new DX.Name("parentDataProperty"),rootData:new DX.Name("rootData"),dynamicAnchors:new DX.Name("dynamicAnchors"),vErrors:new DX.Name("vErrors"),errors:new DX.Name("errors"),this:new DX.Name("this"),self:new DX.Name("self"),scope:new DX.Name("scope"),json:new DX.Name("json"),jsonPos:new DX.Name("jsonPos"),jsonLen:new DX.Name("jsonLen"),jsonPart:new DX.Name("jsonPart")};B9.default=FN});var YW=F0((N9)=>{Object.defineProperty(N9,"__esModule",{value:!0});N9.extendErrors=N9.resetErrorsCount=N9.reportExtraError=N9.reportError=N9.keyword$DataError=N9.keywordError=void 0;var GQ=QQ(),aG=HQ(),PX=wY();N9.keywordError={message:({keyword:Q})=>GQ.str`must pass "${Q}" keyword validation`};N9.keyword$DataError={message:({keyword:Q,schemaType:X})=>X?GQ.str`"${Q}" keyword must be ${X} ($data)`:GQ.str`"${Q}" keyword is invalid ($data)`};function zN(Q,X=N9.keywordError,Y,W){let{it:G}=Q,{gen:K,compositeRule:Z,allErrors:q}=G,E=j9(Q,X,Y);if(W!==null&&W!==void 0?W:Z||q)S9(K,E);else C9(G,GQ._`[${E}]`)}N9.reportError=zN;function ON(Q,X=N9.keywordError,Y){let{it:W}=Q,{gen:G,compositeRule:K,allErrors:Z}=W,q=j9(Q,X,Y);if(S9(G,q),!(K||Z))C9(W,PX.default.vErrors)}N9.reportExtraError=ON;function AN(Q,X){Q.assign(PX.default.errors,X),Q.if(GQ._`${PX.default.vErrors} !== null`,()=>Q.if(X,()=>Q.assign(GQ._`${PX.default.vErrors}.length`,X),()=>Q.assign(PX.default.vErrors,null)))}N9.resetErrorsCount=AN;function DN({gen:Q,keyword:X,schemaValue:Y,data:W,errsCount:G,it:K}){if(G===void 0)throw Error("ajv implementation error");let Z=Q.name("err");Q.forRange("i",G,PX.default.errors,(q)=>{if(Q.const(Z,GQ._`${PX.default.vErrors}[${q}]`),Q.if(GQ._`${Z}.instancePath === undefined`,()=>Q.assign(GQ._`${Z}.instancePath`,(0,GQ.strConcat)(PX.default.instancePath,K.errorPath))),Q.assign(GQ._`${Z}.schemaPath`,GQ.str`${K.errSchemaPath}/${X}`),K.opts.verbose)Q.assign(GQ._`${Z}.schema`,Y),Q.assign(GQ._`${Z}.data`,W)})}N9.extendErrors=DN;function S9(Q,X){let Y=Q.const("err",X);Q.if(GQ._`${PX.default.vErrors} === null`,()=>Q.assign(PX.default.vErrors,GQ._`[${Y}]`),GQ._`${PX.default.vErrors}.push(${Y})`),Q.code(GQ._`${PX.default.errors}++`)}function C9(Q,X){let{gen:Y,validateName:W,schemaEnv:G}=Q;if(G.$async)Y.throw(GQ._`new ${Q.ValidationError}(${X})`);else Y.assign(GQ._`${W}.errors`,X),Y.return(!1)}var L1={keyword:new GQ.Name("keyword"),schemaPath:new GQ.Name("schemaPath"),params:new GQ.Name("params"),propertyName:new GQ.Name("propertyName"),message:new GQ.Name("message"),schema:new GQ.Name("schema"),parentSchema:new GQ.Name("parentSchema")};function j9(Q,X,Y){let{createErrors:W}=Q.it;if(W===!1)return GQ._`{}`;return qN(Q,X,Y)}function qN(Q,X,Y={}){let{gen:W,it:G}=Q,K=[IN(G,Y),MN(Q,Y)];return LN(Q,X,K),W.object(...K)}function IN({errorPath:Q},{instancePath:X}){let Y=X?GQ.str`${Q}${(0,aG.getErrorPath)(X,aG.Type.Str)}`:Q;return[PX.default.instancePath,(0,GQ.strConcat)(PX.default.instancePath,Y)]}function MN({keyword:Q,it:{errSchemaPath:X}},{schemaPath:Y,parentSchema:W}){let G=W?X:GQ.str`${X}/${Q}`;if(Y)G=GQ.str`${G}${(0,aG.getErrorPath)(Y,aG.Type.Str)}`;return[L1.schemaPath,G]}function LN(Q,{params:X,message:Y},W){let{keyword:G,data:K,schemaValue:Z,it:q}=Q,{opts:E,propertyName:I,topSchemaRef:L,schemaPath:D}=q;if(W.push([L1.keyword,G],[L1.params,typeof X=="function"?X(Q):X||GQ._`{}`]),E.messages)W.push([L1.message,typeof Y=="function"?Y(Q):Y]);if(E.verbose)W.push([L1.schema,Z],[L1.parentSchema,GQ._`${L}${D}`],[PX.default.data,K]);if(I)W.push([L1.propertyName,I])}});var x9=F0((v9)=>{Object.defineProperty(v9,"__esModule",{value:!0});v9.boolOrEmptySchema=v9.topBoolOrEmptySchema=void 0;var BN=YW(),SN=QQ(),CN=wY(),jN={message:"boolean schema is false"};function NN(Q){let{gen:X,schema:Y,validateName:W}=Q;if(Y===!1)w9(Q,!1);else if(typeof Y=="object"&&Y.$async===!0)X.return(CN.default.data);else X.assign(SN._`${W}.errors`,null),X.return(!0)}v9.topBoolOrEmptySchema=NN;function kN(Q,X){let{gen:Y,schema:W}=Q;if(W===!1)Y.var(X,!1),w9(Q);else Y.var(X,!0)}v9.boolOrEmptySchema=kN;function w9(Q,X){let{gen:Y,data:W}=Q,G={gen:Y,keyword:"false schema",data:W,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Q};(0,BN.reportError)(G,jN,void 0,X)}});var u8=F0((y9)=>{Object.defineProperty(y9,"__esModule",{value:!0});y9.getRules=y9.isJSONType=void 0;var vN=["string","number","integer","boolean","null","object","array"],_N=new Set(vN);function xN(Q){return typeof Q=="string"&&_N.has(Q)}y9.isJSONType=xN;function yN(){let Q={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Q,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Q.number,Q.string,Q.array,Q.object],post:{rules:[]},all:{},keywords:{}}}y9.getRules=yN});var p8=F0((h9)=>{Object.defineProperty(h9,"__esModule",{value:!0});h9.shouldUseRule=h9.shouldUseGroup=h9.schemaHasRulesForType=void 0;function fN({schema:Q,self:X},Y){let W=X.RULES.types[Y];return W&&W!==!0&&f9(Q,W)}h9.schemaHasRulesForType=fN;function f9(Q,X){return X.rules.some((Y)=>b9(Q,Y))}h9.shouldUseGroup=f9;function b9(Q,X){var Y;return Q[X.keyword]!==void 0||((Y=X.definition.implements)===null||Y===void 0?void 0:Y.some((W)=>Q[W]!==void 0))}h9.shouldUseRule=b9});var JW=F0((m9)=>{Object.defineProperty(m9,"__esModule",{value:!0});m9.reportTypeError=m9.checkDataTypes=m9.checkDataType=m9.coerceAndCheckDataType=m9.getJSONTypes=m9.getSchemaTypes=m9.DataType=void 0;var uN=u8(),pN=p8(),cN=YW(),i0=QQ(),p9=HQ(),r1;(function(Q){Q[Q.Correct=0]="Correct",Q[Q.Wrong=1]="Wrong"})(r1||(m9.DataType=r1={}));function lN(Q){let X=c9(Q.type);if(X.includes("null")){if(Q.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&Q.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Q.nullable===!0)X.push("null")}return X}m9.getSchemaTypes=lN;function c9(Q){let X=Array.isArray(Q)?Q:Q?[Q]:[];if(X.every(uN.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}m9.getJSONTypes=c9;function mN(Q,X){let{gen:Y,data:W,opts:G}=Q,K=dN(X,G.coerceTypes),Z=X.length>0&&!(K.length===0&&X.length===1&&(0,pN.schemaHasRulesForType)(Q,X[0]));if(Z){let q=l8(X,W,G.strictNumbers,r1.Wrong);Y.if(q,()=>{if(K.length)nN(Q,X,K);else m8(Q)})}return Z}m9.coerceAndCheckDataType=mN;var l9=new Set(["string","number","integer","boolean","null"]);function dN(Q,X){return X?Q.filter((Y)=>l9.has(Y)||X==="array"&&Y==="array"):[]}function nN(Q,X,Y){let{gen:W,data:G,opts:K}=Q,Z=W.let("dataType",i0._`typeof ${G}`),q=W.let("coerced",i0._`undefined`);if(K.coerceTypes==="array")W.if(i0._`${Z} == 'object' && Array.isArray(${G}) && ${G}.length == 1`,()=>W.assign(G,i0._`${G}[0]`).assign(Z,i0._`typeof ${G}`).if(l8(X,G,K.strictNumbers),()=>W.assign(q,G)));W.if(i0._`${q} !== undefined`);for(let I of Y)if(l9.has(I)||I==="array"&&K.coerceTypes==="array")E(I);W.else(),m8(Q),W.endIf(),W.if(i0._`${q} !== undefined`,()=>{W.assign(G,q),oN(Q,q)});function E(I){switch(I){case"string":W.elseIf(i0._`${Z} == "number" || ${Z} == "boolean"`).assign(q,i0._`"" + ${G}`).elseIf(i0._`${G} === null`).assign(q,i0._`""`);return;case"number":W.elseIf(i0._`${Z} == "boolean" || ${G} === null
|
|
18
|
+
|| (${Z} == "string" && ${G} && ${G} == +${G})`).assign(q,i0._`+${G}`);return;case"integer":W.elseIf(i0._`${Z} === "boolean" || ${G} === null
|
|
19
|
+
|| (${Z} === "string" && ${G} && ${G} == +${G} && !(${G} % 1))`).assign(q,i0._`+${G}`);return;case"boolean":W.elseIf(i0._`${G} === "false" || ${G} === 0 || ${G} === null`).assign(q,!1).elseIf(i0._`${G} === "true" || ${G} === 1`).assign(q,!0);return;case"null":W.elseIf(i0._`${G} === "" || ${G} === 0 || ${G} === false`),W.assign(q,null);return;case"array":W.elseIf(i0._`${Z} === "string" || ${Z} === "number"
|
|
20
|
+
|| ${Z} === "boolean" || ${G} === null`).assign(q,i0._`[${G}]`)}}}function oN({gen:Q,parentData:X,parentDataProperty:Y},W){Q.if(i0._`${X} !== undefined`,()=>Q.assign(i0._`${X}[${Y}]`,W))}function c8(Q,X,Y,W=r1.Correct){let G=W===r1.Correct?i0.operators.EQ:i0.operators.NEQ,K;switch(Q){case"null":return i0._`${X} ${G} null`;case"array":K=i0._`Array.isArray(${X})`;break;case"object":K=i0._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":K=Z(i0._`!(${X} % 1) && !isNaN(${X})`);break;case"number":K=Z();break;default:return i0._`typeof ${X} ${G} ${Q}`}return W===r1.Correct?K:(0,i0.not)(K);function Z(q=i0.nil){return(0,i0.and)(i0._`typeof ${X} == "number"`,q,Y?i0._`isFinite(${X})`:i0.nil)}}m9.checkDataType=c8;function l8(Q,X,Y,W){if(Q.length===1)return c8(Q[0],X,Y,W);let G,K=(0,p9.toHash)(Q);if(K.array&&K.object){let Z=i0._`typeof ${X} != "object"`;G=K.null?Z:i0._`!${X} || ${Z}`,delete K.null,delete K.array,delete K.object}else G=i0.nil;if(K.number)delete K.integer;for(let Z in K)G=(0,i0.and)(G,c8(Z,X,Y,W));return G}m9.checkDataTypes=l8;var rN={message:({schema:Q})=>`must be ${Q}`,params:({schema:Q,schemaValue:X})=>typeof Q=="string"?i0._`{type: ${Q}}`:i0._`{type: ${X}}`};function m8(Q){let X=iN(Q);(0,cN.reportError)(X,rN)}m9.reportTypeError=m8;function iN(Q){let{gen:X,data:Y,schema:W}=Q,G=(0,p9.schemaRefOrVal)(Q,W,"type");return{gen:X,keyword:"type",data:Y,schema:W.type,schemaCode:G,schemaValue:G,parentSchema:W,params:{},it:Q}}});var i9=F0((o9)=>{Object.defineProperty(o9,"__esModule",{value:!0});o9.assignDefaults=void 0;var i1=QQ(),Y2=HQ();function J2(Q,X){let{properties:Y,items:W}=Q.schema;if(X==="object"&&Y)for(let G in Y)n9(Q,G,Y[G].default);else if(X==="array"&&Array.isArray(W))W.forEach((G,K)=>n9(Q,K,G.default))}o9.assignDefaults=J2;function n9(Q,X,Y){let{gen:W,compositeRule:G,data:K,opts:Z}=Q;if(Y===void 0)return;let q=i1._`${K}${(0,i1.getProperty)(X)}`;if(G){(0,Y2.checkStrictMode)(Q,`default is ignored for: ${q}`);return}let E=i1._`${q} === undefined`;if(Z.useDefaults==="empty")E=i1._`${E} || ${q} === null || ${q} === ""`;W.if(E,i1._`${q} = ${(0,i1.stringify)(Y)}`)}});var rX=F0((a9)=>{Object.defineProperty(a9,"__esModule",{value:!0});a9.validateUnion=a9.validateArray=a9.usePattern=a9.callValidateCode=a9.schemaProperties=a9.allSchemaProperties=a9.noPropertyInData=a9.propertyInData=a9.isOwnProperty=a9.hasPropFunc=a9.reportMissingProp=a9.checkMissingProp=a9.checkReportMissingProp=void 0;var RQ=QQ(),d8=HQ(),eY=wY(),W2=HQ();function G2(Q,X){let{gen:Y,data:W,it:G}=Q;Y.if(o8(Y,W,X,G.opts.ownProperties),()=>{Q.setParams({missingProperty:RQ._`${X}`},!0),Q.error()})}a9.checkReportMissingProp=G2;function $2({gen:Q,data:X,it:{opts:Y}},W,G){return(0,RQ.or)(...W.map((K)=>(0,RQ.and)(o8(Q,X,K,Y.ownProperties),RQ._`${G} = ${K}`)))}a9.checkMissingProp=$2;function Z2(Q,X){Q.setParams({missingProperty:X},!0),Q.error()}a9.reportMissingProp=Z2;function t9(Q){return Q.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:RQ._`Object.prototype.hasOwnProperty`})}a9.hasPropFunc=t9;function n8(Q,X,Y){return RQ._`${t9(Q)}.call(${X}, ${Y})`}a9.isOwnProperty=n8;function H2(Q,X,Y,W){let G=RQ._`${X}${(0,RQ.getProperty)(Y)} !== undefined`;return W?RQ._`${G} && ${n8(Q,X,Y)}`:G}a9.propertyInData=H2;function o8(Q,X,Y,W){let G=RQ._`${X}${(0,RQ.getProperty)(Y)} === undefined`;return W?(0,RQ.or)(G,(0,RQ.not)(n8(Q,X,Y))):G}a9.noPropertyInData=o8;function s9(Q){return Q?Object.keys(Q).filter((X)=>X!=="__proto__"):[]}a9.allSchemaProperties=s9;function U2(Q,X){return s9(X).filter((Y)=>!(0,d8.alwaysValidSchema)(Q,X[Y]))}a9.schemaProperties=U2;function K2({schemaCode:Q,data:X,it:{gen:Y,topSchemaRef:W,schemaPath:G,errorPath:K},it:Z},q,E,I){let L=I?RQ._`${Q}, ${X}, ${W}${G}`:X,D=[[eY.default.instancePath,(0,RQ.strConcat)(eY.default.instancePath,K)],[eY.default.parentData,Z.parentData],[eY.default.parentDataProperty,Z.parentDataProperty],[eY.default.rootData,eY.default.rootData]];if(Z.opts.dynamicRef)D.push([eY.default.dynamicAnchors,eY.default.dynamicAnchors]);let T=RQ._`${L}, ${Y.object(...D)}`;return E!==RQ.nil?RQ._`${q}.call(${E}, ${T})`:RQ._`${q}(${T})`}a9.callValidateCode=K2;var F2=RQ._`new RegExp`;function V2({gen:Q,it:{opts:X}},Y){let W=X.unicodeRegExp?"u":"",{regExp:G}=X.code,K=G(Y,W);return Q.scopeValue("pattern",{key:K.toString(),ref:K,code:RQ._`${G.code==="new RegExp"?F2:(0,W2.useFunc)(Q,G)}(${Y}, ${W})`})}a9.usePattern=V2;function z2(Q){let{gen:X,data:Y,keyword:W,it:G}=Q,K=X.name("valid");if(G.allErrors){let q=X.let("valid",!0);return Z(()=>X.assign(q,!1)),q}return X.var(K,!0),Z(()=>X.break()),K;function Z(q){let E=X.const("len",RQ._`${Y}.length`);X.forRange("i",0,E,(I)=>{Q.subschema({keyword:W,dataProp:I,dataPropType:d8.Type.Num},K),X.if((0,RQ.not)(K),q)})}}a9.validateArray=z2;function O2(Q){let{gen:X,schema:Y,keyword:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(Y.some((E)=>(0,d8.alwaysValidSchema)(G,E))&&!G.opts.unevaluated)return;let Z=X.let("valid",!1),q=X.name("_valid");X.block(()=>Y.forEach((E,I)=>{let L=Q.subschema({keyword:W,schemaProp:I,compositeRule:!0},q);if(X.assign(Z,RQ._`${Z} || ${q}`),!Q.mergeValidEvaluated(L,q))X.if((0,RQ.not)(Z))})),Q.result(Z,()=>Q.reset(),()=>Q.error(!0))}a9.validateUnion=O2});var WO=F0((YO)=>{Object.defineProperty(YO,"__esModule",{value:!0});YO.validateKeywordUsage=YO.validSchemaType=YO.funcKeywordCode=YO.macroKeywordCode=void 0;var BX=QQ(),E1=wY(),C2=rX(),j2=YW();function N2(Q,X){let{gen:Y,keyword:W,schema:G,parentSchema:K,it:Z}=Q,q=X.macro.call(Z.self,G,K,Z),E=XO(Y,W,q);if(Z.opts.validateSchema!==!1)Z.self.validateSchema(q,!0);let I=Y.name("valid");Q.subschema({schema:q,schemaPath:BX.nil,errSchemaPath:`${Z.errSchemaPath}/${W}`,topSchemaRef:E,compositeRule:!0},I),Q.pass(I,()=>Q.error(!0))}YO.macroKeywordCode=N2;function k2(Q,X){var Y;let{gen:W,keyword:G,schema:K,parentSchema:Z,$data:q,it:E}=Q;v2(E,X);let I=!q&&X.compile?X.compile.call(E.self,K,Z,E):X.validate,L=XO(W,G,I),D=W.let("valid");Q.block$data(D,T),Q.ok((Y=X.valid)!==null&&Y!==void 0?Y:D);function T(){if(X.errors===!1){if(j(),X.modifying)QO(Q);S(()=>Q.error())}else{let N=X.async?P():B();if(X.modifying)QO(Q);S(()=>w2(Q,N))}}function P(){let N=W.let("ruleErrs",null);return W.try(()=>j(BX._`await `),(k)=>W.assign(D,!1).if(BX._`${k} instanceof ${E.ValidationError}`,()=>W.assign(N,BX._`${k}.errors`),()=>W.throw(k))),N}function B(){let N=BX._`${L}.errors`;return W.assign(N,null),j(BX.nil),N}function j(N=X.async?BX._`await `:BX.nil){let k=E.opts.passContext?E1.default.this:E1.default.self,v=!(("compile"in X)&&!q||X.schema===!1);W.assign(D,BX._`${N}${(0,C2.callValidateCode)(Q,L,k,v)}`,X.modifying)}function S(N){var k;W.if((0,BX.not)((k=X.valid)!==null&&k!==void 0?k:D),N)}}YO.funcKeywordCode=k2;function QO(Q){let{gen:X,data:Y,it:W}=Q;X.if(W.parentData,()=>X.assign(Y,BX._`${W.parentData}[${W.parentDataProperty}]`))}function w2(Q,X){let{gen:Y}=Q;Y.if(BX._`Array.isArray(${X})`,()=>{Y.assign(E1.default.vErrors,BX._`${E1.default.vErrors} === null ? ${X} : ${E1.default.vErrors}.concat(${X})`).assign(E1.default.errors,BX._`${E1.default.vErrors}.length`),(0,j2.extendErrors)(Q)},()=>Q.error())}function v2({schemaEnv:Q},X){if(X.async&&!Q.$async)throw Error("async keyword in sync schema")}function XO(Q,X,Y){if(Y===void 0)throw Error(`keyword "${X}" failed to compile`);return Q.scopeValue("keyword",typeof Y=="function"?{ref:Y}:{ref:Y,code:(0,BX.stringify)(Y)})}function _2(Q,X,Y=!1){return!X.length||X.some((W)=>W==="array"?Array.isArray(Q):W==="object"?Q&&typeof Q=="object"&&!Array.isArray(Q):typeof Q==W||Y&&typeof Q>"u")}YO.validSchemaType=_2;function x2({schema:Q,opts:X,self:Y,errSchemaPath:W},G,K){if(Array.isArray(G.keyword)?!G.keyword.includes(K):G.keyword!==K)throw Error("ajv implementation error");let Z=G.dependencies;if(Z===null||Z===void 0?void 0:Z.some((q)=>!Object.prototype.hasOwnProperty.call(Q,q)))throw Error(`parent schema must have dependencies of ${K}: ${Z.join(",")}`);if(G.validateSchema){if(!G.validateSchema(Q[K])){let E=`keyword "${K}" value is invalid at path "${W}": `+Y.errorsText(G.validateSchema.errors);if(X.validateSchema==="log")Y.logger.error(E);else throw Error(E)}}}YO.validateKeywordUsage=x2});var HO=F0(($O)=>{Object.defineProperty($O,"__esModule",{value:!0});$O.extendSubschemaMode=$O.extendSubschemaData=$O.getSubschema=void 0;var DY=QQ(),GO=HQ();function b2(Q,{keyword:X,schemaProp:Y,schema:W,schemaPath:G,errSchemaPath:K,topSchemaRef:Z}){if(X!==void 0&&W!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let q=Q.schema[X];return Y===void 0?{schema:q,schemaPath:DY._`${Q.schemaPath}${(0,DY.getProperty)(X)}`,errSchemaPath:`${Q.errSchemaPath}/${X}`}:{schema:q[Y],schemaPath:DY._`${Q.schemaPath}${(0,DY.getProperty)(X)}${(0,DY.getProperty)(Y)}`,errSchemaPath:`${Q.errSchemaPath}/${X}/${(0,GO.escapeFragment)(Y)}`}}if(W!==void 0){if(G===void 0||K===void 0||Z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:W,schemaPath:G,topSchemaRef:Z,errSchemaPath:K}}throw Error('either "keyword" or "schema" must be passed')}$O.getSubschema=b2;function h2(Q,X,{dataProp:Y,dataPropType:W,data:G,dataTypes:K,propertyName:Z}){if(G!==void 0&&Y!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:q}=X;if(Y!==void 0){let{errorPath:I,dataPathArr:L,opts:D}=X,T=q.let("data",DY._`${X.data}${(0,DY.getProperty)(Y)}`,!0);E(T),Q.errorPath=DY.str`${I}${(0,GO.getErrorPath)(Y,W,D.jsPropertySyntax)}`,Q.parentDataProperty=DY._`${Y}`,Q.dataPathArr=[...L,Q.parentDataProperty]}if(G!==void 0){let I=G instanceof DY.Name?G:q.let("data",G,!0);if(E(I),Z!==void 0)Q.propertyName=Z}if(K)Q.dataTypes=K;function E(I){Q.data=I,Q.dataLevel=X.dataLevel+1,Q.dataTypes=[],X.definedProperties=new Set,Q.parentData=X.data,Q.dataNames=[...X.dataNames,I]}}$O.extendSubschemaData=h2;function u2(Q,{jtdDiscriminator:X,jtdMetadata:Y,compositeRule:W,createErrors:G,allErrors:K}){if(W!==void 0)Q.compositeRule=W;if(G!==void 0)Q.createErrors=G;if(K!==void 0)Q.allErrors=K;Q.jtdDiscriminator=X,Q.jtdMetadata=Y}$O.extendSubschemaMode=u2});var WW=F0((Q00,UO)=>{UO.exports=function Q(X,Y){if(X===Y)return!0;if(X&&Y&&typeof X=="object"&&typeof Y=="object"){if(X.constructor!==Y.constructor)return!1;var W,G,K;if(Array.isArray(X)){if(W=X.length,W!=Y.length)return!1;for(G=W;G--!==0;)if(!Q(X[G],Y[G]))return!1;return!0}if(X.constructor===RegExp)return X.source===Y.source&&X.flags===Y.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===Y.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===Y.toString();if(K=Object.keys(X),W=K.length,W!==Object.keys(Y).length)return!1;for(G=W;G--!==0;)if(!Object.prototype.hasOwnProperty.call(Y,K[G]))return!1;for(G=W;G--!==0;){var Z=K[G];if(!Q(X[Z],Y[Z]))return!1}return!0}return X!==X&&Y!==Y}});var FO=F0((X00,KO)=>{var Q1=KO.exports=function(Q,X,Y){if(typeof X=="function")Y=X,X={};Y=X.cb||Y;var W=typeof Y=="function"?Y:Y.pre||function(){},G=Y.post||function(){};eG(X,W,G,Q,"",Q)};Q1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Q1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Q1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Q1.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 eG(Q,X,Y,W,G,K,Z,q,E,I){if(W&&typeof W=="object"&&!Array.isArray(W)){X(W,G,K,Z,q,E,I);for(var L in W){var D=W[L];if(Array.isArray(D)){if(L in Q1.arrayKeywords)for(var T=0;T<D.length;T++)eG(Q,X,Y,D[T],G+"/"+L+"/"+T,K,G,L,W,T)}else if(L in Q1.propsKeywords){if(D&&typeof D=="object")for(var P in D)eG(Q,X,Y,D[P],G+"/"+L+"/"+l2(P),K,G,L,W,P)}else if(L in Q1.keywords||Q.allKeys&&!(L in Q1.skipKeywords))eG(Q,X,Y,D,G+"/"+L,K,G,L,W)}Y(W,G,K,Z,q,E,I)}}function l2(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}});var GW=F0((AO)=>{Object.defineProperty(AO,"__esModule",{value:!0});AO.getSchemaRefs=AO.resolveUrl=AO.normalizeId=AO._getFullPath=AO.getFullPath=AO.inlineRef=void 0;var m2=HQ(),d2=WW(),n2=FO(),o2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function r2(Q,X=!0){if(typeof Q=="boolean")return!0;if(X===!0)return!r8(Q);if(!X)return!1;return VO(Q)<=X}AO.inlineRef=r2;var i2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function r8(Q){for(let X in Q){if(i2.has(X))return!0;let Y=Q[X];if(Array.isArray(Y)&&Y.some(r8))return!0;if(typeof Y=="object"&&r8(Y))return!0}return!1}function VO(Q){let X=0;for(let Y in Q){if(Y==="$ref")return 1/0;if(X++,o2.has(Y))continue;if(typeof Q[Y]=="object")(0,m2.eachItem)(Q[Y],(W)=>X+=VO(W));if(X===1/0)return 1/0}return X}function zO(Q,X="",Y){if(Y!==!1)X=t1(X);let W=Q.parse(X);return OO(Q,W)}AO.getFullPath=zO;function OO(Q,X){return Q.serialize(X).split("#")[0]+"#"}AO._getFullPath=OO;var t2=/#\/?$/;function t1(Q){return Q?Q.replace(t2,""):""}AO.normalizeId=t1;function s2(Q,X,Y){return Y=t1(Y),Q.resolve(X,Y)}AO.resolveUrl=s2;var a2=/^[a-z_][-a-z0-9._]*$/i;function e2(Q,X){if(typeof Q=="boolean")return{};let{schemaId:Y,uriResolver:W}=this.opts,G=t1(Q[Y]||X),K={"":G},Z=zO(W,G,!1),q={},E=new Set;return n2(Q,{allKeys:!0},(D,T,P,B)=>{if(B===void 0)return;let j=Z+T,S=K[B];if(typeof D[Y]=="string")S=N.call(this,D[Y]);k.call(this,D.$anchor),k.call(this,D.$dynamicAnchor),K[T]=S;function N(v){let _=this.opts.uriResolver.resolve;if(v=t1(S?_(S,v):v),E.has(v))throw L(v);E.add(v);let x=this.refs[v];if(typeof x=="string")x=this.refs[x];if(typeof x=="object")I(D,x.schema,v);else if(v!==t1(j))if(v[0]==="#")I(D,q[v],v),q[v]=D;else this.refs[v]=j;return v}function k(v){if(typeof v=="string"){if(!a2.test(v))throw Error(`invalid anchor "${v}"`);N.call(this,`#${v}`)}}}),q;function I(D,T,P){if(T!==void 0&&!d2(D,T))throw L(P)}function L(D){return Error(`reference "${D}" resolves to more than one schema`)}}AO.getSchemaRefs=e2});var HW=F0((wO)=>{Object.defineProperty(wO,"__esModule",{value:!0});wO.getData=wO.KeywordCxt=wO.validateFunctionCode=void 0;var EO=x9(),qO=JW(),t8=p8(),Q$=JW(),Gk=i9(),ZW=WO(),i8=HO(),p0=QQ(),d0=wY(),$k=GW(),vY=HQ(),$W=YW();function Zk(Q){if(PO(Q)){if(BO(Q),RO(Q)){Kk(Q);return}}TO(Q,()=>(0,EO.topBoolOrEmptySchema)(Q))}wO.validateFunctionCode=Zk;function TO({gen:Q,validateName:X,schema:Y,schemaEnv:W,opts:G},K){if(G.code.es5)Q.func(X,p0._`${d0.default.data}, ${d0.default.valCxt}`,W.$async,()=>{Q.code(p0._`"use strict"; ${IO(Y,G)}`),Uk(Q,G),Q.code(K)});else Q.func(X,p0._`${d0.default.data}, ${Hk(G)}`,W.$async,()=>Q.code(IO(Y,G)).code(K))}function Hk(Q){return p0._`{${d0.default.instancePath}="", ${d0.default.parentData}, ${d0.default.parentDataProperty}, ${d0.default.rootData}=${d0.default.data}${Q.dynamicRef?p0._`, ${d0.default.dynamicAnchors}={}`:p0.nil}}={}`}function Uk(Q,X){Q.if(d0.default.valCxt,()=>{if(Q.var(d0.default.instancePath,p0._`${d0.default.valCxt}.${d0.default.instancePath}`),Q.var(d0.default.parentData,p0._`${d0.default.valCxt}.${d0.default.parentData}`),Q.var(d0.default.parentDataProperty,p0._`${d0.default.valCxt}.${d0.default.parentDataProperty}`),Q.var(d0.default.rootData,p0._`${d0.default.valCxt}.${d0.default.rootData}`),X.dynamicRef)Q.var(d0.default.dynamicAnchors,p0._`${d0.default.valCxt}.${d0.default.dynamicAnchors}`)},()=>{if(Q.var(d0.default.instancePath,p0._`""`),Q.var(d0.default.parentData,p0._`undefined`),Q.var(d0.default.parentDataProperty,p0._`undefined`),Q.var(d0.default.rootData,d0.default.data),X.dynamicRef)Q.var(d0.default.dynamicAnchors,p0._`{}`)})}function Kk(Q){let{schema:X,opts:Y,gen:W}=Q;TO(Q,()=>{if(Y.$comment&&X.$comment)CO(Q);if(Ak(Q),W.let(d0.default.vErrors,null),W.let(d0.default.errors,0),Y.unevaluated)Fk(Q);SO(Q),Ik(Q)});return}function Fk(Q){let{gen:X,validateName:Y}=Q;Q.evaluated=X.const("evaluated",p0._`${Y}.evaluated`),X.if(p0._`${Q.evaluated}.dynamicProps`,()=>X.assign(p0._`${Q.evaluated}.props`,p0._`undefined`)),X.if(p0._`${Q.evaluated}.dynamicItems`,()=>X.assign(p0._`${Q.evaluated}.items`,p0._`undefined`))}function IO(Q,X){let Y=typeof Q=="object"&&Q[X.schemaId];return Y&&(X.code.source||X.code.process)?p0._`/*# sourceURL=${Y} */`:p0.nil}function Vk(Q,X){if(PO(Q)){if(BO(Q),RO(Q)){zk(Q,X);return}}(0,EO.boolOrEmptySchema)(Q,X)}function RO({schema:Q,self:X}){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X.RULES.all[Y])return!0;return!1}function PO(Q){return typeof Q.schema!="boolean"}function zk(Q,X){let{schema:Y,gen:W,opts:G}=Q;if(G.$comment&&Y.$comment)CO(Q);Dk(Q),qk(Q);let K=W.const("_errs",d0.default.errors);SO(Q,K),W.var(X,p0._`${K} === ${d0.default.errors}`)}function BO(Q){(0,vY.checkUnknownRules)(Q),Ok(Q)}function SO(Q,X){if(Q.opts.jtd)return MO(Q,[],!1,X);let Y=(0,qO.getSchemaTypes)(Q.schema),W=(0,qO.coerceAndCheckDataType)(Q,Y);MO(Q,Y,!W,X)}function Ok(Q){let{schema:X,errSchemaPath:Y,opts:W,self:G}=Q;if(X.$ref&&W.ignoreKeywordsWithRef&&(0,vY.schemaHasRulesButRef)(X,G.RULES))G.logger.warn(`$ref: keywords ignored in schema at path "${Y}"`)}function Ak(Q){let{schema:X,opts:Y}=Q;if(X.default!==void 0&&Y.useDefaults&&Y.strictSchema)(0,vY.checkStrictMode)(Q,"default is ignored in the schema root")}function Dk(Q){let X=Q.schema[Q.opts.schemaId];if(X)Q.baseId=(0,$k.resolveUrl)(Q.opts.uriResolver,Q.baseId,X)}function qk(Q){if(Q.schema.$async&&!Q.schemaEnv.$async)throw Error("async schema in sync schema")}function CO({gen:Q,schemaEnv:X,schema:Y,errSchemaPath:W,opts:G}){let K=Y.$comment;if(G.$comment===!0)Q.code(p0._`${d0.default.self}.logger.log(${K})`);else if(typeof G.$comment=="function"){let Z=p0.str`${W}/$comment`,q=Q.scopeValue("root",{ref:X.root});Q.code(p0._`${d0.default.self}.opts.$comment(${K}, ${Z}, ${q}.schema)`)}}function Ik(Q){let{gen:X,schemaEnv:Y,validateName:W,ValidationError:G,opts:K}=Q;if(Y.$async)X.if(p0._`${d0.default.errors} === 0`,()=>X.return(d0.default.data),()=>X.throw(p0._`new ${G}(${d0.default.vErrors})`));else{if(X.assign(p0._`${W}.errors`,d0.default.vErrors),K.unevaluated)Mk(Q);X.return(p0._`${d0.default.errors} === 0`)}}function Mk({gen:Q,evaluated:X,props:Y,items:W}){if(Y instanceof p0.Name)Q.assign(p0._`${X}.props`,Y);if(W instanceof p0.Name)Q.assign(p0._`${X}.items`,W)}function MO(Q,X,Y,W){let{gen:G,schema:K,data:Z,allErrors:q,opts:E,self:I}=Q,{RULES:L}=I;if(K.$ref&&(E.ignoreKeywordsWithRef||!(0,vY.schemaHasRulesButRef)(K,L))){G.block(()=>NO(Q,"$ref",L.all.$ref.definition));return}if(!E.jtd)Lk(Q,X);G.block(()=>{for(let T of L.rules)D(T);D(L.post)});function D(T){if(!(0,t8.shouldUseGroup)(K,T))return;if(T.type){if(G.if((0,Q$.checkDataType)(T.type,Z,E.strictNumbers)),LO(Q,T),X.length===1&&X[0]===T.type&&Y)G.else(),(0,Q$.reportTypeError)(Q);G.endIf()}else LO(Q,T);if(!q)G.if(p0._`${d0.default.errors} === ${W||0}`)}}function LO(Q,X){let{gen:Y,schema:W,opts:{useDefaults:G}}=Q;if(G)(0,Gk.assignDefaults)(Q,X.type);Y.block(()=>{for(let K of X.rules)if((0,t8.shouldUseRule)(W,K))NO(Q,K.keyword,K.definition,X.type)})}function Lk(Q,X){if(Q.schemaEnv.meta||!Q.opts.strictTypes)return;if(Ek(Q,X),!Q.opts.allowUnionTypes)Tk(Q,X);Rk(Q,Q.dataTypes)}function Ek(Q,X){if(!X.length)return;if(!Q.dataTypes.length){Q.dataTypes=X;return}X.forEach((Y)=>{if(!jO(Q.dataTypes,Y))s8(Q,`type "${Y}" not allowed by context "${Q.dataTypes.join(",")}"`)}),Bk(Q,X)}function Tk(Q,X){if(X.length>1&&!(X.length===2&&X.includes("null")))s8(Q,"use allowUnionTypes to allow union type keyword")}function Rk(Q,X){let Y=Q.self.RULES.all;for(let W in Y){let G=Y[W];if(typeof G=="object"&&(0,t8.shouldUseRule)(Q.schema,G)){let{type:K}=G.definition;if(K.length&&!K.some((Z)=>Pk(X,Z)))s8(Q,`missing type "${K.join(",")}" for keyword "${W}"`)}}}function Pk(Q,X){return Q.includes(X)||X==="number"&&Q.includes("integer")}function jO(Q,X){return Q.includes(X)||X==="integer"&&Q.includes("number")}function Bk(Q,X){let Y=[];for(let W of Q.dataTypes)if(jO(X,W))Y.push(W);else if(X.includes("integer")&&W==="number")Y.push("integer");Q.dataTypes=Y}function s8(Q,X){let Y=Q.schemaEnv.baseId+Q.errSchemaPath;X+=` at "${Y}" (strictTypes)`,(0,vY.checkStrictMode)(Q,X,Q.opts.strictTypes)}class a8{constructor(Q,X,Y){if((0,ZW.validateKeywordUsage)(Q,X,Y),this.gen=Q.gen,this.allErrors=Q.allErrors,this.keyword=Y,this.data=Q.data,this.schema=Q.schema[Y],this.$data=X.$data&&Q.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,vY.schemaRefOrVal)(Q,this.schema,Y,this.$data),this.schemaType=X.schemaType,this.parentSchema=Q.schema,this.params={},this.it=Q,this.def=X,this.$data)this.schemaCode=Q.gen.const("vSchema",kO(this.$data,Q));else if(this.schemaCode=this.schemaValue,!(0,ZW.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${Y} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=Q.gen.const("_errs",d0.default.errors)}result(Q,X,Y){this.failResult((0,p0.not)(Q),X,Y)}failResult(Q,X,Y){if(this.gen.if(Q),Y)Y();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(Q,X){this.failResult((0,p0.not)(Q),void 0,X)}fail(Q){if(Q===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Q),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Q){if(!this.$data)return this.fail(Q);let{schemaCode:X}=this;this.fail(p0._`${X} !== undefined && (${(0,p0.or)(this.invalid$data(),Q)})`)}error(Q,X,Y){if(X){this.setParams(X),this._error(Q,Y),this.setParams({});return}this._error(Q,Y)}_error(Q,X){(Q?$W.reportExtraError:$W.reportError)(this,this.def.error,X)}$dataError(){(0,$W.reportError)(this,this.def.$dataError||$W.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,$W.resetErrorsCount)(this.gen,this.errsCount)}ok(Q){if(!this.allErrors)this.gen.if(Q)}setParams(Q,X){if(X)Object.assign(this.params,Q);else this.params=Q}block$data(Q,X,Y=p0.nil){this.gen.block(()=>{this.check$data(Q,Y),X()})}check$data(Q=p0.nil,X=p0.nil){if(!this.$data)return;let{gen:Y,schemaCode:W,schemaType:G,def:K}=this;if(Y.if((0,p0.or)(p0._`${W} === undefined`,X)),Q!==p0.nil)Y.assign(Q,!0);if(G.length||K.validateSchema){if(Y.elseIf(this.invalid$data()),this.$dataError(),Q!==p0.nil)Y.assign(Q,!1)}Y.else()}invalid$data(){let{gen:Q,schemaCode:X,schemaType:Y,def:W,it:G}=this;return(0,p0.or)(K(),Z());function K(){if(Y.length){if(!(X instanceof p0.Name))throw Error("ajv implementation error");let q=Array.isArray(Y)?Y:[Y];return p0._`${(0,Q$.checkDataTypes)(q,X,G.opts.strictNumbers,Q$.DataType.Wrong)}`}return p0.nil}function Z(){if(W.validateSchema){let q=Q.scopeValue("validate$data",{ref:W.validateSchema});return p0._`!${q}(${X})`}return p0.nil}}subschema(Q,X){let Y=(0,i8.getSubschema)(this.it,Q);(0,i8.extendSubschemaData)(Y,this.it,Q),(0,i8.extendSubschemaMode)(Y,Q);let W={...this.it,...Y,items:void 0,props:void 0};return Vk(W,X),W}mergeEvaluated(Q,X){let{it:Y,gen:W}=this;if(!Y.opts.unevaluated)return;if(Y.props!==!0&&Q.props!==void 0)Y.props=vY.mergeEvaluated.props(W,Q.props,Y.props,X);if(Y.items!==!0&&Q.items!==void 0)Y.items=vY.mergeEvaluated.items(W,Q.items,Y.items,X)}mergeValidEvaluated(Q,X){let{it:Y,gen:W}=this;if(Y.opts.unevaluated&&(Y.props!==!0||Y.items!==!0))return W.if(X,()=>this.mergeEvaluated(Q,p0.Name)),!0}}wO.KeywordCxt=a8;function NO(Q,X,Y,W){let G=new a8(Q,Y,X);if("code"in Y)Y.code(G,W);else if(G.$data&&Y.validate)(0,ZW.funcKeywordCode)(G,Y);else if("macro"in Y)(0,ZW.macroKeywordCode)(G,Y);else if(Y.compile||Y.validate)(0,ZW.funcKeywordCode)(G,Y)}var Sk=/^\/(?:[^~]|~0|~1)*$/,Ck=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function kO(Q,{dataLevel:X,dataNames:Y,dataPathArr:W}){let G,K;if(Q==="")return d0.default.rootData;if(Q[0]==="/"){if(!Sk.test(Q))throw Error(`Invalid JSON-pointer: ${Q}`);G=Q,K=d0.default.rootData}else{let I=Ck.exec(Q);if(!I)throw Error(`Invalid JSON-pointer: ${Q}`);let L=+I[1];if(G=I[2],G==="#"){if(L>=X)throw Error(E("property/index",L));return W[X-L]}if(L>X)throw Error(E("data",L));if(K=Y[X-L],!G)return K}let Z=K,q=G.split("/");for(let I of q)if(I)K=p0._`${K}${(0,p0.getProperty)((0,vY.unescapeJsonPointer)(I))}`,Z=p0._`${Z} && ${K}`;return Z;function E(I,L){return`Cannot access ${I} ${L} levels up, current level is ${X}`}}wO.getData=kO});var X$=F0((xO)=>{Object.defineProperty(xO,"__esModule",{value:!0});class _O extends Error{constructor(Q){super("validation failed");this.errors=Q,this.ajv=this.validation=!0}}xO.default=_O});var UW=F0((gO)=>{Object.defineProperty(gO,"__esModule",{value:!0});var e8=GW();class yO extends Error{constructor(Q,X,Y,W){super(W||`can't resolve reference ${Y} from id ${X}`);this.missingRef=(0,e8.resolveUrl)(Q,X,Y),this.missingSchema=(0,e8.normalizeId)((0,e8.getFullPath)(Q,this.missingRef))}}gO.default=yO});var J$=F0((hO)=>{Object.defineProperty(hO,"__esModule",{value:!0});hO.resolveSchema=hO.getCompilingSchema=hO.resolveRef=hO.compileSchema=hO.SchemaEnv=void 0;var WY=QQ(),vk=X$(),T1=wY(),GY=GW(),fO=HQ(),_k=HW();class KW{constructor(Q){var X;this.refs={},this.dynamicAnchors={};let Y;if(typeof Q.schema=="object")Y=Q.schema;this.schema=Q.schema,this.schemaId=Q.schemaId,this.root=Q.root||this,this.baseId=(X=Q.baseId)!==null&&X!==void 0?X:(0,GY.normalizeId)(Y===null||Y===void 0?void 0:Y[Q.schemaId||"$id"]),this.schemaPath=Q.schemaPath,this.localRefs=Q.localRefs,this.meta=Q.meta,this.$async=Y===null||Y===void 0?void 0:Y.$async,this.refs={}}}hO.SchemaEnv=KW;function X6(Q){let X=bO.call(this,Q);if(X)return X;let Y=(0,GY.getFullPath)(this.opts.uriResolver,Q.root.baseId),{es5:W,lines:G}=this.opts.code,{ownProperties:K}=this.opts,Z=new WY.CodeGen(this.scope,{es5:W,lines:G,ownProperties:K}),q;if(Q.$async)q=Z.scopeValue("Error",{ref:vk.default,code:WY._`require("ajv/dist/runtime/validation_error").default`});let E=Z.scopeName("validate");Q.validateName=E;let I={gen:Z,allErrors:this.opts.allErrors,data:T1.default.data,parentData:T1.default.parentData,parentDataProperty:T1.default.parentDataProperty,dataNames:[T1.default.data],dataPathArr:[WY.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Z.scopeValue("schema",this.opts.code.source===!0?{ref:Q.schema,code:(0,WY.stringify)(Q.schema)}:{ref:Q.schema}),validateName:E,ValidationError:q,schema:Q.schema,schemaEnv:Q,rootId:Y,baseId:Q.baseId||Y,schemaPath:WY.nil,errSchemaPath:Q.schemaPath||(this.opts.jtd?"":"#"),errorPath:WY._`""`,opts:this.opts,self:this},L;try{this._compilations.add(Q),(0,_k.validateFunctionCode)(I),Z.optimize(this.opts.code.optimize);let D=Z.toString();if(L=`${Z.scopeRefs(T1.default.scope)}return ${D}`,this.opts.code.process)L=this.opts.code.process(L,Q);let P=Function(`${T1.default.self}`,`${T1.default.scope}`,L)(this,this.scope.get());if(this.scope.value(E,{ref:P}),P.errors=null,P.schema=Q.schema,P.schemaEnv=Q,Q.$async)P.$async=!0;if(this.opts.code.source===!0)P.source={validateName:E,validateCode:D,scopeValues:Z._values};if(this.opts.unevaluated){let{props:B,items:j}=I;if(P.evaluated={props:B instanceof WY.Name?void 0:B,items:j instanceof WY.Name?void 0:j,dynamicProps:B instanceof WY.Name,dynamicItems:j instanceof WY.Name},P.source)P.source.evaluated=(0,WY.stringify)(P.evaluated)}return Q.validate=P,Q}catch(D){if(delete Q.validate,delete Q.validateName,L)this.logger.error("Error compiling schema, function code:",L);throw D}finally{this._compilations.delete(Q)}}hO.compileSchema=X6;function xk(Q,X,Y){var W;Y=(0,GY.resolveUrl)(this.opts.uriResolver,X,Y);let G=Q.refs[Y];if(G)return G;let K=fk.call(this,Q,Y);if(K===void 0){let Z=(W=Q.localRefs)===null||W===void 0?void 0:W[Y],{schemaId:q}=this.opts;if(Z)K=new KW({schema:Z,schemaId:q,root:Q,baseId:X})}if(K===void 0)return;return Q.refs[Y]=yk.call(this,K)}hO.resolveRef=xk;function yk(Q){if((0,GY.inlineRef)(Q.schema,this.opts.inlineRefs))return Q.schema;return Q.validate?Q:X6.call(this,Q)}function bO(Q){for(let X of this._compilations)if(gk(X,Q))return X}hO.getCompilingSchema=bO;function gk(Q,X){return Q.schema===X.schema&&Q.root===X.root&&Q.baseId===X.baseId}function fk(Q,X){let Y;while(typeof(Y=this.refs[X])=="string")X=Y;return Y||this.schemas[X]||Y$.call(this,Q,X)}function Y$(Q,X){let Y=this.opts.uriResolver.parse(X),W=(0,GY._getFullPath)(this.opts.uriResolver,Y),G=(0,GY.getFullPath)(this.opts.uriResolver,Q.baseId,void 0);if(Object.keys(Q.schema).length>0&&W===G)return Q6.call(this,Y,Q);let K=(0,GY.normalizeId)(W),Z=this.refs[K]||this.schemas[K];if(typeof Z=="string"){let q=Y$.call(this,Q,Z);if(typeof(q===null||q===void 0?void 0:q.schema)!=="object")return;return Q6.call(this,Y,q)}if(typeof(Z===null||Z===void 0?void 0:Z.schema)!=="object")return;if(!Z.validate)X6.call(this,Z);if(K===(0,GY.normalizeId)(X)){let{schema:q}=Z,{schemaId:E}=this.opts,I=q[E];if(I)G=(0,GY.resolveUrl)(this.opts.uriResolver,G,I);return new KW({schema:q,schemaId:E,root:Q,baseId:G})}return Q6.call(this,Y,Z)}hO.resolveSchema=Y$;var bk=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Q6(Q,{baseId:X,schema:Y,root:W}){var G;if(((G=Q.fragment)===null||G===void 0?void 0:G[0])!=="/")return;for(let q of Q.fragment.slice(1).split("/")){if(typeof Y==="boolean")return;let E=Y[(0,fO.unescapeFragment)(q)];if(E===void 0)return;Y=E;let I=typeof Y==="object"&&Y[this.opts.schemaId];if(!bk.has(q)&&I)X=(0,GY.resolveUrl)(this.opts.uriResolver,X,I)}let K;if(typeof Y!="boolean"&&Y.$ref&&!(0,fO.schemaHasRulesButRef)(Y,this.RULES)){let q=(0,GY.resolveUrl)(this.opts.uriResolver,X,Y.$ref);K=Y$.call(this,W,q)}let{schemaId:Z}=this.opts;if(K=K||new KW({schema:Y,schemaId:Z,root:W,baseId:X}),K.schema!==K.root.schema)return K;return}});var pO=F0((Z00,lk)=>{lk.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 J6=F0((H00,dO)=>{var mk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),lO=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Y6(Q){let X="",Y=0,W=0;for(W=0;W<Q.length;W++){if(Y=Q[W].charCodeAt(0),Y===48)continue;if(!(Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102))return"";X+=Q[W];break}for(W+=1;W<Q.length;W++){if(Y=Q[W].charCodeAt(0),!(Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102))return"";X+=Q[W]}return X}var dk=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function cO(Q){return Q.length=0,!0}function nk(Q,X,Y){if(Q.length){let W=Y6(Q);if(W!=="")X.push(W);else return Y.error=!0,!1;Q.length=0}return!0}function ok(Q){let X=0,Y={error:!1,address:"",zone:""},W=[],G=[],K=!1,Z=!1,q=nk;for(let E=0;E<Q.length;E++){let I=Q[E];if(I==="["||I==="]")continue;if(I===":"){if(K===!0)Z=!0;if(!q(G,W,Y))break;if(++X>7){Y.error=!0;break}if(E>0&&Q[E-1]===":")K=!0;W.push(":");continue}else if(I==="%"){if(!q(G,W,Y))break;q=cO}else{G.push(I);continue}}if(G.length)if(q===cO)Y.zone=G.join("");else if(Z)W.push(G.join(""));else W.push(Y6(G));return Y.address=W.join(""),Y}function mO(Q){if(rk(Q,":")<2)return{host:Q,isIPV6:!1};let X=ok(Q);if(!X.error){let{address:Y,address:W}=X;if(X.zone)Y+="%"+X.zone,W+="%25"+X.zone;return{host:Y,isIPV6:!0,escapedHost:W}}else return{host:Q,isIPV6:!1}}function rk(Q,X){let Y=0;for(let W=0;W<Q.length;W++)if(Q[W]===X)Y++;return Y}function ik(Q){let X=Q,Y=[],W=-1,G=0;while(G=X.length){if(G===1)if(X===".")break;else if(X==="/"){Y.push("/");break}else{Y.push(X);break}else if(G===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){Y.push("/");break}}}else if(G===3){if(X==="/.."){if(Y.length!==0)Y.pop();Y.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),Y.length!==0)Y.pop();continue}}}}if((W=X.indexOf("/",1))===-1){Y.push(X);break}else Y.push(X.slice(0,W)),X=X.slice(W)}return Y.join("")}function tk(Q,X){let Y=X!==!0?escape:unescape;if(Q.scheme!==void 0)Q.scheme=Y(Q.scheme);if(Q.userinfo!==void 0)Q.userinfo=Y(Q.userinfo);if(Q.host!==void 0)Q.host=Y(Q.host);if(Q.path!==void 0)Q.path=Y(Q.path);if(Q.query!==void 0)Q.query=Y(Q.query);if(Q.fragment!==void 0)Q.fragment=Y(Q.fragment);return Q}function sk(Q){let X=[];if(Q.userinfo!==void 0)X.push(Q.userinfo),X.push("@");if(Q.host!==void 0){let Y=unescape(Q.host);if(!lO(Y)){let W=mO(Y);if(W.isIPV6===!0)Y=`[${W.escapedHost}]`;else Y=Q.host}X.push(Y)}if(typeof Q.port==="number"||typeof Q.port==="string")X.push(":"),X.push(String(Q.port));return X.length?X.join(""):void 0}dO.exports={nonSimpleDomain:dk,recomposeAuthority:sk,normalizeComponentEncoding:tk,removeDotSegments:ik,isIPv4:lO,isUUID:mk,normalizeIPv6:mO,stringArrayToHexStripped:Y6}});var tO=F0((U00,iO)=>{var{isUUID:ak}=J6(),ek=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Qw=["http","https","ws","wss","urn","urn:uuid"];function Xw(Q){return Qw.indexOf(Q)!==-1}function W6(Q){if(Q.secure===!0)return!0;else if(Q.secure===!1)return!1;else if(Q.scheme)return Q.scheme.length===3&&(Q.scheme[0]==="w"||Q.scheme[0]==="W")&&(Q.scheme[1]==="s"||Q.scheme[1]==="S")&&(Q.scheme[2]==="s"||Q.scheme[2]==="S");else return!1}function nO(Q){if(!Q.host)Q.error=Q.error||"HTTP URIs must have a host.";return Q}function oO(Q){let X=String(Q.scheme).toLowerCase()==="https";if(Q.port===(X?443:80)||Q.port==="")Q.port=void 0;if(!Q.path)Q.path="/";return Q}function Yw(Q){return Q.secure=W6(Q),Q.resourceName=(Q.path||"/")+(Q.query?"?"+Q.query:""),Q.path=void 0,Q.query=void 0,Q}function Jw(Q){if(Q.port===(W6(Q)?443:80)||Q.port==="")Q.port=void 0;if(typeof Q.secure==="boolean")Q.scheme=Q.secure?"wss":"ws",Q.secure=void 0;if(Q.resourceName){let[X,Y]=Q.resourceName.split("?");Q.path=X&&X!=="/"?X:void 0,Q.query=Y,Q.resourceName=void 0}return Q.fragment=void 0,Q}function Ww(Q,X){if(!Q.path)return Q.error="URN can not be parsed",Q;let Y=Q.path.match(ek);if(Y){let W=X.scheme||Q.scheme||"urn";Q.nid=Y[1].toLowerCase(),Q.nss=Y[2];let G=`${W}:${X.nid||Q.nid}`,K=G6(G);if(Q.path=void 0,K)Q=K.parse(Q,X)}else Q.error=Q.error||"URN can not be parsed.";return Q}function Gw(Q,X){if(Q.nid===void 0)throw Error("URN without nid cannot be serialized");let Y=X.scheme||Q.scheme||"urn",W=Q.nid.toLowerCase(),G=`${Y}:${X.nid||W}`,K=G6(G);if(K)Q=K.serialize(Q,X);let Z=Q,q=Q.nss;return Z.path=`${W||X.nid}:${q}`,X.skipEscape=!0,Z}function $w(Q,X){let Y=Q;if(Y.uuid=Y.nss,Y.nss=void 0,!X.tolerant&&(!Y.uuid||!ak(Y.uuid)))Y.error=Y.error||"UUID is not valid.";return Y}function Zw(Q){let X=Q;return X.nss=(Q.uuid||"").toLowerCase(),X}var rO={scheme:"http",domainHost:!0,parse:nO,serialize:oO},Hw={scheme:"https",domainHost:rO.domainHost,parse:nO,serialize:oO},W$={scheme:"ws",domainHost:!0,parse:Yw,serialize:Jw},Uw={scheme:"wss",domainHost:W$.domainHost,parse:W$.parse,serialize:W$.serialize},Kw={scheme:"urn",parse:Ww,serialize:Gw,skipNormalize:!0},Fw={scheme:"urn:uuid",parse:$w,serialize:Zw,skipNormalize:!0},G$={http:rO,https:Hw,ws:W$,wss:Uw,urn:Kw,"urn:uuid":Fw};Object.setPrototypeOf(G$,null);function G6(Q){return Q&&(G$[Q]||G$[Q.toLowerCase()])||void 0}iO.exports={wsIsSecure:W6,SCHEMES:G$,isValidSchemeName:Xw,getSchemeHandler:G6}});var Z6=F0((K00,Z$)=>{var{normalizeIPv6:Vw,removeDotSegments:FW,recomposeAuthority:zw,normalizeComponentEncoding:$$,isIPv4:Ow,nonSimpleDomain:Aw}=J6(),{SCHEMES:Dw,getSchemeHandler:sO}=tO();function qw(Q,X){if(typeof Q==="string")Q=qY(_Y(Q,X),X);else if(typeof Q==="object")Q=_Y(qY(Q,X),X);return Q}function Iw(Q,X,Y){let W=Y?Object.assign({scheme:"null"},Y):{scheme:"null"},G=aO(_Y(Q,W),_Y(X,W),W,!0);return W.skipEscape=!0,qY(G,W)}function aO(Q,X,Y,W){let G={};if(!W)Q=_Y(qY(Q,Y),Y),X=_Y(qY(X,Y),Y);if(Y=Y||{},!Y.tolerant&&X.scheme)G.scheme=X.scheme,G.userinfo=X.userinfo,G.host=X.host,G.port=X.port,G.path=FW(X.path||""),G.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)G.userinfo=X.userinfo,G.host=X.host,G.port=X.port,G.path=FW(X.path||""),G.query=X.query;else{if(!X.path)if(G.path=Q.path,X.query!==void 0)G.query=X.query;else G.query=Q.query;else{if(X.path[0]==="/")G.path=FW(X.path);else{if((Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0)&&!Q.path)G.path="/"+X.path;else if(!Q.path)G.path=X.path;else G.path=Q.path.slice(0,Q.path.lastIndexOf("/")+1)+X.path;G.path=FW(G.path)}G.query=X.query}G.userinfo=Q.userinfo,G.host=Q.host,G.port=Q.port}G.scheme=Q.scheme}return G.fragment=X.fragment,G}function Mw(Q,X,Y){if(typeof Q==="string")Q=unescape(Q),Q=qY($$(_Y(Q,Y),!0),{...Y,skipEscape:!0});else if(typeof Q==="object")Q=qY($$(Q,!0),{...Y,skipEscape:!0});if(typeof X==="string")X=unescape(X),X=qY($$(_Y(X,Y),!0),{...Y,skipEscape:!0});else if(typeof X==="object")X=qY($$(X,!0),{...Y,skipEscape:!0});return Q.toLowerCase()===X.toLowerCase()}function qY(Q,X){let Y={host:Q.host,scheme:Q.scheme,userinfo:Q.userinfo,port:Q.port,path:Q.path,query:Q.query,nid:Q.nid,nss:Q.nss,uuid:Q.uuid,fragment:Q.fragment,reference:Q.reference,resourceName:Q.resourceName,secure:Q.secure,error:""},W=Object.assign({},X),G=[],K=sO(W.scheme||Y.scheme);if(K&&K.serialize)K.serialize(Y,W);if(Y.path!==void 0)if(!W.skipEscape){if(Y.path=escape(Y.path),Y.scheme!==void 0)Y.path=Y.path.split("%3A").join(":")}else Y.path=unescape(Y.path);if(W.reference!=="suffix"&&Y.scheme)G.push(Y.scheme,":");let Z=zw(Y);if(Z!==void 0){if(W.reference!=="suffix")G.push("//");if(G.push(Z),Y.path&&Y.path[0]!=="/")G.push("/")}if(Y.path!==void 0){let q=Y.path;if(!W.absolutePath&&(!K||!K.absolutePath))q=FW(q);if(Z===void 0&&q[0]==="/"&&q[1]==="/")q="/%2F"+q.slice(2);G.push(q)}if(Y.query!==void 0)G.push("?",Y.query);if(Y.fragment!==void 0)G.push("#",Y.fragment);return G.join("")}var Lw=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _Y(Q,X){let Y=Object.assign({},X),W={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},G=!1;if(Y.reference==="suffix")if(Y.scheme)Q=Y.scheme+":"+Q;else Q="//"+Q;let K=Q.match(Lw);if(K){if(W.scheme=K[1],W.userinfo=K[3],W.host=K[4],W.port=parseInt(K[5],10),W.path=K[6]||"",W.query=K[7],W.fragment=K[8],isNaN(W.port))W.port=K[5];if(W.host)if(Ow(W.host)===!1){let E=Vw(W.host);W.host=E.host.toLowerCase(),G=E.isIPV6}else G=!0;if(W.scheme===void 0&&W.userinfo===void 0&&W.host===void 0&&W.port===void 0&&W.query===void 0&&!W.path)W.reference="same-document";else if(W.scheme===void 0)W.reference="relative";else if(W.fragment===void 0)W.reference="absolute";else W.reference="uri";if(Y.reference&&Y.reference!=="suffix"&&Y.reference!==W.reference)W.error=W.error||"URI is not a "+Y.reference+" reference.";let Z=sO(Y.scheme||W.scheme);if(!Y.unicodeSupport&&(!Z||!Z.unicodeSupport)){if(W.host&&(Y.domainHost||Z&&Z.domainHost)&&G===!1&&Aw(W.host))try{W.host=URL.domainToASCII(W.host.toLowerCase())}catch(q){W.error=W.error||"Host's domain name can not be converted to ASCII: "+q}}if(!Z||Z&&!Z.skipNormalize){if(Q.indexOf("%")!==-1){if(W.scheme!==void 0)W.scheme=unescape(W.scheme);if(W.host!==void 0)W.host=unescape(W.host)}if(W.path)W.path=escape(unescape(W.path));if(W.fragment)W.fragment=encodeURI(decodeURIComponent(W.fragment))}if(Z&&Z.parse)Z.parse(W,Y)}else W.error=W.error||"URI can not be parsed.";return W}var $6={SCHEMES:Dw,normalize:qw,resolve:Iw,resolveComponent:aO,equal:Mw,serialize:qY,parse:_Y};Z$.exports=$6;Z$.exports.default=$6;Z$.exports.fastUri=$6});var X7=F0((Q7)=>{Object.defineProperty(Q7,"__esModule",{value:!0});var eO=Z6();eO.code='require("ajv/dist/runtime/uri").default';Q7.default=eO});var U7=F0((xY)=>{Object.defineProperty(xY,"__esModule",{value:!0});xY.CodeGen=xY.Name=xY.nil=xY.stringify=xY.str=xY._=xY.KeywordCxt=void 0;var Tw=HW();Object.defineProperty(xY,"KeywordCxt",{enumerable:!0,get:function(){return Tw.KeywordCxt}});var s1=QQ();Object.defineProperty(xY,"_",{enumerable:!0,get:function(){return s1._}});Object.defineProperty(xY,"str",{enumerable:!0,get:function(){return s1.str}});Object.defineProperty(xY,"stringify",{enumerable:!0,get:function(){return s1.stringify}});Object.defineProperty(xY,"nil",{enumerable:!0,get:function(){return s1.nil}});Object.defineProperty(xY,"Name",{enumerable:!0,get:function(){return s1.Name}});Object.defineProperty(xY,"CodeGen",{enumerable:!0,get:function(){return s1.CodeGen}});var Rw=X$(),$7=UW(),Pw=u8(),VW=J$(),Bw=QQ(),zW=GW(),H$=JW(),U6=HQ(),Y7=pO(),Sw=X7(),Z7=(Q,X)=>new RegExp(Q,X);Z7.code="new RegExp";var Cw=["removeAdditional","useDefaults","coerceTypes"],jw=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Nw={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."},kw={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},J7=200;function ww(Q){var X,Y,W,G,K,Z,q,E,I,L,D,T,P,B,j,S,N,k,v,_,x,c,Y0,$0,e;let p=Q.strict,X0=(X=Q.code)===null||X===void 0?void 0:X.optimize,J=X0===!0||X0===void 0?1:X0||0,U=(W=(Y=Q.code)===null||Y===void 0?void 0:Y.regExp)!==null&&W!==void 0?W:Z7,V=(G=Q.uriResolver)!==null&&G!==void 0?G:Sw.default;return{strictSchema:(Z=(K=Q.strictSchema)!==null&&K!==void 0?K:p)!==null&&Z!==void 0?Z:!0,strictNumbers:(E=(q=Q.strictNumbers)!==null&&q!==void 0?q:p)!==null&&E!==void 0?E:!0,strictTypes:(L=(I=Q.strictTypes)!==null&&I!==void 0?I:p)!==null&&L!==void 0?L:"log",strictTuples:(T=(D=Q.strictTuples)!==null&&D!==void 0?D:p)!==null&&T!==void 0?T:"log",strictRequired:(B=(P=Q.strictRequired)!==null&&P!==void 0?P:p)!==null&&B!==void 0?B:!1,code:Q.code?{...Q.code,optimize:J,regExp:U}:{optimize:J,regExp:U},loopRequired:(j=Q.loopRequired)!==null&&j!==void 0?j:J7,loopEnum:(S=Q.loopEnum)!==null&&S!==void 0?S:J7,meta:(N=Q.meta)!==null&&N!==void 0?N:!0,messages:(k=Q.messages)!==null&&k!==void 0?k:!0,inlineRefs:(v=Q.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(_=Q.schemaId)!==null&&_!==void 0?_:"$id",addUsedSchema:(x=Q.addUsedSchema)!==null&&x!==void 0?x:!0,validateSchema:(c=Q.validateSchema)!==null&&c!==void 0?c:!0,validateFormats:(Y0=Q.validateFormats)!==null&&Y0!==void 0?Y0:!0,unicodeRegExp:($0=Q.unicodeRegExp)!==null&&$0!==void 0?$0:!0,int32range:(e=Q.int32range)!==null&&e!==void 0?e:!0,uriResolver:V}}class U${constructor(Q={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,Q=this.opts={...Q,...ww(Q)};let{es5:X,lines:Y}=this.opts.code;this.scope=new Bw.ValueScope({scope:{},prefixes:jw,es5:X,lines:Y}),this.logger=fw(Q.logger);let W=Q.validateFormats;if(Q.validateFormats=!1,this.RULES=(0,Pw.getRules)(),W7.call(this,Nw,Q,"NOT SUPPORTED"),W7.call(this,kw,Q,"DEPRECATED","warn"),this._metaOpts=yw.call(this),Q.formats)_w.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Q.keywords)xw.call(this,Q.keywords);if(typeof Q.meta=="object")this.addMetaSchema(Q.meta);vw.call(this),Q.validateFormats=W}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Q,meta:X,schemaId:Y}=this.opts,W=Y7;if(Y==="id")W={...Y7},W.id=W.$id,delete W.$id;if(X&&Q)this.addMetaSchema(W,W[Y],!1)}defaultMeta(){let{meta:Q,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof Q=="object"?Q[X]||Q:void 0}validate(Q,X){let Y;if(typeof Q=="string"){if(Y=this.getSchema(Q),!Y)throw Error(`no schema with key or ref "${Q}"`)}else Y=this.compile(Q);let W=Y(X);if(!("$async"in Y))this.errors=Y.errors;return W}compile(Q,X){let Y=this._addSchema(Q,X);return Y.validate||this._compileSchemaEnv(Y)}compileAsync(Q,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Y}=this.opts;return W.call(this,Q,X);async function W(I,L){await G.call(this,I.$schema);let D=this._addSchema(I,L);return D.validate||K.call(this,D)}async function G(I){if(I&&!this.getSchema(I))await W.call(this,{$ref:I},!0)}async function K(I){try{return this._compileSchemaEnv(I)}catch(L){if(!(L instanceof $7.default))throw L;return Z.call(this,L),await q.call(this,L.missingSchema),K.call(this,I)}}function Z({missingSchema:I,missingRef:L}){if(this.refs[I])throw Error(`AnySchema ${I} is loaded but ${L} cannot be resolved`)}async function q(I){let L=await E.call(this,I);if(!this.refs[I])await G.call(this,L.$schema);if(!this.refs[I])this.addSchema(L,I,X)}async function E(I){let L=this._loading[I];if(L)return L;try{return await(this._loading[I]=Y(I))}finally{delete this._loading[I]}}}addSchema(Q,X,Y,W=this.opts.validateSchema){if(Array.isArray(Q)){for(let K of Q)this.addSchema(K,void 0,Y,W);return this}let G;if(typeof Q==="object"){let{schemaId:K}=this.opts;if(G=Q[K],G!==void 0&&typeof G!="string")throw Error(`schema ${K} must be string`)}return X=(0,zW.normalizeId)(X||G),this._checkUnique(X),this.schemas[X]=this._addSchema(Q,Y,X,W,!0),this}addMetaSchema(Q,X,Y=this.opts.validateSchema){return this.addSchema(Q,X,!0,Y),this}validateSchema(Q,X){if(typeof Q=="boolean")return!0;let Y;if(Y=Q.$schema,Y!==void 0&&typeof Y!="string")throw Error("$schema must be a string");if(Y=Y||this.opts.defaultMeta||this.defaultMeta(),!Y)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let W=this.validate(Y,Q);if(!W&&X){let G="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(G);else throw Error(G)}return W}getSchema(Q){let X;while(typeof(X=G7.call(this,Q))=="string")Q=X;if(X===void 0){let{schemaId:Y}=this.opts,W=new VW.SchemaEnv({schema:{},schemaId:Y});if(X=VW.resolveSchema.call(this,W,Q),!X)return;this.refs[Q]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(Q){if(Q instanceof RegExp)return this._removeAllSchemas(this.schemas,Q),this._removeAllSchemas(this.refs,Q),this;switch(typeof Q){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=G7.call(this,Q);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[Q],delete this.refs[Q],this}case"object":{let X=Q;this._cache.delete(X);let Y=Q[this.opts.schemaId];if(Y)Y=(0,zW.normalizeId)(Y),delete this.schemas[Y],delete this.refs[Y];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Q){for(let X of Q)this.addKeyword(X);return this}addKeyword(Q,X){let Y;if(typeof Q=="string"){if(Y=Q,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=Y}else if(typeof Q=="object"&&X===void 0){if(X=Q,Y=X.keyword,Array.isArray(Y)&&!Y.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(hw.call(this,Y,X),!X)return(0,U6.eachItem)(Y,(G)=>H6.call(this,G)),this;pw.call(this,X);let W={...X,type:(0,H$.getJSONTypes)(X.type),schemaType:(0,H$.getJSONTypes)(X.schemaType)};return(0,U6.eachItem)(Y,W.type.length===0?(G)=>H6.call(this,G,W):(G)=>W.type.forEach((K)=>H6.call(this,G,W,K))),this}getKeyword(Q){let X=this.RULES.all[Q];return typeof X=="object"?X.definition:!!X}removeKeyword(Q){let{RULES:X}=this;delete X.keywords[Q],delete X.all[Q];for(let Y of X.rules){let W=Y.rules.findIndex((G)=>G.keyword===Q);if(W>=0)Y.rules.splice(W,1)}return this}addFormat(Q,X){if(typeof X=="string")X=new RegExp(X);return this.formats[Q]=X,this}errorsText(Q=this.errors,{separator:X=", ",dataVar:Y="data"}={}){if(!Q||Q.length===0)return"No errors";return Q.map((W)=>`${Y}${W.instancePath} ${W.message}`).reduce((W,G)=>W+X+G)}$dataMetaSchema(Q,X){let Y=this.RULES.all;Q=JSON.parse(JSON.stringify(Q));for(let W of X){let G=W.split("/").slice(1),K=Q;for(let Z of G)K=K[Z];for(let Z in Y){let q=Y[Z];if(typeof q!="object")continue;let{$data:E}=q.definition,I=K[Z];if(E&&I)K[Z]=H7(I)}}return Q}_removeAllSchemas(Q,X){for(let Y in Q){let W=Q[Y];if(!X||X.test(Y)){if(typeof W=="string")delete Q[Y];else if(W&&!W.meta)this._cache.delete(W.schema),delete Q[Y]}}}_addSchema(Q,X,Y,W=this.opts.validateSchema,G=this.opts.addUsedSchema){let K,{schemaId:Z}=this.opts;if(typeof Q=="object")K=Q[Z];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Q!="boolean")throw Error("schema must be object or boolean");let q=this._cache.get(Q);if(q!==void 0)return q;Y=(0,zW.normalizeId)(K||Y);let E=zW.getSchemaRefs.call(this,Q,Y);if(q=new VW.SchemaEnv({schema:Q,schemaId:Z,meta:X,baseId:Y,localRefs:E}),this._cache.set(q.schema,q),G&&!Y.startsWith("#")){if(Y)this._checkUnique(Y);this.refs[Y]=q}if(W)this.validateSchema(Q,!0);return q}_checkUnique(Q){if(this.schemas[Q]||this.refs[Q])throw Error(`schema with key or id "${Q}" already exists`)}_compileSchemaEnv(Q){if(Q.meta)this._compileMetaSchema(Q);else VW.compileSchema.call(this,Q);if(!Q.validate)throw Error("ajv implementation error");return Q.validate}_compileMetaSchema(Q){let X=this.opts;this.opts=this._metaOpts;try{VW.compileSchema.call(this,Q)}finally{this.opts=X}}}U$.ValidationError=Rw.default;U$.MissingRefError=$7.default;xY.default=U$;function W7(Q,X,Y,W="error"){for(let G in Q){let K=G;if(K in X)this.logger[W](`${Y}: option ${G}. ${Q[K]}`)}}function G7(Q){return Q=(0,zW.normalizeId)(Q),this.schemas[Q]||this.refs[Q]}function vw(){let Q=this.opts.schemas;if(!Q)return;if(Array.isArray(Q))this.addSchema(Q);else for(let X in Q)this.addSchema(Q[X],X)}function _w(){for(let Q in this.opts.formats){let X=this.opts.formats[Q];if(X)this.addFormat(Q,X)}}function xw(Q){if(Array.isArray(Q)){this.addVocabulary(Q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in Q){let Y=Q[X];if(!Y.keyword)Y.keyword=X;this.addKeyword(Y)}}function yw(){let Q={...this.opts};for(let X of Cw)delete Q[X];return Q}var gw={log(){},warn(){},error(){}};function fw(Q){if(Q===!1)return gw;if(Q===void 0)return console;if(Q.log&&Q.warn&&Q.error)return Q;throw Error("logger must implement log, warn and error methods")}var bw=/^[a-z_$][a-z0-9_$:-]*$/i;function hw(Q,X){let{RULES:Y}=this;if((0,U6.eachItem)(Q,(W)=>{if(Y.keywords[W])throw Error(`Keyword ${W} is already defined`);if(!bw.test(W))throw Error(`Keyword ${W} 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 H6(Q,X,Y){var W;let G=X===null||X===void 0?void 0:X.post;if(Y&&G)throw Error('keyword with "post" flag cannot have "type"');let{RULES:K}=this,Z=G?K.post:K.rules.find(({type:E})=>E===Y);if(!Z)Z={type:Y,rules:[]},K.rules.push(Z);if(K.keywords[Q]=!0,!X)return;let q={keyword:Q,definition:{...X,type:(0,H$.getJSONTypes)(X.type),schemaType:(0,H$.getJSONTypes)(X.schemaType)}};if(X.before)uw.call(this,Z,q,X.before);else Z.rules.push(q);K.all[Q]=q,(W=X.implements)===null||W===void 0||W.forEach((E)=>this.addKeyword(E))}function uw(Q,X,Y){let W=Q.rules.findIndex((G)=>G.keyword===Y);if(W>=0)Q.rules.splice(W,0,X);else Q.rules.push(X),this.logger.warn(`rule ${Y} is not defined`)}function pw(Q){let{metaSchema:X}=Q;if(X===void 0)return;if(Q.$data&&this.opts.$data)X=H7(X);Q.validateSchema=this.compile(X,!0)}var cw={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function H7(Q){return{anyOf:[Q,cw]}}});var F7=F0((K7)=>{Object.defineProperty(K7,"__esModule",{value:!0});var dw={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};K7.default=dw});var q7=F0((A7)=>{Object.defineProperty(A7,"__esModule",{value:!0});A7.callRef=A7.getValidate=void 0;var ow=UW(),V7=rX(),_X=QQ(),a1=wY(),z7=J$(),K$=HQ(),rw={keyword:"$ref",schemaType:"string",code(Q){let{gen:X,schema:Y,it:W}=Q,{baseId:G,schemaEnv:K,validateName:Z,opts:q,self:E}=W,{root:I}=K;if((Y==="#"||Y==="#/")&&G===I.baseId)return D();let L=z7.resolveRef.call(E,I,G,Y);if(L===void 0)throw new ow.default(W.opts.uriResolver,G,Y);if(L instanceof z7.SchemaEnv)return T(L);return P(L);function D(){if(K===I)return F$(Q,Z,K,K.$async);let B=X.scopeValue("root",{ref:I});return F$(Q,_X._`${B}.validate`,I,I.$async)}function T(B){let j=O7(Q,B);F$(Q,j,B,B.$async)}function P(B){let j=X.scopeValue("schema",q.code.source===!0?{ref:B,code:(0,_X.stringify)(B)}:{ref:B}),S=X.name("valid"),N=Q.subschema({schema:B,dataTypes:[],schemaPath:_X.nil,topSchemaRef:j,errSchemaPath:Y},S);Q.mergeEvaluated(N),Q.ok(S)}}};function O7(Q,X){let{gen:Y}=Q;return X.validate?Y.scopeValue("validate",{ref:X.validate}):_X._`${Y.scopeValue("wrapper",{ref:X})}.validate`}A7.getValidate=O7;function F$(Q,X,Y,W){let{gen:G,it:K}=Q,{allErrors:Z,schemaEnv:q,opts:E}=K,I=E.passContext?a1.default.this:_X.nil;if(W)L();else D();function L(){if(!q.$async)throw Error("async schema referenced by sync schema");let B=G.let("valid");G.try(()=>{if(G.code(_X._`await ${(0,V7.callValidateCode)(Q,X,I)}`),P(X),!Z)G.assign(B,!0)},(j)=>{if(G.if(_X._`!(${j} instanceof ${K.ValidationError})`,()=>G.throw(j)),T(j),!Z)G.assign(B,!1)}),Q.ok(B)}function D(){Q.result((0,V7.callValidateCode)(Q,X,I),()=>P(X),()=>T(X))}function T(B){let j=_X._`${B}.errors`;G.assign(a1.default.vErrors,_X._`${a1.default.vErrors} === null ? ${j} : ${a1.default.vErrors}.concat(${j})`),G.assign(a1.default.errors,_X._`${a1.default.vErrors}.length`)}function P(B){var j;if(!K.opts.unevaluated)return;let S=(j=Y===null||Y===void 0?void 0:Y.validate)===null||j===void 0?void 0:j.evaluated;if(K.props!==!0)if(S&&!S.dynamicProps){if(S.props!==void 0)K.props=K$.mergeEvaluated.props(G,S.props,K.props)}else{let N=G.var("props",_X._`${B}.evaluated.props`);K.props=K$.mergeEvaluated.props(G,N,K.props,_X.Name)}if(K.items!==!0)if(S&&!S.dynamicItems){if(S.items!==void 0)K.items=K$.mergeEvaluated.items(G,S.items,K.items)}else{let N=G.var("items",_X._`${B}.evaluated.items`);K.items=K$.mergeEvaluated.items(G,N,K.items,_X.Name)}}}A7.callRef=F$;A7.default=rw});var M7=F0((I7)=>{Object.defineProperty(I7,"__esModule",{value:!0});var sw=F7(),aw=q7(),ew=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",sw.default,aw.default];I7.default=ew});var E7=F0((L7)=>{Object.defineProperty(L7,"__esModule",{value:!0});var V$=QQ(),X1=V$.operators,z$={maximum:{okStr:"<=",ok:X1.LTE,fail:X1.GT},minimum:{okStr:">=",ok:X1.GTE,fail:X1.LT},exclusiveMaximum:{okStr:"<",ok:X1.LT,fail:X1.GTE},exclusiveMinimum:{okStr:">",ok:X1.GT,fail:X1.LTE}},Xv={message:({keyword:Q,schemaCode:X})=>V$.str`must be ${z$[Q].okStr} ${X}`,params:({keyword:Q,schemaCode:X})=>V$._`{comparison: ${z$[Q].okStr}, limit: ${X}}`},Yv={keyword:Object.keys(z$),type:"number",schemaType:"number",$data:!0,error:Xv,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q;Q.fail$data(V$._`${Y} ${z$[X].fail} ${W} || isNaN(${Y})`)}};L7.default=Yv});var R7=F0((T7)=>{Object.defineProperty(T7,"__esModule",{value:!0});var OW=QQ(),Wv={message:({schemaCode:Q})=>OW.str`must be multiple of ${Q}`,params:({schemaCode:Q})=>OW._`{multipleOf: ${Q}}`},Gv={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Wv,code(Q){let{gen:X,data:Y,schemaCode:W,it:G}=Q,K=G.opts.multipleOfPrecision,Z=X.let("res"),q=K?OW._`Math.abs(Math.round(${Z}) - ${Z}) > 1e-${K}`:OW._`${Z} !== parseInt(${Z})`;Q.fail$data(OW._`(${W} === 0 || (${Z} = ${Y}/${W}, ${q}))`)}};T7.default=Gv});var S7=F0((B7)=>{Object.defineProperty(B7,"__esModule",{value:!0});function P7(Q){let X=Q.length,Y=0,W=0,G;while(W<X)if(Y++,G=Q.charCodeAt(W++),G>=55296&&G<=56319&&W<X){if(G=Q.charCodeAt(W),(G&64512)===56320)W++}return Y}B7.default=P7;P7.code='require("ajv/dist/runtime/ucs2length").default'});var j7=F0((C7)=>{Object.defineProperty(C7,"__esModule",{value:!0});var R1=QQ(),Hv=HQ(),Uv=S7(),Kv={message({keyword:Q,schemaCode:X}){let Y=Q==="maxLength"?"more":"fewer";return R1.str`must NOT have ${Y} than ${X} characters`},params:({schemaCode:Q})=>R1._`{limit: ${Q}}`},Fv={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Kv,code(Q){let{keyword:X,data:Y,schemaCode:W,it:G}=Q,K=X==="maxLength"?R1.operators.GT:R1.operators.LT,Z=G.opts.unicode===!1?R1._`${Y}.length`:R1._`${(0,Hv.useFunc)(Q.gen,Uv.default)}(${Y})`;Q.fail$data(R1._`${Z} ${K} ${W}`)}};C7.default=Fv});var k7=F0((N7)=>{Object.defineProperty(N7,"__esModule",{value:!0});var zv=rX(),O$=QQ(),Ov={message:({schemaCode:Q})=>O$.str`must match pattern "${Q}"`,params:({schemaCode:Q})=>O$._`{pattern: ${Q}}`},Av={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Ov,code(Q){let{data:X,$data:Y,schema:W,schemaCode:G,it:K}=Q,Z=K.opts.unicodeRegExp?"u":"",q=Y?O$._`(new RegExp(${G}, ${Z}))`:(0,zv.usePattern)(Q,W);Q.fail$data(O$._`!${q}.test(${X})`)}};N7.default=Av});var v7=F0((w7)=>{Object.defineProperty(w7,"__esModule",{value:!0});var AW=QQ(),qv={message({keyword:Q,schemaCode:X}){let Y=Q==="maxProperties"?"more":"fewer";return AW.str`must NOT have ${Y} than ${X} properties`},params:({schemaCode:Q})=>AW._`{limit: ${Q}}`},Iv={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qv,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxProperties"?AW.operators.GT:AW.operators.LT;Q.fail$data(AW._`Object.keys(${Y}).length ${G} ${W}`)}};w7.default=Iv});var x7=F0((_7)=>{Object.defineProperty(_7,"__esModule",{value:!0});var DW=rX(),qW=QQ(),Lv=HQ(),Ev={message:({params:{missingProperty:Q}})=>qW.str`must have required property '${Q}'`,params:({params:{missingProperty:Q}})=>qW._`{missingProperty: ${Q}}`},Tv={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Ev,code(Q){let{gen:X,schema:Y,schemaCode:W,data:G,$data:K,it:Z}=Q,{opts:q}=Z;if(!K&&Y.length===0)return;let E=Y.length>=q.loopRequired;if(Z.allErrors)I();else L();if(q.strictRequired){let P=Q.parentSchema.properties,{definedProperties:B}=Q.it;for(let j of Y)if((P===null||P===void 0?void 0:P[j])===void 0&&!B.has(j)){let S=Z.schemaEnv.baseId+Z.errSchemaPath,N=`required property "${j}" is not defined at "${S}" (strictRequired)`;(0,Lv.checkStrictMode)(Z,N,Z.opts.strictRequired)}}function I(){if(E||K)Q.block$data(qW.nil,D);else for(let P of Y)(0,DW.checkReportMissingProp)(Q,P)}function L(){let P=X.let("missing");if(E||K){let B=X.let("valid",!0);Q.block$data(B,()=>T(P,B)),Q.ok(B)}else X.if((0,DW.checkMissingProp)(Q,Y,P)),(0,DW.reportMissingProp)(Q,P),X.else()}function D(){X.forOf("prop",W,(P)=>{Q.setParams({missingProperty:P}),X.if((0,DW.noPropertyInData)(X,G,P,q.ownProperties),()=>Q.error())})}function T(P,B){Q.setParams({missingProperty:P}),X.forOf(P,W,()=>{X.assign(B,(0,DW.propertyInData)(X,G,P,q.ownProperties)),X.if((0,qW.not)(B),()=>{Q.error(),X.break()})},qW.nil)}}};_7.default=Tv});var g7=F0((y7)=>{Object.defineProperty(y7,"__esModule",{value:!0});var IW=QQ(),Pv={message({keyword:Q,schemaCode:X}){let Y=Q==="maxItems"?"more":"fewer";return IW.str`must NOT have ${Y} than ${X} items`},params:({schemaCode:Q})=>IW._`{limit: ${Q}}`},Bv={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Pv,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxItems"?IW.operators.GT:IW.operators.LT;Q.fail$data(IW._`${Y}.length ${G} ${W}`)}};y7.default=Bv});var A$=F0((b7)=>{Object.defineProperty(b7,"__esModule",{value:!0});var f7=WW();f7.code='require("ajv/dist/runtime/equal").default';b7.default=f7});var u7=F0((h7)=>{Object.defineProperty(h7,"__esModule",{value:!0});var K6=JW(),VX=QQ(),jv=HQ(),Nv=A$(),kv={message:({params:{i:Q,j:X}})=>VX.str`must NOT have duplicate items (items ## ${X} and ${Q} are identical)`,params:({params:{i:Q,j:X}})=>VX._`{i: ${Q}, j: ${X}}`},wv={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:kv,code(Q){let{gen:X,data:Y,$data:W,schema:G,parentSchema:K,schemaCode:Z,it:q}=Q;if(!W&&!G)return;let E=X.let("valid"),I=K.items?(0,K6.getSchemaTypes)(K.items):[];Q.block$data(E,L,VX._`${Z} === false`),Q.ok(E);function L(){let B=X.let("i",VX._`${Y}.length`),j=X.let("j");Q.setParams({i:B,j}),X.assign(E,!0),X.if(VX._`${B} > 1`,()=>(D()?T:P)(B,j))}function D(){return I.length>0&&!I.some((B)=>B==="object"||B==="array")}function T(B,j){let S=X.name("item"),N=(0,K6.checkDataTypes)(I,S,q.opts.strictNumbers,K6.DataType.Wrong),k=X.const("indices",VX._`{}`);X.for(VX._`;${B}--;`,()=>{if(X.let(S,VX._`${Y}[${B}]`),X.if(N,VX._`continue`),I.length>1)X.if(VX._`typeof ${S} == "string"`,VX._`${S} += "_"`);X.if(VX._`typeof ${k}[${S}] == "number"`,()=>{X.assign(j,VX._`${k}[${S}]`),Q.error(),X.assign(E,!1).break()}).code(VX._`${k}[${S}] = ${B}`)})}function P(B,j){let S=(0,jv.useFunc)(X,Nv.default),N=X.name("outer");X.label(N).for(VX._`;${B}--;`,()=>X.for(VX._`${j} = ${B}; ${j}--;`,()=>X.if(VX._`${S}(${Y}[${B}], ${Y}[${j}])`,()=>{Q.error(),X.assign(E,!1).break(N)})))}}};h7.default=wv});var c7=F0((p7)=>{Object.defineProperty(p7,"__esModule",{value:!0});var F6=QQ(),_v=HQ(),xv=A$(),yv={message:"must be equal to constant",params:({schemaCode:Q})=>F6._`{allowedValue: ${Q}}`},gv={keyword:"const",$data:!0,error:yv,code(Q){let{gen:X,data:Y,$data:W,schemaCode:G,schema:K}=Q;if(W||K&&typeof K=="object")Q.fail$data(F6._`!${(0,_v.useFunc)(X,xv.default)}(${Y}, ${G})`);else Q.fail(F6._`${K} !== ${Y}`)}};p7.default=gv});var m7=F0((l7)=>{Object.defineProperty(l7,"__esModule",{value:!0});var MW=QQ(),bv=HQ(),hv=A$(),uv={message:"must be equal to one of the allowed values",params:({schemaCode:Q})=>MW._`{allowedValues: ${Q}}`},pv={keyword:"enum",schemaType:"array",$data:!0,error:uv,code(Q){let{gen:X,data:Y,$data:W,schema:G,schemaCode:K,it:Z}=Q;if(!W&&G.length===0)throw Error("enum must have non-empty array");let q=G.length>=Z.opts.loopEnum,E,I=()=>E!==null&&E!==void 0?E:E=(0,bv.useFunc)(X,hv.default),L;if(q||W)L=X.let("valid"),Q.block$data(L,D);else{if(!Array.isArray(G))throw Error("ajv implementation error");let P=X.const("vSchema",K);L=(0,MW.or)(...G.map((B,j)=>T(P,j)))}Q.pass(L);function D(){X.assign(L,!1),X.forOf("v",K,(P)=>X.if(MW._`${I()}(${Y}, ${P})`,()=>X.assign(L,!0).break()))}function T(P,B){let j=G[B];return typeof j==="object"&&j!==null?MW._`${I()}(${Y}, ${P}[${B}])`:MW._`${Y} === ${j}`}}};l7.default=pv});var n7=F0((d7)=>{Object.defineProperty(d7,"__esModule",{value:!0});var lv=E7(),mv=R7(),dv=j7(),nv=k7(),ov=v7(),rv=x7(),iv=g7(),tv=u7(),sv=c7(),av=m7(),ev=[lv.default,mv.default,dv.default,nv.default,ov.default,rv.default,iv.default,tv.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},sv.default,av.default];d7.default=ev});var z6=F0((r7)=>{Object.defineProperty(r7,"__esModule",{value:!0});r7.validateAdditionalItems=void 0;var P1=QQ(),V6=HQ(),X_={message:({params:{len:Q}})=>P1.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>P1._`{limit: ${Q}}`},Y_={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:X_,code(Q){let{parentSchema:X,it:Y}=Q,{items:W}=X;if(!Array.isArray(W)){(0,V6.checkStrictMode)(Y,'"additionalItems" is ignored when "items" is not an array of schemas');return}o7(Q,W)}};function o7(Q,X){let{gen:Y,schema:W,data:G,keyword:K,it:Z}=Q;Z.items=!0;let q=Y.const("len",P1._`${G}.length`);if(W===!1)Q.setParams({len:X.length}),Q.pass(P1._`${q} <= ${X.length}`);else if(typeof W=="object"&&!(0,V6.alwaysValidSchema)(Z,W)){let I=Y.var("valid",P1._`${q} <= ${X.length}`);Y.if((0,P1.not)(I),()=>E(I)),Q.ok(I)}function E(I){Y.forRange("i",X.length,q,(L)=>{if(Q.subschema({keyword:K,dataProp:L,dataPropType:V6.Type.Num},I),!Z.allErrors)Y.if((0,P1.not)(I),()=>Y.break())})}}r7.validateAdditionalItems=o7;r7.default=Y_});var O6=F0((a7)=>{Object.defineProperty(a7,"__esModule",{value:!0});a7.validateTuple=void 0;var t7=QQ(),D$=HQ(),W_=rX(),G_={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Q){let{schema:X,it:Y}=Q;if(Array.isArray(X))return s7(Q,"additionalItems",X);if(Y.items=!0,(0,D$.alwaysValidSchema)(Y,X))return;Q.ok((0,W_.validateArray)(Q))}};function s7(Q,X,Y=Q.schema){let{gen:W,parentSchema:G,data:K,keyword:Z,it:q}=Q;if(L(G),q.opts.unevaluated&&Y.length&&q.items!==!0)q.items=D$.mergeEvaluated.items(W,Y.length,q.items);let E=W.name("valid"),I=W.const("len",t7._`${K}.length`);Y.forEach((D,T)=>{if((0,D$.alwaysValidSchema)(q,D))return;W.if(t7._`${I} > ${T}`,()=>Q.subschema({keyword:Z,schemaProp:T,dataProp:T},E)),Q.ok(E)});function L(D){let{opts:T,errSchemaPath:P}=q,B=Y.length,j=B===D.minItems&&(B===D.maxItems||D[X]===!1);if(T.strictTuples&&!j){let S=`"${Z}" is ${B}-tuple, but minItems or maxItems/${X} are not specified or different at path "${P}"`;(0,D$.checkStrictMode)(q,S,T.strictTuples)}}}a7.validateTuple=s7;a7.default=G_});var XA=F0((QA)=>{Object.defineProperty(QA,"__esModule",{value:!0});var Z_=O6(),H_={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Q)=>(0,Z_.validateTuple)(Q,"items")};QA.default=H_});var WA=F0((JA)=>{Object.defineProperty(JA,"__esModule",{value:!0});var YA=QQ(),K_=HQ(),F_=rX(),V_=z6(),z_={message:({params:{len:Q}})=>YA.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>YA._`{limit: ${Q}}`},O_={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:z_,code(Q){let{schema:X,parentSchema:Y,it:W}=Q,{prefixItems:G}=Y;if(W.items=!0,(0,K_.alwaysValidSchema)(W,X))return;if(G)(0,V_.validateAdditionalItems)(Q,G);else Q.ok((0,F_.validateArray)(Q))}};JA.default=O_});var $A=F0((GA)=>{Object.defineProperty(GA,"__esModule",{value:!0});var iX=QQ(),q$=HQ(),D_={message:({params:{min:Q,max:X}})=>X===void 0?iX.str`must contain at least ${Q} valid item(s)`:iX.str`must contain at least ${Q} and no more than ${X} valid item(s)`,params:({params:{min:Q,max:X}})=>X===void 0?iX._`{minContains: ${Q}}`:iX._`{minContains: ${Q}, maxContains: ${X}}`},q_={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:D_,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:K}=Q,Z,q,{minContains:E,maxContains:I}=W;if(K.opts.next)Z=E===void 0?1:E,q=I;else Z=1;let L=X.const("len",iX._`${G}.length`);if(Q.setParams({min:Z,max:q}),q===void 0&&Z===0){(0,q$.checkStrictMode)(K,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(q!==void 0&&Z>q){(0,q$.checkStrictMode)(K,'"minContains" > "maxContains" is always invalid'),Q.fail();return}if((0,q$.alwaysValidSchema)(K,Y)){let j=iX._`${L} >= ${Z}`;if(q!==void 0)j=iX._`${j} && ${L} <= ${q}`;Q.pass(j);return}K.items=!0;let D=X.name("valid");if(q===void 0&&Z===1)P(D,()=>X.if(D,()=>X.break()));else if(Z===0){if(X.let(D,!0),q!==void 0)X.if(iX._`${G}.length > 0`,T)}else X.let(D,!1),T();Q.result(D,()=>Q.reset());function T(){let j=X.name("_valid"),S=X.let("count",0);P(j,()=>X.if(j,()=>B(S)))}function P(j,S){X.forRange("i",0,L,(N)=>{Q.subschema({keyword:"contains",dataProp:N,dataPropType:q$.Type.Num,compositeRule:!0},j),S()})}function B(j){if(X.code(iX._`${j}++`),q===void 0)X.if(iX._`${j} >= ${Z}`,()=>X.assign(D,!0).break());else if(X.if(iX._`${j} > ${q}`,()=>X.assign(D,!1).break()),Z===1)X.assign(D,!0);else X.if(iX._`${j} >= ${Z}`,()=>X.assign(D,!0))}}};GA.default=q_});var VA=F0((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.validateSchemaDeps=UA.validatePropertyDeps=UA.error=void 0;var A6=QQ(),M_=HQ(),LW=rX();UA.error={message:({params:{property:Q,depsCount:X,deps:Y}})=>{let W=X===1?"property":"properties";return A6.str`must have ${W} ${Y} when property ${Q} is present`},params:({params:{property:Q,depsCount:X,deps:Y,missingProperty:W}})=>A6._`{property: ${Q},
|
|
21
|
+
missingProperty: ${W},
|
|
22
|
+
depsCount: ${X},
|
|
23
|
+
deps: ${Y}}`};var L_={keyword:"dependencies",type:"object",schemaType:"object",error:UA.error,code(Q){let[X,Y]=E_(Q);ZA(Q,X),HA(Q,Y)}};function E_({schema:Q}){let X={},Y={};for(let W in Q){if(W==="__proto__")continue;let G=Array.isArray(Q[W])?X:Y;G[W]=Q[W]}return[X,Y]}function ZA(Q,X=Q.schema){let{gen:Y,data:W,it:G}=Q;if(Object.keys(X).length===0)return;let K=Y.let("missing");for(let Z in X){let q=X[Z];if(q.length===0)continue;let E=(0,LW.propertyInData)(Y,W,Z,G.opts.ownProperties);if(Q.setParams({property:Z,depsCount:q.length,deps:q.join(", ")}),G.allErrors)Y.if(E,()=>{for(let I of q)(0,LW.checkReportMissingProp)(Q,I)});else Y.if(A6._`${E} && (${(0,LW.checkMissingProp)(Q,q,K)})`),(0,LW.reportMissingProp)(Q,K),Y.else()}}UA.validatePropertyDeps=ZA;function HA(Q,X=Q.schema){let{gen:Y,data:W,keyword:G,it:K}=Q,Z=Y.name("valid");for(let q in X){if((0,M_.alwaysValidSchema)(K,X[q]))continue;Y.if((0,LW.propertyInData)(Y,W,q,K.opts.ownProperties),()=>{let E=Q.subschema({keyword:G,schemaProp:q},Z);Q.mergeValidEvaluated(E,Z)},()=>Y.var(Z,!0)),Q.ok(Z)}}UA.validateSchemaDeps=HA;UA.default=L_});var AA=F0((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});var zA=QQ(),P_=HQ(),B_={message:"property name must be valid",params:({params:Q})=>zA._`{propertyName: ${Q.propertyName}}`},S_={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:B_,code(Q){let{gen:X,schema:Y,data:W,it:G}=Q;if((0,P_.alwaysValidSchema)(G,Y))return;let K=X.name("valid");X.forIn("key",W,(Z)=>{Q.setParams({propertyName:Z}),Q.subschema({keyword:"propertyNames",data:Z,dataTypes:["string"],propertyName:Z,compositeRule:!0},K),X.if((0,zA.not)(K),()=>{if(Q.error(!0),!G.allErrors)X.break()})}),Q.ok(K)}};OA.default=S_});var D6=F0((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});var I$=rX(),$Y=QQ(),j_=wY(),M$=HQ(),N_={message:"must NOT have additional properties",params:({params:Q})=>$Y._`{additionalProperty: ${Q.additionalProperty}}`},k_={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:N_,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,errsCount:K,it:Z}=Q;if(!K)throw Error("ajv implementation error");let{allErrors:q,opts:E}=Z;if(Z.props=!0,E.removeAdditional!=="all"&&(0,M$.alwaysValidSchema)(Z,Y))return;let I=(0,I$.allSchemaProperties)(W.properties),L=(0,I$.allSchemaProperties)(W.patternProperties);D(),Q.ok($Y._`${K} === ${j_.default.errors}`);function D(){X.forIn("key",G,(S)=>{if(!I.length&&!L.length)B(S);else X.if(T(S),()=>B(S))})}function T(S){let N;if(I.length>8){let k=(0,M$.schemaRefOrVal)(Z,W.properties,"properties");N=(0,I$.isOwnProperty)(X,k,S)}else if(I.length)N=(0,$Y.or)(...I.map((k)=>$Y._`${S} === ${k}`));else N=$Y.nil;if(L.length)N=(0,$Y.or)(N,...L.map((k)=>$Y._`${(0,I$.usePattern)(Q,k)}.test(${S})`));return(0,$Y.not)(N)}function P(S){X.code($Y._`delete ${G}[${S}]`)}function B(S){if(E.removeAdditional==="all"||E.removeAdditional&&Y===!1){P(S);return}if(Y===!1){if(Q.setParams({additionalProperty:S}),Q.error(),!q)X.break();return}if(typeof Y=="object"&&!(0,M$.alwaysValidSchema)(Z,Y)){let N=X.name("valid");if(E.removeAdditional==="failing")j(S,N,!1),X.if((0,$Y.not)(N),()=>{Q.reset(),P(S)});else if(j(S,N),!q)X.if((0,$Y.not)(N),()=>X.break())}}function j(S,N,k){let v={keyword:"additionalProperties",dataProp:S,dataPropType:M$.Type.Str};if(k===!1)Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1});Q.subschema(v,N)}}};DA.default=k_});var LA=F0((MA)=>{Object.defineProperty(MA,"__esModule",{value:!0});var v_=HW(),qA=rX(),q6=HQ(),IA=D6(),__={keyword:"properties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:K}=Q;if(K.opts.removeAdditional==="all"&&W.additionalProperties===void 0)IA.default.code(new v_.KeywordCxt(K,IA.default,"additionalProperties"));let Z=(0,qA.allSchemaProperties)(Y);for(let D of Z)K.definedProperties.add(D);if(K.opts.unevaluated&&Z.length&&K.props!==!0)K.props=q6.mergeEvaluated.props(X,(0,q6.toHash)(Z),K.props);let q=Z.filter((D)=>!(0,q6.alwaysValidSchema)(K,Y[D]));if(q.length===0)return;let E=X.name("valid");for(let D of q){if(I(D))L(D);else{if(X.if((0,qA.propertyInData)(X,G,D,K.opts.ownProperties)),L(D),!K.allErrors)X.else().var(E,!0);X.endIf()}Q.it.definedProperties.add(D),Q.ok(E)}function I(D){return K.opts.useDefaults&&!K.compositeRule&&Y[D].default!==void 0}function L(D){Q.subschema({keyword:"properties",schemaProp:D,dataProp:D},E)}}};MA.default=__});var BA=F0((PA)=>{Object.defineProperty(PA,"__esModule",{value:!0});var EA=rX(),L$=QQ(),TA=HQ(),RA=HQ(),y_={keyword:"patternProperties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,data:W,parentSchema:G,it:K}=Q,{opts:Z}=K,q=(0,EA.allSchemaProperties)(Y),E=q.filter((j)=>(0,TA.alwaysValidSchema)(K,Y[j]));if(q.length===0||E.length===q.length&&(!K.opts.unevaluated||K.props===!0))return;let I=Z.strictSchema&&!Z.allowMatchingProperties&&G.properties,L=X.name("valid");if(K.props!==!0&&!(K.props instanceof L$.Name))K.props=(0,RA.evaluatedPropsToName)(X,K.props);let{props:D}=K;T();function T(){for(let j of q){if(I)P(j);if(K.allErrors)B(j);else X.var(L,!0),B(j),X.if(L)}}function P(j){for(let S in I)if(new RegExp(j).test(S))(0,TA.checkStrictMode)(K,`property ${S} matches pattern ${j} (use allowMatchingProperties)`)}function B(j){X.forIn("key",W,(S)=>{X.if(L$._`${(0,EA.usePattern)(Q,j)}.test(${S})`,()=>{let N=E.includes(j);if(!N)Q.subschema({keyword:"patternProperties",schemaProp:j,dataProp:S,dataPropType:RA.Type.Str},L);if(K.opts.unevaluated&&D!==!0)X.assign(L$._`${D}[${S}]`,!0);else if(!N&&!K.allErrors)X.if((0,L$.not)(L),()=>X.break())})})}}};PA.default=y_});var CA=F0((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});var f_=HQ(),b_={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Q){let{gen:X,schema:Y,it:W}=Q;if((0,f_.alwaysValidSchema)(W,Y)){Q.fail();return}let G=X.name("valid");Q.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},G),Q.failResult(G,()=>Q.reset(),()=>Q.error())},error:{message:"must NOT be valid"}};SA.default=b_});var NA=F0((jA)=>{Object.defineProperty(jA,"__esModule",{value:!0});var u_=rX(),p_={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:u_.validateUnion,error:{message:"must match a schema in anyOf"}};jA.default=p_});var wA=F0((kA)=>{Object.defineProperty(kA,"__esModule",{value:!0});var E$=QQ(),l_=HQ(),m_={message:"must match exactly one schema in oneOf",params:({params:Q})=>E$._`{passingSchemas: ${Q.passing}}`},d_={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:m_,code(Q){let{gen:X,schema:Y,parentSchema:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(G.opts.discriminator&&W.discriminator)return;let K=Y,Z=X.let("valid",!1),q=X.let("passing",null),E=X.name("_valid");Q.setParams({passing:q}),X.block(I),Q.result(Z,()=>Q.reset(),()=>Q.error(!0));function I(){K.forEach((L,D)=>{let T;if((0,l_.alwaysValidSchema)(G,L))X.var(E,!0);else T=Q.subschema({keyword:"oneOf",schemaProp:D,compositeRule:!0},E);if(D>0)X.if(E$._`${E} && ${Z}`).assign(Z,!1).assign(q,E$._`[${q}, ${D}]`).else();X.if(E,()=>{if(X.assign(Z,!0),X.assign(q,D),T)Q.mergeEvaluated(T,E$.Name)})})}}};kA.default=d_});var _A=F0((vA)=>{Object.defineProperty(vA,"__esModule",{value:!0});var o_=HQ(),r_={keyword:"allOf",schemaType:"array",code(Q){let{gen:X,schema:Y,it:W}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");let G=X.name("valid");Y.forEach((K,Z)=>{if((0,o_.alwaysValidSchema)(W,K))return;let q=Q.subschema({keyword:"allOf",schemaProp:Z},G);Q.ok(G),Q.mergeEvaluated(q)})}};vA.default=r_});var fA=F0((gA)=>{Object.defineProperty(gA,"__esModule",{value:!0});var T$=QQ(),yA=HQ(),t_={message:({params:Q})=>T$.str`must match "${Q.ifClause}" schema`,params:({params:Q})=>T$._`{failingKeyword: ${Q.ifClause}}`},s_={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:t_,code(Q){let{gen:X,parentSchema:Y,it:W}=Q;if(Y.then===void 0&&Y.else===void 0)(0,yA.checkStrictMode)(W,'"if" without "then" and "else" is ignored');let G=xA(W,"then"),K=xA(W,"else");if(!G&&!K)return;let Z=X.let("valid",!0),q=X.name("_valid");if(E(),Q.reset(),G&&K){let L=X.let("ifClause");Q.setParams({ifClause:L}),X.if(q,I("then",L),I("else",L))}else if(G)X.if(q,I("then"));else X.if((0,T$.not)(q),I("else"));Q.pass(Z,()=>Q.error(!0));function E(){let L=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},q);Q.mergeEvaluated(L)}function I(L,D){return()=>{let T=Q.subschema({keyword:L},q);if(X.assign(Z,q),Q.mergeValidEvaluated(T,Z),D)X.assign(D,T$._`${L}`);else Q.setParams({ifClause:L})}}}};function xA(Q,X){let Y=Q.schema[X];return Y!==void 0&&!(0,yA.alwaysValidSchema)(Q,Y)}gA.default=s_});var hA=F0((bA)=>{Object.defineProperty(bA,"__esModule",{value:!0});var e_=HQ(),Qx={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Q,parentSchema:X,it:Y}){if(X.if===void 0)(0,e_.checkStrictMode)(Y,`"${Q}" without "if" is ignored`)}};bA.default=Qx});var pA=F0((uA)=>{Object.defineProperty(uA,"__esModule",{value:!0});var Yx=z6(),Jx=XA(),Wx=O6(),Gx=WA(),$x=$A(),Zx=VA(),Hx=AA(),Ux=D6(),Kx=LA(),Fx=BA(),Vx=CA(),zx=NA(),Ox=wA(),Ax=_A(),Dx=fA(),qx=hA();function Ix(Q=!1){let X=[Vx.default,zx.default,Ox.default,Ax.default,Dx.default,qx.default,Hx.default,Ux.default,Zx.default,Kx.default,Fx.default];if(Q)X.push(Jx.default,Gx.default);else X.push(Yx.default,Wx.default);return X.push($x.default),X}uA.default=Ix});var lA=F0((cA)=>{Object.defineProperty(cA,"__esModule",{value:!0});var gQ=QQ(),Lx={message:({schemaCode:Q})=>gQ.str`must match format "${Q}"`,params:({schemaCode:Q})=>gQ._`{format: ${Q}}`},Ex={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Lx,code(Q,X){let{gen:Y,data:W,$data:G,schema:K,schemaCode:Z,it:q}=Q,{opts:E,errSchemaPath:I,schemaEnv:L,self:D}=q;if(!E.validateFormats)return;if(G)T();else P();function T(){let B=Y.scopeValue("formats",{ref:D.formats,code:E.code.formats}),j=Y.const("fDef",gQ._`${B}[${Z}]`),S=Y.let("fType"),N=Y.let("format");Y.if(gQ._`typeof ${j} == "object" && !(${j} instanceof RegExp)`,()=>Y.assign(S,gQ._`${j}.type || "string"`).assign(N,gQ._`${j}.validate`),()=>Y.assign(S,gQ._`"string"`).assign(N,j)),Q.fail$data((0,gQ.or)(k(),v()));function k(){if(E.strictSchema===!1)return gQ.nil;return gQ._`${Z} && !${N}`}function v(){let _=L.$async?gQ._`(${j}.async ? await ${N}(${W}) : ${N}(${W}))`:gQ._`${N}(${W})`,x=gQ._`(typeof ${N} == "function" ? ${_} : ${N}.test(${W}))`;return gQ._`${N} && ${N} !== true && ${S} === ${X} && !${x}`}}function P(){let B=D.formats[K];if(!B){k();return}if(B===!0)return;let[j,S,N]=v(B);if(j===X)Q.pass(_());function k(){if(E.strictSchema===!1){D.logger.warn(x());return}throw Error(x());function x(){return`unknown format "${K}" ignored in schema at path "${I}"`}}function v(x){let c=x instanceof RegExp?(0,gQ.regexpCode)(x):E.code.formats?gQ._`${E.code.formats}${(0,gQ.getProperty)(K)}`:void 0,Y0=Y.scopeValue("formats",{key:K,ref:x,code:c});if(typeof x=="object"&&!(x instanceof RegExp))return[x.type||"string",x.validate,gQ._`${Y0}.validate`];return["string",x,Y0]}function _(){if(typeof B=="object"&&!(B instanceof RegExp)&&B.async){if(!L.$async)throw Error("async format in sync schema");return gQ._`await ${N}(${W})`}return typeof S=="function"?gQ._`${N}(${W})`:gQ._`${N}.test(${W})`}}}};cA.default=Ex});var dA=F0((mA)=>{Object.defineProperty(mA,"__esModule",{value:!0});var Rx=lA(),Px=[Rx.default];mA.default=Px});var rA=F0((nA)=>{Object.defineProperty(nA,"__esModule",{value:!0});nA.contentVocabulary=nA.metadataVocabulary=void 0;nA.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];nA.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var sA=F0((tA)=>{Object.defineProperty(tA,"__esModule",{value:!0});var Cx=M7(),jx=n7(),Nx=pA(),kx=dA(),iA=rA(),wx=[Cx.default,jx.default,(0,Nx.default)(),kx.default,iA.metadataVocabulary,iA.contentVocabulary];tA.default=wx});var XD=F0((eA)=>{Object.defineProperty(eA,"__esModule",{value:!0});eA.DiscrError=void 0;var aA;(function(Q){Q.Tag="tag",Q.Mapping="mapping"})(aA||(eA.DiscrError=aA={}))});var WD=F0((JD)=>{Object.defineProperty(JD,"__esModule",{value:!0});var e1=QQ(),I6=XD(),YD=J$(),_x=UW(),xx=HQ(),yx={message:({params:{discrError:Q,tagName:X}})=>Q===I6.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:Q,tag:X,tagName:Y}})=>e1._`{error: ${Q}, tag: ${Y}, tagValue: ${X}}`},gx={keyword:"discriminator",type:"object",schemaType:"object",error:yx,code(Q){let{gen:X,data:Y,schema:W,parentSchema:G,it:K}=Q,{oneOf:Z}=G;if(!K.opts.discriminator)throw Error("discriminator: requires discriminator option");let q=W.propertyName;if(typeof q!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!Z)throw Error("discriminator: requires oneOf keyword");let E=X.let("valid",!1),I=X.const("tag",e1._`${Y}${(0,e1.getProperty)(q)}`);X.if(e1._`typeof ${I} == "string"`,()=>L(),()=>Q.error(!1,{discrError:I6.DiscrError.Tag,tag:I,tagName:q})),Q.ok(E);function L(){let P=T();X.if(!1);for(let B in P)X.elseIf(e1._`${I} === ${B}`),X.assign(E,D(P[B]));X.else(),Q.error(!1,{discrError:I6.DiscrError.Mapping,tag:I,tagName:q}),X.endIf()}function D(P){let B=X.name("valid"),j=Q.subschema({keyword:"oneOf",schemaProp:P},B);return Q.mergeEvaluated(j,e1.Name),B}function T(){var P;let B={},j=N(G),S=!0;for(let _=0;_<Z.length;_++){let x=Z[_];if((x===null||x===void 0?void 0:x.$ref)&&!(0,xx.schemaHasRulesButRef)(x,K.self.RULES)){let Y0=x.$ref;if(x=YD.resolveRef.call(K.self,K.schemaEnv.root,K.baseId,Y0),x instanceof YD.SchemaEnv)x=x.schema;if(x===void 0)throw new _x.default(K.opts.uriResolver,K.baseId,Y0)}let c=(P=x===null||x===void 0?void 0:x.properties)===null||P===void 0?void 0:P[q];if(typeof c!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${q}"`);S=S&&(j||N(x)),k(c,_)}if(!S)throw Error(`discriminator: "${q}" must be required`);return B;function N({required:_}){return Array.isArray(_)&&_.includes(q)}function k(_,x){if(_.const)v(_.const,x);else if(_.enum)for(let c of _.enum)v(c,x);else throw Error(`discriminator: "properties/${q}" must have "const" or "enum"`)}function v(_,x){if(typeof _!="string"||_ in B)throw Error(`discriminator: "${q}" values must be unique strings`);B[_]=x}}}};JD.default=gx});var GD=F0((WQ0,bx)=>{bx.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 ZD=F0((xX,M6)=>{Object.defineProperty(xX,"__esModule",{value:!0});xX.MissingRefError=xX.ValidationError=xX.CodeGen=xX.Name=xX.nil=xX.stringify=xX.str=xX._=xX.KeywordCxt=xX.Ajv=void 0;var hx=U7(),ux=sA(),px=WD(),$D=GD(),cx=["/properties"],R$="http://json-schema.org/draft-07/schema";class EW extends hx.default{_addVocabularies(){if(super._addVocabularies(),ux.default.forEach((Q)=>this.addVocabulary(Q)),this.opts.discriminator)this.addKeyword(px.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Q=this.opts.$data?this.$dataMetaSchema($D,cx):$D;this.addMetaSchema(Q,R$,!1),this.refs["http://json-schema.org/schema"]=R$}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(R$)?R$:void 0)}}xX.Ajv=EW;M6.exports=xX=EW;M6.exports.Ajv=EW;Object.defineProperty(xX,"__esModule",{value:!0});xX.default=EW;var lx=HW();Object.defineProperty(xX,"KeywordCxt",{enumerable:!0,get:function(){return lx.KeywordCxt}});var QJ=QQ();Object.defineProperty(xX,"_",{enumerable:!0,get:function(){return QJ._}});Object.defineProperty(xX,"str",{enumerable:!0,get:function(){return QJ.str}});Object.defineProperty(xX,"stringify",{enumerable:!0,get:function(){return QJ.stringify}});Object.defineProperty(xX,"nil",{enumerable:!0,get:function(){return QJ.nil}});Object.defineProperty(xX,"Name",{enumerable:!0,get:function(){return QJ.Name}});Object.defineProperty(xX,"CodeGen",{enumerable:!0,get:function(){return QJ.CodeGen}});var mx=X$();Object.defineProperty(xX,"ValidationError",{enumerable:!0,get:function(){return mx.default}});var dx=UW();Object.defineProperty(xX,"MissingRefError",{enumerable:!0,get:function(){return dx.default}})});var qD=F0((AD)=>{Object.defineProperty(AD,"__esModule",{value:!0});AD.formatNames=AD.fastFormats=AD.fullFormats=void 0;function IY(Q,X){return{validate:Q,compare:X}}AD.fullFormats={date:IY(FD,R6),time:IY(E6(!0),P6),"date-time":IY(HD(!0),zD),"iso-time":IY(E6(),VD),"iso-date-time":IY(HD(),OD),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:ex,"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:$y,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:Qy,int32:{type:"number",validate:Jy},int64:{type:"number",validate:Wy},float:{type:"number",validate:KD},double:{type:"number",validate:KD},password:!0,binary:!0};AD.fastFormats={...AD.fullFormats,date:IY(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,R6),time:IY(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,P6),"date-time":IY(/^\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,zD),"iso-time":IY(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,VD),"iso-date-time":IY(/^\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,OD),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};AD.formatNames=Object.keys(AD.fullFormats);function rx(Q){return Q%4===0&&(Q%100!==0||Q%400===0)}var ix=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,tx=[0,31,28,31,30,31,30,31,31,30,31,30,31];function FD(Q){let X=ix.exec(Q);if(!X)return!1;let Y=+X[1],W=+X[2],G=+X[3];return W>=1&&W<=12&&G>=1&&G<=(W===2&&rx(Y)?29:tx[W])}function R6(Q,X){if(!(Q&&X))return;if(Q>X)return 1;if(Q<X)return-1;return 0}var L6=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function E6(Q){return function(Y){let W=L6.exec(Y);if(!W)return!1;let G=+W[1],K=+W[2],Z=+W[3],q=W[4],E=W[5]==="-"?-1:1,I=+(W[6]||0),L=+(W[7]||0);if(I>23||L>59||Q&&!q)return!1;if(G<=23&&K<=59&&Z<60)return!0;let D=K-L*E,T=G-I*E-(D<0?1:0);return(T===23||T===-1)&&(D===59||D===-1)&&Z<61}}function P6(Q,X){if(!(Q&&X))return;let Y=new Date("2020-01-01T"+Q).valueOf(),W=new Date("2020-01-01T"+X).valueOf();if(!(Y&&W))return;return Y-W}function VD(Q,X){if(!(Q&&X))return;let Y=L6.exec(Q),W=L6.exec(X);if(!(Y&&W))return;if(Q=Y[1]+Y[2]+Y[3],X=W[1]+W[2]+W[3],Q>X)return 1;if(Q<X)return-1;return 0}var T6=/t|\s/i;function HD(Q){let X=E6(Q);return function(W){let G=W.split(T6);return G.length===2&&FD(G[0])&&X(G[1])}}function zD(Q,X){if(!(Q&&X))return;let Y=new Date(Q).valueOf(),W=new Date(X).valueOf();if(!(Y&&W))return;return Y-W}function OD(Q,X){if(!(Q&&X))return;let[Y,W]=Q.split(T6),[G,K]=X.split(T6),Z=R6(Y,G);if(Z===void 0)return;return Z||P6(W,K)}var sx=/\/|:/,ax=/^(?:[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 ex(Q){return sx.test(Q)&&ax.test(Q)}var UD=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Qy(Q){return UD.lastIndex=0,UD.test(Q)}var Xy=-2147483648,Yy=2147483647;function Jy(Q){return Number.isInteger(Q)&&Q<=Yy&&Q>=Xy}function Wy(Q){return Number.isInteger(Q)}function KD(){return!0}var Gy=/[^\\]\\Z/;function $y(Q){if(Gy.test(Q))return!1;try{return new RegExp(Q),!0}catch(X){return!1}}});var RW=F0((LD)=>{Object.defineProperty(LD,"__esModule",{value:!0});LD.regexpCode=LD.getEsmExportName=LD.getProperty=LD.safeStringify=LD.stringify=LD.strConcat=LD.addCodeArg=LD.str=LD._=LD.nil=LD._Code=LD.Name=LD.IDENTIFIER=LD._CodeOrName=void 0;class P${}LD._CodeOrName=P$;LD.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class XJ extends P${constructor(Q){super();if(!LD.IDENTIFIER.test(Q))throw Error("CodeGen: name must be a valid identifier");this.str=Q}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}LD.Name=XJ;class ZY extends P${constructor(Q){super();this._items=typeof Q==="string"?[Q]:Q}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Q=this._items[0];return Q===""||Q==='""'}get str(){var Q;return(Q=this._str)!==null&&Q!==void 0?Q:this._str=this._items.reduce((X,Y)=>`${X}${Y}`,"")}get names(){var Q;return(Q=this._names)!==null&&Q!==void 0?Q:this._names=this._items.reduce((X,Y)=>{if(Y instanceof XJ)X[Y.str]=(X[Y.str]||0)+1;return X},{})}}LD._Code=ZY;LD.nil=new ZY("");function ID(Q,...X){let Y=[Q[0]],W=0;while(W<X.length)C6(Y,X[W]),Y.push(Q[++W]);return new ZY(Y)}LD._=ID;var S6=new ZY("+");function MD(Q,...X){let Y=[TW(Q[0])],W=0;while(W<X.length)Y.push(S6),C6(Y,X[W]),Y.push(S6,TW(Q[++W]));return Hy(Y),new ZY(Y)}LD.str=MD;function C6(Q,X){if(X instanceof ZY)Q.push(...X._items);else if(X instanceof XJ)Q.push(X);else Q.push(Fy(X))}LD.addCodeArg=C6;function Hy(Q){let X=1;while(X<Q.length-1){if(Q[X]===S6){let Y=Uy(Q[X-1],Q[X+1]);if(Y!==void 0){Q.splice(X-1,3,Y);continue}Q[X++]="+"}X++}}function Uy(Q,X){if(X==='""')return Q;if(Q==='""')return X;if(typeof Q=="string"){if(X instanceof XJ||Q[Q.length-1]!=='"')return;if(typeof X!="string")return`${Q.slice(0,-1)}${X}"`;if(X[0]==='"')return Q.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!(Q instanceof XJ))return`"${Q}${X.slice(1)}`;return}function Ky(Q,X){return X.emptyStr()?Q:Q.emptyStr()?X:MD`${Q}${X}`}LD.strConcat=Ky;function Fy(Q){return typeof Q=="number"||typeof Q=="boolean"||Q===null?Q:TW(Array.isArray(Q)?Q.join(","):Q)}function Vy(Q){return new ZY(TW(Q))}LD.stringify=Vy;function TW(Q){return JSON.stringify(Q).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}LD.safeStringify=TW;function zy(Q){return typeof Q=="string"&&LD.IDENTIFIER.test(Q)?new ZY(`.${Q}`):ID`[${Q}]`}LD.getProperty=zy;function Oy(Q){if(typeof Q=="string"&&LD.IDENTIFIER.test(Q))return new ZY(`${Q}`);throw Error(`CodeGen: invalid export name: ${Q}, use explicit $id name mapping`)}LD.getEsmExportName=Oy;function Ay(Q){return new ZY(Q.toString())}LD.regexpCode=Ay});var w6=F0((PD)=>{Object.defineProperty(PD,"__esModule",{value:!0});PD.ValueScope=PD.ValueScopeName=PD.Scope=PD.varKinds=PD.UsedValueState=void 0;var yX=RW();class TD extends Error{constructor(Q){super(`CodeGen: "code" for ${Q} not defined`);this.value=Q.value}}var S$;(function(Q){Q[Q.Started=0]="Started",Q[Q.Completed=1]="Completed"})(S$||(PD.UsedValueState=S$={}));PD.varKinds={const:new yX.Name("const"),let:new yX.Name("let"),var:new yX.Name("var")};class N6{constructor({prefixes:Q,parent:X}={}){this._names={},this._prefixes=Q,this._parent=X}toName(Q){return Q instanceof yX.Name?Q:this.name(Q)}name(Q){return new yX.Name(this._newName(Q))}_newName(Q){let X=this._names[Q]||this._nameGroup(Q);return`${Q}${X.index++}`}_nameGroup(Q){var X,Y;if(((Y=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||Y===void 0?void 0:Y.has(Q))||this._prefixes&&!this._prefixes.has(Q))throw Error(`CodeGen: prefix "${Q}" is not allowed in this scope`);return this._names[Q]={prefix:Q,index:0}}}PD.Scope=N6;class k6 extends yX.Name{constructor(Q,X){super(X);this.prefix=Q}setValue(Q,{property:X,itemIndex:Y}){this.value=Q,this.scopePath=yX._`.${new yX.Name(X)}[${Y}]`}}PD.ValueScopeName=k6;var jy=yX._`\n`;class RD extends N6{constructor(Q){super(Q);this._values={},this._scope=Q.scope,this.opts={...Q,_n:Q.lines?jy:yX.nil}}get(){return this._scope}name(Q){return new k6(Q,this._newName(Q))}value(Q,X){var Y;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let W=this.toName(Q),{prefix:G}=W,K=(Y=X.key)!==null&&Y!==void 0?Y:X.ref,Z=this._values[G];if(Z){let I=Z.get(K);if(I)return I}else Z=this._values[G]=new Map;Z.set(K,W);let q=this._scope[G]||(this._scope[G]=[]),E=q.length;return q[E]=X.ref,W.setValue(X,{property:G,itemIndex:E}),W}getValue(Q,X){let Y=this._values[Q];if(!Y)return;return Y.get(X)}scopeRefs(Q,X=this._values){return this._reduceValues(X,(Y)=>{if(Y.scopePath===void 0)throw Error(`CodeGen: name "${Y}" has no value`);return yX._`${Q}${Y.scopePath}`})}scopeCode(Q=this._values,X,Y){return this._reduceValues(Q,(W)=>{if(W.value===void 0)throw Error(`CodeGen: name "${W}" has no value`);return W.value.code},X,Y)}_reduceValues(Q,X,Y={},W){let G=yX.nil;for(let K in Q){let Z=Q[K];if(!Z)continue;let q=Y[K]=Y[K]||new Map;Z.forEach((E)=>{if(q.has(E))return;q.set(E,S$.Started);let I=X(E);if(I){let L=this.opts.es5?PD.varKinds.var:PD.varKinds.const;G=yX._`${G}${L} ${E} = ${I};${this.opts._n}`}else if(I=W===null||W===void 0?void 0:W(E))G=yX._`${G}${I}${this.opts._n}`;else throw new TD(E);q.set(E,S$.Completed)})}return G}}PD.ValueScope=RD});var a0=F0((gX)=>{Object.defineProperty(gX,"__esModule",{value:!0});gX.or=gX.and=gX.not=gX.CodeGen=gX.operators=gX.varKinds=gX.ValueScopeName=gX.ValueScope=gX.Scope=gX.Name=gX.regexpCode=gX.stringify=gX.getProperty=gX.nil=gX.strConcat=gX.str=gX._=void 0;var JQ=RW(),HY=w6(),Y1=RW();Object.defineProperty(gX,"_",{enumerable:!0,get:function(){return Y1._}});Object.defineProperty(gX,"str",{enumerable:!0,get:function(){return Y1.str}});Object.defineProperty(gX,"strConcat",{enumerable:!0,get:function(){return Y1.strConcat}});Object.defineProperty(gX,"nil",{enumerable:!0,get:function(){return Y1.nil}});Object.defineProperty(gX,"getProperty",{enumerable:!0,get:function(){return Y1.getProperty}});Object.defineProperty(gX,"stringify",{enumerable:!0,get:function(){return Y1.stringify}});Object.defineProperty(gX,"regexpCode",{enumerable:!0,get:function(){return Y1.regexpCode}});Object.defineProperty(gX,"Name",{enumerable:!0,get:function(){return Y1.Name}});var v$=w6();Object.defineProperty(gX,"Scope",{enumerable:!0,get:function(){return v$.Scope}});Object.defineProperty(gX,"ValueScope",{enumerable:!0,get:function(){return v$.ValueScope}});Object.defineProperty(gX,"ValueScopeName",{enumerable:!0,get:function(){return v$.ValueScopeName}});Object.defineProperty(gX,"varKinds",{enumerable:!0,get:function(){return v$.varKinds}});gX.operators={GT:new JQ._Code(">"),GTE:new JQ._Code(">="),LT:new JQ._Code("<"),LTE:new JQ._Code("<="),EQ:new JQ._Code("==="),NEQ:new JQ._Code("!=="),NOT:new JQ._Code("!"),OR:new JQ._Code("||"),AND:new JQ._Code("&&"),ADD:new JQ._Code("+")};class J1{optimizeNodes(){return this}optimizeNames(Q,X){return this}}class SD extends J1{constructor(Q,X,Y){super();this.varKind=Q,this.name=X,this.rhs=Y}render({es5:Q,_n:X}){let Y=Q?HY.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${W};`+X}optimizeNames(Q,X){if(!Q[this.name.str])return;if(this.rhs)this.rhs=JJ(this.rhs,Q,X);return this}get names(){return this.rhs instanceof JQ._CodeOrName?this.rhs.names:{}}}class x6 extends J1{constructor(Q,X,Y){super();this.lhs=Q,this.rhs=X,this.sideEffects=Y}render({_n:Q}){return`${this.lhs} = ${this.rhs};`+Q}optimizeNames(Q,X){if(this.lhs instanceof JQ.Name&&!Q[this.lhs.str]&&!this.sideEffects)return;return this.rhs=JJ(this.rhs,Q,X),this}get names(){let Q=this.lhs instanceof JQ.Name?{}:{...this.lhs.names};return w$(Q,this.rhs)}}class CD extends x6{constructor(Q,X,Y,W){super(Q,Y,W);this.op=X}render({_n:Q}){return`${this.lhs} ${this.op}= ${this.rhs};`+Q}}class jD extends J1{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`${this.label}:`+Q}}class ND extends J1{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`break${this.label?` ${this.label}`:""};`+Q}}class kD extends J1{constructor(Q){super();this.error=Q}render({_n:Q}){return`throw ${this.error};`+Q}get names(){return this.error.names}}class wD extends J1{constructor(Q){super();this.code=Q}render({_n:Q}){return`${this.code};`+Q}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Q,X){return this.code=JJ(this.code,Q,X),this}get names(){return this.code instanceof JQ._CodeOrName?this.code.names:{}}}class _$ extends J1{constructor(Q=[]){super();this.nodes=Q}render(Q){return this.nodes.reduce((X,Y)=>X+Y.render(Q),"")}optimizeNodes(){let{nodes:Q}=this,X=Q.length;while(X--){let Y=Q[X].optimizeNodes();if(Array.isArray(Y))Q.splice(X,1,...Y);else if(Y)Q[X]=Y;else Q.splice(X,1)}return Q.length>0?this:void 0}optimizeNames(Q,X){let{nodes:Y}=this,W=Y.length;while(W--){let G=Y[W];if(G.optimizeNames(Q,X))continue;vy(Q,G.names),Y.splice(W,1)}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((Q,X)=>B1(Q,X.names),{})}}class W1 extends _${render(Q){return"{"+Q._n+super.render(Q)+"}"+Q._n}}class vD extends _${}class PW extends W1{}PW.kind="else";class yY extends W1{constructor(Q,X){super(X);this.condition=Q}render(Q){let X=`if(${this.condition})`+super.render(Q);if(this.else)X+="else "+this.else.render(Q);return X}optimizeNodes(){super.optimizeNodes();let Q=this.condition;if(Q===!0)return this.nodes;let X=this.else;if(X){let Y=X.optimizeNodes();X=this.else=Array.isArray(Y)?new PW(Y):Y}if(X){if(Q===!1)return X instanceof yY?X:X.nodes;if(this.nodes.length)return this;return new yY(fD(Q),X instanceof yY?[X]:X.nodes)}if(Q===!1||!this.nodes.length)return;return this}optimizeNames(Q,X){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(Q,X),!(super.optimizeNames(Q,X)||this.else))return;return this.condition=JJ(this.condition,Q,X),this}get names(){let Q=super.names;if(w$(Q,this.condition),this.else)B1(Q,this.else.names);return Q}}yY.kind="if";class YJ extends W1{}YJ.kind="for";class _D extends YJ{constructor(Q){super();this.iteration=Q}render(Q){return`for(${this.iteration})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iteration=JJ(this.iteration,Q,X),this}get names(){return B1(super.names,this.iteration.names)}}class xD extends YJ{constructor(Q,X,Y,W){super();this.varKind=Q,this.name=X,this.from=Y,this.to=W}render(Q){let X=Q.es5?HY.varKinds.var:this.varKind,{name:Y,from:W,to:G}=this;return`for(${X} ${Y}=${W}; ${Y}<${G}; ${Y}++)`+super.render(Q)}get names(){let Q=w$(super.names,this.from);return w$(Q,this.to)}}class v6 extends YJ{constructor(Q,X,Y,W){super();this.loop=Q,this.varKind=X,this.name=Y,this.iterable=W}render(Q){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iterable=JJ(this.iterable,Q,X),this}get names(){return B1(super.names,this.iterable.names)}}class C$ extends W1{constructor(Q,X,Y){super();this.name=Q,this.args=X,this.async=Y}render(Q){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Q)}}C$.kind="func";class j$ extends _${render(Q){return"return "+super.render(Q)}}j$.kind="return";class yD extends W1{render(Q){let X="try"+super.render(Q);if(this.catch)X+=this.catch.render(Q);if(this.finally)X+=this.finally.render(Q);return X}optimizeNodes(){var Q,X;return super.optimizeNodes(),(Q=this.catch)===null||Q===void 0||Q.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(Q,X){var Y,W;return super.optimizeNames(Q,X),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(Q,X),(W=this.finally)===null||W===void 0||W.optimizeNames(Q,X),this}get names(){let Q=super.names;if(this.catch)B1(Q,this.catch.names);if(this.finally)B1(Q,this.finally.names);return Q}}class N$ extends W1{constructor(Q){super();this.error=Q}render(Q){return`catch(${this.error})`+super.render(Q)}}N$.kind="catch";class k$ extends W1{render(Q){return"finally"+super.render(Q)}}k$.kind="finally";class gD{constructor(Q,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
24
|
+
`:""},this._extScope=Q,this._scope=new HY.Scope({parent:Q}),this._nodes=[new vD]}toString(){return this._root.render(this.opts)}name(Q){return this._scope.name(Q)}scopeName(Q){return this._extScope.name(Q)}scopeValue(Q,X){let Y=this._extScope.value(Q,X);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}getScopeValue(Q,X){return this._extScope.getValue(Q,X)}scopeRefs(Q){return this._extScope.scopeRefs(Q,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Q,X,Y,W){let G=this._scope.toName(X);if(Y!==void 0&&W)this._constants[G.str]=Y;return this._leafNode(new SD(Q,G,Y)),G}const(Q,X,Y){return this._def(HY.varKinds.const,Q,X,Y)}let(Q,X,Y){return this._def(HY.varKinds.let,Q,X,Y)}var(Q,X,Y){return this._def(HY.varKinds.var,Q,X,Y)}assign(Q,X,Y){return this._leafNode(new x6(Q,X,Y))}add(Q,X){return this._leafNode(new CD(Q,gX.operators.ADD,X))}code(Q){if(typeof Q=="function")Q();else if(Q!==JQ.nil)this._leafNode(new wD(Q));return this}object(...Q){let X=["{"];for(let[Y,W]of Q){if(X.length>1)X.push(",");if(X.push(Y),Y!==W||this.opts.es5)X.push(":"),(0,JQ.addCodeArg)(X,W)}return X.push("}"),new JQ._Code(X)}if(Q,X,Y){if(this._blockNode(new yY(Q)),X&&Y)this.code(X).else().code(Y).endIf();else if(X)this.code(X).endIf();else if(Y)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Q){return this._elseNode(new yY(Q))}else(){return this._elseNode(new PW)}endIf(){return this._endBlockNode(yY,PW)}_for(Q,X){if(this._blockNode(Q),X)this.code(X).endFor();return this}for(Q,X){return this._for(new _D(Q),X)}forRange(Q,X,Y,W,G=this.opts.es5?HY.varKinds.var:HY.varKinds.let){let K=this._scope.toName(Q);return this._for(new xD(G,K,X,Y),()=>W(K))}forOf(Q,X,Y,W=HY.varKinds.const){let G=this._scope.toName(Q);if(this.opts.es5){let K=X instanceof JQ.Name?X:this.var("_arr",X);return this.forRange("_i",0,JQ._`${K}.length`,(Z)=>{this.var(G,JQ._`${K}[${Z}]`),Y(G)})}return this._for(new v6("of",W,G,X),()=>Y(G))}forIn(Q,X,Y,W=this.opts.es5?HY.varKinds.var:HY.varKinds.const){if(this.opts.ownProperties)return this.forOf(Q,JQ._`Object.keys(${X})`,Y);let G=this._scope.toName(Q);return this._for(new v6("in",W,G,X),()=>Y(G))}endFor(){return this._endBlockNode(YJ)}label(Q){return this._leafNode(new jD(Q))}break(Q){return this._leafNode(new ND(Q))}return(Q){let X=new j$;if(this._blockNode(X),this.code(Q),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(j$)}try(Q,X,Y){if(!X&&!Y)throw Error('CodeGen: "try" without "catch" and "finally"');let W=new yD;if(this._blockNode(W),this.code(Q),X){let G=this.name("e");this._currNode=W.catch=new N$(G),X(G)}if(Y)this._currNode=W.finally=new k$,this.code(Y);return this._endBlockNode(N$,k$)}throw(Q){return this._leafNode(new kD(Q))}block(Q,X){if(this._blockStarts.push(this._nodes.length),Q)this.code(Q).endBlock(X);return this}endBlock(Q){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let Y=this._nodes.length-X;if(Y<0||Q!==void 0&&Y!==Q)throw Error(`CodeGen: wrong number of nodes: ${Y} vs ${Q} expected`);return this._nodes.length=X,this}func(Q,X=JQ.nil,Y,W){if(this._blockNode(new C$(Q,X,Y)),W)this.code(W).endFunc();return this}endFunc(){return this._endBlockNode(C$)}optimize(Q=1){while(Q-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Q){return this._currNode.nodes.push(Q),this}_blockNode(Q){this._currNode.nodes.push(Q),this._nodes.push(Q)}_endBlockNode(Q,X){let Y=this._currNode;if(Y instanceof Q||X&&Y instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${Q.kind}/${X.kind}`:Q.kind}"`)}_elseNode(Q){let X=this._currNode;if(!(X instanceof yY))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=Q,this}get _root(){return this._nodes[0]}get _currNode(){let Q=this._nodes;return Q[Q.length-1]}set _currNode(Q){let X=this._nodes;X[X.length-1]=Q}}gX.CodeGen=gD;function B1(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)+(X[Y]||0);return Q}function w$(Q,X){return X instanceof JQ._CodeOrName?B1(Q,X.names):Q}function JJ(Q,X,Y){if(Q instanceof JQ.Name)return W(Q);if(!G(Q))return Q;return new JQ._Code(Q._items.reduce((K,Z)=>{if(Z instanceof JQ.Name)Z=W(Z);if(Z instanceof JQ._Code)K.push(...Z._items);else K.push(Z);return K},[]));function W(K){let Z=Y[K.str];if(Z===void 0||X[K.str]!==1)return K;return delete X[K.str],Z}function G(K){return K instanceof JQ._Code&&K._items.some((Z)=>Z instanceof JQ.Name&&X[Z.str]===1&&Y[Z.str]!==void 0)}}function vy(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)-(X[Y]||0)}function fD(Q){return typeof Q=="boolean"||typeof Q=="number"||Q===null?!Q:JQ._`!${_6(Q)}`}gX.not=fD;var _y=bD(gX.operators.AND);function xy(...Q){return Q.reduce(_y)}gX.and=xy;var yy=bD(gX.operators.OR);function gy(...Q){return Q.reduce(yy)}gX.or=gy;function bD(Q){return(X,Y)=>X===JQ.nil?Y:Y===JQ.nil?X:JQ._`${_6(X)} ${Q} ${_6(Y)}`}function _6(Q){return Q instanceof JQ.Name?Q:JQ._`(${Q})`}});var UQ=F0((oD)=>{Object.defineProperty(oD,"__esModule",{value:!0});oD.checkStrictMode=oD.getErrorPath=oD.Type=oD.useFunc=oD.setEvaluated=oD.evaluatedPropsToName=oD.mergeEvaluated=oD.eachItem=oD.unescapeJsonPointer=oD.escapeJsonPointer=oD.escapeFragment=oD.unescapeFragment=oD.schemaRefOrVal=oD.schemaHasRulesButRef=oD.schemaHasRules=oD.checkUnknownRules=oD.alwaysValidSchema=oD.toHash=void 0;var DQ=a0(),uy=RW();function py(Q){let X={};for(let Y of Q)X[Y]=!0;return X}oD.toHash=py;function cy(Q,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return cD(Q,X),!lD(X,Q.self.RULES.all)}oD.alwaysValidSchema=cy;function cD(Q,X=Q.schema){let{opts:Y,self:W}=Q;if(!Y.strictSchema)return;if(typeof X==="boolean")return;let G=W.RULES.keywords;for(let K in X)if(!G[K])nD(Q,`unknown keyword: "${K}"`)}oD.checkUnknownRules=cD;function lD(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X[Y])return!0;return!1}oD.schemaHasRules=lD;function ly(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(Y!=="$ref"&&X.all[Y])return!0;return!1}oD.schemaHasRulesButRef=ly;function my({topSchemaRef:Q,schemaPath:X},Y,W,G){if(!G){if(typeof Y=="number"||typeof Y=="boolean")return Y;if(typeof Y=="string")return DQ._`${Y}`}return DQ._`${Q}${X}${(0,DQ.getProperty)(W)}`}oD.schemaRefOrVal=my;function dy(Q){return mD(decodeURIComponent(Q))}oD.unescapeFragment=dy;function ny(Q){return encodeURIComponent(g6(Q))}oD.escapeFragment=ny;function g6(Q){if(typeof Q=="number")return`${Q}`;return Q.replace(/~/g,"~0").replace(/\//g,"~1")}oD.escapeJsonPointer=g6;function mD(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}oD.unescapeJsonPointer=mD;function oy(Q,X){if(Array.isArray(Q))for(let Y of Q)X(Y);else X(Q)}oD.eachItem=oy;function uD({mergeNames:Q,mergeToName:X,mergeValues:Y,resultToName:W}){return(G,K,Z,q)=>{let E=Z===void 0?K:Z instanceof DQ.Name?(K instanceof DQ.Name?Q(G,K,Z):X(G,K,Z),Z):K instanceof DQ.Name?(X(G,Z,K),K):Y(K,Z);return q===DQ.Name&&!(E instanceof DQ.Name)?W(G,E):E}}oD.mergeEvaluated={props:uD({mergeNames:(Q,X,Y)=>Q.if(DQ._`${Y} !== true && ${X} !== undefined`,()=>{Q.if(DQ._`${X} === true`,()=>Q.assign(Y,!0),()=>Q.assign(Y,DQ._`${Y} || {}`).code(DQ._`Object.assign(${Y}, ${X})`))}),mergeToName:(Q,X,Y)=>Q.if(DQ._`${Y} !== true`,()=>{if(X===!0)Q.assign(Y,!0);else Q.assign(Y,DQ._`${Y} || {}`),f6(Q,Y,X)}),mergeValues:(Q,X)=>Q===!0?!0:{...Q,...X},resultToName:dD}),items:uD({mergeNames:(Q,X,Y)=>Q.if(DQ._`${Y} !== true && ${X} !== undefined`,()=>Q.assign(Y,DQ._`${X} === true ? true : ${Y} > ${X} ? ${Y} : ${X}`)),mergeToName:(Q,X,Y)=>Q.if(DQ._`${Y} !== true`,()=>Q.assign(Y,X===!0?!0:DQ._`${Y} > ${X} ? ${Y} : ${X}`)),mergeValues:(Q,X)=>Q===!0?!0:Math.max(Q,X),resultToName:(Q,X)=>Q.var("items",X)})};function dD(Q,X){if(X===!0)return Q.var("props",!0);let Y=Q.var("props",DQ._`{}`);if(X!==void 0)f6(Q,Y,X);return Y}oD.evaluatedPropsToName=dD;function f6(Q,X,Y){Object.keys(Y).forEach((W)=>Q.assign(DQ._`${X}${(0,DQ.getProperty)(W)}`,!0))}oD.setEvaluated=f6;var pD={};function ry(Q,X){return Q.scopeValue("func",{ref:X,code:pD[X.code]||(pD[X.code]=new uy._Code(X.code))})}oD.useFunc=ry;var y6;(function(Q){Q[Q.Num=0]="Num",Q[Q.Str=1]="Str"})(y6||(oD.Type=y6={}));function iy(Q,X,Y){if(Q instanceof DQ.Name){let W=X===y6.Num;return Y?W?DQ._`"[" + ${Q} + "]"`:DQ._`"['" + ${Q} + "']"`:W?DQ._`"/" + ${Q}`:DQ._`"/" + ${Q}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Y?(0,DQ.getProperty)(Q).toString():"/"+g6(Q)}oD.getErrorPath=iy;function nD(Q,X,Y=Q.opts.strictSchema){if(!Y)return;if(X=`strict mode: ${X}`,Y===!0)throw Error(X);Q.self.logger.warn(X)}oD.checkStrictMode=nD});var gY=F0((iD)=>{Object.defineProperty(iD,"__esModule",{value:!0});var qX=a0(),zg={data:new qX.Name("data"),valCxt:new qX.Name("valCxt"),instancePath:new qX.Name("instancePath"),parentData:new qX.Name("parentData"),parentDataProperty:new qX.Name("parentDataProperty"),rootData:new qX.Name("rootData"),dynamicAnchors:new qX.Name("dynamicAnchors"),vErrors:new qX.Name("vErrors"),errors:new qX.Name("errors"),this:new qX.Name("this"),self:new qX.Name("self"),scope:new qX.Name("scope"),json:new qX.Name("json"),jsonPos:new qX.Name("jsonPos"),jsonLen:new qX.Name("jsonLen"),jsonPart:new qX.Name("jsonPart")};iD.default=zg});var BW=F0((eD)=>{Object.defineProperty(eD,"__esModule",{value:!0});eD.extendErrors=eD.resetErrorsCount=eD.reportExtraError=eD.reportError=eD.keyword$DataError=eD.keywordError=void 0;var $Q=a0(),y$=UQ(),SX=gY();eD.keywordError={message:({keyword:Q})=>$Q.str`must pass "${Q}" keyword validation`};eD.keyword$DataError={message:({keyword:Q,schemaType:X})=>X?$Q.str`"${Q}" keyword must be ${X} ($data)`:$Q.str`"${Q}" keyword is invalid ($data)`};function Ag(Q,X=eD.keywordError,Y,W){let{it:G}=Q,{gen:K,compositeRule:Z,allErrors:q}=G,E=aD(Q,X,Y);if(W!==null&&W!==void 0?W:Z||q)tD(K,E);else sD(G,$Q._`[${E}]`)}eD.reportError=Ag;function Dg(Q,X=eD.keywordError,Y){let{it:W}=Q,{gen:G,compositeRule:K,allErrors:Z}=W,q=aD(Q,X,Y);if(tD(G,q),!(K||Z))sD(W,SX.default.vErrors)}eD.reportExtraError=Dg;function qg(Q,X){Q.assign(SX.default.errors,X),Q.if($Q._`${SX.default.vErrors} !== null`,()=>Q.if(X,()=>Q.assign($Q._`${SX.default.vErrors}.length`,X),()=>Q.assign(SX.default.vErrors,null)))}eD.resetErrorsCount=qg;function Ig({gen:Q,keyword:X,schemaValue:Y,data:W,errsCount:G,it:K}){if(G===void 0)throw Error("ajv implementation error");let Z=Q.name("err");Q.forRange("i",G,SX.default.errors,(q)=>{if(Q.const(Z,$Q._`${SX.default.vErrors}[${q}]`),Q.if($Q._`${Z}.instancePath === undefined`,()=>Q.assign($Q._`${Z}.instancePath`,(0,$Q.strConcat)(SX.default.instancePath,K.errorPath))),Q.assign($Q._`${Z}.schemaPath`,$Q.str`${K.errSchemaPath}/${X}`),K.opts.verbose)Q.assign($Q._`${Z}.schema`,Y),Q.assign($Q._`${Z}.data`,W)})}eD.extendErrors=Ig;function tD(Q,X){let Y=Q.const("err",X);Q.if($Q._`${SX.default.vErrors} === null`,()=>Q.assign(SX.default.vErrors,$Q._`[${Y}]`),$Q._`${SX.default.vErrors}.push(${Y})`),Q.code($Q._`${SX.default.errors}++`)}function sD(Q,X){let{gen:Y,validateName:W,schemaEnv:G}=Q;if(G.$async)Y.throw($Q._`new ${Q.ValidationError}(${X})`);else Y.assign($Q._`${W}.errors`,X),Y.return(!1)}var S1={keyword:new $Q.Name("keyword"),schemaPath:new $Q.Name("schemaPath"),params:new $Q.Name("params"),propertyName:new $Q.Name("propertyName"),message:new $Q.Name("message"),schema:new $Q.Name("schema"),parentSchema:new $Q.Name("parentSchema")};function aD(Q,X,Y){let{createErrors:W}=Q.it;if(W===!1)return $Q._`{}`;return Mg(Q,X,Y)}function Mg(Q,X,Y={}){let{gen:W,it:G}=Q,K=[Lg(G,Y),Eg(Q,Y)];return Tg(Q,X,K),W.object(...K)}function Lg({errorPath:Q},{instancePath:X}){let Y=X?$Q.str`${Q}${(0,y$.getErrorPath)(X,y$.Type.Str)}`:Q;return[SX.default.instancePath,(0,$Q.strConcat)(SX.default.instancePath,Y)]}function Eg({keyword:Q,it:{errSchemaPath:X}},{schemaPath:Y,parentSchema:W}){let G=W?X:$Q.str`${X}/${Q}`;if(Y)G=$Q.str`${G}${(0,y$.getErrorPath)(Y,y$.Type.Str)}`;return[S1.schemaPath,G]}function Tg(Q,{params:X,message:Y},W){let{keyword:G,data:K,schemaValue:Z,it:q}=Q,{opts:E,propertyName:I,topSchemaRef:L,schemaPath:D}=q;if(W.push([S1.keyword,G],[S1.params,typeof X=="function"?X(Q):X||$Q._`{}`]),E.messages)W.push([S1.message,typeof Y=="function"?Y(Q):Y]);if(E.verbose)W.push([S1.schema,Z],[S1.parentSchema,$Q._`${L}${D}`],[SX.default.data,K]);if(I)W.push([S1.propertyName,I])}});var Wq=F0((Yq)=>{Object.defineProperty(Yq,"__esModule",{value:!0});Yq.boolOrEmptySchema=Yq.topBoolOrEmptySchema=void 0;var Cg=BW(),jg=a0(),Ng=gY(),kg={message:"boolean schema is false"};function wg(Q){let{gen:X,schema:Y,validateName:W}=Q;if(Y===!1)Xq(Q,!1);else if(typeof Y=="object"&&Y.$async===!0)X.return(Ng.default.data);else X.assign(jg._`${W}.errors`,null),X.return(!0)}Yq.topBoolOrEmptySchema=wg;function vg(Q,X){let{gen:Y,schema:W}=Q;if(W===!1)Y.var(X,!1),Xq(Q);else Y.var(X,!0)}Yq.boolOrEmptySchema=vg;function Xq(Q,X){let{gen:Y,data:W}=Q,G={gen:Y,keyword:"false schema",data:W,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Q};(0,Cg.reportError)(G,kg,void 0,X)}});var h6=F0((Gq)=>{Object.defineProperty(Gq,"__esModule",{value:!0});Gq.getRules=Gq.isJSONType=void 0;var xg=["string","number","integer","boolean","null","object","array"],yg=new Set(xg);function gg(Q){return typeof Q=="string"&&yg.has(Q)}Gq.isJSONType=gg;function fg(){let Q={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Q,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Q.number,Q.string,Q.array,Q.object],post:{rules:[]},all:{},keywords:{}}}Gq.getRules=fg});var u6=F0((Uq)=>{Object.defineProperty(Uq,"__esModule",{value:!0});Uq.shouldUseRule=Uq.shouldUseGroup=Uq.schemaHasRulesForType=void 0;function hg({schema:Q,self:X},Y){let W=X.RULES.types[Y];return W&&W!==!0&&Zq(Q,W)}Uq.schemaHasRulesForType=hg;function Zq(Q,X){return X.rules.some((Y)=>Hq(Q,Y))}Uq.shouldUseGroup=Zq;function Hq(Q,X){var Y;return Q[X.keyword]!==void 0||((Y=X.definition.implements)===null||Y===void 0?void 0:Y.some((W)=>Q[W]!==void 0))}Uq.shouldUseRule=Hq});var SW=F0((Oq)=>{Object.defineProperty(Oq,"__esModule",{value:!0});Oq.reportTypeError=Oq.checkDataTypes=Oq.checkDataType=Oq.coerceAndCheckDataType=Oq.getJSONTypes=Oq.getSchemaTypes=Oq.DataType=void 0;var cg=h6(),lg=u6(),mg=BW(),t0=a0(),Fq=UQ(),WJ;(function(Q){Q[Q.Correct=0]="Correct",Q[Q.Wrong=1]="Wrong"})(WJ||(Oq.DataType=WJ={}));function dg(Q){let X=Vq(Q.type);if(X.includes("null")){if(Q.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&Q.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Q.nullable===!0)X.push("null")}return X}Oq.getSchemaTypes=dg;function Vq(Q){let X=Array.isArray(Q)?Q:Q?[Q]:[];if(X.every(cg.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}Oq.getJSONTypes=Vq;function ng(Q,X){let{gen:Y,data:W,opts:G}=Q,K=og(X,G.coerceTypes),Z=X.length>0&&!(K.length===0&&X.length===1&&(0,lg.schemaHasRulesForType)(Q,X[0]));if(Z){let q=c6(X,W,G.strictNumbers,WJ.Wrong);Y.if(q,()=>{if(K.length)rg(Q,X,K);else l6(Q)})}return Z}Oq.coerceAndCheckDataType=ng;var zq=new Set(["string","number","integer","boolean","null"]);function og(Q,X){return X?Q.filter((Y)=>zq.has(Y)||X==="array"&&Y==="array"):[]}function rg(Q,X,Y){let{gen:W,data:G,opts:K}=Q,Z=W.let("dataType",t0._`typeof ${G}`),q=W.let("coerced",t0._`undefined`);if(K.coerceTypes==="array")W.if(t0._`${Z} == 'object' && Array.isArray(${G}) && ${G}.length == 1`,()=>W.assign(G,t0._`${G}[0]`).assign(Z,t0._`typeof ${G}`).if(c6(X,G,K.strictNumbers),()=>W.assign(q,G)));W.if(t0._`${q} !== undefined`);for(let I of Y)if(zq.has(I)||I==="array"&&K.coerceTypes==="array")E(I);W.else(),l6(Q),W.endIf(),W.if(t0._`${q} !== undefined`,()=>{W.assign(G,q),ig(Q,q)});function E(I){switch(I){case"string":W.elseIf(t0._`${Z} == "number" || ${Z} == "boolean"`).assign(q,t0._`"" + ${G}`).elseIf(t0._`${G} === null`).assign(q,t0._`""`);return;case"number":W.elseIf(t0._`${Z} == "boolean" || ${G} === null
|
|
25
|
+
|| (${Z} == "string" && ${G} && ${G} == +${G})`).assign(q,t0._`+${G}`);return;case"integer":W.elseIf(t0._`${Z} === "boolean" || ${G} === null
|
|
26
|
+
|| (${Z} === "string" && ${G} && ${G} == +${G} && !(${G} % 1))`).assign(q,t0._`+${G}`);return;case"boolean":W.elseIf(t0._`${G} === "false" || ${G} === 0 || ${G} === null`).assign(q,!1).elseIf(t0._`${G} === "true" || ${G} === 1`).assign(q,!0);return;case"null":W.elseIf(t0._`${G} === "" || ${G} === 0 || ${G} === false`),W.assign(q,null);return;case"array":W.elseIf(t0._`${Z} === "string" || ${Z} === "number"
|
|
27
|
+
|| ${Z} === "boolean" || ${G} === null`).assign(q,t0._`[${G}]`)}}}function ig({gen:Q,parentData:X,parentDataProperty:Y},W){Q.if(t0._`${X} !== undefined`,()=>Q.assign(t0._`${X}[${Y}]`,W))}function p6(Q,X,Y,W=WJ.Correct){let G=W===WJ.Correct?t0.operators.EQ:t0.operators.NEQ,K;switch(Q){case"null":return t0._`${X} ${G} null`;case"array":K=t0._`Array.isArray(${X})`;break;case"object":K=t0._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":K=Z(t0._`!(${X} % 1) && !isNaN(${X})`);break;case"number":K=Z();break;default:return t0._`typeof ${X} ${G} ${Q}`}return W===WJ.Correct?K:(0,t0.not)(K);function Z(q=t0.nil){return(0,t0.and)(t0._`typeof ${X} == "number"`,q,Y?t0._`isFinite(${X})`:t0.nil)}}Oq.checkDataType=p6;function c6(Q,X,Y,W){if(Q.length===1)return p6(Q[0],X,Y,W);let G,K=(0,Fq.toHash)(Q);if(K.array&&K.object){let Z=t0._`typeof ${X} != "object"`;G=K.null?Z:t0._`!${X} || ${Z}`,delete K.null,delete K.array,delete K.object}else G=t0.nil;if(K.number)delete K.integer;for(let Z in K)G=(0,t0.and)(G,p6(Z,X,Y,W));return G}Oq.checkDataTypes=c6;var tg={message:({schema:Q})=>`must be ${Q}`,params:({schema:Q,schemaValue:X})=>typeof Q=="string"?t0._`{type: ${Q}}`:t0._`{type: ${X}}`};function l6(Q){let X=sg(Q);(0,mg.reportError)(X,tg)}Oq.reportTypeError=l6;function sg(Q){let{gen:X,data:Y,schema:W}=Q,G=(0,Fq.schemaRefOrVal)(Q,W,"type");return{gen:X,keyword:"type",data:Y,schema:W.type,schemaCode:G,schemaValue:G,parentSchema:W,params:{},it:Q}}});var Mq=F0((qq)=>{Object.defineProperty(qq,"__esModule",{value:!0});qq.assignDefaults=void 0;var GJ=a0(),Wf=UQ();function Gf(Q,X){let{properties:Y,items:W}=Q.schema;if(X==="object"&&Y)for(let G in Y)Dq(Q,G,Y[G].default);else if(X==="array"&&Array.isArray(W))W.forEach((G,K)=>Dq(Q,K,G.default))}qq.assignDefaults=Gf;function Dq(Q,X,Y){let{gen:W,compositeRule:G,data:K,opts:Z}=Q;if(Y===void 0)return;let q=GJ._`${K}${(0,GJ.getProperty)(X)}`;if(G){(0,Wf.checkStrictMode)(Q,`default is ignored for: ${q}`);return}let E=GJ._`${q} === undefined`;if(Z.useDefaults==="empty")E=GJ._`${E} || ${q} === null || ${q} === ""`;W.if(E,GJ._`${q} = ${(0,GJ.stringify)(Y)}`)}});var tX=F0((Tq)=>{Object.defineProperty(Tq,"__esModule",{value:!0});Tq.validateUnion=Tq.validateArray=Tq.usePattern=Tq.callValidateCode=Tq.schemaProperties=Tq.allSchemaProperties=Tq.noPropertyInData=Tq.propertyInData=Tq.isOwnProperty=Tq.hasPropFunc=Tq.reportMissingProp=Tq.checkMissingProp=Tq.checkReportMissingProp=void 0;var PQ=a0(),m6=UQ(),G1=gY(),$f=UQ();function Zf(Q,X){let{gen:Y,data:W,it:G}=Q;Y.if(n6(Y,W,X,G.opts.ownProperties),()=>{Q.setParams({missingProperty:PQ._`${X}`},!0),Q.error()})}Tq.checkReportMissingProp=Zf;function Hf({gen:Q,data:X,it:{opts:Y}},W,G){return(0,PQ.or)(...W.map((K)=>(0,PQ.and)(n6(Q,X,K,Y.ownProperties),PQ._`${G} = ${K}`)))}Tq.checkMissingProp=Hf;function Uf(Q,X){Q.setParams({missingProperty:X},!0),Q.error()}Tq.reportMissingProp=Uf;function Lq(Q){return Q.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:PQ._`Object.prototype.hasOwnProperty`})}Tq.hasPropFunc=Lq;function d6(Q,X,Y){return PQ._`${Lq(Q)}.call(${X}, ${Y})`}Tq.isOwnProperty=d6;function Kf(Q,X,Y,W){let G=PQ._`${X}${(0,PQ.getProperty)(Y)} !== undefined`;return W?PQ._`${G} && ${d6(Q,X,Y)}`:G}Tq.propertyInData=Kf;function n6(Q,X,Y,W){let G=PQ._`${X}${(0,PQ.getProperty)(Y)} === undefined`;return W?(0,PQ.or)(G,(0,PQ.not)(d6(Q,X,Y))):G}Tq.noPropertyInData=n6;function Eq(Q){return Q?Object.keys(Q).filter((X)=>X!=="__proto__"):[]}Tq.allSchemaProperties=Eq;function Ff(Q,X){return Eq(X).filter((Y)=>!(0,m6.alwaysValidSchema)(Q,X[Y]))}Tq.schemaProperties=Ff;function Vf({schemaCode:Q,data:X,it:{gen:Y,topSchemaRef:W,schemaPath:G,errorPath:K},it:Z},q,E,I){let L=I?PQ._`${Q}, ${X}, ${W}${G}`:X,D=[[G1.default.instancePath,(0,PQ.strConcat)(G1.default.instancePath,K)],[G1.default.parentData,Z.parentData],[G1.default.parentDataProperty,Z.parentDataProperty],[G1.default.rootData,G1.default.rootData]];if(Z.opts.dynamicRef)D.push([G1.default.dynamicAnchors,G1.default.dynamicAnchors]);let T=PQ._`${L}, ${Y.object(...D)}`;return E!==PQ.nil?PQ._`${q}.call(${E}, ${T})`:PQ._`${q}(${T})`}Tq.callValidateCode=Vf;var zf=PQ._`new RegExp`;function Of({gen:Q,it:{opts:X}},Y){let W=X.unicodeRegExp?"u":"",{regExp:G}=X.code,K=G(Y,W);return Q.scopeValue("pattern",{key:K.toString(),ref:K,code:PQ._`${G.code==="new RegExp"?zf:(0,$f.useFunc)(Q,G)}(${Y}, ${W})`})}Tq.usePattern=Of;function Af(Q){let{gen:X,data:Y,keyword:W,it:G}=Q,K=X.name("valid");if(G.allErrors){let q=X.let("valid",!0);return Z(()=>X.assign(q,!1)),q}return X.var(K,!0),Z(()=>X.break()),K;function Z(q){let E=X.const("len",PQ._`${Y}.length`);X.forRange("i",0,E,(I)=>{Q.subschema({keyword:W,dataProp:I,dataPropType:m6.Type.Num},K),X.if((0,PQ.not)(K),q)})}}Tq.validateArray=Af;function Df(Q){let{gen:X,schema:Y,keyword:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(Y.some((E)=>(0,m6.alwaysValidSchema)(G,E))&&!G.opts.unevaluated)return;let Z=X.let("valid",!1),q=X.name("_valid");X.block(()=>Y.forEach((E,I)=>{let L=Q.subschema({keyword:W,schemaProp:I,compositeRule:!0},q);if(X.assign(Z,PQ._`${Z} || ${q}`),!Q.mergeValidEvaluated(L,q))X.if((0,PQ.not)(Z))})),Q.result(Z,()=>Q.reset(),()=>Q.error(!0))}Tq.validateUnion=Df});var jq=F0((Sq)=>{Object.defineProperty(Sq,"__esModule",{value:!0});Sq.validateKeywordUsage=Sq.validSchemaType=Sq.funcKeywordCode=Sq.macroKeywordCode=void 0;var CX=a0(),C1=gY(),Nf=tX(),kf=BW();function wf(Q,X){let{gen:Y,keyword:W,schema:G,parentSchema:K,it:Z}=Q,q=X.macro.call(Z.self,G,K,Z),E=Bq(Y,W,q);if(Z.opts.validateSchema!==!1)Z.self.validateSchema(q,!0);let I=Y.name("valid");Q.subschema({schema:q,schemaPath:CX.nil,errSchemaPath:`${Z.errSchemaPath}/${W}`,topSchemaRef:E,compositeRule:!0},I),Q.pass(I,()=>Q.error(!0))}Sq.macroKeywordCode=wf;function vf(Q,X){var Y;let{gen:W,keyword:G,schema:K,parentSchema:Z,$data:q,it:E}=Q;xf(E,X);let I=!q&&X.compile?X.compile.call(E.self,K,Z,E):X.validate,L=Bq(W,G,I),D=W.let("valid");Q.block$data(D,T),Q.ok((Y=X.valid)!==null&&Y!==void 0?Y:D);function T(){if(X.errors===!1){if(j(),X.modifying)Pq(Q);S(()=>Q.error())}else{let N=X.async?P():B();if(X.modifying)Pq(Q);S(()=>_f(Q,N))}}function P(){let N=W.let("ruleErrs",null);return W.try(()=>j(CX._`await `),(k)=>W.assign(D,!1).if(CX._`${k} instanceof ${E.ValidationError}`,()=>W.assign(N,CX._`${k}.errors`),()=>W.throw(k))),N}function B(){let N=CX._`${L}.errors`;return W.assign(N,null),j(CX.nil),N}function j(N=X.async?CX._`await `:CX.nil){let k=E.opts.passContext?C1.default.this:C1.default.self,v=!(("compile"in X)&&!q||X.schema===!1);W.assign(D,CX._`${N}${(0,Nf.callValidateCode)(Q,L,k,v)}`,X.modifying)}function S(N){var k;W.if((0,CX.not)((k=X.valid)!==null&&k!==void 0?k:D),N)}}Sq.funcKeywordCode=vf;function Pq(Q){let{gen:X,data:Y,it:W}=Q;X.if(W.parentData,()=>X.assign(Y,CX._`${W.parentData}[${W.parentDataProperty}]`))}function _f(Q,X){let{gen:Y}=Q;Y.if(CX._`Array.isArray(${X})`,()=>{Y.assign(C1.default.vErrors,CX._`${C1.default.vErrors} === null ? ${X} : ${C1.default.vErrors}.concat(${X})`).assign(C1.default.errors,CX._`${C1.default.vErrors}.length`),(0,kf.extendErrors)(Q)},()=>Q.error())}function xf({schemaEnv:Q},X){if(X.async&&!Q.$async)throw Error("async keyword in sync schema")}function Bq(Q,X,Y){if(Y===void 0)throw Error(`keyword "${X}" failed to compile`);return Q.scopeValue("keyword",typeof Y=="function"?{ref:Y}:{ref:Y,code:(0,CX.stringify)(Y)})}function yf(Q,X,Y=!1){return!X.length||X.some((W)=>W==="array"?Array.isArray(Q):W==="object"?Q&&typeof Q=="object"&&!Array.isArray(Q):typeof Q==W||Y&&typeof Q>"u")}Sq.validSchemaType=yf;function gf({schema:Q,opts:X,self:Y,errSchemaPath:W},G,K){if(Array.isArray(G.keyword)?!G.keyword.includes(K):G.keyword!==K)throw Error("ajv implementation error");let Z=G.dependencies;if(Z===null||Z===void 0?void 0:Z.some((q)=>!Object.prototype.hasOwnProperty.call(Q,q)))throw Error(`parent schema must have dependencies of ${K}: ${Z.join(",")}`);if(G.validateSchema){if(!G.validateSchema(Q[K])){let E=`keyword "${K}" value is invalid at path "${W}": `+Y.errorsText(G.validateSchema.errors);if(X.validateSchema==="log")Y.logger.error(E);else throw Error(E)}}}Sq.validateKeywordUsage=gf});var vq=F0((kq)=>{Object.defineProperty(kq,"__esModule",{value:!0});kq.extendSubschemaMode=kq.extendSubschemaData=kq.getSubschema=void 0;var MY=a0(),Nq=UQ();function uf(Q,{keyword:X,schemaProp:Y,schema:W,schemaPath:G,errSchemaPath:K,topSchemaRef:Z}){if(X!==void 0&&W!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let q=Q.schema[X];return Y===void 0?{schema:q,schemaPath:MY._`${Q.schemaPath}${(0,MY.getProperty)(X)}`,errSchemaPath:`${Q.errSchemaPath}/${X}`}:{schema:q[Y],schemaPath:MY._`${Q.schemaPath}${(0,MY.getProperty)(X)}${(0,MY.getProperty)(Y)}`,errSchemaPath:`${Q.errSchemaPath}/${X}/${(0,Nq.escapeFragment)(Y)}`}}if(W!==void 0){if(G===void 0||K===void 0||Z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:W,schemaPath:G,topSchemaRef:Z,errSchemaPath:K}}throw Error('either "keyword" or "schema" must be passed')}kq.getSubschema=uf;function pf(Q,X,{dataProp:Y,dataPropType:W,data:G,dataTypes:K,propertyName:Z}){if(G!==void 0&&Y!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:q}=X;if(Y!==void 0){let{errorPath:I,dataPathArr:L,opts:D}=X,T=q.let("data",MY._`${X.data}${(0,MY.getProperty)(Y)}`,!0);E(T),Q.errorPath=MY.str`${I}${(0,Nq.getErrorPath)(Y,W,D.jsPropertySyntax)}`,Q.parentDataProperty=MY._`${Y}`,Q.dataPathArr=[...L,Q.parentDataProperty]}if(G!==void 0){let I=G instanceof MY.Name?G:q.let("data",G,!0);if(E(I),Z!==void 0)Q.propertyName=Z}if(K)Q.dataTypes=K;function E(I){Q.data=I,Q.dataLevel=X.dataLevel+1,Q.dataTypes=[],X.definedProperties=new Set,Q.parentData=X.data,Q.dataNames=[...X.dataNames,I]}}kq.extendSubschemaData=pf;function cf(Q,{jtdDiscriminator:X,jtdMetadata:Y,compositeRule:W,createErrors:G,allErrors:K}){if(W!==void 0)Q.compositeRule=W;if(G!==void 0)Q.createErrors=G;if(K!==void 0)Q.allErrors=K;Q.jtdDiscriminator=X,Q.jtdMetadata=Y}kq.extendSubschemaMode=cf});var xq=F0((uQ0,_q)=>{var $1=_q.exports=function(Q,X,Y){if(typeof X=="function")Y=X,X={};Y=X.cb||Y;var W=typeof Y=="function"?Y:Y.pre||function(){},G=Y.post||function(){};g$(X,W,G,Q,"",Q)};$1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};$1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};$1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};$1.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 g$(Q,X,Y,W,G,K,Z,q,E,I){if(W&&typeof W=="object"&&!Array.isArray(W)){X(W,G,K,Z,q,E,I);for(var L in W){var D=W[L];if(Array.isArray(D)){if(L in $1.arrayKeywords)for(var T=0;T<D.length;T++)g$(Q,X,Y,D[T],G+"/"+L+"/"+T,K,G,L,W,T)}else if(L in $1.propsKeywords){if(D&&typeof D=="object")for(var P in D)g$(Q,X,Y,D[P],G+"/"+L+"/"+df(P),K,G,L,W,P)}else if(L in $1.keywords||Q.allKeys&&!(L in $1.skipKeywords))g$(Q,X,Y,D,G+"/"+L,K,G,L,W)}Y(W,G,K,Z,q,E,I)}}function df(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}});var CW=F0((bq)=>{Object.defineProperty(bq,"__esModule",{value:!0});bq.getSchemaRefs=bq.resolveUrl=bq.normalizeId=bq._getFullPath=bq.getFullPath=bq.inlineRef=void 0;var nf=UQ(),of=WW(),rf=xq(),tf=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function sf(Q,X=!0){if(typeof Q=="boolean")return!0;if(X===!0)return!o6(Q);if(!X)return!1;return yq(Q)<=X}bq.inlineRef=sf;var af=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o6(Q){for(let X in Q){if(af.has(X))return!0;let Y=Q[X];if(Array.isArray(Y)&&Y.some(o6))return!0;if(typeof Y=="object"&&o6(Y))return!0}return!1}function yq(Q){let X=0;for(let Y in Q){if(Y==="$ref")return 1/0;if(X++,tf.has(Y))continue;if(typeof Q[Y]=="object")(0,nf.eachItem)(Q[Y],(W)=>X+=yq(W));if(X===1/0)return 1/0}return X}function gq(Q,X="",Y){if(Y!==!1)X=$J(X);let W=Q.parse(X);return fq(Q,W)}bq.getFullPath=gq;function fq(Q,X){return Q.serialize(X).split("#")[0]+"#"}bq._getFullPath=fq;var ef=/#\/?$/;function $J(Q){return Q?Q.replace(ef,""):""}bq.normalizeId=$J;function Qb(Q,X,Y){return Y=$J(Y),Q.resolve(X,Y)}bq.resolveUrl=Qb;var Xb=/^[a-z_][-a-z0-9._]*$/i;function Yb(Q,X){if(typeof Q=="boolean")return{};let{schemaId:Y,uriResolver:W}=this.opts,G=$J(Q[Y]||X),K={"":G},Z=gq(W,G,!1),q={},E=new Set;return rf(Q,{allKeys:!0},(D,T,P,B)=>{if(B===void 0)return;let j=Z+T,S=K[B];if(typeof D[Y]=="string")S=N.call(this,D[Y]);k.call(this,D.$anchor),k.call(this,D.$dynamicAnchor),K[T]=S;function N(v){let _=this.opts.uriResolver.resolve;if(v=$J(S?_(S,v):v),E.has(v))throw L(v);E.add(v);let x=this.refs[v];if(typeof x=="string")x=this.refs[x];if(typeof x=="object")I(D,x.schema,v);else if(v!==$J(j))if(v[0]==="#")I(D,q[v],v),q[v]=D;else this.refs[v]=j;return v}function k(v){if(typeof v=="string"){if(!Xb.test(v))throw Error(`invalid anchor "${v}"`);N.call(this,`#${v}`)}}}),q;function I(D,T,P){if(T!==void 0&&!of(D,T))throw L(P)}function L(D){return Error(`reference "${D}" resolves to more than one schema`)}}bq.getSchemaRefs=Yb});var kW=F0((QI)=>{Object.defineProperty(QI,"__esModule",{value:!0});QI.getData=QI.KeywordCxt=QI.validateFunctionCode=void 0;var mq=Wq(),uq=SW(),i6=u6(),f$=SW(),Hb=Mq(),NW=jq(),r6=vq(),c0=a0(),n0=gY(),Ub=CW(),fY=UQ(),jW=BW();function Kb(Q){if(oq(Q)){if(rq(Q),nq(Q)){zb(Q);return}}dq(Q,()=>(0,mq.topBoolOrEmptySchema)(Q))}QI.validateFunctionCode=Kb;function dq({gen:Q,validateName:X,schema:Y,schemaEnv:W,opts:G},K){if(G.code.es5)Q.func(X,c0._`${n0.default.data}, ${n0.default.valCxt}`,W.$async,()=>{Q.code(c0._`"use strict"; ${pq(Y,G)}`),Vb(Q,G),Q.code(K)});else Q.func(X,c0._`${n0.default.data}, ${Fb(G)}`,W.$async,()=>Q.code(pq(Y,G)).code(K))}function Fb(Q){return c0._`{${n0.default.instancePath}="", ${n0.default.parentData}, ${n0.default.parentDataProperty}, ${n0.default.rootData}=${n0.default.data}${Q.dynamicRef?c0._`, ${n0.default.dynamicAnchors}={}`:c0.nil}}={}`}function Vb(Q,X){Q.if(n0.default.valCxt,()=>{if(Q.var(n0.default.instancePath,c0._`${n0.default.valCxt}.${n0.default.instancePath}`),Q.var(n0.default.parentData,c0._`${n0.default.valCxt}.${n0.default.parentData}`),Q.var(n0.default.parentDataProperty,c0._`${n0.default.valCxt}.${n0.default.parentDataProperty}`),Q.var(n0.default.rootData,c0._`${n0.default.valCxt}.${n0.default.rootData}`),X.dynamicRef)Q.var(n0.default.dynamicAnchors,c0._`${n0.default.valCxt}.${n0.default.dynamicAnchors}`)},()=>{if(Q.var(n0.default.instancePath,c0._`""`),Q.var(n0.default.parentData,c0._`undefined`),Q.var(n0.default.parentDataProperty,c0._`undefined`),Q.var(n0.default.rootData,n0.default.data),X.dynamicRef)Q.var(n0.default.dynamicAnchors,c0._`{}`)})}function zb(Q){let{schema:X,opts:Y,gen:W}=Q;dq(Q,()=>{if(Y.$comment&&X.$comment)tq(Q);if(Ib(Q),W.let(n0.default.vErrors,null),W.let(n0.default.errors,0),Y.unevaluated)Ob(Q);iq(Q),Eb(Q)});return}function Ob(Q){let{gen:X,validateName:Y}=Q;Q.evaluated=X.const("evaluated",c0._`${Y}.evaluated`),X.if(c0._`${Q.evaluated}.dynamicProps`,()=>X.assign(c0._`${Q.evaluated}.props`,c0._`undefined`)),X.if(c0._`${Q.evaluated}.dynamicItems`,()=>X.assign(c0._`${Q.evaluated}.items`,c0._`undefined`))}function pq(Q,X){let Y=typeof Q=="object"&&Q[X.schemaId];return Y&&(X.code.source||X.code.process)?c0._`/*# sourceURL=${Y} */`:c0.nil}function Ab(Q,X){if(oq(Q)){if(rq(Q),nq(Q)){Db(Q,X);return}}(0,mq.boolOrEmptySchema)(Q,X)}function nq({schema:Q,self:X}){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X.RULES.all[Y])return!0;return!1}function oq(Q){return typeof Q.schema!="boolean"}function Db(Q,X){let{schema:Y,gen:W,opts:G}=Q;if(G.$comment&&Y.$comment)tq(Q);Mb(Q),Lb(Q);let K=W.const("_errs",n0.default.errors);iq(Q,K),W.var(X,c0._`${K} === ${n0.default.errors}`)}function rq(Q){(0,fY.checkUnknownRules)(Q),qb(Q)}function iq(Q,X){if(Q.opts.jtd)return cq(Q,[],!1,X);let Y=(0,uq.getSchemaTypes)(Q.schema),W=(0,uq.coerceAndCheckDataType)(Q,Y);cq(Q,Y,!W,X)}function qb(Q){let{schema:X,errSchemaPath:Y,opts:W,self:G}=Q;if(X.$ref&&W.ignoreKeywordsWithRef&&(0,fY.schemaHasRulesButRef)(X,G.RULES))G.logger.warn(`$ref: keywords ignored in schema at path "${Y}"`)}function Ib(Q){let{schema:X,opts:Y}=Q;if(X.default!==void 0&&Y.useDefaults&&Y.strictSchema)(0,fY.checkStrictMode)(Q,"default is ignored in the schema root")}function Mb(Q){let X=Q.schema[Q.opts.schemaId];if(X)Q.baseId=(0,Ub.resolveUrl)(Q.opts.uriResolver,Q.baseId,X)}function Lb(Q){if(Q.schema.$async&&!Q.schemaEnv.$async)throw Error("async schema in sync schema")}function tq({gen:Q,schemaEnv:X,schema:Y,errSchemaPath:W,opts:G}){let K=Y.$comment;if(G.$comment===!0)Q.code(c0._`${n0.default.self}.logger.log(${K})`);else if(typeof G.$comment=="function"){let Z=c0.str`${W}/$comment`,q=Q.scopeValue("root",{ref:X.root});Q.code(c0._`${n0.default.self}.opts.$comment(${K}, ${Z}, ${q}.schema)`)}}function Eb(Q){let{gen:X,schemaEnv:Y,validateName:W,ValidationError:G,opts:K}=Q;if(Y.$async)X.if(c0._`${n0.default.errors} === 0`,()=>X.return(n0.default.data),()=>X.throw(c0._`new ${G}(${n0.default.vErrors})`));else{if(X.assign(c0._`${W}.errors`,n0.default.vErrors),K.unevaluated)Tb(Q);X.return(c0._`${n0.default.errors} === 0`)}}function Tb({gen:Q,evaluated:X,props:Y,items:W}){if(Y instanceof c0.Name)Q.assign(c0._`${X}.props`,Y);if(W instanceof c0.Name)Q.assign(c0._`${X}.items`,W)}function cq(Q,X,Y,W){let{gen:G,schema:K,data:Z,allErrors:q,opts:E,self:I}=Q,{RULES:L}=I;if(K.$ref&&(E.ignoreKeywordsWithRef||!(0,fY.schemaHasRulesButRef)(K,L))){G.block(()=>aq(Q,"$ref",L.all.$ref.definition));return}if(!E.jtd)Rb(Q,X);G.block(()=>{for(let T of L.rules)D(T);D(L.post)});function D(T){if(!(0,i6.shouldUseGroup)(K,T))return;if(T.type){if(G.if((0,f$.checkDataType)(T.type,Z,E.strictNumbers)),lq(Q,T),X.length===1&&X[0]===T.type&&Y)G.else(),(0,f$.reportTypeError)(Q);G.endIf()}else lq(Q,T);if(!q)G.if(c0._`${n0.default.errors} === ${W||0}`)}}function lq(Q,X){let{gen:Y,schema:W,opts:{useDefaults:G}}=Q;if(G)(0,Hb.assignDefaults)(Q,X.type);Y.block(()=>{for(let K of X.rules)if((0,i6.shouldUseRule)(W,K))aq(Q,K.keyword,K.definition,X.type)})}function Rb(Q,X){if(Q.schemaEnv.meta||!Q.opts.strictTypes)return;if(Pb(Q,X),!Q.opts.allowUnionTypes)Bb(Q,X);Sb(Q,Q.dataTypes)}function Pb(Q,X){if(!X.length)return;if(!Q.dataTypes.length){Q.dataTypes=X;return}X.forEach((Y)=>{if(!sq(Q.dataTypes,Y))t6(Q,`type "${Y}" not allowed by context "${Q.dataTypes.join(",")}"`)}),jb(Q,X)}function Bb(Q,X){if(X.length>1&&!(X.length===2&&X.includes("null")))t6(Q,"use allowUnionTypes to allow union type keyword")}function Sb(Q,X){let Y=Q.self.RULES.all;for(let W in Y){let G=Y[W];if(typeof G=="object"&&(0,i6.shouldUseRule)(Q.schema,G)){let{type:K}=G.definition;if(K.length&&!K.some((Z)=>Cb(X,Z)))t6(Q,`missing type "${K.join(",")}" for keyword "${W}"`)}}}function Cb(Q,X){return Q.includes(X)||X==="number"&&Q.includes("integer")}function sq(Q,X){return Q.includes(X)||X==="integer"&&Q.includes("number")}function jb(Q,X){let Y=[];for(let W of Q.dataTypes)if(sq(X,W))Y.push(W);else if(X.includes("integer")&&W==="number")Y.push("integer");Q.dataTypes=Y}function t6(Q,X){let Y=Q.schemaEnv.baseId+Q.errSchemaPath;X+=` at "${Y}" (strictTypes)`,(0,fY.checkStrictMode)(Q,X,Q.opts.strictTypes)}class s6{constructor(Q,X,Y){if((0,NW.validateKeywordUsage)(Q,X,Y),this.gen=Q.gen,this.allErrors=Q.allErrors,this.keyword=Y,this.data=Q.data,this.schema=Q.schema[Y],this.$data=X.$data&&Q.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,fY.schemaRefOrVal)(Q,this.schema,Y,this.$data),this.schemaType=X.schemaType,this.parentSchema=Q.schema,this.params={},this.it=Q,this.def=X,this.$data)this.schemaCode=Q.gen.const("vSchema",eq(this.$data,Q));else if(this.schemaCode=this.schemaValue,!(0,NW.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${Y} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=Q.gen.const("_errs",n0.default.errors)}result(Q,X,Y){this.failResult((0,c0.not)(Q),X,Y)}failResult(Q,X,Y){if(this.gen.if(Q),Y)Y();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(Q,X){this.failResult((0,c0.not)(Q),void 0,X)}fail(Q){if(Q===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Q),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Q){if(!this.$data)return this.fail(Q);let{schemaCode:X}=this;this.fail(c0._`${X} !== undefined && (${(0,c0.or)(this.invalid$data(),Q)})`)}error(Q,X,Y){if(X){this.setParams(X),this._error(Q,Y),this.setParams({});return}this._error(Q,Y)}_error(Q,X){(Q?jW.reportExtraError:jW.reportError)(this,this.def.error,X)}$dataError(){(0,jW.reportError)(this,this.def.$dataError||jW.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,jW.resetErrorsCount)(this.gen,this.errsCount)}ok(Q){if(!this.allErrors)this.gen.if(Q)}setParams(Q,X){if(X)Object.assign(this.params,Q);else this.params=Q}block$data(Q,X,Y=c0.nil){this.gen.block(()=>{this.check$data(Q,Y),X()})}check$data(Q=c0.nil,X=c0.nil){if(!this.$data)return;let{gen:Y,schemaCode:W,schemaType:G,def:K}=this;if(Y.if((0,c0.or)(c0._`${W} === undefined`,X)),Q!==c0.nil)Y.assign(Q,!0);if(G.length||K.validateSchema){if(Y.elseIf(this.invalid$data()),this.$dataError(),Q!==c0.nil)Y.assign(Q,!1)}Y.else()}invalid$data(){let{gen:Q,schemaCode:X,schemaType:Y,def:W,it:G}=this;return(0,c0.or)(K(),Z());function K(){if(Y.length){if(!(X instanceof c0.Name))throw Error("ajv implementation error");let q=Array.isArray(Y)?Y:[Y];return c0._`${(0,f$.checkDataTypes)(q,X,G.opts.strictNumbers,f$.DataType.Wrong)}`}return c0.nil}function Z(){if(W.validateSchema){let q=Q.scopeValue("validate$data",{ref:W.validateSchema});return c0._`!${q}(${X})`}return c0.nil}}subschema(Q,X){let Y=(0,r6.getSubschema)(this.it,Q);(0,r6.extendSubschemaData)(Y,this.it,Q),(0,r6.extendSubschemaMode)(Y,Q);let W={...this.it,...Y,items:void 0,props:void 0};return Ab(W,X),W}mergeEvaluated(Q,X){let{it:Y,gen:W}=this;if(!Y.opts.unevaluated)return;if(Y.props!==!0&&Q.props!==void 0)Y.props=fY.mergeEvaluated.props(W,Q.props,Y.props,X);if(Y.items!==!0&&Q.items!==void 0)Y.items=fY.mergeEvaluated.items(W,Q.items,Y.items,X)}mergeValidEvaluated(Q,X){let{it:Y,gen:W}=this;if(Y.opts.unevaluated&&(Y.props!==!0||Y.items!==!0))return W.if(X,()=>this.mergeEvaluated(Q,c0.Name)),!0}}QI.KeywordCxt=s6;function aq(Q,X,Y,W){let G=new s6(Q,Y,X);if("code"in Y)Y.code(G,W);else if(G.$data&&Y.validate)(0,NW.funcKeywordCode)(G,Y);else if("macro"in Y)(0,NW.macroKeywordCode)(G,Y);else if(Y.compile||Y.validate)(0,NW.funcKeywordCode)(G,Y)}var Nb=/^\/(?:[^~]|~0|~1)*$/,kb=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function eq(Q,{dataLevel:X,dataNames:Y,dataPathArr:W}){let G,K;if(Q==="")return n0.default.rootData;if(Q[0]==="/"){if(!Nb.test(Q))throw Error(`Invalid JSON-pointer: ${Q}`);G=Q,K=n0.default.rootData}else{let I=kb.exec(Q);if(!I)throw Error(`Invalid JSON-pointer: ${Q}`);let L=+I[1];if(G=I[2],G==="#"){if(L>=X)throw Error(E("property/index",L));return W[X-L]}if(L>X)throw Error(E("data",L));if(K=Y[X-L],!G)return K}let Z=K,q=G.split("/");for(let I of q)if(I)K=c0._`${K}${(0,c0.getProperty)((0,fY.unescapeJsonPointer)(I))}`,Z=c0._`${Z} && ${K}`;return Z;function E(I,L){return`Cannot access ${I} ${L} levels up, current level is ${X}`}}QI.getData=eq});var b$=F0((JI)=>{Object.defineProperty(JI,"__esModule",{value:!0});class YI extends Error{constructor(Q){super("validation failed");this.errors=Q,this.ajv=this.validation=!0}}JI.default=YI});var wW=F0((GI)=>{Object.defineProperty(GI,"__esModule",{value:!0});var a6=CW();class WI extends Error{constructor(Q,X,Y,W){super(W||`can't resolve reference ${Y} from id ${X}`);this.missingRef=(0,a6.resolveUrl)(Q,X,Y),this.missingSchema=(0,a6.normalizeId)((0,a6.getFullPath)(Q,this.missingRef))}}GI.default=WI});var u$=F0((HI)=>{Object.defineProperty(HI,"__esModule",{value:!0});HI.resolveSchema=HI.getCompilingSchema=HI.resolveRef=HI.compileSchema=HI.SchemaEnv=void 0;var UY=a0(),yb=b$(),j1=gY(),KY=CW(),$I=UQ(),gb=kW();class vW{constructor(Q){var X;this.refs={},this.dynamicAnchors={};let Y;if(typeof Q.schema=="object")Y=Q.schema;this.schema=Q.schema,this.schemaId=Q.schemaId,this.root=Q.root||this,this.baseId=(X=Q.baseId)!==null&&X!==void 0?X:(0,KY.normalizeId)(Y===null||Y===void 0?void 0:Y[Q.schemaId||"$id"]),this.schemaPath=Q.schemaPath,this.localRefs=Q.localRefs,this.meta=Q.meta,this.$async=Y===null||Y===void 0?void 0:Y.$async,this.refs={}}}HI.SchemaEnv=vW;function QU(Q){let X=ZI.call(this,Q);if(X)return X;let Y=(0,KY.getFullPath)(this.opts.uriResolver,Q.root.baseId),{es5:W,lines:G}=this.opts.code,{ownProperties:K}=this.opts,Z=new UY.CodeGen(this.scope,{es5:W,lines:G,ownProperties:K}),q;if(Q.$async)q=Z.scopeValue("Error",{ref:yb.default,code:UY._`require("ajv/dist/runtime/validation_error").default`});let E=Z.scopeName("validate");Q.validateName=E;let I={gen:Z,allErrors:this.opts.allErrors,data:j1.default.data,parentData:j1.default.parentData,parentDataProperty:j1.default.parentDataProperty,dataNames:[j1.default.data],dataPathArr:[UY.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Z.scopeValue("schema",this.opts.code.source===!0?{ref:Q.schema,code:(0,UY.stringify)(Q.schema)}:{ref:Q.schema}),validateName:E,ValidationError:q,schema:Q.schema,schemaEnv:Q,rootId:Y,baseId:Q.baseId||Y,schemaPath:UY.nil,errSchemaPath:Q.schemaPath||(this.opts.jtd?"":"#"),errorPath:UY._`""`,opts:this.opts,self:this},L;try{this._compilations.add(Q),(0,gb.validateFunctionCode)(I),Z.optimize(this.opts.code.optimize);let D=Z.toString();if(L=`${Z.scopeRefs(j1.default.scope)}return ${D}`,this.opts.code.process)L=this.opts.code.process(L,Q);let P=Function(`${j1.default.self}`,`${j1.default.scope}`,L)(this,this.scope.get());if(this.scope.value(E,{ref:P}),P.errors=null,P.schema=Q.schema,P.schemaEnv=Q,Q.$async)P.$async=!0;if(this.opts.code.source===!0)P.source={validateName:E,validateCode:D,scopeValues:Z._values};if(this.opts.unevaluated){let{props:B,items:j}=I;if(P.evaluated={props:B instanceof UY.Name?void 0:B,items:j instanceof UY.Name?void 0:j,dynamicProps:B instanceof UY.Name,dynamicItems:j instanceof UY.Name},P.source)P.source.evaluated=(0,UY.stringify)(P.evaluated)}return Q.validate=P,Q}catch(D){if(delete Q.validate,delete Q.validateName,L)this.logger.error("Error compiling schema, function code:",L);throw D}finally{this._compilations.delete(Q)}}HI.compileSchema=QU;function fb(Q,X,Y){var W;Y=(0,KY.resolveUrl)(this.opts.uriResolver,X,Y);let G=Q.refs[Y];if(G)return G;let K=ub.call(this,Q,Y);if(K===void 0){let Z=(W=Q.localRefs)===null||W===void 0?void 0:W[Y],{schemaId:q}=this.opts;if(Z)K=new vW({schema:Z,schemaId:q,root:Q,baseId:X})}if(K===void 0)return;return Q.refs[Y]=bb.call(this,K)}HI.resolveRef=fb;function bb(Q){if((0,KY.inlineRef)(Q.schema,this.opts.inlineRefs))return Q.schema;return Q.validate?Q:QU.call(this,Q)}function ZI(Q){for(let X of this._compilations)if(hb(X,Q))return X}HI.getCompilingSchema=ZI;function hb(Q,X){return Q.schema===X.schema&&Q.root===X.root&&Q.baseId===X.baseId}function ub(Q,X){let Y;while(typeof(Y=this.refs[X])=="string")X=Y;return Y||this.schemas[X]||h$.call(this,Q,X)}function h$(Q,X){let Y=this.opts.uriResolver.parse(X),W=(0,KY._getFullPath)(this.opts.uriResolver,Y),G=(0,KY.getFullPath)(this.opts.uriResolver,Q.baseId,void 0);if(Object.keys(Q.schema).length>0&&W===G)return e6.call(this,Y,Q);let K=(0,KY.normalizeId)(W),Z=this.refs[K]||this.schemas[K];if(typeof Z=="string"){let q=h$.call(this,Q,Z);if(typeof(q===null||q===void 0?void 0:q.schema)!=="object")return;return e6.call(this,Y,q)}if(typeof(Z===null||Z===void 0?void 0:Z.schema)!=="object")return;if(!Z.validate)QU.call(this,Z);if(K===(0,KY.normalizeId)(X)){let{schema:q}=Z,{schemaId:E}=this.opts,I=q[E];if(I)G=(0,KY.resolveUrl)(this.opts.uriResolver,G,I);return new vW({schema:q,schemaId:E,root:Q,baseId:G})}return e6.call(this,Y,Z)}HI.resolveSchema=h$;var pb=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function e6(Q,{baseId:X,schema:Y,root:W}){var G;if(((G=Q.fragment)===null||G===void 0?void 0:G[0])!=="/")return;for(let q of Q.fragment.slice(1).split("/")){if(typeof Y==="boolean")return;let E=Y[(0,$I.unescapeFragment)(q)];if(E===void 0)return;Y=E;let I=typeof Y==="object"&&Y[this.opts.schemaId];if(!pb.has(q)&&I)X=(0,KY.resolveUrl)(this.opts.uriResolver,X,I)}let K;if(typeof Y!="boolean"&&Y.$ref&&!(0,$I.schemaHasRulesButRef)(Y,this.RULES)){let q=(0,KY.resolveUrl)(this.opts.uriResolver,X,Y.$ref);K=h$.call(this,W,q)}let{schemaId:Z}=this.opts;if(K=K||new vW({schema:Y,schemaId:Z,root:W,baseId:X}),K.schema!==K.root.schema)return K;return}});var KI=F0((nQ0,nb)=>{nb.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 zI=F0((VI)=>{Object.defineProperty(VI,"__esModule",{value:!0});var FI=Z6();FI.code='require("ajv/dist/runtime/uri").default';VI.default=FI});var EI=F0((bY)=>{Object.defineProperty(bY,"__esModule",{value:!0});bY.CodeGen=bY.Name=bY.nil=bY.stringify=bY.str=bY._=bY.KeywordCxt=void 0;var rb=kW();Object.defineProperty(bY,"KeywordCxt",{enumerable:!0,get:function(){return rb.KeywordCxt}});var ZJ=a0();Object.defineProperty(bY,"_",{enumerable:!0,get:function(){return ZJ._}});Object.defineProperty(bY,"str",{enumerable:!0,get:function(){return ZJ.str}});Object.defineProperty(bY,"stringify",{enumerable:!0,get:function(){return ZJ.stringify}});Object.defineProperty(bY,"nil",{enumerable:!0,get:function(){return ZJ.nil}});Object.defineProperty(bY,"Name",{enumerable:!0,get:function(){return ZJ.Name}});Object.defineProperty(bY,"CodeGen",{enumerable:!0,get:function(){return ZJ.CodeGen}});var ib=b$(),II=wW(),tb=h6(),_W=u$(),sb=a0(),xW=CW(),p$=SW(),YU=UQ(),OI=KI(),ab=zI(),MI=(Q,X)=>new RegExp(Q,X);MI.code="new RegExp";var eb=["removeAdditional","useDefaults","coerceTypes"],Qh=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Xh={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."},Yh={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},AI=200;function Jh(Q){var X,Y,W,G,K,Z,q,E,I,L,D,T,P,B,j,S,N,k,v,_,x,c,Y0,$0,e;let p=Q.strict,X0=(X=Q.code)===null||X===void 0?void 0:X.optimize,J=X0===!0||X0===void 0?1:X0||0,U=(W=(Y=Q.code)===null||Y===void 0?void 0:Y.regExp)!==null&&W!==void 0?W:MI,V=(G=Q.uriResolver)!==null&&G!==void 0?G:ab.default;return{strictSchema:(Z=(K=Q.strictSchema)!==null&&K!==void 0?K:p)!==null&&Z!==void 0?Z:!0,strictNumbers:(E=(q=Q.strictNumbers)!==null&&q!==void 0?q:p)!==null&&E!==void 0?E:!0,strictTypes:(L=(I=Q.strictTypes)!==null&&I!==void 0?I:p)!==null&&L!==void 0?L:"log",strictTuples:(T=(D=Q.strictTuples)!==null&&D!==void 0?D:p)!==null&&T!==void 0?T:"log",strictRequired:(B=(P=Q.strictRequired)!==null&&P!==void 0?P:p)!==null&&B!==void 0?B:!1,code:Q.code?{...Q.code,optimize:J,regExp:U}:{optimize:J,regExp:U},loopRequired:(j=Q.loopRequired)!==null&&j!==void 0?j:AI,loopEnum:(S=Q.loopEnum)!==null&&S!==void 0?S:AI,meta:(N=Q.meta)!==null&&N!==void 0?N:!0,messages:(k=Q.messages)!==null&&k!==void 0?k:!0,inlineRefs:(v=Q.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(_=Q.schemaId)!==null&&_!==void 0?_:"$id",addUsedSchema:(x=Q.addUsedSchema)!==null&&x!==void 0?x:!0,validateSchema:(c=Q.validateSchema)!==null&&c!==void 0?c:!0,validateFormats:(Y0=Q.validateFormats)!==null&&Y0!==void 0?Y0:!0,unicodeRegExp:($0=Q.unicodeRegExp)!==null&&$0!==void 0?$0:!0,int32range:(e=Q.int32range)!==null&&e!==void 0?e:!0,uriResolver:V}}class c${constructor(Q={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,Q=this.opts={...Q,...Jh(Q)};let{es5:X,lines:Y}=this.opts.code;this.scope=new sb.ValueScope({scope:{},prefixes:Qh,es5:X,lines:Y}),this.logger=Uh(Q.logger);let W=Q.validateFormats;if(Q.validateFormats=!1,this.RULES=(0,tb.getRules)(),DI.call(this,Xh,Q,"NOT SUPPORTED"),DI.call(this,Yh,Q,"DEPRECATED","warn"),this._metaOpts=Zh.call(this),Q.formats)Gh.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Q.keywords)$h.call(this,Q.keywords);if(typeof Q.meta=="object")this.addMetaSchema(Q.meta);Wh.call(this),Q.validateFormats=W}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Q,meta:X,schemaId:Y}=this.opts,W=OI;if(Y==="id")W={...OI},W.id=W.$id,delete W.$id;if(X&&Q)this.addMetaSchema(W,W[Y],!1)}defaultMeta(){let{meta:Q,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof Q=="object"?Q[X]||Q:void 0}validate(Q,X){let Y;if(typeof Q=="string"){if(Y=this.getSchema(Q),!Y)throw Error(`no schema with key or ref "${Q}"`)}else Y=this.compile(Q);let W=Y(X);if(!("$async"in Y))this.errors=Y.errors;return W}compile(Q,X){let Y=this._addSchema(Q,X);return Y.validate||this._compileSchemaEnv(Y)}compileAsync(Q,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Y}=this.opts;return W.call(this,Q,X);async function W(I,L){await G.call(this,I.$schema);let D=this._addSchema(I,L);return D.validate||K.call(this,D)}async function G(I){if(I&&!this.getSchema(I))await W.call(this,{$ref:I},!0)}async function K(I){try{return this._compileSchemaEnv(I)}catch(L){if(!(L instanceof II.default))throw L;return Z.call(this,L),await q.call(this,L.missingSchema),K.call(this,I)}}function Z({missingSchema:I,missingRef:L}){if(this.refs[I])throw Error(`AnySchema ${I} is loaded but ${L} cannot be resolved`)}async function q(I){let L=await E.call(this,I);if(!this.refs[I])await G.call(this,L.$schema);if(!this.refs[I])this.addSchema(L,I,X)}async function E(I){let L=this._loading[I];if(L)return L;try{return await(this._loading[I]=Y(I))}finally{delete this._loading[I]}}}addSchema(Q,X,Y,W=this.opts.validateSchema){if(Array.isArray(Q)){for(let K of Q)this.addSchema(K,void 0,Y,W);return this}let G;if(typeof Q==="object"){let{schemaId:K}=this.opts;if(G=Q[K],G!==void 0&&typeof G!="string")throw Error(`schema ${K} must be string`)}return X=(0,xW.normalizeId)(X||G),this._checkUnique(X),this.schemas[X]=this._addSchema(Q,Y,X,W,!0),this}addMetaSchema(Q,X,Y=this.opts.validateSchema){return this.addSchema(Q,X,!0,Y),this}validateSchema(Q,X){if(typeof Q=="boolean")return!0;let Y;if(Y=Q.$schema,Y!==void 0&&typeof Y!="string")throw Error("$schema must be a string");if(Y=Y||this.opts.defaultMeta||this.defaultMeta(),!Y)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let W=this.validate(Y,Q);if(!W&&X){let G="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(G);else throw Error(G)}return W}getSchema(Q){let X;while(typeof(X=qI.call(this,Q))=="string")Q=X;if(X===void 0){let{schemaId:Y}=this.opts,W=new _W.SchemaEnv({schema:{},schemaId:Y});if(X=_W.resolveSchema.call(this,W,Q),!X)return;this.refs[Q]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(Q){if(Q instanceof RegExp)return this._removeAllSchemas(this.schemas,Q),this._removeAllSchemas(this.refs,Q),this;switch(typeof Q){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=qI.call(this,Q);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[Q],delete this.refs[Q],this}case"object":{let X=Q;this._cache.delete(X);let Y=Q[this.opts.schemaId];if(Y)Y=(0,xW.normalizeId)(Y),delete this.schemas[Y],delete this.refs[Y];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Q){for(let X of Q)this.addKeyword(X);return this}addKeyword(Q,X){let Y;if(typeof Q=="string"){if(Y=Q,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=Y}else if(typeof Q=="object"&&X===void 0){if(X=Q,Y=X.keyword,Array.isArray(Y)&&!Y.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Fh.call(this,Y,X),!X)return(0,YU.eachItem)(Y,(G)=>XU.call(this,G)),this;zh.call(this,X);let W={...X,type:(0,p$.getJSONTypes)(X.type),schemaType:(0,p$.getJSONTypes)(X.schemaType)};return(0,YU.eachItem)(Y,W.type.length===0?(G)=>XU.call(this,G,W):(G)=>W.type.forEach((K)=>XU.call(this,G,W,K))),this}getKeyword(Q){let X=this.RULES.all[Q];return typeof X=="object"?X.definition:!!X}removeKeyword(Q){let{RULES:X}=this;delete X.keywords[Q],delete X.all[Q];for(let Y of X.rules){let W=Y.rules.findIndex((G)=>G.keyword===Q);if(W>=0)Y.rules.splice(W,1)}return this}addFormat(Q,X){if(typeof X=="string")X=new RegExp(X);return this.formats[Q]=X,this}errorsText(Q=this.errors,{separator:X=", ",dataVar:Y="data"}={}){if(!Q||Q.length===0)return"No errors";return Q.map((W)=>`${Y}${W.instancePath} ${W.message}`).reduce((W,G)=>W+X+G)}$dataMetaSchema(Q,X){let Y=this.RULES.all;Q=JSON.parse(JSON.stringify(Q));for(let W of X){let G=W.split("/").slice(1),K=Q;for(let Z of G)K=K[Z];for(let Z in Y){let q=Y[Z];if(typeof q!="object")continue;let{$data:E}=q.definition,I=K[Z];if(E&&I)K[Z]=LI(I)}}return Q}_removeAllSchemas(Q,X){for(let Y in Q){let W=Q[Y];if(!X||X.test(Y)){if(typeof W=="string")delete Q[Y];else if(W&&!W.meta)this._cache.delete(W.schema),delete Q[Y]}}}_addSchema(Q,X,Y,W=this.opts.validateSchema,G=this.opts.addUsedSchema){let K,{schemaId:Z}=this.opts;if(typeof Q=="object")K=Q[Z];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Q!="boolean")throw Error("schema must be object or boolean");let q=this._cache.get(Q);if(q!==void 0)return q;Y=(0,xW.normalizeId)(K||Y);let E=xW.getSchemaRefs.call(this,Q,Y);if(q=new _W.SchemaEnv({schema:Q,schemaId:Z,meta:X,baseId:Y,localRefs:E}),this._cache.set(q.schema,q),G&&!Y.startsWith("#")){if(Y)this._checkUnique(Y);this.refs[Y]=q}if(W)this.validateSchema(Q,!0);return q}_checkUnique(Q){if(this.schemas[Q]||this.refs[Q])throw Error(`schema with key or id "${Q}" already exists`)}_compileSchemaEnv(Q){if(Q.meta)this._compileMetaSchema(Q);else _W.compileSchema.call(this,Q);if(!Q.validate)throw Error("ajv implementation error");return Q.validate}_compileMetaSchema(Q){let X=this.opts;this.opts=this._metaOpts;try{_W.compileSchema.call(this,Q)}finally{this.opts=X}}}c$.ValidationError=ib.default;c$.MissingRefError=II.default;bY.default=c$;function DI(Q,X,Y,W="error"){for(let G in Q){let K=G;if(K in X)this.logger[W](`${Y}: option ${G}. ${Q[K]}`)}}function qI(Q){return Q=(0,xW.normalizeId)(Q),this.schemas[Q]||this.refs[Q]}function Wh(){let Q=this.opts.schemas;if(!Q)return;if(Array.isArray(Q))this.addSchema(Q);else for(let X in Q)this.addSchema(Q[X],X)}function Gh(){for(let Q in this.opts.formats){let X=this.opts.formats[Q];if(X)this.addFormat(Q,X)}}function $h(Q){if(Array.isArray(Q)){this.addVocabulary(Q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in Q){let Y=Q[X];if(!Y.keyword)Y.keyword=X;this.addKeyword(Y)}}function Zh(){let Q={...this.opts};for(let X of eb)delete Q[X];return Q}var Hh={log(){},warn(){},error(){}};function Uh(Q){if(Q===!1)return Hh;if(Q===void 0)return console;if(Q.log&&Q.warn&&Q.error)return Q;throw Error("logger must implement log, warn and error methods")}var Kh=/^[a-z_$][a-z0-9_$:-]*$/i;function Fh(Q,X){let{RULES:Y}=this;if((0,YU.eachItem)(Q,(W)=>{if(Y.keywords[W])throw Error(`Keyword ${W} is already defined`);if(!Kh.test(W))throw Error(`Keyword ${W} 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 XU(Q,X,Y){var W;let G=X===null||X===void 0?void 0:X.post;if(Y&&G)throw Error('keyword with "post" flag cannot have "type"');let{RULES:K}=this,Z=G?K.post:K.rules.find(({type:E})=>E===Y);if(!Z)Z={type:Y,rules:[]},K.rules.push(Z);if(K.keywords[Q]=!0,!X)return;let q={keyword:Q,definition:{...X,type:(0,p$.getJSONTypes)(X.type),schemaType:(0,p$.getJSONTypes)(X.schemaType)}};if(X.before)Vh.call(this,Z,q,X.before);else Z.rules.push(q);K.all[Q]=q,(W=X.implements)===null||W===void 0||W.forEach((E)=>this.addKeyword(E))}function Vh(Q,X,Y){let W=Q.rules.findIndex((G)=>G.keyword===Y);if(W>=0)Q.rules.splice(W,0,X);else Q.rules.push(X),this.logger.warn(`rule ${Y} is not defined`)}function zh(Q){let{metaSchema:X}=Q;if(X===void 0)return;if(Q.$data&&this.opts.$data)X=LI(X);Q.validateSchema=this.compile(X,!0)}var Oh={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function LI(Q){return{anyOf:[Q,Oh]}}});var RI=F0((TI)=>{Object.defineProperty(TI,"__esModule",{value:!0});var qh={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};TI.default=qh});var NI=F0((CI)=>{Object.defineProperty(CI,"__esModule",{value:!0});CI.callRef=CI.getValidate=void 0;var Mh=wW(),PI=tX(),fX=a0(),HJ=gY(),BI=u$(),l$=UQ(),Lh={keyword:"$ref",schemaType:"string",code(Q){let{gen:X,schema:Y,it:W}=Q,{baseId:G,schemaEnv:K,validateName:Z,opts:q,self:E}=W,{root:I}=K;if((Y==="#"||Y==="#/")&&G===I.baseId)return D();let L=BI.resolveRef.call(E,I,G,Y);if(L===void 0)throw new Mh.default(W.opts.uriResolver,G,Y);if(L instanceof BI.SchemaEnv)return T(L);return P(L);function D(){if(K===I)return m$(Q,Z,K,K.$async);let B=X.scopeValue("root",{ref:I});return m$(Q,fX._`${B}.validate`,I,I.$async)}function T(B){let j=SI(Q,B);m$(Q,j,B,B.$async)}function P(B){let j=X.scopeValue("schema",q.code.source===!0?{ref:B,code:(0,fX.stringify)(B)}:{ref:B}),S=X.name("valid"),N=Q.subschema({schema:B,dataTypes:[],schemaPath:fX.nil,topSchemaRef:j,errSchemaPath:Y},S);Q.mergeEvaluated(N),Q.ok(S)}}};function SI(Q,X){let{gen:Y}=Q;return X.validate?Y.scopeValue("validate",{ref:X.validate}):fX._`${Y.scopeValue("wrapper",{ref:X})}.validate`}CI.getValidate=SI;function m$(Q,X,Y,W){let{gen:G,it:K}=Q,{allErrors:Z,schemaEnv:q,opts:E}=K,I=E.passContext?HJ.default.this:fX.nil;if(W)L();else D();function L(){if(!q.$async)throw Error("async schema referenced by sync schema");let B=G.let("valid");G.try(()=>{if(G.code(fX._`await ${(0,PI.callValidateCode)(Q,X,I)}`),P(X),!Z)G.assign(B,!0)},(j)=>{if(G.if(fX._`!(${j} instanceof ${K.ValidationError})`,()=>G.throw(j)),T(j),!Z)G.assign(B,!1)}),Q.ok(B)}function D(){Q.result((0,PI.callValidateCode)(Q,X,I),()=>P(X),()=>T(X))}function T(B){let j=fX._`${B}.errors`;G.assign(HJ.default.vErrors,fX._`${HJ.default.vErrors} === null ? ${j} : ${HJ.default.vErrors}.concat(${j})`),G.assign(HJ.default.errors,fX._`${HJ.default.vErrors}.length`)}function P(B){var j;if(!K.opts.unevaluated)return;let S=(j=Y===null||Y===void 0?void 0:Y.validate)===null||j===void 0?void 0:j.evaluated;if(K.props!==!0)if(S&&!S.dynamicProps){if(S.props!==void 0)K.props=l$.mergeEvaluated.props(G,S.props,K.props)}else{let N=G.var("props",fX._`${B}.evaluated.props`);K.props=l$.mergeEvaluated.props(G,N,K.props,fX.Name)}if(K.items!==!0)if(S&&!S.dynamicItems){if(S.items!==void 0)K.items=l$.mergeEvaluated.items(G,S.items,K.items)}else{let N=G.var("items",fX._`${B}.evaluated.items`);K.items=l$.mergeEvaluated.items(G,N,K.items,fX.Name)}}}CI.callRef=m$;CI.default=Lh});var wI=F0((kI)=>{Object.defineProperty(kI,"__esModule",{value:!0});var Rh=RI(),Ph=NI(),Bh=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Rh.default,Ph.default];kI.default=Bh});var _I=F0((vI)=>{Object.defineProperty(vI,"__esModule",{value:!0});var d$=a0(),Z1=d$.operators,n$={maximum:{okStr:"<=",ok:Z1.LTE,fail:Z1.GT},minimum:{okStr:">=",ok:Z1.GTE,fail:Z1.LT},exclusiveMaximum:{okStr:"<",ok:Z1.LT,fail:Z1.GTE},exclusiveMinimum:{okStr:">",ok:Z1.GT,fail:Z1.LTE}},Ch={message:({keyword:Q,schemaCode:X})=>d$.str`must be ${n$[Q].okStr} ${X}`,params:({keyword:Q,schemaCode:X})=>d$._`{comparison: ${n$[Q].okStr}, limit: ${X}}`},jh={keyword:Object.keys(n$),type:"number",schemaType:"number",$data:!0,error:Ch,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q;Q.fail$data(d$._`${Y} ${n$[X].fail} ${W} || isNaN(${Y})`)}};vI.default=jh});var yI=F0((xI)=>{Object.defineProperty(xI,"__esModule",{value:!0});var yW=a0(),kh={message:({schemaCode:Q})=>yW.str`must be multiple of ${Q}`,params:({schemaCode:Q})=>yW._`{multipleOf: ${Q}}`},wh={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:kh,code(Q){let{gen:X,data:Y,schemaCode:W,it:G}=Q,K=G.opts.multipleOfPrecision,Z=X.let("res"),q=K?yW._`Math.abs(Math.round(${Z}) - ${Z}) > 1e-${K}`:yW._`${Z} !== parseInt(${Z})`;Q.fail$data(yW._`(${W} === 0 || (${Z} = ${Y}/${W}, ${q}))`)}};xI.default=wh});var bI=F0((fI)=>{Object.defineProperty(fI,"__esModule",{value:!0});function gI(Q){let X=Q.length,Y=0,W=0,G;while(W<X)if(Y++,G=Q.charCodeAt(W++),G>=55296&&G<=56319&&W<X){if(G=Q.charCodeAt(W),(G&64512)===56320)W++}return Y}fI.default=gI;gI.code='require("ajv/dist/runtime/ucs2length").default'});var uI=F0((hI)=>{Object.defineProperty(hI,"__esModule",{value:!0});var N1=a0(),xh=UQ(),yh=bI(),gh={message({keyword:Q,schemaCode:X}){let Y=Q==="maxLength"?"more":"fewer";return N1.str`must NOT have ${Y} than ${X} characters`},params:({schemaCode:Q})=>N1._`{limit: ${Q}}`},fh={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:gh,code(Q){let{keyword:X,data:Y,schemaCode:W,it:G}=Q,K=X==="maxLength"?N1.operators.GT:N1.operators.LT,Z=G.opts.unicode===!1?N1._`${Y}.length`:N1._`${(0,xh.useFunc)(Q.gen,yh.default)}(${Y})`;Q.fail$data(N1._`${Z} ${K} ${W}`)}};hI.default=fh});var cI=F0((pI)=>{Object.defineProperty(pI,"__esModule",{value:!0});var hh=tX(),o$=a0(),uh={message:({schemaCode:Q})=>o$.str`must match pattern "${Q}"`,params:({schemaCode:Q})=>o$._`{pattern: ${Q}}`},ph={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:uh,code(Q){let{data:X,$data:Y,schema:W,schemaCode:G,it:K}=Q,Z=K.opts.unicodeRegExp?"u":"",q=Y?o$._`(new RegExp(${G}, ${Z}))`:(0,hh.usePattern)(Q,W);Q.fail$data(o$._`!${q}.test(${X})`)}};pI.default=ph});var mI=F0((lI)=>{Object.defineProperty(lI,"__esModule",{value:!0});var gW=a0(),lh={message({keyword:Q,schemaCode:X}){let Y=Q==="maxProperties"?"more":"fewer";return gW.str`must NOT have ${Y} than ${X} properties`},params:({schemaCode:Q})=>gW._`{limit: ${Q}}`},mh={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:lh,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxProperties"?gW.operators.GT:gW.operators.LT;Q.fail$data(gW._`Object.keys(${Y}).length ${G} ${W}`)}};lI.default=mh});var nI=F0((dI)=>{Object.defineProperty(dI,"__esModule",{value:!0});var fW=tX(),bW=a0(),nh=UQ(),oh={message:({params:{missingProperty:Q}})=>bW.str`must have required property '${Q}'`,params:({params:{missingProperty:Q}})=>bW._`{missingProperty: ${Q}}`},rh={keyword:"required",type:"object",schemaType:"array",$data:!0,error:oh,code(Q){let{gen:X,schema:Y,schemaCode:W,data:G,$data:K,it:Z}=Q,{opts:q}=Z;if(!K&&Y.length===0)return;let E=Y.length>=q.loopRequired;if(Z.allErrors)I();else L();if(q.strictRequired){let P=Q.parentSchema.properties,{definedProperties:B}=Q.it;for(let j of Y)if((P===null||P===void 0?void 0:P[j])===void 0&&!B.has(j)){let S=Z.schemaEnv.baseId+Z.errSchemaPath,N=`required property "${j}" is not defined at "${S}" (strictRequired)`;(0,nh.checkStrictMode)(Z,N,Z.opts.strictRequired)}}function I(){if(E||K)Q.block$data(bW.nil,D);else for(let P of Y)(0,fW.checkReportMissingProp)(Q,P)}function L(){let P=X.let("missing");if(E||K){let B=X.let("valid",!0);Q.block$data(B,()=>T(P,B)),Q.ok(B)}else X.if((0,fW.checkMissingProp)(Q,Y,P)),(0,fW.reportMissingProp)(Q,P),X.else()}function D(){X.forOf("prop",W,(P)=>{Q.setParams({missingProperty:P}),X.if((0,fW.noPropertyInData)(X,G,P,q.ownProperties),()=>Q.error())})}function T(P,B){Q.setParams({missingProperty:P}),X.forOf(P,W,()=>{X.assign(B,(0,fW.propertyInData)(X,G,P,q.ownProperties)),X.if((0,bW.not)(B),()=>{Q.error(),X.break()})},bW.nil)}}};dI.default=rh});var rI=F0((oI)=>{Object.defineProperty(oI,"__esModule",{value:!0});var hW=a0(),th={message({keyword:Q,schemaCode:X}){let Y=Q==="maxItems"?"more":"fewer";return hW.str`must NOT have ${Y} than ${X} items`},params:({schemaCode:Q})=>hW._`{limit: ${Q}}`},sh={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:th,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxItems"?hW.operators.GT:hW.operators.LT;Q.fail$data(hW._`${Y}.length ${G} ${W}`)}};oI.default=sh});var r$=F0((tI)=>{Object.defineProperty(tI,"__esModule",{value:!0});var iI=WW();iI.code='require("ajv/dist/runtime/equal").default';tI.default=iI});var aI=F0((sI)=>{Object.defineProperty(sI,"__esModule",{value:!0});var JU=SW(),zX=a0(),Qu=UQ(),Xu=r$(),Yu={message:({params:{i:Q,j:X}})=>zX.str`must NOT have duplicate items (items ## ${X} and ${Q} are identical)`,params:({params:{i:Q,j:X}})=>zX._`{i: ${Q}, j: ${X}}`},Ju={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Yu,code(Q){let{gen:X,data:Y,$data:W,schema:G,parentSchema:K,schemaCode:Z,it:q}=Q;if(!W&&!G)return;let E=X.let("valid"),I=K.items?(0,JU.getSchemaTypes)(K.items):[];Q.block$data(E,L,zX._`${Z} === false`),Q.ok(E);function L(){let B=X.let("i",zX._`${Y}.length`),j=X.let("j");Q.setParams({i:B,j}),X.assign(E,!0),X.if(zX._`${B} > 1`,()=>(D()?T:P)(B,j))}function D(){return I.length>0&&!I.some((B)=>B==="object"||B==="array")}function T(B,j){let S=X.name("item"),N=(0,JU.checkDataTypes)(I,S,q.opts.strictNumbers,JU.DataType.Wrong),k=X.const("indices",zX._`{}`);X.for(zX._`;${B}--;`,()=>{if(X.let(S,zX._`${Y}[${B}]`),X.if(N,zX._`continue`),I.length>1)X.if(zX._`typeof ${S} == "string"`,zX._`${S} += "_"`);X.if(zX._`typeof ${k}[${S}] == "number"`,()=>{X.assign(j,zX._`${k}[${S}]`),Q.error(),X.assign(E,!1).break()}).code(zX._`${k}[${S}] = ${B}`)})}function P(B,j){let S=(0,Qu.useFunc)(X,Xu.default),N=X.name("outer");X.label(N).for(zX._`;${B}--;`,()=>X.for(zX._`${j} = ${B}; ${j}--;`,()=>X.if(zX._`${S}(${Y}[${B}], ${Y}[${j}])`,()=>{Q.error(),X.assign(E,!1).break(N)})))}}};sI.default=Ju});var QM=F0((eI)=>{Object.defineProperty(eI,"__esModule",{value:!0});var WU=a0(),Gu=UQ(),$u=r$(),Zu={message:"must be equal to constant",params:({schemaCode:Q})=>WU._`{allowedValue: ${Q}}`},Hu={keyword:"const",$data:!0,error:Zu,code(Q){let{gen:X,data:Y,$data:W,schemaCode:G,schema:K}=Q;if(W||K&&typeof K=="object")Q.fail$data(WU._`!${(0,Gu.useFunc)(X,$u.default)}(${Y}, ${G})`);else Q.fail(WU._`${K} !== ${Y}`)}};eI.default=Hu});var YM=F0((XM)=>{Object.defineProperty(XM,"__esModule",{value:!0});var uW=a0(),Ku=UQ(),Fu=r$(),Vu={message:"must be equal to one of the allowed values",params:({schemaCode:Q})=>uW._`{allowedValues: ${Q}}`},zu={keyword:"enum",schemaType:"array",$data:!0,error:Vu,code(Q){let{gen:X,data:Y,$data:W,schema:G,schemaCode:K,it:Z}=Q;if(!W&&G.length===0)throw Error("enum must have non-empty array");let q=G.length>=Z.opts.loopEnum,E,I=()=>E!==null&&E!==void 0?E:E=(0,Ku.useFunc)(X,Fu.default),L;if(q||W)L=X.let("valid"),Q.block$data(L,D);else{if(!Array.isArray(G))throw Error("ajv implementation error");let P=X.const("vSchema",K);L=(0,uW.or)(...G.map((B,j)=>T(P,j)))}Q.pass(L);function D(){X.assign(L,!1),X.forOf("v",K,(P)=>X.if(uW._`${I()}(${Y}, ${P})`,()=>X.assign(L,!0).break()))}function T(P,B){let j=G[B];return typeof j==="object"&&j!==null?uW._`${I()}(${Y}, ${P}[${B}])`:uW._`${Y} === ${j}`}}};XM.default=zu});var WM=F0((JM)=>{Object.defineProperty(JM,"__esModule",{value:!0});var Au=_I(),Du=yI(),qu=uI(),Iu=cI(),Mu=mI(),Lu=nI(),Eu=rI(),Tu=aI(),Ru=QM(),Pu=YM(),Bu=[Au.default,Du.default,qu.default,Iu.default,Mu.default,Lu.default,Eu.default,Tu.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ru.default,Pu.default];JM.default=Bu});var $U=F0(($M)=>{Object.defineProperty($M,"__esModule",{value:!0});$M.validateAdditionalItems=void 0;var k1=a0(),GU=UQ(),Cu={message:({params:{len:Q}})=>k1.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>k1._`{limit: ${Q}}`},ju={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Cu,code(Q){let{parentSchema:X,it:Y}=Q,{items:W}=X;if(!Array.isArray(W)){(0,GU.checkStrictMode)(Y,'"additionalItems" is ignored when "items" is not an array of schemas');return}GM(Q,W)}};function GM(Q,X){let{gen:Y,schema:W,data:G,keyword:K,it:Z}=Q;Z.items=!0;let q=Y.const("len",k1._`${G}.length`);if(W===!1)Q.setParams({len:X.length}),Q.pass(k1._`${q} <= ${X.length}`);else if(typeof W=="object"&&!(0,GU.alwaysValidSchema)(Z,W)){let I=Y.var("valid",k1._`${q} <= ${X.length}`);Y.if((0,k1.not)(I),()=>E(I)),Q.ok(I)}function E(I){Y.forRange("i",X.length,q,(L)=>{if(Q.subschema({keyword:K,dataProp:L,dataPropType:GU.Type.Num},I),!Z.allErrors)Y.if((0,k1.not)(I),()=>Y.break())})}}$M.validateAdditionalItems=GM;$M.default=ju});var ZU=F0((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});KM.validateTuple=void 0;var HM=a0(),i$=UQ(),ku=tX(),wu={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Q){let{schema:X,it:Y}=Q;if(Array.isArray(X))return UM(Q,"additionalItems",X);if(Y.items=!0,(0,i$.alwaysValidSchema)(Y,X))return;Q.ok((0,ku.validateArray)(Q))}};function UM(Q,X,Y=Q.schema){let{gen:W,parentSchema:G,data:K,keyword:Z,it:q}=Q;if(L(G),q.opts.unevaluated&&Y.length&&q.items!==!0)q.items=i$.mergeEvaluated.items(W,Y.length,q.items);let E=W.name("valid"),I=W.const("len",HM._`${K}.length`);Y.forEach((D,T)=>{if((0,i$.alwaysValidSchema)(q,D))return;W.if(HM._`${I} > ${T}`,()=>Q.subschema({keyword:Z,schemaProp:T,dataProp:T},E)),Q.ok(E)});function L(D){let{opts:T,errSchemaPath:P}=q,B=Y.length,j=B===D.minItems&&(B===D.maxItems||D[X]===!1);if(T.strictTuples&&!j){let S=`"${Z}" is ${B}-tuple, but minItems or maxItems/${X} are not specified or different at path "${P}"`;(0,i$.checkStrictMode)(q,S,T.strictTuples)}}}KM.validateTuple=UM;KM.default=wu});var zM=F0((VM)=>{Object.defineProperty(VM,"__esModule",{value:!0});var _u=ZU(),xu={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Q)=>(0,_u.validateTuple)(Q,"items")};VM.default=xu});var DM=F0((AM)=>{Object.defineProperty(AM,"__esModule",{value:!0});var OM=a0(),gu=UQ(),fu=tX(),bu=$U(),hu={message:({params:{len:Q}})=>OM.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>OM._`{limit: ${Q}}`},uu={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:hu,code(Q){let{schema:X,parentSchema:Y,it:W}=Q,{prefixItems:G}=Y;if(W.items=!0,(0,gu.alwaysValidSchema)(W,X))return;if(G)(0,bu.validateAdditionalItems)(Q,G);else Q.ok((0,fu.validateArray)(Q))}};AM.default=uu});var IM=F0((qM)=>{Object.defineProperty(qM,"__esModule",{value:!0});var sX=a0(),t$=UQ(),cu={message:({params:{min:Q,max:X}})=>X===void 0?sX.str`must contain at least ${Q} valid item(s)`:sX.str`must contain at least ${Q} and no more than ${X} valid item(s)`,params:({params:{min:Q,max:X}})=>X===void 0?sX._`{minContains: ${Q}}`:sX._`{minContains: ${Q}, maxContains: ${X}}`},lu={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:cu,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:K}=Q,Z,q,{minContains:E,maxContains:I}=W;if(K.opts.next)Z=E===void 0?1:E,q=I;else Z=1;let L=X.const("len",sX._`${G}.length`);if(Q.setParams({min:Z,max:q}),q===void 0&&Z===0){(0,t$.checkStrictMode)(K,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(q!==void 0&&Z>q){(0,t$.checkStrictMode)(K,'"minContains" > "maxContains" is always invalid'),Q.fail();return}if((0,t$.alwaysValidSchema)(K,Y)){let j=sX._`${L} >= ${Z}`;if(q!==void 0)j=sX._`${j} && ${L} <= ${q}`;Q.pass(j);return}K.items=!0;let D=X.name("valid");if(q===void 0&&Z===1)P(D,()=>X.if(D,()=>X.break()));else if(Z===0){if(X.let(D,!0),q!==void 0)X.if(sX._`${G}.length > 0`,T)}else X.let(D,!1),T();Q.result(D,()=>Q.reset());function T(){let j=X.name("_valid"),S=X.let("count",0);P(j,()=>X.if(j,()=>B(S)))}function P(j,S){X.forRange("i",0,L,(N)=>{Q.subschema({keyword:"contains",dataProp:N,dataPropType:t$.Type.Num,compositeRule:!0},j),S()})}function B(j){if(X.code(sX._`${j}++`),q===void 0)X.if(sX._`${j} >= ${Z}`,()=>X.assign(D,!0).break());else if(X.if(sX._`${j} > ${q}`,()=>X.assign(D,!1).break()),Z===1)X.assign(D,!0);else X.if(sX._`${j} >= ${Z}`,()=>X.assign(D,!0))}}};qM.default=lu});var PM=F0((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});EM.validateSchemaDeps=EM.validatePropertyDeps=EM.error=void 0;var HU=a0(),du=UQ(),pW=tX();EM.error={message:({params:{property:Q,depsCount:X,deps:Y}})=>{let W=X===1?"property":"properties";return HU.str`must have ${W} ${Y} when property ${Q} is present`},params:({params:{property:Q,depsCount:X,deps:Y,missingProperty:W}})=>HU._`{property: ${Q},
|
|
28
|
+
missingProperty: ${W},
|
|
29
|
+
depsCount: ${X},
|
|
30
|
+
deps: ${Y}}`};var nu={keyword:"dependencies",type:"object",schemaType:"object",error:EM.error,code(Q){let[X,Y]=ou(Q);MM(Q,X),LM(Q,Y)}};function ou({schema:Q}){let X={},Y={};for(let W in Q){if(W==="__proto__")continue;let G=Array.isArray(Q[W])?X:Y;G[W]=Q[W]}return[X,Y]}function MM(Q,X=Q.schema){let{gen:Y,data:W,it:G}=Q;if(Object.keys(X).length===0)return;let K=Y.let("missing");for(let Z in X){let q=X[Z];if(q.length===0)continue;let E=(0,pW.propertyInData)(Y,W,Z,G.opts.ownProperties);if(Q.setParams({property:Z,depsCount:q.length,deps:q.join(", ")}),G.allErrors)Y.if(E,()=>{for(let I of q)(0,pW.checkReportMissingProp)(Q,I)});else Y.if(HU._`${E} && (${(0,pW.checkMissingProp)(Q,q,K)})`),(0,pW.reportMissingProp)(Q,K),Y.else()}}EM.validatePropertyDeps=MM;function LM(Q,X=Q.schema){let{gen:Y,data:W,keyword:G,it:K}=Q,Z=Y.name("valid");for(let q in X){if((0,du.alwaysValidSchema)(K,X[q]))continue;Y.if((0,pW.propertyInData)(Y,W,q,K.opts.ownProperties),()=>{let E=Q.subschema({keyword:G,schemaProp:q},Z);Q.mergeValidEvaluated(E,Z)},()=>Y.var(Z,!0)),Q.ok(Z)}}EM.validateSchemaDeps=LM;EM.default=nu});var CM=F0((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});var BM=a0(),tu=UQ(),su={message:"property name must be valid",params:({params:Q})=>BM._`{propertyName: ${Q.propertyName}}`},au={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:su,code(Q){let{gen:X,schema:Y,data:W,it:G}=Q;if((0,tu.alwaysValidSchema)(G,Y))return;let K=X.name("valid");X.forIn("key",W,(Z)=>{Q.setParams({propertyName:Z}),Q.subschema({keyword:"propertyNames",data:Z,dataTypes:["string"],propertyName:Z,compositeRule:!0},K),X.if((0,BM.not)(K),()=>{if(Q.error(!0),!G.allErrors)X.break()})}),Q.ok(K)}};SM.default=au});var UU=F0((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});var s$=tX(),FY=a0(),Qp=gY(),a$=UQ(),Xp={message:"must NOT have additional properties",params:({params:Q})=>FY._`{additionalProperty: ${Q.additionalProperty}}`},Yp={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Xp,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,errsCount:K,it:Z}=Q;if(!K)throw Error("ajv implementation error");let{allErrors:q,opts:E}=Z;if(Z.props=!0,E.removeAdditional!=="all"&&(0,a$.alwaysValidSchema)(Z,Y))return;let I=(0,s$.allSchemaProperties)(W.properties),L=(0,s$.allSchemaProperties)(W.patternProperties);D(),Q.ok(FY._`${K} === ${Qp.default.errors}`);function D(){X.forIn("key",G,(S)=>{if(!I.length&&!L.length)B(S);else X.if(T(S),()=>B(S))})}function T(S){let N;if(I.length>8){let k=(0,a$.schemaRefOrVal)(Z,W.properties,"properties");N=(0,s$.isOwnProperty)(X,k,S)}else if(I.length)N=(0,FY.or)(...I.map((k)=>FY._`${S} === ${k}`));else N=FY.nil;if(L.length)N=(0,FY.or)(N,...L.map((k)=>FY._`${(0,s$.usePattern)(Q,k)}.test(${S})`));return(0,FY.not)(N)}function P(S){X.code(FY._`delete ${G}[${S}]`)}function B(S){if(E.removeAdditional==="all"||E.removeAdditional&&Y===!1){P(S);return}if(Y===!1){if(Q.setParams({additionalProperty:S}),Q.error(),!q)X.break();return}if(typeof Y=="object"&&!(0,a$.alwaysValidSchema)(Z,Y)){let N=X.name("valid");if(E.removeAdditional==="failing")j(S,N,!1),X.if((0,FY.not)(N),()=>{Q.reset(),P(S)});else if(j(S,N),!q)X.if((0,FY.not)(N),()=>X.break())}}function j(S,N,k){let v={keyword:"additionalProperties",dataProp:S,dataPropType:a$.Type.Str};if(k===!1)Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1});Q.subschema(v,N)}}};jM.default=Yp});var vM=F0((wM)=>{Object.defineProperty(wM,"__esModule",{value:!0});var Wp=kW(),NM=tX(),KU=UQ(),kM=UU(),Gp={keyword:"properties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:K}=Q;if(K.opts.removeAdditional==="all"&&W.additionalProperties===void 0)kM.default.code(new Wp.KeywordCxt(K,kM.default,"additionalProperties"));let Z=(0,NM.allSchemaProperties)(Y);for(let D of Z)K.definedProperties.add(D);if(K.opts.unevaluated&&Z.length&&K.props!==!0)K.props=KU.mergeEvaluated.props(X,(0,KU.toHash)(Z),K.props);let q=Z.filter((D)=>!(0,KU.alwaysValidSchema)(K,Y[D]));if(q.length===0)return;let E=X.name("valid");for(let D of q){if(I(D))L(D);else{if(X.if((0,NM.propertyInData)(X,G,D,K.opts.ownProperties)),L(D),!K.allErrors)X.else().var(E,!0);X.endIf()}Q.it.definedProperties.add(D),Q.ok(E)}function I(D){return K.opts.useDefaults&&!K.compositeRule&&Y[D].default!==void 0}function L(D){Q.subschema({keyword:"properties",schemaProp:D,dataProp:D},E)}}};wM.default=Gp});var fM=F0((gM)=>{Object.defineProperty(gM,"__esModule",{value:!0});var _M=tX(),e$=a0(),xM=UQ(),yM=UQ(),Zp={keyword:"patternProperties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,data:W,parentSchema:G,it:K}=Q,{opts:Z}=K,q=(0,_M.allSchemaProperties)(Y),E=q.filter((j)=>(0,xM.alwaysValidSchema)(K,Y[j]));if(q.length===0||E.length===q.length&&(!K.opts.unevaluated||K.props===!0))return;let I=Z.strictSchema&&!Z.allowMatchingProperties&&G.properties,L=X.name("valid");if(K.props!==!0&&!(K.props instanceof e$.Name))K.props=(0,yM.evaluatedPropsToName)(X,K.props);let{props:D}=K;T();function T(){for(let j of q){if(I)P(j);if(K.allErrors)B(j);else X.var(L,!0),B(j),X.if(L)}}function P(j){for(let S in I)if(new RegExp(j).test(S))(0,xM.checkStrictMode)(K,`property ${S} matches pattern ${j} (use allowMatchingProperties)`)}function B(j){X.forIn("key",W,(S)=>{X.if(e$._`${(0,_M.usePattern)(Q,j)}.test(${S})`,()=>{let N=E.includes(j);if(!N)Q.subschema({keyword:"patternProperties",schemaProp:j,dataProp:S,dataPropType:yM.Type.Str},L);if(K.opts.unevaluated&&D!==!0)X.assign(e$._`${D}[${S}]`,!0);else if(!N&&!K.allErrors)X.if((0,e$.not)(L),()=>X.break())})})}}};gM.default=Zp});var hM=F0((bM)=>{Object.defineProperty(bM,"__esModule",{value:!0});var Up=UQ(),Kp={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Q){let{gen:X,schema:Y,it:W}=Q;if((0,Up.alwaysValidSchema)(W,Y)){Q.fail();return}let G=X.name("valid");Q.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},G),Q.failResult(G,()=>Q.reset(),()=>Q.error())},error:{message:"must NOT be valid"}};bM.default=Kp});var pM=F0((uM)=>{Object.defineProperty(uM,"__esModule",{value:!0});var Vp=tX(),zp={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Vp.validateUnion,error:{message:"must match a schema in anyOf"}};uM.default=zp});var lM=F0((cM)=>{Object.defineProperty(cM,"__esModule",{value:!0});var QZ=a0(),Ap=UQ(),Dp={message:"must match exactly one schema in oneOf",params:({params:Q})=>QZ._`{passingSchemas: ${Q.passing}}`},qp={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Dp,code(Q){let{gen:X,schema:Y,parentSchema:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(G.opts.discriminator&&W.discriminator)return;let K=Y,Z=X.let("valid",!1),q=X.let("passing",null),E=X.name("_valid");Q.setParams({passing:q}),X.block(I),Q.result(Z,()=>Q.reset(),()=>Q.error(!0));function I(){K.forEach((L,D)=>{let T;if((0,Ap.alwaysValidSchema)(G,L))X.var(E,!0);else T=Q.subschema({keyword:"oneOf",schemaProp:D,compositeRule:!0},E);if(D>0)X.if(QZ._`${E} && ${Z}`).assign(Z,!1).assign(q,QZ._`[${q}, ${D}]`).else();X.if(E,()=>{if(X.assign(Z,!0),X.assign(q,D),T)Q.mergeEvaluated(T,QZ.Name)})})}}};cM.default=qp});var dM=F0((mM)=>{Object.defineProperty(mM,"__esModule",{value:!0});var Mp=UQ(),Lp={keyword:"allOf",schemaType:"array",code(Q){let{gen:X,schema:Y,it:W}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");let G=X.name("valid");Y.forEach((K,Z)=>{if((0,Mp.alwaysValidSchema)(W,K))return;let q=Q.subschema({keyword:"allOf",schemaProp:Z},G);Q.ok(G),Q.mergeEvaluated(q)})}};mM.default=Lp});var iM=F0((rM)=>{Object.defineProperty(rM,"__esModule",{value:!0});var XZ=a0(),oM=UQ(),Tp={message:({params:Q})=>XZ.str`must match "${Q.ifClause}" schema`,params:({params:Q})=>XZ._`{failingKeyword: ${Q.ifClause}}`},Rp={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Tp,code(Q){let{gen:X,parentSchema:Y,it:W}=Q;if(Y.then===void 0&&Y.else===void 0)(0,oM.checkStrictMode)(W,'"if" without "then" and "else" is ignored');let G=nM(W,"then"),K=nM(W,"else");if(!G&&!K)return;let Z=X.let("valid",!0),q=X.name("_valid");if(E(),Q.reset(),G&&K){let L=X.let("ifClause");Q.setParams({ifClause:L}),X.if(q,I("then",L),I("else",L))}else if(G)X.if(q,I("then"));else X.if((0,XZ.not)(q),I("else"));Q.pass(Z,()=>Q.error(!0));function E(){let L=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},q);Q.mergeEvaluated(L)}function I(L,D){return()=>{let T=Q.subschema({keyword:L},q);if(X.assign(Z,q),Q.mergeValidEvaluated(T,Z),D)X.assign(D,XZ._`${L}`);else Q.setParams({ifClause:L})}}}};function nM(Q,X){let Y=Q.schema[X];return Y!==void 0&&!(0,oM.alwaysValidSchema)(Q,Y)}rM.default=Rp});var sM=F0((tM)=>{Object.defineProperty(tM,"__esModule",{value:!0});var Bp=UQ(),Sp={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Q,parentSchema:X,it:Y}){if(X.if===void 0)(0,Bp.checkStrictMode)(Y,`"${Q}" without "if" is ignored`)}};tM.default=Sp});var eM=F0((aM)=>{Object.defineProperty(aM,"__esModule",{value:!0});var jp=$U(),Np=zM(),kp=ZU(),wp=DM(),vp=IM(),_p=PM(),xp=CM(),yp=UU(),gp=vM(),fp=fM(),bp=hM(),hp=pM(),up=lM(),pp=dM(),cp=iM(),lp=sM();function mp(Q=!1){let X=[bp.default,hp.default,up.default,pp.default,cp.default,lp.default,xp.default,yp.default,_p.default,gp.default,fp.default];if(Q)X.push(Np.default,wp.default);else X.push(jp.default,kp.default);return X.push(vp.default),X}aM.default=mp});var XL=F0((QL)=>{Object.defineProperty(QL,"__esModule",{value:!0});var fQ=a0(),np={message:({schemaCode:Q})=>fQ.str`must match format "${Q}"`,params:({schemaCode:Q})=>fQ._`{format: ${Q}}`},op={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:np,code(Q,X){let{gen:Y,data:W,$data:G,schema:K,schemaCode:Z,it:q}=Q,{opts:E,errSchemaPath:I,schemaEnv:L,self:D}=q;if(!E.validateFormats)return;if(G)T();else P();function T(){let B=Y.scopeValue("formats",{ref:D.formats,code:E.code.formats}),j=Y.const("fDef",fQ._`${B}[${Z}]`),S=Y.let("fType"),N=Y.let("format");Y.if(fQ._`typeof ${j} == "object" && !(${j} instanceof RegExp)`,()=>Y.assign(S,fQ._`${j}.type || "string"`).assign(N,fQ._`${j}.validate`),()=>Y.assign(S,fQ._`"string"`).assign(N,j)),Q.fail$data((0,fQ.or)(k(),v()));function k(){if(E.strictSchema===!1)return fQ.nil;return fQ._`${Z} && !${N}`}function v(){let _=L.$async?fQ._`(${j}.async ? await ${N}(${W}) : ${N}(${W}))`:fQ._`${N}(${W})`,x=fQ._`(typeof ${N} == "function" ? ${_} : ${N}.test(${W}))`;return fQ._`${N} && ${N} !== true && ${S} === ${X} && !${x}`}}function P(){let B=D.formats[K];if(!B){k();return}if(B===!0)return;let[j,S,N]=v(B);if(j===X)Q.pass(_());function k(){if(E.strictSchema===!1){D.logger.warn(x());return}throw Error(x());function x(){return`unknown format "${K}" ignored in schema at path "${I}"`}}function v(x){let c=x instanceof RegExp?(0,fQ.regexpCode)(x):E.code.formats?fQ._`${E.code.formats}${(0,fQ.getProperty)(K)}`:void 0,Y0=Y.scopeValue("formats",{key:K,ref:x,code:c});if(typeof x=="object"&&!(x instanceof RegExp))return[x.type||"string",x.validate,fQ._`${Y0}.validate`];return["string",x,Y0]}function _(){if(typeof B=="object"&&!(B instanceof RegExp)&&B.async){if(!L.$async)throw Error("async format in sync schema");return fQ._`await ${N}(${W})`}return typeof S=="function"?fQ._`${N}(${W})`:fQ._`${N}.test(${W})`}}}};QL.default=op});var JL=F0((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});var ip=XL(),tp=[ip.default];YL.default=tp});var $L=F0((WL)=>{Object.defineProperty(WL,"__esModule",{value:!0});WL.contentVocabulary=WL.metadataVocabulary=void 0;WL.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];WL.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var UL=F0((HL)=>{Object.defineProperty(HL,"__esModule",{value:!0});var ep=wI(),Qc=WM(),Xc=eM(),Yc=JL(),ZL=$L(),Jc=[ep.default,Qc.default,(0,Xc.default)(),Yc.default,ZL.metadataVocabulary,ZL.contentVocabulary];HL.default=Jc});var zL=F0((FL)=>{Object.defineProperty(FL,"__esModule",{value:!0});FL.DiscrError=void 0;var KL;(function(Q){Q.Tag="tag",Q.Mapping="mapping"})(KL||(FL.DiscrError=KL={}))});var DL=F0((AL)=>{Object.defineProperty(AL,"__esModule",{value:!0});var UJ=a0(),FU=zL(),OL=u$(),Gc=wW(),$c=UQ(),Zc={message:({params:{discrError:Q,tagName:X}})=>Q===FU.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:Q,tag:X,tagName:Y}})=>UJ._`{error: ${Q}, tag: ${Y}, tagValue: ${X}}`},Hc={keyword:"discriminator",type:"object",schemaType:"object",error:Zc,code(Q){let{gen:X,data:Y,schema:W,parentSchema:G,it:K}=Q,{oneOf:Z}=G;if(!K.opts.discriminator)throw Error("discriminator: requires discriminator option");let q=W.propertyName;if(typeof q!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!Z)throw Error("discriminator: requires oneOf keyword");let E=X.let("valid",!1),I=X.const("tag",UJ._`${Y}${(0,UJ.getProperty)(q)}`);X.if(UJ._`typeof ${I} == "string"`,()=>L(),()=>Q.error(!1,{discrError:FU.DiscrError.Tag,tag:I,tagName:q})),Q.ok(E);function L(){let P=T();X.if(!1);for(let B in P)X.elseIf(UJ._`${I} === ${B}`),X.assign(E,D(P[B]));X.else(),Q.error(!1,{discrError:FU.DiscrError.Mapping,tag:I,tagName:q}),X.endIf()}function D(P){let B=X.name("valid"),j=Q.subschema({keyword:"oneOf",schemaProp:P},B);return Q.mergeEvaluated(j,UJ.Name),B}function T(){var P;let B={},j=N(G),S=!0;for(let _=0;_<Z.length;_++){let x=Z[_];if((x===null||x===void 0?void 0:x.$ref)&&!(0,$c.schemaHasRulesButRef)(x,K.self.RULES)){let Y0=x.$ref;if(x=OL.resolveRef.call(K.self,K.schemaEnv.root,K.baseId,Y0),x instanceof OL.SchemaEnv)x=x.schema;if(x===void 0)throw new Gc.default(K.opts.uriResolver,K.baseId,Y0)}let c=(P=x===null||x===void 0?void 0:x.properties)===null||P===void 0?void 0:P[q];if(typeof c!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${q}"`);S=S&&(j||N(x)),k(c,_)}if(!S)throw Error(`discriminator: "${q}" must be required`);return B;function N({required:_}){return Array.isArray(_)&&_.includes(q)}function k(_,x){if(_.const)v(_.const,x);else if(_.enum)for(let c of _.enum)v(c,x);else throw Error(`discriminator: "properties/${q}" must have "const" or "enum"`)}function v(_,x){if(typeof _!="string"||_ in B)throw Error(`discriminator: "${q}" values must be unique strings`);B[_]=x}}}};AL.default=Hc});var qL=F0((uX0,Kc)=>{Kc.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 ML=F0((bX,VU)=>{Object.defineProperty(bX,"__esModule",{value:!0});bX.MissingRefError=bX.ValidationError=bX.CodeGen=bX.Name=bX.nil=bX.stringify=bX.str=bX._=bX.KeywordCxt=bX.Ajv=void 0;var Fc=EI(),Vc=UL(),zc=DL(),IL=qL(),Oc=["/properties"],YZ="http://json-schema.org/draft-07/schema";class cW extends Fc.default{_addVocabularies(){if(super._addVocabularies(),Vc.default.forEach((Q)=>this.addVocabulary(Q)),this.opts.discriminator)this.addKeyword(zc.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Q=this.opts.$data?this.$dataMetaSchema(IL,Oc):IL;this.addMetaSchema(Q,YZ,!1),this.refs["http://json-schema.org/schema"]=YZ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(YZ)?YZ:void 0)}}bX.Ajv=cW;VU.exports=bX=cW;VU.exports.Ajv=cW;Object.defineProperty(bX,"__esModule",{value:!0});bX.default=cW;var Ac=kW();Object.defineProperty(bX,"KeywordCxt",{enumerable:!0,get:function(){return Ac.KeywordCxt}});var KJ=a0();Object.defineProperty(bX,"_",{enumerable:!0,get:function(){return KJ._}});Object.defineProperty(bX,"str",{enumerable:!0,get:function(){return KJ.str}});Object.defineProperty(bX,"stringify",{enumerable:!0,get:function(){return KJ.stringify}});Object.defineProperty(bX,"nil",{enumerable:!0,get:function(){return KJ.nil}});Object.defineProperty(bX,"Name",{enumerable:!0,get:function(){return KJ.Name}});Object.defineProperty(bX,"CodeGen",{enumerable:!0,get:function(){return KJ.CodeGen}});var Dc=b$();Object.defineProperty(bX,"ValidationError",{enumerable:!0,get:function(){return Dc.default}});var qc=wW();Object.defineProperty(bX,"MissingRefError",{enumerable:!0,get:function(){return qc.default}})});var EL=F0((LL)=>{Object.defineProperty(LL,"__esModule",{value:!0});LL.formatLimitDefinition=void 0;var Lc=ML(),VY=a0(),H1=VY.operators,JZ={formatMaximum:{okStr:"<=",ok:H1.LTE,fail:H1.GT},formatMinimum:{okStr:">=",ok:H1.GTE,fail:H1.LT},formatExclusiveMaximum:{okStr:"<",ok:H1.LT,fail:H1.GTE},formatExclusiveMinimum:{okStr:">",ok:H1.GT,fail:H1.LTE}},Ec={message:({keyword:Q,schemaCode:X})=>VY.str`should be ${JZ[Q].okStr} ${X}`,params:({keyword:Q,schemaCode:X})=>VY._`{comparison: ${JZ[Q].okStr}, limit: ${X}}`};LL.formatLimitDefinition={keyword:Object.keys(JZ),type:"string",schemaType:"string",$data:!0,error:Ec,code(Q){let{gen:X,data:Y,schemaCode:W,keyword:G,it:K}=Q,{opts:Z,self:q}=K;if(!Z.validateFormats)return;let E=new Lc.KeywordCxt(K,q.RULES.all.format.definition,"format");if(E.$data)I();else L();function I(){let T=X.scopeValue("formats",{ref:q.formats,code:Z.code.formats}),P=X.const("fmt",VY._`${T}[${E.schemaCode}]`);Q.fail$data((0,VY.or)(VY._`typeof ${P} != "object"`,VY._`${P} instanceof RegExp`,VY._`typeof ${P}.compare != "function"`,D(P)))}function L(){let T=E.schema,P=q.formats[T];if(!P||P===!0)return;if(typeof P!="object"||P instanceof RegExp||typeof P.compare!="function")throw Error(`"${G}": format "${T}" does not define "compare" function`);let B=X.scopeValue("formats",{key:T,ref:P,code:Z.code.formats?VY._`${Z.code.formats}${(0,VY.getProperty)(T)}`:void 0});Q.fail$data(D(B))}function D(T){return VY._`${T}.compare(${Y}, ${W}) ${JZ[G].fail} 0`}},dependencies:["format"]};var Tc=(Q)=>{return Q.addKeyword(LL.formatLimitDefinition),Q};LL.default=Tc});var BL=F0((lW,PL)=>{Object.defineProperty(lW,"__esModule",{value:!0});var FJ=qD(),Pc=EL(),OU=a0(),TL=new OU.Name("fullFormats"),Bc=new OU.Name("fastFormats"),AU=(Q,X={keywords:!0})=>{if(Array.isArray(X))return RL(Q,X,FJ.fullFormats,TL),Q;let[Y,W]=X.mode==="fast"?[FJ.fastFormats,Bc]:[FJ.fullFormats,TL],G=X.formats||FJ.formatNames;if(RL(Q,G,Y,W),X.keywords)(0,Pc.default)(Q);return Q};AU.get=(Q,X="full")=>{let W=(X==="fast"?FJ.fastFormats:FJ.fullFormats)[Q];if(!W)throw Error(`Unknown format "${Q}"`);return W};function RL(Q,X,Y,W){var G,K;(G=(K=Q.opts.code).formats)!==null&&G!==void 0||(K.formats=OU._`require("ajv-formats/dist/formats").${W}`);for(let Z of X)Q.addFormat(Z,Y[Z])}PL.exports=lW=AU;Object.defineProperty(lW,"__esModule",{value:!0});lW.default=AU});var _Q=function(Q){return Q[Q.Exploration=0]="Exploration",Q[Q.ProblemSolutionFit=1]="ProblemSolutionFit",Q[Q.MvpEarlyTraction=2]="MvpEarlyTraction",Q[Q.ProductMarketFit=3]="ProductMarketFit",Q[Q.GrowthScaleUp=4]="GrowthScaleUp",Q[Q.ExpansionPlatform=5]="ExpansionPlatform",Q[Q.MaturityRenewal=6]="MaturityRenewal",Q}({}),MU=[_Q.Exploration,_Q.ProblemSolutionFit,_Q.MvpEarlyTraction,_Q.ProductMarketFit,_Q.GrowthScaleUp,_Q.ExpansionPlatform,_Q.MaturityRenewal],LU={[_Q.Exploration]:{id:_Q.Exploration,order:0,slug:"exploration",name:"Exploration / Ideation",question:"Is there a problem worth my time?",signals:["20+ discovery interviews","Clear problem statement","Named ICP"],traps:["Branding before discovery","Premature tooling decisions"],focusAreas:["Customer discovery","Problem definition","Segment clarity"]},[_Q.ProblemSolutionFit]:{id:_Q.ProblemSolutionFit,order:1,slug:"problem-solution-fit",name:"Problem–Solution Fit",question:"Do people care enough about this solution?",signals:["Prototype reuse","Referral energy","Pre-pay interest"],traps:["“Market is huge” without users","Skipping qualitative loops"],focusAreas:["Solution hypothesis","Value messaging","Feedback capture"]},[_Q.MvpEarlyTraction]:{id:_Q.MvpEarlyTraction,order:2,slug:"mvp-early-traction",name:"MVP & Early Traction",question:"Can we get real usage and learn fast?",signals:["20–50 named active users","Weekly releases","Noisy feedback"],traps:["Overbuilt infra for 10 users","Undefined retention metric"],focusAreas:["Activation","Cohort tracking","Feedback rituals"]},[_Q.ProductMarketFit]:{id:_Q.ProductMarketFit,order:3,slug:"product-market-fit",name:"Product–Market Fit",question:"Is this pulling us forward?",signals:["Retention without heroics","Organic word-of-mouth","Value stories"],traps:["Hero growth that does not scale","Ignoring churn signals"],focusAreas:["Retention","Reliability","ICP clarity"]},[_Q.GrowthScaleUp]:{id:_Q.GrowthScaleUp,order:4,slug:"growth-scale-up",name:"Growth / Scale-up",question:"Can we grow this repeatably?",signals:["Predictable channels","Specialized hires","Unit economics on track"],traps:["Paid spend masking retention gaps","Infra debt blocking launches"],focusAreas:["Ops systems","Growth loops","Reliability engineering"]},[_Q.ExpansionPlatform]:{id:_Q.ExpansionPlatform,order:5,slug:"expansion-platform",name:"Expansion / Platform",question:"What is the next growth curve?",signals:["Stable core metrics","Partner/API demand","Ecosystem pull"],traps:["Platform theater before wedge is solid"],focusAreas:["Partnerships","APIs","New market validation"]},[_Q.MaturityRenewal]:{id:_Q.MaturityRenewal,order:6,slug:"maturity-renewal",name:"Maturity / Renewal",question:"Optimize, reinvent, or sunset?",signals:["Margin focus","Portfolio bets","Narrative refresh"],traps:["Assuming past success is enough"],focusAreas:["Cost optimization","Reinvention bets","Sunset planning"]}};var ZZ=function(Q){return Q.Sketch="Sketch",Q.Prototype="Prototype",Q.Mvp="MVP",Q.V1="V1",Q.Ecosystem="Ecosystem",Q}({}),HZ=function(Q){return Q.Solo="Solo",Q.TinyTeam="TinyTeam",Q.FunctionalOrg="FunctionalOrg",Q.MultiTeam="MultiTeam",Q.Bureaucratic="Bureaucratic",Q}({}),UZ=function(Q){return Q.Bootstrapped="Bootstrapped",Q.PreSeed="PreSeed",Q.Seed="Seed",Q.SeriesAorB="SeriesAorB",Q.LateStage="LateStage",Q}({});var BQ=function(Q){return Q[Q.Exploration=0]="Exploration",Q[Q.ProblemSolutionFit=1]="ProblemSolutionFit",Q[Q.MvpEarlyTraction=2]="MvpEarlyTraction",Q[Q.ProductMarketFit=3]="ProductMarketFit",Q[Q.GrowthScaleUp=4]="GrowthScaleUp",Q[Q.ExpansionPlatform=5]="ExpansionPlatform",Q[Q.MaturityRenewal=6]="MaturityRenewal",Q}({}),Kl=[BQ.Exploration,BQ.ProblemSolutionFit,BQ.MvpEarlyTraction,BQ.ProductMarketFit,BQ.GrowthScaleUp,BQ.ExpansionPlatform,BQ.MaturityRenewal],TU={[BQ.Exploration]:{id:BQ.Exploration,order:0,slug:"exploration",name:"Exploration / Ideation",question:"Is there a problem worth my time?",signals:["20+ discovery interviews","Clear problem statement","Named ICP"],traps:["Branding before discovery","Premature tooling decisions"],focusAreas:["Customer discovery","Problem definition","Segment clarity"]},[BQ.ProblemSolutionFit]:{id:BQ.ProblemSolutionFit,order:1,slug:"problem-solution-fit",name:"Problem–Solution Fit",question:"Do people care enough about this solution?",signals:["Prototype reuse","Referral energy","Pre-pay interest"],traps:["“Market is huge” without users","Skipping qualitative loops"],focusAreas:["Solution hypothesis","Value messaging","Feedback capture"]},[BQ.MvpEarlyTraction]:{id:BQ.MvpEarlyTraction,order:2,slug:"mvp-early-traction",name:"MVP & Early Traction",question:"Can we get real usage and learn fast?",signals:["20–50 named active users","Weekly releases","Noisy feedback"],traps:["Overbuilt infra for 10 users","Undefined retention metric"],focusAreas:["Activation","Cohort tracking","Feedback rituals"]},[BQ.ProductMarketFit]:{id:BQ.ProductMarketFit,order:3,slug:"product-market-fit",name:"Product–Market Fit",question:"Is this pulling us forward?",signals:["Retention without heroics","Organic word-of-mouth","Value stories"],traps:["Hero growth that does not scale","Ignoring churn signals"],focusAreas:["Retention","Reliability","ICP clarity"]},[BQ.GrowthScaleUp]:{id:BQ.GrowthScaleUp,order:4,slug:"growth-scale-up",name:"Growth / Scale-up",question:"Can we grow this repeatably?",signals:["Predictable channels","Specialized hires","Unit economics on track"],traps:["Paid spend masking retention gaps","Infra debt blocking launches"],focusAreas:["Ops systems","Growth loops","Reliability engineering"]},[BQ.ExpansionPlatform]:{id:BQ.ExpansionPlatform,order:5,slug:"expansion-platform",name:"Expansion / Platform",question:"What is the next growth curve?",signals:["Stable core metrics","Partner/API demand","Ecosystem pull"],traps:["Platform theater before wedge is solid"],focusAreas:["Partnerships","APIs","New market validation"]},[BQ.MaturityRenewal]:{id:BQ.MaturityRenewal,order:6,slug:"maturity-renewal",name:"Maturity / Renewal",question:"Optimize, reinvent, or sunset?",signals:["Margin focus","Portfolio bets","Narrative refresh"],traps:["Assuming past success is enough"],focusAreas:["Cost optimization","Reinvention bets","Sunset planning"]}},vL=function(Q){return Q.Sketch="Sketch",Q.Prototype="Prototype",Q.Mvp="MVP",Q.V1="V1",Q.Ecosystem="Ecosystem",Q}({}),_L=function(Q){return Q.Solo="Solo",Q.TinyTeam="TinyTeam",Q.FunctionalOrg="FunctionalOrg",Q.MultiTeam="MultiTeam",Q.Bureaucratic="Bureaucratic",Q}({}),xL=function(Q){return Q.Bootstrapped="Bootstrapped",Q.PreSeed="PreSeed",Q.Seed="Seed",Q.SeriesAorB="SeriesAorB",Q.LateStage="LateStage",Q}({}),yL={product:vL.Sketch,company:_L.Solo,capital:xL.Bootstrapped};class KZ{options;constructor(Q){this.options=Q}async collect(Q={}){let X={...yL,...Q.axes??{}},Y=[],W=[...Q.signals??[]],G={...Q.questionnaireAnswers??{}};if(Q.metrics)Y.push(Q.metrics);if(this.options.analyticsAdapter){let Z=await this.options.analyticsAdapter.fetch();if(Z.axes)Object.assign(X,Z.axes);if(Z.metrics)Y.push(Z.metrics);if(Z.signals)W.push(...Z.signals)}if(this.options.questionnaireAdapter){let Z=await this.options.questionnaireAdapter.fetch();if(Z.axes)Object.assign(X,Z.axes);if(Z.signals)W.push(...Z.signals);Object.assign(G,Z.answers)}if(this.options.intentAdapter){let Z=await this.options.intentAdapter.fetch();if(Z.signals)W.push(...Z.signals)}let K=gL(Y);return{axes:X,metrics:K,signals:fL(W),questionnaireAnswers:Object.keys(G).length?G:void 0}}}var gL=(Q)=>Q.reduce((X,Y)=>{return Object.entries(Y??{}).forEach(([W,G])=>{if(G!==void 0&&G!==null)X[W]=G}),X},{}),fL=(Q)=>{let X=new Set;return Q.filter((Y)=>{if(!Y.id)return!0;if(X.has(Y.id))return!1;return X.add(Y.id),!0})},bL={Exploration:{base:0.35,metrics:{activeUsers:{weight:-0.3,direction:"lte",threshold:5},customerCount:{weight:-0.2,direction:"lte",threshold:3},teamSize:{weight:-0.1,direction:"lte",threshold:3}},signalKinds:{qualitative:0.4,metric:0.1}},ProblemSolutionFit:{base:0.4,metrics:{activeUsers:{weight:0.2,direction:"gte",threshold:5},customerCount:{weight:0.2,direction:"gte",threshold:3}},signalKinds:{qualitative:0.3,event:0.1}},MvpEarlyTraction:{base:0.45,metrics:{activeUsers:{weight:0.25,direction:"gte",threshold:25},weeklyActiveUsers:{weight:0.25,direction:"gte",threshold:20},retentionRate:{weight:0.2,direction:"gte",threshold:0.25}},signalKinds:{metric:0.15,event:0.1}},ProductMarketFit:{base:0.5,metrics:{retentionRate:{weight:0.35,direction:"gte",threshold:0.45},monthlyRecurringRevenue:{weight:0.25,direction:"gte",threshold:1e4},customerCount:{weight:0.2,direction:"gte",threshold:30}},signalKinds:{metric:0.15,event:0.1}},GrowthScaleUp:{base:0.55,metrics:{retentionRate:{weight:0.2,direction:"gte",threshold:0.55},monthlyRecurringRevenue:{weight:0.3,direction:"gte",threshold:50000},teamSize:{weight:0.15,direction:"gte",threshold:15}},signalKinds:{event:0.2,metric:0.15}},ExpansionPlatform:{base:0.6,metrics:{monthlyRecurringRevenue:{weight:0.35,direction:"gte",threshold:150000},customerCount:{weight:0.2,direction:"gte",threshold:100},teamSize:{weight:0.15,direction:"gte",threshold:40}},signalKinds:{event:0.2,milestone:0.1}},MaturityRenewal:{base:0.6,metrics:{monthlyRecurringRevenue:{weight:0.25,direction:"gte",threshold:250000},teamSize:{weight:0.15,direction:"gte",threshold:80},burnMultiple:{weight:0.2,direction:"lte",threshold:1.5}},signalKinds:{event:0.2,milestone:0.15}}},hL=bL;class FZ{weights;constructor(Q=hL){this.weights=Q}score(Q){let X=pL(Q.signals);return Object.values(BQ).filter(cL).map((Y)=>{let W=BQ[Y],G=this.weights[W]??{base:0.5},K=G.base??0.5,Z=0,q=Object.keys(G.metrics??{}).length+Object.keys(G.signalKinds??{}).length||1,E=[];if(G.metrics)Object.entries(G.metrics).forEach(([L,D])=>{let T=Q.metrics[L];if(T===void 0||T===null)return;if(uL(T,D))K+=D.weight,Z+=1,E.push(`metric:${L}`);else K+=D.weight*0.25});if(G.signalKinds)Object.entries(G.signalKinds).forEach(([L,D])=>{if((X[L]??0)>0&&typeof D==="number")K+=D,Z+=1,E.push(`signal:${L}`)});K=EU(K,0,1.25);let I=EU(Z/q,0.1,1);return{stage:Y,score:K,confidence:I,supportingSignals:E}}).sort((Y,W)=>{if(W.score===Y.score)return W.confidence-Y.confidence;return W.score-Y.score})}}var uL=(Q,X)=>{if((X.direction??"gte")==="gte")return Q>=X.threshold;return Q<=X.threshold},EU=(Q,X,Y)=>Math.min(Math.max(Q,X),Y),pL=(Q)=>Q.reduce((X,Y)=>{let W=Y.kind??"unknown";return X[W]=(X[W]??0)+(Y.weight??1),X},{}),cL=(Q)=>typeof Q==="number"&&(Q in TU);class VZ{collector;scorer;planner;constructor(Q){this.collector=Q.collector,this.scorer=Q.scorer,this.planner=Q.milestonePlanner}async run(Q){let X=await this.collector.collect(Q),Y=this.scorer.score({metrics:X.metrics,signals:X.signals}),W=Y[0]??lL(),G=TU[W.stage];return{stage:W.stage,confidence:W.confidence,axes:X.axes,signals:X.signals,metrics:mL(X.metrics),gaps:G.focusAreas.slice(0,3),focusAreas:G.focusAreas,scorecard:Y,generatedAt:new Date().toISOString()}}getUpcomingMilestones(Q,X=[],Y=5){if(!this.planner)return[];return this.planner.getUpcoming(Q,X,Y)}}var lL=()=>({stage:BQ.Exploration,score:0.3,confidence:0.3,supportingSignals:[]}),mL=(Q)=>Object.entries(Q??{}).reduce((X,[Y,W])=>{if(typeof W==="number")X[Y]=W;return X},{}),dL=[{id:"stage0-problem-statement",stage:0,category:"product",title:"Write the pain statement",description:"Capture the clearest description of the top problem in the customer’s own words.",priority:1,actionItems:["Interview at least 5 ideal customers","Synthesize quotes into a one-page brief"]},{id:"stage1-prototype-loop",stage:1,category:"product",title:"Prototype feedback loop",description:"Ship a clickable prototype and gather 3 rounds of feedback.",priority:2,actionItems:["Create a low-fidelity prototype","Schedule standing feedback calls"]},{id:"stage2-activation",stage:2,category:"operations",title:"Activation checklist",description:"Define the minimum steps required for a new user to succeed.",priority:1,actionItems:["Document onboarding flow","Instrument activation analytics"]},{id:"stage3-retention-narrative",stage:3,category:"product",title:"Retention narrative",description:"Create the before/after story that proves why users stay.",priority:2,actionItems:["Interview 3 retained users","Publish a one-pager with concrete metrics"]},{id:"stage4-growth-loop",stage:4,category:"growth",title:"Install a growth loop",description:"Stand up a repeatable acquisition → activation → referral motion.",priority:1,actionItems:["Define loop metrics","Assign owners for each stage","Review weekly"]},{id:"stage5-platform-blueprint",stage:5,category:"product",title:"Platform blueprint",description:"Align on APIs, integrations, and governance for partners.",priority:2,actionItems:["Create integration scoring rubric","Publish partner onboarding checklist"]},{id:"stage6-renewal-ops",stage:6,category:"operations",title:"Renewal operating rhythm",description:"Decide whether to optimize, reinvest, or sunset each major surface.",priority:1,actionItems:["Hold quarterly renewal review","Document reinvestment bets"]}];class zZ{milestones;constructor(Q){this.milestones=Q??dL}getUpcoming(Q,X=[],Y=5){let W=new Set(X);return this.milestones.filter((G)=>G.stage===Q&&!W.has(G.id)).sort((G,K)=>G.priority-K.priority).slice(0,Y)}}var o0=function(Q){return Q[Q.Exploration=0]="Exploration",Q[Q.ProblemSolutionFit=1]="ProblemSolutionFit",Q[Q.MvpEarlyTraction=2]="MvpEarlyTraction",Q[Q.ProductMarketFit=3]="ProductMarketFit",Q[Q.GrowthScaleUp=4]="GrowthScaleUp",Q[Q.ExpansionPlatform=5]="ExpansionPlatform",Q[Q.MaturityRenewal=6]="MaturityRenewal",Q}({}),Vl=[o0.Exploration,o0.ProblemSolutionFit,o0.MvpEarlyTraction,o0.ProductMarketFit,o0.GrowthScaleUp,o0.ExpansionPlatform,o0.MaturityRenewal],nW={[o0.Exploration]:{id:o0.Exploration,order:0,slug:"exploration",name:"Exploration / Ideation",question:"Is there a problem worth my time?",signals:["20+ discovery interviews","Clear problem statement","Named ICP"],traps:["Branding before discovery","Premature tooling decisions"],focusAreas:["Customer discovery","Problem definition","Segment clarity"]},[o0.ProblemSolutionFit]:{id:o0.ProblemSolutionFit,order:1,slug:"problem-solution-fit",name:"Problem–Solution Fit",question:"Do people care enough about this solution?",signals:["Prototype reuse","Referral energy","Pre-pay interest"],traps:["“Market is huge” without users","Skipping qualitative loops"],focusAreas:["Solution hypothesis","Value messaging","Feedback capture"]},[o0.MvpEarlyTraction]:{id:o0.MvpEarlyTraction,order:2,slug:"mvp-early-traction",name:"MVP & Early Traction",question:"Can we get real usage and learn fast?",signals:["20–50 named active users","Weekly releases","Noisy feedback"],traps:["Overbuilt infra for 10 users","Undefined retention metric"],focusAreas:["Activation","Cohort tracking","Feedback rituals"]},[o0.ProductMarketFit]:{id:o0.ProductMarketFit,order:3,slug:"product-market-fit",name:"Product–Market Fit",question:"Is this pulling us forward?",signals:["Retention without heroics","Organic word-of-mouth","Value stories"],traps:["Hero growth that does not scale","Ignoring churn signals"],focusAreas:["Retention","Reliability","ICP clarity"]},[o0.GrowthScaleUp]:{id:o0.GrowthScaleUp,order:4,slug:"growth-scale-up",name:"Growth / Scale-up",question:"Can we grow this repeatably?",signals:["Predictable channels","Specialized hires","Unit economics on track"],traps:["Paid spend masking retention gaps","Infra debt blocking launches"],focusAreas:["Ops systems","Growth loops","Reliability engineering"]},[o0.ExpansionPlatform]:{id:o0.ExpansionPlatform,order:5,slug:"expansion-platform",name:"Expansion / Platform",question:"What is the next growth curve?",signals:["Stable core metrics","Partner/API demand","Ecosystem pull"],traps:["Platform theater before wedge is solid"],focusAreas:["Partnerships","APIs","New market validation"]},[o0.MaturityRenewal]:{id:o0.MaturityRenewal,order:6,slug:"maturity-renewal",name:"Maturity / Renewal",question:"Optimize, reinvent, or sunset?",signals:["Margin focus","Portfolio bets","Narrative refresh"],traps:["Assuming past success is enough"],focusAreas:["Cost optimization","Reinvention bets","Sunset planning"]}};var nL=[{stage:o0.Exploration,focusAreas:["Discovery","Problem clarity","Persona"],actions:[{id:"stage0-interview-burst",stage:o0.Exploration,title:"Run a 5-day interview burst",description:"Schedule at least 5 back-to-back interviews and capture raw quotes.",priority:1,estimatedImpact:"medium",effortLevel:"m",category:"product",recommendedLibraries:["@lssm/lib.content-gen"]},{id:"stage0-problem-story",stage:o0.Exploration,title:"Write the problem story",description:"Summarize the pain in one paragraph you can repeat to partners.",priority:2,estimatedImpact:"low",effortLevel:"s",category:"product"}],ceremony:{title:"Discovery Spark",copy:"Share the sharpest pain quote with your crew. Frame it, celebrate focus.",cues:["\uD83D\uDD0E","\uD83D\uDDD2️"]}},{stage:o0.ProblemSolutionFit,focusAreas:["Prototype","Feedback","Value proof"],actions:[{id:"stage1-demo-loop",stage:o0.ProblemSolutionFit,title:"Prototype feedback loop",description:"Ship a low-fidelity prototype and collect 3 rounds of reactions.",priority:1,estimatedImpact:"medium",effortLevel:"m",category:"product",recommendedLibraries:["@lssm/lib.progressive-delivery"]},{id:"stage1-referrals",stage:o0.ProblemSolutionFit,title:"Capture referral signals",description:"Ask each tester who else should see the demo.",priority:2,estimatedImpact:"low",effortLevel:"s",category:"growth"}],ceremony:{title:"Solution Resonance",copy:"Record a short screen share telling the before/after story to your future self.",cues:["\uD83C\uDFA4","✨"]}},{stage:o0.MvpEarlyTraction,focusAreas:["Activation","Telemetry","Feedback"],actions:[{id:"stage2-activation",stage:o0.MvpEarlyTraction,title:"Define activation checklist",description:"Document the 3 steps users must finish to get value.",priority:1,estimatedImpact:"high",effortLevel:"m",category:"operations",recommendedLibraries:["@lssm/lib.analytics","@lssm/lib.observability"]},{id:"stage2-weekly-sync",stage:o0.MvpEarlyTraction,title:"Weekly user sync",description:"Host a standing call with your 5 most active testers.",priority:2,estimatedImpact:"medium",effortLevel:"m",category:"company"}],ceremony:{title:"Traction Toast",copy:"Toast your first 20 real users—say their names, tell them why they matter.",cues:["\uD83E\uDD42","\uD83D\uDCE3"]}},{stage:o0.ProductMarketFit,focusAreas:["Retention","Reliability","Story"],actions:[{id:"stage3-retention-study",stage:o0.ProductMarketFit,title:"Run a retention study",description:"Interview 3 retained users and publish their before/after metrics.",priority:1,estimatedImpact:"high",effortLevel:"m",category:"product",recommendedLibraries:["@lssm/lib.evolution"]},{id:"stage3-incident-review",stage:o0.ProductMarketFit,title:"Lightweight incident review",description:"Review the last 2 reliability hiccups and capture fixes.",priority:2,estimatedImpact:"medium",effortLevel:"s",category:"operations"}],ceremony:{title:"PMF Signal Fire",copy:"Write a letter to your future Series A self describing the pull you feel today.",cues:["\uD83D\uDD25","\uD83D\uDCEC"]}},{stage:o0.GrowthScaleUp,focusAreas:["Systems","Growth loops","Specialization"],actions:[{id:"stage4-growth-loop",stage:o0.GrowthScaleUp,title:"Codify a growth loop",description:"Choose one loop (SEO, referrals, outbound) and document owners + inputs.",priority:1,estimatedImpact:"high",effortLevel:"l",category:"growth",recommendedLibraries:["@lssm/lib.growth","@lssm/lib.resilience"]},{id:"stage4-hiring-map",stage:o0.GrowthScaleUp,title:"Create hiring map",description:"List specialized roles you need in the next 2 quarters.",priority:2,estimatedImpact:"medium",effortLevel:"m",category:"company"}],ceremony:{title:"Scale Systems",copy:"Invite the team to map the journey from first user to repeatable machine.",cues:["\uD83D\uDDFA️","⚙️"]}},{stage:o0.ExpansionPlatform,focusAreas:["Partners","APIs","Expansion bets"],actions:[{id:"stage5-partner-brief",stage:o0.ExpansionPlatform,title:"Partner readiness brief",description:"Document partner types, value props, and onboarding steps.",priority:1,estimatedImpact:"high",effortLevel:"m",category:"product",recommendedLibraries:["@lssm/lib.workflow-composer"]},{id:"stage5-experiment-portfolio",stage:o0.ExpansionPlatform,title:"Expansion experiment portfolio",description:"List the top 3 markets or product lines with owners.",priority:2,estimatedImpact:"medium",effortLevel:"m",category:"growth"}],ceremony:{title:"Platform Threshold",copy:"Host a partner circle—invite allies to share what they need from your platform.",cues:["\uD83E\uDD1D","\uD83C\uDF10"]}},{stage:o0.MaturityRenewal,focusAreas:["Optimization","Renewal","Portfolio"],actions:[{id:"stage6-cost-review",stage:o0.MaturityRenewal,title:"Run a cost-to-value review",description:"Audit each major surface for margin impact.",priority:1,estimatedImpact:"high",effortLevel:"m",category:"operations",recommendedLibraries:["@lssm/lib.cost-tracking"]},{id:"stage6-renewal-bet",stage:o0.MaturityRenewal,title:"Define the renewal bet",description:"Choose one reinvention or sunset track and set checkpoints.",priority:2,estimatedImpact:"medium",effortLevel:"m",category:"product"}],ceremony:{title:"Renewal Summit",copy:"Pause to honor what got you here, then commit publicly to the next reinvention.",cues:["\uD83C\uDFD4️","\uD83D\uDD01"]}}],oW=nL;var oL=new Map(oW.map((Q)=>[Q.stage,{...Q,stage:Q.stage}])),OZ=class{playbooks;constructor(Q){this.playbooks=Q?.length?new Map(Q.map((X)=>[X.stage,X])):oL}generate(Q,X={}){let Y=this.playbooks.get(Q.stage)??rL(Q.stage),W=X.limit??3,G=(Y.actions??[]).slice(0,W),K=G.length>0?G:iL(Q,W);return{assessmentId:Q.generatedAt,stage:Q.stage,actions:K,upcomingMilestones:X.upcomingMilestones??[],ceremony:Y.ceremony}}},rL=(Q)=>({stage:Q,actions:[],focusAreas:nW[Q].focusAreas}),iL=(Q,X)=>(Q.focusAreas??nW[Q.stage].focusAreas).slice(0,X).map((Y,W)=>({id:`fallback-${Q.stage}-${W}`,stage:Q.stage,title:`Advance ${Y}`,description:`Identify one task that will improve "${Y}" this week.`,priority:W+1,estimatedImpact:"low",effortLevel:"s",category:"product"}));var tL=[{stage:0,items:[{id:"@lssm/lib.content-gen",type:"library",description:"Summarize interviews and synthesize IC insights."},{id:"@lssm/lib.presentation-runtime",type:"library",description:"Craft low-fi storyboards without custom code."}]},{stage:1,items:[{id:"@lssm/lib.progressive-delivery",type:"library",description:"Gate prototype features behind lightweight flags."},{id:"@lssm/module.lifecycle-core",type:"module",description:"Capture questionnaire signals for early scoring."}]},{stage:2,items:[{id:"@lssm/lib.analytics",type:"library",description:"Instrument activation paths + cohorts."},{id:"@lssm/lib.observability",type:"library",description:"Collect minimum viable traces and metrics."}]},{stage:3,items:[{id:"@lssm/lib.evolution",type:"library",description:"Auto-detect contract gaps and spec improvements."},{id:"@lssm/module.lifecycle-advisor",type:"module",description:"Generate retention-focused guidance at scale."}]},{stage:4,items:[{id:"@lssm/lib.growth",type:"library",description:"Experiment orchestration with guardrails."},{id:"@lssm/lib.resilience",type:"library",description:"Stabilize infra and SLOs as teams split."}]},{stage:5,items:[{id:"@lssm/lib.workflow-composer",type:"library",description:"Automate partner workflows and integrations."},{id:"@lssm/bundle.contractspec-studio",type:"bundle",description:"Expose managed partner onboarding via Studio."}]},{stage:6,items:[{id:"@lssm/lib.cost-tracking",type:"library",description:"Model margin scenarios and reinvestment bets."},{id:"@lssm/lib.workflow-composer",type:"library",description:"Standardize renewal rituals and automation."}]}],RU=tL;var sL=new Map(RU.map((Q)=>[Q.stage,Q.items])),AZ=class{mapping;constructor(Q){this.mapping=Q?.length?new Map(Q.map((X)=>[X.stage,X.items])):sL}recommend(Q,X=4){let Y=this.mapping.get(Q);if(!Y?.length)return[];return Y.slice(0,X)}};var aL=new Map(oW.map((Q)=>[Q.stage,Q.ceremony])),DZ=class{ceremonies;constructor(Q){this.ceremonies=Q?.length?new Map(Q.map((X)=>[X.stage,X.ceremony])):aL}design(Q){return this.ceremonies.get(Q)}};var PU=typeof globalThis==="object"?globalThis:typeof self==="object"?self:typeof window==="object"?window:typeof global==="object"?global:{};var LY="1.9.0";var BU=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function eL(Q){var X=new Set([Q]),Y=new Set,W=Q.match(BU);if(!W)return function(){return!1};var G={major:+W[1],minor:+W[2],patch:+W[3],prerelease:W[4]};if(G.prerelease!=null)return function(E){return E===Q};function K(q){return Y.add(q),!1}function Z(q){return X.add(q),!0}return function(E){if(X.has(E))return!0;if(Y.has(E))return!1;var I=E.match(BU);if(!I)return K(E);var L={major:+I[1],minor:+I[2],patch:+I[3],prerelease:I[4]};if(L.prerelease!=null)return K(E);if(G.major!==L.major)return K(E);if(G.major===0){if(G.minor===L.minor&&G.patch<=L.patch)return Z(E);return K(E)}if(G.minor<=L.minor)return Z(E);return K(E)}}var SU=eL(LY);var QE=LY.split(".")[0],zJ=Symbol.for("opentelemetry.js.api."+QE),OJ=PU;function hY(Q,X,Y,W){var G;if(W===void 0)W=!1;var K=OJ[zJ]=(G=OJ[zJ])!==null&&G!==void 0?G:{version:LY};if(!W&&K[Q]){var Z=Error("@opentelemetry/api: Attempted duplicate registration of API: "+Q);return Y.error(Z.stack||Z.message),!1}if(K.version!==LY){var Z=Error("@opentelemetry/api: Registration of version v"+K.version+" for "+Q+" does not match previously registered API v"+LY);return Y.error(Z.stack||Z.message),!1}return K[Q]=X,Y.debug("@opentelemetry/api: Registered a global for "+Q+" v"+LY+"."),!0}function aX(Q){var X,Y,W=(X=OJ[zJ])===null||X===void 0?void 0:X.version;if(!W||!SU(W))return;return(Y=OJ[zJ])===null||Y===void 0?void 0:Y[Q]}function uY(Q,X){X.debug("@opentelemetry/api: Unregistering a global for "+Q+" v"+LY+".");var Y=OJ[zJ];if(Y)delete Y[Q]}var XE=function(Q,X){var Y=typeof Symbol==="function"&&Q[Symbol.iterator];if(!Y)return Q;var W=Y.call(Q),G,K=[],Z;try{while((X===void 0||X-- >0)&&!(G=W.next()).done)K.push(G.value)}catch(q){Z={error:q}}finally{try{if(G&&!G.done&&(Y=W.return))Y.call(W)}finally{if(Z)throw Z.error}}return K},YE=function(Q,X,Y){if(Y||arguments.length===2){for(var W=0,G=X.length,K;W<G;W++)if(K||!(W in X)){if(!K)K=Array.prototype.slice.call(X,0,W);K[W]=X[W]}}return Q.concat(K||Array.prototype.slice.call(X))},CU=function(){function Q(X){this._namespace=X.namespace||"DiagComponentLogger"}return Q.prototype.debug=function(){var X=[];for(var Y=0;Y<arguments.length;Y++)X[Y]=arguments[Y];return AJ("debug",this._namespace,X)},Q.prototype.error=function(){var X=[];for(var Y=0;Y<arguments.length;Y++)X[Y]=arguments[Y];return AJ("error",this._namespace,X)},Q.prototype.info=function(){var X=[];for(var Y=0;Y<arguments.length;Y++)X[Y]=arguments[Y];return AJ("info",this._namespace,X)},Q.prototype.warn=function(){var X=[];for(var Y=0;Y<arguments.length;Y++)X[Y]=arguments[Y];return AJ("warn",this._namespace,X)},Q.prototype.verbose=function(){var X=[];for(var Y=0;Y<arguments.length;Y++)X[Y]=arguments[Y];return AJ("verbose",this._namespace,X)},Q}();function AJ(Q,X,Y){var W=aX("diag");if(!W)return;return Y.unshift(X),W[Q].apply(W,YE([],XE(Y),!1))}var IX;(function(Q){Q[Q.NONE=0]="NONE",Q[Q.ERROR=30]="ERROR",Q[Q.WARN=50]="WARN",Q[Q.INFO=60]="INFO",Q[Q.DEBUG=70]="DEBUG",Q[Q.VERBOSE=80]="VERBOSE",Q[Q.ALL=9999]="ALL"})(IX||(IX={}));function jU(Q,X){if(Q<IX.NONE)Q=IX.NONE;else if(Q>IX.ALL)Q=IX.ALL;X=X||{};function Y(W,G){var K=X[W];if(typeof K==="function"&&Q>=G)return K.bind(X);return function(){}}return{error:Y("error",IX.ERROR),warn:Y("warn",IX.WARN),info:Y("info",IX.INFO),debug:Y("debug",IX.DEBUG),verbose:Y("verbose",IX.VERBOSE)}}var JE=function(Q,X){var Y=typeof Symbol==="function"&&Q[Symbol.iterator];if(!Y)return Q;var W=Y.call(Q),G,K=[],Z;try{while((X===void 0||X-- >0)&&!(G=W.next()).done)K.push(G.value)}catch(q){Z={error:q}}finally{try{if(G&&!G.done&&(Y=W.return))Y.call(W)}finally{if(Z)throw Z.error}}return K},WE=function(Q,X,Y){if(Y||arguments.length===2){for(var W=0,G=X.length,K;W<G;W++)if(K||!(W in X)){if(!K)K=Array.prototype.slice.call(X,0,W);K[W]=X[W]}}return Q.concat(K||Array.prototype.slice.call(X))},GE="diag",EY=function(){function Q(){function X(G){return function(){var K=[];for(var Z=0;Z<arguments.length;Z++)K[Z]=arguments[Z];var q=aX("diag");if(!q)return;return q[G].apply(q,WE([],JE(K),!1))}}var Y=this,W=function(G,K){var Z,q,E;if(K===void 0)K={logLevel:IX.INFO};if(G===Y){var I=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return Y.error((Z=I.stack)!==null&&Z!==void 0?Z:I.message),!1}if(typeof K==="number")K={logLevel:K};var L=aX("diag"),D=jU((q=K.logLevel)!==null&&q!==void 0?q:IX.INFO,G);if(L&&!K.suppressOverrideMessage){var T=(E=Error().stack)!==null&&E!==void 0?E:"<failed to generate stacktrace>";L.warn("Current logger will be overwritten from "+T),D.warn("Current logger will overwrite one already registered from "+T)}return hY("diag",D,Y,!0)};Y.setLogger=W,Y.disable=function(){uY(GE,Y)},Y.createComponentLogger=function(G){return new CU(G)},Y.verbose=X("verbose"),Y.debug=X("debug"),Y.info=X("info"),Y.warn=X("warn"),Y.error=X("error")}return Q.instance=function(){if(!this._instance)this._instance=new Q;return this._instance},Q}();function NU(Q){return Symbol.for(Q)}var $E=function(){function Q(X){var Y=this;Y._currentContext=X?new Map(X):new Map,Y.getValue=function(W){return Y._currentContext.get(W)},Y.setValue=function(W,G){var K=new Q(Y._currentContext);return K._currentContext.set(W,G),K},Y.deleteValue=function(W){var G=new Q(Y._currentContext);return G._currentContext.delete(W),G}}return Q}(),kU=new $E;var U1=function(){var Q=function(X,Y){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,G){W.__proto__=G}||function(W,G){for(var K in G)if(Object.prototype.hasOwnProperty.call(G,K))W[K]=G[K]},Q(X,Y)};return function(X,Y){if(typeof Y!=="function"&&Y!==null)throw TypeError("Class extends value "+String(Y)+" is not a constructor or null");Q(X,Y);function W(){this.constructor=X}X.prototype=Y===null?Object.create(Y):(W.prototype=Y.prototype,new W)}}(),ZE=function(){function Q(){}return Q.prototype.createGauge=function(X,Y){return DE},Q.prototype.createHistogram=function(X,Y){return qE},Q.prototype.createCounter=function(X,Y){return AE},Q.prototype.createUpDownCounter=function(X,Y){return IE},Q.prototype.createObservableGauge=function(X,Y){return LE},Q.prototype.createObservableCounter=function(X,Y){return ME},Q.prototype.createObservableUpDownCounter=function(X,Y){return EE},Q.prototype.addBatchObservableCallback=function(X,Y){},Q.prototype.removeBatchObservableCallback=function(X){},Q}();var rW=function(){function Q(){}return Q}();var HE=function(Q){U1(X,Q);function X(){return Q!==null&&Q.apply(this,arguments)||this}return X.prototype.add=function(Y,W){},X}(rW);var UE=function(Q){U1(X,Q);function X(){return Q!==null&&Q.apply(this,arguments)||this}return X.prototype.add=function(Y,W){},X}(rW);var KE=function(Q){U1(X,Q);function X(){return Q!==null&&Q.apply(this,arguments)||this}return X.prototype.record=function(Y,W){},X}(rW);var FE=function(Q){U1(X,Q);function X(){return Q!==null&&Q.apply(this,arguments)||this}return X.prototype.record=function(Y,W){},X}(rW);var qZ=function(){function Q(){}return Q.prototype.addCallback=function(X){},Q.prototype.removeCallback=function(X){},Q}();var VE=function(Q){U1(X,Q);function X(){return Q!==null&&Q.apply(this,arguments)||this}return X}(qZ);var zE=function(Q){U1(X,Q);function X(){return Q!==null&&Q.apply(this,arguments)||this}return X}(qZ);var OE=function(Q){U1(X,Q);function X(){return Q!==null&&Q.apply(this,arguments)||this}return X}(qZ);var wU=new ZE,AE=new HE,DE=new KE,qE=new FE,IE=new UE,ME=new VE,LE=new zE,EE=new OE;var TE=function(Q,X){var Y=typeof Symbol==="function"&&Q[Symbol.iterator];if(!Y)return Q;var W=Y.call(Q),G,K=[],Z;try{while((X===void 0||X-- >0)&&!(G=W.next()).done)K.push(G.value)}catch(q){Z={error:q}}finally{try{if(G&&!G.done&&(Y=W.return))Y.call(W)}finally{if(Z)throw Z.error}}return K},RE=function(Q,X,Y){if(Y||arguments.length===2){for(var W=0,G=X.length,K;W<G;W++)if(K||!(W in X)){if(!K)K=Array.prototype.slice.call(X,0,W);K[W]=X[W]}}return Q.concat(K||Array.prototype.slice.call(X))},vU=function(){function Q(){}return Q.prototype.active=function(){return kU},Q.prototype.with=function(X,Y,W){var G=[];for(var K=3;K<arguments.length;K++)G[K-3]=arguments[K];return Y.call.apply(Y,RE([W],TE(G),!1))},Q.prototype.bind=function(X,Y){return Y},Q.prototype.enable=function(){return this},Q.prototype.disable=function(){return this},Q}();var PE=function(Q,X){var Y=typeof Symbol==="function"&&Q[Symbol.iterator];if(!Y)return Q;var W=Y.call(Q),G,K=[],Z;try{while((X===void 0||X-- >0)&&!(G=W.next()).done)K.push(G.value)}catch(q){Z={error:q}}finally{try{if(G&&!G.done&&(Y=W.return))Y.call(W)}finally{if(Z)throw Z.error}}return K},BE=function(Q,X,Y){if(Y||arguments.length===2){for(var W=0,G=X.length,K;W<G;W++)if(K||!(W in X)){if(!K)K=Array.prototype.slice.call(X,0,W);K[W]=X[W]}}return Q.concat(K||Array.prototype.slice.call(X))},IZ="context",SE=new vU,v1=function(){function Q(){}return Q.getInstance=function(){if(!this._instance)this._instance=new Q;return this._instance},Q.prototype.setGlobalContextManager=function(X){return hY(IZ,X,EY.instance())},Q.prototype.active=function(){return this._getContextManager().active()},Q.prototype.with=function(X,Y,W){var G,K=[];for(var Z=3;Z<arguments.length;Z++)K[Z-3]=arguments[Z];return(G=this._getContextManager()).with.apply(G,BE([X,Y,W],PE(K),!1))},Q.prototype.bind=function(X,Y){return this._getContextManager().bind(X,Y)},Q.prototype._getContextManager=function(){return aX(IZ)||SE},Q.prototype.disable=function(){this._getContextManager().disable(),uY(IZ,EY.instance())},Q}();var iW;(function(Q){Q[Q.NONE=0]="NONE",Q[Q.SAMPLED=1]="SAMPLED"})(iW||(iW={}));var MZ="0000000000000000",LZ="00000000000000000000000000000000",_U={traceId:LZ,spanId:MZ,traceFlags:iW.NONE};var pY=function(){function Q(X){if(X===void 0)X=_U;this._spanContext=X}return Q.prototype.spanContext=function(){return this._spanContext},Q.prototype.setAttribute=function(X,Y){return this},Q.prototype.setAttributes=function(X){return this},Q.prototype.addEvent=function(X,Y){return this},Q.prototype.addLink=function(X){return this},Q.prototype.addLinks=function(X){return this},Q.prototype.setStatus=function(X){return this},Q.prototype.updateName=function(X){return this},Q.prototype.end=function(X){},Q.prototype.isRecording=function(){return!1},Q.prototype.recordException=function(X,Y){},Q}();var EZ=NU("OpenTelemetry Context Key SPAN");function tW(Q){return Q.getValue(EZ)||void 0}function xU(){return tW(v1.getInstance().active())}function DJ(Q,X){return Q.setValue(EZ,X)}function yU(Q){return Q.deleteValue(EZ)}function gU(Q,X){return DJ(Q,new pY(X))}function sW(Q){var X;return(X=tW(Q))===null||X===void 0?void 0:X.spanContext()}var CE=/^([0-9a-f]{32})$/i,jE=/^[0-9a-f]{16}$/i;function NE(Q){return CE.test(Q)&&Q!==LZ}function kE(Q){return jE.test(Q)&&Q!==MZ}function aW(Q){return NE(Q.traceId)&&kE(Q.spanId)}function fU(Q){return new pY(Q)}var TZ=v1.getInstance(),eW=function(){function Q(){}return Q.prototype.startSpan=function(X,Y,W){if(W===void 0)W=TZ.active();var G=Boolean(Y===null||Y===void 0?void 0:Y.root);if(G)return new pY;var K=W&&sW(W);if(wE(K)&&aW(K))return new pY(K);else return new pY},Q.prototype.startActiveSpan=function(X,Y,W,G){var K,Z,q;if(arguments.length<2)return;else if(arguments.length===2)q=Y;else if(arguments.length===3)K=Y,q=W;else K=Y,Z=W,q=G;var E=Z!==null&&Z!==void 0?Z:TZ.active(),I=this.startSpan(X,K,E),L=DJ(E,I);return TZ.with(L,q,void 0,I)},Q}();function wE(Q){return typeof Q==="object"&&typeof Q.spanId==="string"&&typeof Q.traceId==="string"&&typeof Q.traceFlags==="number"}var vE=new eW,bU=function(){function Q(X,Y,W,G){this._provider=X,this.name=Y,this.version=W,this.options=G}return Q.prototype.startSpan=function(X,Y,W){return this._getTracer().startSpan(X,Y,W)},Q.prototype.startActiveSpan=function(X,Y,W,G){var K=this._getTracer();return Reflect.apply(K.startActiveSpan,K,arguments)},Q.prototype._getTracer=function(){if(this._delegate)return this._delegate;var X=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!X)return vE;return this._delegate=X,this._delegate},Q}();var hU=function(){function Q(){}return Q.prototype.getTracer=function(X,Y,W){return new eW},Q}();var _E=new hU,RZ=function(){function Q(){}return Q.prototype.getTracer=function(X,Y,W){var G;return(G=this.getDelegateTracer(X,Y,W))!==null&&G!==void 0?G:new bU(this,X,Y,W)},Q.prototype.getDelegate=function(){var X;return(X=this._delegate)!==null&&X!==void 0?X:_E},Q.prototype.setDelegate=function(X){this._delegate=X},Q.prototype.getDelegateTracer=function(X,Y,W){var G;return(G=this._delegate)===null||G===void 0?void 0:G.getTracer(X,Y,W)},Q}();var PZ=v1.getInstance();var xE=function(){function Q(){}return Q.prototype.getMeter=function(X,Y,W){return wU},Q}();var uU=new xE;var BZ="metrics",pU=function(){function Q(){}return Q.getInstance=function(){if(!this._instance)this._instance=new Q;return this._instance},Q.prototype.setGlobalMeterProvider=function(X){return hY(BZ,X,EY.instance())},Q.prototype.getMeterProvider=function(){return aX(BZ)||uU},Q.prototype.getMeter=function(X,Y,W){return this.getMeterProvider().getMeter(X,Y,W)},Q.prototype.disable=function(){uY(BZ,EY.instance())},Q}();var SZ=pU.getInstance();var CZ="trace",cU=function(){function Q(){this._proxyTracerProvider=new RZ,this.wrapSpanContext=fU,this.isSpanContextValid=aW,this.deleteSpan=yU,this.getSpan=tW,this.getActiveSpan=xU,this.getSpanContext=sW,this.setSpan=DJ,this.setSpanContext=gU}return Q.getInstance=function(){if(!this._instance)this._instance=new Q;return this._instance},Q.prototype.setGlobalTracerProvider=function(X){var Y=hY(CZ,this._proxyTracerProvider,EY.instance());if(Y)this._proxyTracerProvider.setDelegate(X);return Y},Q.prototype.getTracerProvider=function(){return aX(CZ)||this._proxyTracerProvider},Q.prototype.getTracer=function(X,Y){return this.getTracerProvider().getTracer(X,Y)},Q.prototype.disable=function(){uY(CZ,EY.instance()),this._proxyTracerProvider=new RZ},Q}();var jZ=cU.getInstance();var yE="@lssm/lib.observability";function QG(Q=yE){return SZ.getMeter(Q)}function qJ(Q,X,Y){return QG(Y).createCounter(Q,{description:X})}function NZ(Q,X,Y){return QG(Y).createUpDownCounter(Q,{description:X})}function IJ(Q,X,Y){return QG(Y).createHistogram(Q,{description:X})}var lU={httpRequests:qJ("http_requests_total","Total HTTP requests"),httpDuration:IJ("http_request_duration_seconds","HTTP request duration"),operationErrors:qJ("operation_errors_total","Total operation errors"),workflowDuration:IJ("workflow_duration_seconds","Workflow execution duration")};var mU=class{constructor(Q){this.serviceName=Q}log(Q,X,Y={}){let W=jZ.getSpan(PZ.active()),G=W?.spanContext().traceId,K=W?.spanContext().spanId,Z={timestamp:new Date().toISOString(),service:this.serviceName,level:Q,message:X,traceId:G,spanId:K,...Y};console.log(JSON.stringify(Z))}debug(Q,X){this.log("debug",Q,X)}info(Q,X){this.log("info",Q,X)}warn(Q,X){this.log("warn",Q,X)}error(Q,X){this.log("error",Q,X)}},gE=new mU(process.env.OTEL_SERVICE_NAME||"unknown-service");EX();A1();var xQ=function(Q){return Q[Q.Exploration=0]="Exploration",Q[Q.ProblemSolutionFit=1]="ProblemSolutionFit",Q[Q.MvpEarlyTraction=2]="MvpEarlyTraction",Q[Q.ProductMarketFit=3]="ProductMarketFit",Q[Q.GrowthScaleUp=4]="GrowthScaleUp",Q[Q.ExpansionPlatform=5]="ExpansionPlatform",Q[Q.MaturityRenewal=6]="MaturityRenewal",Q}({}),Bd=[xQ.Exploration,xQ.ProblemSolutionFit,xQ.MvpEarlyTraction,xQ.ProductMarketFit,xQ.GrowthScaleUp,xQ.ExpansionPlatform,xQ.MaturityRenewal],VH={[xQ.Exploration]:{id:xQ.Exploration,order:0,slug:"exploration",name:"Exploration / Ideation",question:"Is there a problem worth my time?",signals:["20+ discovery interviews","Clear problem statement","Named ICP"],traps:["Branding before discovery","Premature tooling decisions"],focusAreas:["Customer discovery","Problem definition","Segment clarity"]},[xQ.ProblemSolutionFit]:{id:xQ.ProblemSolutionFit,order:1,slug:"problem-solution-fit",name:"Problem–Solution Fit",question:"Do people care enough about this solution?",signals:["Prototype reuse","Referral energy","Pre-pay interest"],traps:["“Market is huge” without users","Skipping qualitative loops"],focusAreas:["Solution hypothesis","Value messaging","Feedback capture"]},[xQ.MvpEarlyTraction]:{id:xQ.MvpEarlyTraction,order:2,slug:"mvp-early-traction",name:"MVP & Early Traction",question:"Can we get real usage and learn fast?",signals:["20–50 named active users","Weekly releases","Noisy feedback"],traps:["Overbuilt infra for 10 users","Undefined retention metric"],focusAreas:["Activation","Cohort tracking","Feedback rituals"]},[xQ.ProductMarketFit]:{id:xQ.ProductMarketFit,order:3,slug:"product-market-fit",name:"Product–Market Fit",question:"Is this pulling us forward?",signals:["Retention without heroics","Organic word-of-mouth","Value stories"],traps:["Hero growth that does not scale","Ignoring churn signals"],focusAreas:["Retention","Reliability","ICP clarity"]},[xQ.GrowthScaleUp]:{id:xQ.GrowthScaleUp,order:4,slug:"growth-scale-up",name:"Growth / Scale-up",question:"Can we grow this repeatably?",signals:["Predictable channels","Specialized hires","Unit economics on track"],traps:["Paid spend masking retention gaps","Infra debt blocking launches"],focusAreas:["Ops systems","Growth loops","Reliability engineering"]},[xQ.ExpansionPlatform]:{id:xQ.ExpansionPlatform,order:5,slug:"expansion-platform",name:"Expansion / Platform",question:"What is the next growth curve?",signals:["Stable core metrics","Partner/API demand","Ecosystem pull"],traps:["Platform theater before wedge is solid"],focusAreas:["Partnerships","APIs","New market validation"]},[xQ.MaturityRenewal]:{id:xQ.MaturityRenewal,order:6,slug:"maturity-renewal",name:"Maturity / Renewal",question:"Optimize, reinvent, or sunset?",signals:["Margin focus","Portfolio bets","Narrative refresh"],traps:["Assuming past success is enough"],focusAreas:["Cost optimization","Reinvention bets","Sunset planning"]}};var wJ=(Q)=>VH[Q].name;A1();var zH=class{assessmentCounter;confidenceHistogram;stageUpDownCounter;emitter;lowConfidenceThreshold;currentStageByTenant=new Map;constructor(Q={}){let X=Q.meterName??"@lssm/lib.lifecycle-kpi";this.assessmentCounter=qJ("lifecycle_assessments_total","Total lifecycle assessments",X),this.confidenceHistogram=IJ("lifecycle_assessment_confidence","Lifecycle assessment confidence distribution",X),this.stageUpDownCounter=NZ("lifecycle_stage_tenants","Current tenants per lifecycle stage",X),this.emitter=Q.emitter??new eX,this.lowConfidenceThreshold=Q.lowConfidenceThreshold??0.4}recordAssessment(Q,X){let Y={stage:wJ(Q.stage),tenantId:X};if(this.assessmentCounter.add(1,Y),this.confidenceHistogram.record(Q.confidence,Y),this.ensureStageCounters(Q.stage,X),this.emitter.emit("event",{type:"assessment.recorded",payload:{tenantId:X,stage:Q.stage}}),Q.confidence<this.lowConfidenceThreshold)this.emitter.emit("event",{type:"confidence.low",payload:{tenantId:X,confidence:Q.confidence}})}on(Q){this.emitter.on("event",Q)}ensureStageCounters(Q,X){if(!X)return;let Y=this.currentStageByTenant.get(X);if(Y===Q)return;if(Y!==void 0)this.stageUpDownCounter.add(-1,{stage:wJ(Y),tenantId:X});this.stageUpDownCounter.add(1,{stage:wJ(Q),tenantId:X}),this.currentStageByTenant.set(X,Q),this.emitter.emit("event",{type:"stage.changed",payload:{tenantId:X,previousStage:Y,nextStage:Q}})}};class _B{orchestrator;recommendationEngine;libraryRecommender;ceremonyDesigner;pipeline;eventBridge;constructor(Q){let X=new KZ(Q.collector),Y=new FZ,W=new zZ;if(this.orchestrator=new VZ({collector:X,scorer:Y,milestonePlanner:W}),this.recommendationEngine=Q.recommendationEngine??new OZ,this.libraryRecommender=Q.libraryRecommender??new AZ,this.ceremonyDesigner=Q.ceremonyDesigner??new DZ,this.pipeline=Q.pipeline??new zH,this.eventBridge=Q.eventBridge,Q.onPipelineEvent)this.pipeline.on(Q.onPipelineEvent);if(this.eventBridge)this.pipeline.on((G)=>this.eventBridge?.forward(G))}async runAssessment(Q){let X=await this.orchestrator.run(Q),Y=this.orchestrator.getUpcomingMilestones(X.stage,Q.completedMilestones);this.pipeline.recordAssessment(X,Q.tenantId);let W=this.recommendationEngine.generate(X,{upcomingMilestones:Y}),G=this.libraryRecommender.recommend(X.stage),K=this.ceremonyDesigner.design(X.stage);return{assessment:X,recommendation:W,libraries:G,ceremony:K}}getStagePlaybook(Q){return{recommendation:this.recommendationEngine.generate({stage:Q,confidence:1,axes:{product:ZZ.Mvp,company:HZ.TinyTeam,capital:UZ.Seed},signals:[],gaps:[],focusAreas:[],scorecard:[],generatedAt:new Date().toISOString()},{upcomingMilestones:this.orchestrator.getUpcomingMilestones(Q)}),libraries:this.libraryRecommender.recommend(Q),ceremony:this.ceremonyDesigner.design(Q)}}}var xB=mW(DH(),1);var gB=mW(DH(),1);var b1={assessmentRun:"lifecycle_assessment_run",stageChanged:"lifecycle_stage_changed",guidanceConsumed:"lifecycle_guidance_consumed"};class bB{publisher;constructor(Q){this.publisher=Q}forward(Q){if(!this.publisher)return;switch(Q.type){case"assessment.recorded":this.publisher({name:b1.assessmentRun,properties:{tenantId:Q.payload.tenantId,stage:Q.payload.stage}});break;case"stage.changed":this.publisher({name:b1.stageChanged,properties:{tenantId:Q.payload.tenantId,previousStage:Q.payload.previousStage,nextStage:Q.payload.nextStage}});break;case"confidence.low":this.publisher({name:`${b1.assessmentRun}.low_confidence`,properties:{tenantId:Q.payload.tenantId,confidence:Q.payload.confidence}});break}}}function qH(Q){if(!Q.meta?.name)throw Error("Agent name is required");if(!Number.isFinite(Q.meta.version))throw Error(`Agent ${Q.meta.name} is missing a numeric version`);if(!Q.instructions?.trim())throw Error(`Agent ${Q.meta.name} requires instructions`);if(!Q.tools?.length)throw Error(`Agent ${Q.meta.name} must expose at least one tool`);let X=new Set;for(let Y of Q.tools){if(X.has(Y.name))throw Error(`Agent ${Q.meta.name} has duplicate tool name: ${Y.name}`);X.add(Y.name)}return Object.freeze(Q)}var on=Object.freeze({status:"aborted"});function V0(Q,X,Y){function W(q,E){if(!q._zod)Object.defineProperty(q,"_zod",{value:{def:E,constr:Z,traits:new Set},enumerable:!1});if(q._zod.traits.has(Q))return;q._zod.traits.add(Q),X(q,E);let I=Z.prototype,L=Object.keys(I);for(let D=0;D<L.length;D++){let T=L[D];if(!(T in q))q[T]=I[T].bind(q)}}let G=Y?.Parent??Object;class K extends G{}Object.defineProperty(K,"name",{value:Q});function Z(q){var E;let I=Y?.Parent?new K:this;W(I,q),(E=I._zod).deferred??(E.deferred=[]);for(let L of I._zod.deferred)L();return I}return Object.defineProperty(Z,"init",{value:W}),Object.defineProperty(Z,Symbol.hasInstance,{value:(q)=>{if(Y?.Parent&&q instanceof Y.Parent)return!0;return q?._zod?.traits?.has(Q)}}),Object.defineProperty(Z,"name",{value:Q}),Z}var rn=Symbol("zod_brand");class SY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vJ extends Error{constructor(Q){super(`Encountered unidirectional transform during encode: ${Q}`);this.name="ZodEncodeError"}}var qG={};function dX(Q){if(Q)Object.assign(qG,Q);return qG}var ZQ={};w1(ZQ,{unwrapMessage:()=>_J,uint8ArrayToHex:()=>US,uint8ArrayToBase64url:()=>ZS,uint8ArrayToBase64:()=>CF,stringifyPrimitive:()=>EG,slugify:()=>LH,shallowClone:()=>TF,safeExtend:()=>XS,required:()=>WS,randomString:()=>rB,propertyKeyTypes:()=>TH,promiseAllObject:()=>oB,primitiveTypes:()=>RF,prefixIssues:()=>jY,pick:()=>aB,partial:()=>JS,optionalKeys:()=>RH,omit:()=>eB,objectClone:()=>mB,numKeys:()=>iB,nullish:()=>yJ,normalizeParams:()=>l0,mergeDefs:()=>nY,merge:()=>YS,jsonStringifyReplacer:()=>h1,joinValues:()=>IG,issue:()=>p1,isPlainObject:()=>oY,isObject:()=>q1,hexToUint8Array:()=>HS,getSizableOrigin:()=>BF,getParsedType:()=>tB,getLengthableOrigin:()=>fJ,getEnumValues:()=>xJ,getElementAtPath:()=>nB,floatSafeRemainder:()=>MH,finalizeIssue:()=>XY,extend:()=>QS,escapeRegex:()=>CY,esc:()=>MG,defineLazy:()=>zQ,createTransparentProxy:()=>sB,cloneDef:()=>dB,clone:()=>QY,cleanRegex:()=>gJ,cleanEnum:()=>GS,captureStackTrace:()=>LG,cached:()=>u1,base64urlToUint8Array:()=>$S,base64ToUint8Array:()=>SF,assignProp:()=>dY,assertNotEqual:()=>uB,assertNever:()=>cB,assertIs:()=>pB,assertEqual:()=>hB,assert:()=>lB,allowsEval:()=>EH,aborted:()=>rY,NUMBER_FORMAT_RANGES:()=>PH,Class:()=>jF,BIGINT_FORMAT_RANGES:()=>PF});function hB(Q){return Q}function uB(Q){return Q}function pB(Q){}function cB(Q){throw Error("Unexpected value in exhaustive check")}function lB(Q){}function xJ(Q){let X=Object.values(Q).filter((W)=>typeof W==="number");return Object.entries(Q).filter(([W,G])=>X.indexOf(+W)===-1).map(([W,G])=>G)}function IG(Q,X="|"){return Q.map((Y)=>EG(Y)).join(X)}function h1(Q,X){if(typeof X==="bigint")return X.toString();return X}function u1(Q){return{get value(){{let Y=Q();return Object.defineProperty(this,"value",{value:Y}),Y}throw Error("cached value already set")}}}function yJ(Q){return Q===null||Q===void 0}function gJ(Q){let X=Q.startsWith("^")?1:0,Y=Q.endsWith("$")?Q.length-1:Q.length;return Q.slice(X,Y)}function MH(Q,X){let Y=(Q.toString().split(".")[1]||"").length,W=X.toString(),G=(W.split(".")[1]||"").length;if(G===0&&/\d?e-\d?/.test(W)){let E=W.match(/\d?e-(\d?)/);if(E?.[1])G=Number.parseInt(E[1])}let K=Y>G?Y:G,Z=Number.parseInt(Q.toFixed(K).replace(".","")),q=Number.parseInt(X.toFixed(K).replace(".",""));return Z%q/10**K}var EF=Symbol("evaluating");function zQ(Q,X,Y){let W=void 0;Object.defineProperty(Q,X,{get(){if(W===EF)return;if(W===void 0)W=EF,W=Y();return W},set(G){Object.defineProperty(Q,X,{value:G})},configurable:!0})}function mB(Q){return Object.create(Object.getPrototypeOf(Q),Object.getOwnPropertyDescriptors(Q))}function dY(Q,X,Y){Object.defineProperty(Q,X,{value:Y,writable:!0,enumerable:!0,configurable:!0})}function nY(...Q){let X={};for(let Y of Q){let W=Object.getOwnPropertyDescriptors(Y);Object.assign(X,W)}return Object.defineProperties({},X)}function dB(Q){return nY(Q._zod.def)}function nB(Q,X){if(!X)return Q;return X.reduce((Y,W)=>Y?.[W],Q)}function oB(Q){let X=Object.keys(Q),Y=X.map((W)=>Q[W]);return Promise.all(Y).then((W)=>{let G={};for(let K=0;K<X.length;K++)G[X[K]]=W[K];return G})}function rB(Q=10){let Y="";for(let W=0;W<Q;W++)Y+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Y}function MG(Q){return JSON.stringify(Q)}function LH(Q){return Q.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var LG="captureStackTrace"in Error?Error.captureStackTrace:(...Q)=>{};function q1(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}var EH=u1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(Q){return!1}});function oY(Q){if(q1(Q)===!1)return!1;let X=Q.constructor;if(X===void 0)return!0;if(typeof X!=="function")return!0;let Y=X.prototype;if(q1(Y)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Y,"isPrototypeOf")===!1)return!1;return!0}function TF(Q){if(oY(Q))return{...Q};if(Array.isArray(Q))return[...Q];return Q}function iB(Q){let X=0;for(let Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))X++;return X}var tB=(Q)=>{let X=typeof Q;switch(X){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(Q)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Q.then&&typeof Q.then==="function"&&Q.catch&&typeof Q.catch==="function")return"promise";if(typeof Map<"u"&&Q instanceof Map)return"map";if(typeof Set<"u"&&Q instanceof Set)return"set";if(typeof Date<"u"&&Q instanceof Date)return"date";if(typeof File<"u"&&Q instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${X}`)}},TH=new Set(["string","number","symbol"]),RF=new Set(["string","number","bigint","boolean","symbol","undefined"]);function CY(Q){return Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function QY(Q,X,Y){let W=new Q._zod.constr(X??Q._zod.def);if(!X||Y?.parent)W._zod.parent=Q;return W}function l0(Q){let X=Q;if(!X)return{};if(typeof X==="string")return{error:()=>X};if(X?.message!==void 0){if(X?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");X.error=X.message}if(delete X.message,typeof X.error==="string")return{...X,error:()=>X.error};return X}function sB(Q){let X;return new Proxy({},{get(Y,W,G){return X??(X=Q()),Reflect.get(X,W,G)},set(Y,W,G,K){return X??(X=Q()),Reflect.set(X,W,G,K)},has(Y,W){return X??(X=Q()),Reflect.has(X,W)},deleteProperty(Y,W){return X??(X=Q()),Reflect.deleteProperty(X,W)},ownKeys(Y){return X??(X=Q()),Reflect.ownKeys(X)},getOwnPropertyDescriptor(Y,W){return X??(X=Q()),Reflect.getOwnPropertyDescriptor(X,W)},defineProperty(Y,W,G){return X??(X=Q()),Reflect.defineProperty(X,W,G)}})}function EG(Q){if(typeof Q==="bigint")return Q.toString()+"n";if(typeof Q==="string")return`"${Q}"`;return`${Q}`}function RH(Q){return Object.keys(Q).filter((X)=>{return Q[X]._zod.optin==="optional"&&Q[X]._zod.optout==="optional"})}var PH={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},PF={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function aB(Q,X){let Y=Q._zod.def,W=nY(Q._zod.def,{get shape(){let G={};for(let K in X){if(!(K in Y.shape))throw Error(`Unrecognized key: "${K}"`);if(!X[K])continue;G[K]=Y.shape[K]}return dY(this,"shape",G),G},checks:[]});return QY(Q,W)}function eB(Q,X){let Y=Q._zod.def,W=nY(Q._zod.def,{get shape(){let G={...Q._zod.def.shape};for(let K in X){if(!(K in Y.shape))throw Error(`Unrecognized key: "${K}"`);if(!X[K])continue;delete G[K]}return dY(this,"shape",G),G},checks:[]});return QY(Q,W)}function QS(Q,X){if(!oY(X))throw Error("Invalid input to extend: expected a plain object");let Y=Q._zod.def.checks;if(Y&&Y.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let G=nY(Q._zod.def,{get shape(){let K={...Q._zod.def.shape,...X};return dY(this,"shape",K),K},checks:[]});return QY(Q,G)}function XS(Q,X){if(!oY(X))throw Error("Invalid input to safeExtend: expected a plain object");let Y={...Q._zod.def,get shape(){let W={...Q._zod.def.shape,...X};return dY(this,"shape",W),W},checks:Q._zod.def.checks};return QY(Q,Y)}function YS(Q,X){let Y=nY(Q._zod.def,{get shape(){let W={...Q._zod.def.shape,...X._zod.def.shape};return dY(this,"shape",W),W},get catchall(){return X._zod.def.catchall},checks:[]});return QY(Q,Y)}function JS(Q,X,Y){let W=nY(X._zod.def,{get shape(){let G=X._zod.def.shape,K={...G};if(Y)for(let Z in Y){if(!(Z in G))throw Error(`Unrecognized key: "${Z}"`);if(!Y[Z])continue;K[Z]=Q?new Q({type:"optional",innerType:G[Z]}):G[Z]}else for(let Z in G)K[Z]=Q?new Q({type:"optional",innerType:G[Z]}):G[Z];return dY(this,"shape",K),K},checks:[]});return QY(X,W)}function WS(Q,X,Y){let W=nY(X._zod.def,{get shape(){let G=X._zod.def.shape,K={...G};if(Y)for(let Z in Y){if(!(Z in K))throw Error(`Unrecognized key: "${Z}"`);if(!Y[Z])continue;K[Z]=new Q({type:"nonoptional",innerType:G[Z]})}else for(let Z in G)K[Z]=new Q({type:"nonoptional",innerType:G[Z]});return dY(this,"shape",K),K},checks:[]});return QY(X,W)}function rY(Q,X=0){if(Q.aborted===!0)return!0;for(let Y=X;Y<Q.issues.length;Y++)if(Q.issues[Y]?.continue!==!0)return!0;return!1}function jY(Q,X){return X.map((Y)=>{var W;return(W=Y).path??(W.path=[]),Y.path.unshift(Q),Y})}function _J(Q){return typeof Q==="string"?Q:Q?.message}function XY(Q,X,Y){let W={...Q,path:Q.path??[]};if(!Q.message){let G=_J(Q.inst?._zod.def?.error?.(Q))??_J(X?.error?.(Q))??_J(Y.customError?.(Q))??_J(Y.localeError?.(Q))??"Invalid input";W.message=G}if(delete W.inst,delete W.continue,!X?.reportInput)delete W.input;return W}function BF(Q){if(Q instanceof Set)return"set";if(Q instanceof Map)return"map";if(Q instanceof File)return"file";return"unknown"}function fJ(Q){if(Array.isArray(Q))return"array";if(typeof Q==="string")return"string";return"unknown"}function p1(...Q){let[X,Y,W]=Q;if(typeof X==="string")return{message:X,code:"custom",input:Y,inst:W};return{...X}}function GS(Q){return Object.entries(Q).filter(([X,Y])=>{return Number.isNaN(Number.parseInt(X,10))}).map((X)=>X[1])}function SF(Q){let X=atob(Q),Y=new Uint8Array(X.length);for(let W=0;W<X.length;W++)Y[W]=X.charCodeAt(W);return Y}function CF(Q){let X="";for(let Y=0;Y<Q.length;Y++)X+=String.fromCharCode(Q[Y]);return btoa(X)}function $S(Q){let X=Q.replace(/-/g,"+").replace(/_/g,"/"),Y="=".repeat((4-X.length%4)%4);return SF(X+Y)}function ZS(Q){return CF(Q).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function HS(Q){let X=Q.replace(/^0x/,"");if(X.length%2!==0)throw Error("Invalid hex string length");let Y=new Uint8Array(X.length/2);for(let W=0;W<X.length;W+=2)Y[W/2]=Number.parseInt(X.slice(W,W+2),16);return Y}function US(Q){return Array.from(Q).map((X)=>X.toString(16).padStart(2,"0")).join("")}class jF{constructor(...Q){}}var NF=(Q,X)=>{Q.name="$ZodError",Object.defineProperty(Q,"_zod",{value:Q._zod,enumerable:!1}),Object.defineProperty(Q,"issues",{value:X,enumerable:!1}),Q.message=JSON.stringify(X,h1,2),Object.defineProperty(Q,"toString",{value:()=>Q.message,enumerable:!1})},TG=V0("$ZodError",NF),BH=V0("$ZodError",NF,{Parent:Error});function kF(Q,X=(Y)=>Y.message){let Y={},W=[];for(let G of Q.issues)if(G.path.length>0)Y[G.path[0]]=Y[G.path[0]]||[],Y[G.path[0]].push(X(G));else W.push(X(G));return{formErrors:W,fieldErrors:Y}}function wF(Q,X=(Y)=>Y.message){let Y={_errors:[]},W=(G)=>{for(let K of G.issues)if(K.code==="invalid_union"&&K.errors.length)K.errors.map((Z)=>W({issues:Z}));else if(K.code==="invalid_key")W({issues:K.issues});else if(K.code==="invalid_element")W({issues:K.issues});else if(K.path.length===0)Y._errors.push(X(K));else{let Z=Y,q=0;while(q<K.path.length){let E=K.path[q];if(q!==K.path.length-1)Z[E]=Z[E]||{_errors:[]};else Z[E]=Z[E]||{_errors:[]},Z[E]._errors.push(X(K));Z=Z[E],q++}}};return W(Q),Y}var RG=(Q)=>(X,Y,W,G)=>{let K=W?Object.assign(W,{async:!1}):{async:!1},Z=X._zod.run({value:Y,issues:[]},K);if(Z instanceof Promise)throw new SY;if(Z.issues.length){let q=new(G?.Err??Q)(Z.issues.map((E)=>XY(E,K,dX())));throw LG(q,G?.callee),q}return Z.value};var PG=(Q)=>async(X,Y,W,G)=>{let K=W?Object.assign(W,{async:!0}):{async:!0},Z=X._zod.run({value:Y,issues:[]},K);if(Z instanceof Promise)Z=await Z;if(Z.issues.length){let q=new(G?.Err??Q)(Z.issues.map((E)=>XY(E,K,dX())));throw LG(q,G?.callee),q}return Z.value};var bJ=(Q)=>(X,Y,W)=>{let G=W?{...W,async:!1}:{async:!1},K=X._zod.run({value:Y,issues:[]},G);if(K instanceof Promise)throw new SY;return K.issues.length?{success:!1,error:new(Q??TG)(K.issues.map((Z)=>XY(Z,G,dX())))}:{success:!0,data:K.value}},vF=bJ(BH),hJ=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{async:!0}):{async:!0},K=X._zod.run({value:Y,issues:[]},G);if(K instanceof Promise)K=await K;return K.issues.length?{success:!1,error:new Q(K.issues.map((Z)=>XY(Z,G,dX())))}:{success:!0,data:K.value}},_F=hJ(BH),xF=(Q)=>(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return RG(Q)(X,Y,G)};var yF=(Q)=>(X,Y,W)=>{return RG(Q)(X,Y,W)};var gF=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return PG(Q)(X,Y,G)};var fF=(Q)=>async(X,Y,W)=>{return PG(Q)(X,Y,W)};var bF=(Q)=>(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return bJ(Q)(X,Y,G)};var hF=(Q)=>(X,Y,W)=>{return bJ(Q)(X,Y,W)};var uF=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return hJ(Q)(X,Y,G)};var pF=(Q)=>async(X,Y,W)=>{return hJ(Q)(X,Y,W)};var cF=/^[cC][^\s-]{8,}$/,lF=/^[0-9a-z]+$/,mF=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dF=/^[0-9a-vA-V]{20}$/,nF=/^[A-Za-z0-9]{27}$/,oF=/^[a-zA-Z0-9_-]{21}$/,rF=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var iF=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,SH=(Q)=>{if(!Q)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var tF=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var FS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sF(){return new RegExp(FS,"u")}var aF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eF=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Q4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,X4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Y4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,CH=/^[A-Za-z0-9_-]*$/;var J4=/^\+(?:[0-9]){6,14}[0-9]$/,W4="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",G4=new RegExp(`^${W4}$`);function $4(Q){return typeof Q.precision==="number"?Q.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":Q.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${Q.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Z4(Q){return new RegExp(`^${$4(Q)}$`)}function H4(Q){let X=$4({precision:Q.precision}),Y=["Z"];if(Q.local)Y.push("");if(Q.offset)Y.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let W=`${X}(?:${Y.join("|")})`;return new RegExp(`^${W4}T(?:${W})$`)}var U4=(Q)=>{let X=Q?`[\\s\\S]{${Q?.minimum??0},${Q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${X}$`)};var K4=/^-?\d+$/,F4=/^-?\d+(?:\.\d+)?/,V4=/^(?:true|false)$/i,z4=/^null$/i;var O4=/^[^A-Z]*$/,A4=/^[^a-z]*$/;var ZX=V0("$ZodCheck",(Q,X)=>{var Y;Q._zod??(Q._zod={}),Q._zod.def=X,(Y=Q._zod).onattach??(Y.onattach=[])}),D4={number:"number",bigint:"bigint",object:"date"},jH=V0("$ZodCheckLessThan",(Q,X)=>{ZX.init(Q,X);let Y=D4[typeof X.value];Q._zod.onattach.push((W)=>{let G=W._zod.bag,K=(X.inclusive?G.maximum:G.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(X.value<K)if(X.inclusive)G.maximum=X.value;else G.exclusiveMaximum=X.value}),Q._zod.check=(W)=>{if(X.inclusive?W.value<=X.value:W.value<X.value)return;W.issues.push({origin:Y,code:"too_big",maximum:X.value,input:W.value,inclusive:X.inclusive,inst:Q,continue:!X.abort})}}),NH=V0("$ZodCheckGreaterThan",(Q,X)=>{ZX.init(Q,X);let Y=D4[typeof X.value];Q._zod.onattach.push((W)=>{let G=W._zod.bag,K=(X.inclusive?G.minimum:G.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(X.value>K)if(X.inclusive)G.minimum=X.value;else G.exclusiveMinimum=X.value}),Q._zod.check=(W)=>{if(X.inclusive?W.value>=X.value:W.value>X.value)return;W.issues.push({origin:Y,code:"too_small",minimum:X.value,input:W.value,inclusive:X.inclusive,inst:Q,continue:!X.abort})}}),q4=V0("$ZodCheckMultipleOf",(Q,X)=>{ZX.init(Q,X),Q._zod.onattach.push((Y)=>{var W;(W=Y._zod.bag).multipleOf??(W.multipleOf=X.value)}),Q._zod.check=(Y)=>{if(typeof Y.value!==typeof X.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof Y.value==="bigint"?Y.value%X.value===BigInt(0):MH(Y.value,X.value)===0)return;Y.issues.push({origin:typeof Y.value,code:"not_multiple_of",divisor:X.value,input:Y.value,inst:Q,continue:!X.abort})}}),I4=V0("$ZodCheckNumberFormat",(Q,X)=>{ZX.init(Q,X),X.format=X.format||"float64";let Y=X.format?.includes("int"),W=Y?"int":"number",[G,K]=PH[X.format];Q._zod.onattach.push((Z)=>{let q=Z._zod.bag;if(q.format=X.format,q.minimum=G,q.maximum=K,Y)q.pattern=K4}),Q._zod.check=(Z)=>{let q=Z.value;if(Y){if(!Number.isInteger(q)){Z.issues.push({expected:W,format:X.format,code:"invalid_type",continue:!1,input:q,inst:Q});return}if(!Number.isSafeInteger(q)){if(q>0)Z.issues.push({input:q,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:W,continue:!X.abort});else Z.issues.push({input:q,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:W,continue:!X.abort});return}}if(q<G)Z.issues.push({origin:"number",input:q,code:"too_small",minimum:G,inclusive:!0,inst:Q,continue:!X.abort});if(q>K)Z.issues.push({origin:"number",input:q,code:"too_big",maximum:K,inst:Q})}});var M4=V0("$ZodCheckMaxLength",(Q,X)=>{var Y;ZX.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!yJ(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag.maximum??Number.POSITIVE_INFINITY;if(X.maximum<G)W._zod.bag.maximum=X.maximum}),Q._zod.check=(W)=>{let G=W.value;if(G.length<=X.maximum)return;let Z=fJ(G);W.issues.push({origin:Z,code:"too_big",maximum:X.maximum,inclusive:!0,input:G,inst:Q,continue:!X.abort})}}),L4=V0("$ZodCheckMinLength",(Q,X)=>{var Y;ZX.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!yJ(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(X.minimum>G)W._zod.bag.minimum=X.minimum}),Q._zod.check=(W)=>{let G=W.value;if(G.length>=X.minimum)return;let Z=fJ(G);W.issues.push({origin:Z,code:"too_small",minimum:X.minimum,inclusive:!0,input:G,inst:Q,continue:!X.abort})}}),E4=V0("$ZodCheckLengthEquals",(Q,X)=>{var Y;ZX.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!yJ(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.minimum=X.length,G.maximum=X.length,G.length=X.length}),Q._zod.check=(W)=>{let G=W.value,K=G.length;if(K===X.length)return;let Z=fJ(G),q=K>X.length;W.issues.push({origin:Z,...q?{code:"too_big",maximum:X.length}:{code:"too_small",minimum:X.length},inclusive:!0,exact:!0,input:W.value,inst:Q,continue:!X.abort})}}),uJ=V0("$ZodCheckStringFormat",(Q,X)=>{var Y,W;if(ZX.init(Q,X),Q._zod.onattach.push((G)=>{let K=G._zod.bag;if(K.format=X.format,X.pattern)K.patterns??(K.patterns=new Set),K.patterns.add(X.pattern)}),X.pattern)(Y=Q._zod).check??(Y.check=(G)=>{if(X.pattern.lastIndex=0,X.pattern.test(G.value))return;G.issues.push({origin:"string",code:"invalid_format",format:X.format,input:G.value,...X.pattern?{pattern:X.pattern.toString()}:{},inst:Q,continue:!X.abort})});else(W=Q._zod).check??(W.check=()=>{})}),T4=V0("$ZodCheckRegex",(Q,X)=>{uJ.init(Q,X),Q._zod.check=(Y)=>{if(X.pattern.lastIndex=0,X.pattern.test(Y.value))return;Y.issues.push({origin:"string",code:"invalid_format",format:"regex",input:Y.value,pattern:X.pattern.toString(),inst:Q,continue:!X.abort})}}),R4=V0("$ZodCheckLowerCase",(Q,X)=>{X.pattern??(X.pattern=O4),uJ.init(Q,X)}),P4=V0("$ZodCheckUpperCase",(Q,X)=>{X.pattern??(X.pattern=A4),uJ.init(Q,X)}),B4=V0("$ZodCheckIncludes",(Q,X)=>{ZX.init(Q,X);let Y=CY(X.includes),W=new RegExp(typeof X.position==="number"?`^.{${X.position}}${Y}`:Y);X.pattern=W,Q._zod.onattach.push((G)=>{let K=G._zod.bag;K.patterns??(K.patterns=new Set),K.patterns.add(W)}),Q._zod.check=(G)=>{if(G.value.includes(X.includes,X.position))return;G.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:X.includes,input:G.value,inst:Q,continue:!X.abort})}}),S4=V0("$ZodCheckStartsWith",(Q,X)=>{ZX.init(Q,X);let Y=new RegExp(`^${CY(X.prefix)}.*`);X.pattern??(X.pattern=Y),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(W)=>{if(W.value.startsWith(X.prefix))return;W.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:X.prefix,input:W.value,inst:Q,continue:!X.abort})}}),C4=V0("$ZodCheckEndsWith",(Q,X)=>{ZX.init(Q,X);let Y=new RegExp(`.*${CY(X.suffix)}$`);X.pattern??(X.pattern=Y),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(W)=>{if(W.value.endsWith(X.suffix))return;W.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:X.suffix,input:W.value,inst:Q,continue:!X.abort})}});var j4=V0("$ZodCheckOverwrite",(Q,X)=>{ZX.init(Q,X),Q._zod.check=(Y)=>{Y.value=X.tx(Y.value)}});class kH{constructor(Q=[]){if(this.content=[],this.indent=0,this)this.args=Q}indented(Q){this.indent+=1,Q(this),this.indent-=1}write(Q){if(typeof Q==="function"){Q(this,{execution:"sync"}),Q(this,{execution:"async"});return}let Y=Q.split(`
|
|
31
|
+
`).filter((K)=>K),W=Math.min(...Y.map((K)=>K.length-K.trimStart().length)),G=Y.map((K)=>K.slice(W)).map((K)=>" ".repeat(this.indent*2)+K);for(let K of G)this.content.push(K)}compile(){let Q=Function,X=this?.args,W=[...(this?.content??[""]).map((G)=>` ${G}`)];return new Q(...X,W.join(`
|
|
32
|
+
`))}}var k4={major:4,minor:2,patch:1};var EQ=V0("$ZodType",(Q,X)=>{var Y;Q??(Q={}),Q._zod.def=X,Q._zod.bag=Q._zod.bag||{},Q._zod.version=k4;let W=[...Q._zod.def.checks??[]];if(Q._zod.traits.has("$ZodCheck"))W.unshift(Q);for(let G of W)for(let K of G._zod.onattach)K(Q);if(W.length===0)(Y=Q._zod).deferred??(Y.deferred=[]),Q._zod.deferred?.push(()=>{Q._zod.run=Q._zod.parse});else{let G=(Z,q,E)=>{let I=rY(Z),L;for(let D of q){if(D._zod.def.when){if(!D._zod.def.when(Z))continue}else if(I)continue;let T=Z.issues.length,P=D._zod.check(Z);if(P instanceof Promise&&E?.async===!1)throw new SY;if(L||P instanceof Promise)L=(L??Promise.resolve()).then(async()=>{if(await P,Z.issues.length===T)return;if(!I)I=rY(Z,T)});else{if(Z.issues.length===T)continue;if(!I)I=rY(Z,T)}}if(L)return L.then(()=>{return Z});return Z},K=(Z,q,E)=>{if(rY(Z))return Z.aborted=!0,Z;let I=G(q,W,E);if(I instanceof Promise){if(E.async===!1)throw new SY;return I.then((L)=>Q._zod.parse(L,E))}return Q._zod.parse(I,E)};Q._zod.run=(Z,q)=>{if(q.skipChecks)return Q._zod.parse(Z,q);if(q.direction==="backward"){let I=Q._zod.parse({value:Z.value,issues:[]},{...q,skipChecks:!0});if(I instanceof Promise)return I.then((L)=>{return K(L,Z,q)});return K(I,Z,q)}let E=Q._zod.parse(Z,q);if(E instanceof Promise){if(q.async===!1)throw new SY;return E.then((I)=>G(I,W,q))}return G(E,W,q)}}Q["~standard"]={validate:(G)=>{try{let K=vF(Q,G);return K.success?{value:K.data}:{issues:K.error?.issues}}catch(K){return _F(Q,G).then((Z)=>Z.success?{value:Z.data}:{issues:Z.error?.issues})}},vendor:"zod",version:1}}),jG=V0("$ZodString",(Q,X)=>{EQ.init(Q,X),Q._zod.pattern=[...Q?._zod.bag?.patterns??[]].pop()??U4(Q._zod.bag),Q._zod.parse=(Y,W)=>{if(X.coerce)try{Y.value=String(Y.value)}catch(G){}if(typeof Y.value==="string")return Y;return Y.issues.push({expected:"string",code:"invalid_type",input:Y.value,inst:Q}),Y}}),TQ=V0("$ZodStringFormat",(Q,X)=>{uJ.init(Q,X),jG.init(Q,X)}),h4=V0("$ZodGUID",(Q,X)=>{X.pattern??(X.pattern=iF),TQ.init(Q,X)}),u4=V0("$ZodUUID",(Q,X)=>{if(X.version){let W={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[X.version];if(W===void 0)throw Error(`Invalid UUID version: "${X.version}"`);X.pattern??(X.pattern=SH(W))}else X.pattern??(X.pattern=SH());TQ.init(Q,X)}),p4=V0("$ZodEmail",(Q,X)=>{X.pattern??(X.pattern=tF),TQ.init(Q,X)}),c4=V0("$ZodURL",(Q,X)=>{TQ.init(Q,X),Q._zod.check=(Y)=>{try{let W=Y.value.trim(),G=new URL(W);if(X.hostname){if(X.hostname.lastIndex=0,!X.hostname.test(G.hostname))Y.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.hostname.source,input:Y.value,inst:Q,continue:!X.abort})}if(X.protocol){if(X.protocol.lastIndex=0,!X.protocol.test(G.protocol.endsWith(":")?G.protocol.slice(0,-1):G.protocol))Y.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:X.protocol.source,input:Y.value,inst:Q,continue:!X.abort})}if(X.normalize)Y.value=G.href;else Y.value=W;return}catch(W){Y.issues.push({code:"invalid_format",format:"url",input:Y.value,inst:Q,continue:!X.abort})}}}),l4=V0("$ZodEmoji",(Q,X)=>{X.pattern??(X.pattern=sF()),TQ.init(Q,X)}),m4=V0("$ZodNanoID",(Q,X)=>{X.pattern??(X.pattern=oF),TQ.init(Q,X)}),d4=V0("$ZodCUID",(Q,X)=>{X.pattern??(X.pattern=cF),TQ.init(Q,X)}),n4=V0("$ZodCUID2",(Q,X)=>{X.pattern??(X.pattern=lF),TQ.init(Q,X)}),o4=V0("$ZodULID",(Q,X)=>{X.pattern??(X.pattern=mF),TQ.init(Q,X)}),r4=V0("$ZodXID",(Q,X)=>{X.pattern??(X.pattern=dF),TQ.init(Q,X)}),i4=V0("$ZodKSUID",(Q,X)=>{X.pattern??(X.pattern=nF),TQ.init(Q,X)}),t4=V0("$ZodISODateTime",(Q,X)=>{X.pattern??(X.pattern=H4(X)),TQ.init(Q,X)}),s4=V0("$ZodISODate",(Q,X)=>{X.pattern??(X.pattern=G4),TQ.init(Q,X)}),a4=V0("$ZodISOTime",(Q,X)=>{X.pattern??(X.pattern=Z4(X)),TQ.init(Q,X)}),e4=V0("$ZodISODuration",(Q,X)=>{X.pattern??(X.pattern=rF),TQ.init(Q,X)}),QV=V0("$ZodIPv4",(Q,X)=>{X.pattern??(X.pattern=aF),TQ.init(Q,X),Q._zod.bag.format="ipv4"}),XV=V0("$ZodIPv6",(Q,X)=>{X.pattern??(X.pattern=eF),TQ.init(Q,X),Q._zod.bag.format="ipv6",Q._zod.check=(Y)=>{try{new URL(`http://[${Y.value}]`)}catch{Y.issues.push({code:"invalid_format",format:"ipv6",input:Y.value,inst:Q,continue:!X.abort})}}});var YV=V0("$ZodCIDRv4",(Q,X)=>{X.pattern??(X.pattern=Q4),TQ.init(Q,X)}),JV=V0("$ZodCIDRv6",(Q,X)=>{X.pattern??(X.pattern=X4),TQ.init(Q,X),Q._zod.check=(Y)=>{let W=Y.value.split("/");try{if(W.length!==2)throw Error();let[G,K]=W;if(!K)throw Error();let Z=Number(K);if(`${Z}`!==K)throw Error();if(Z<0||Z>128)throw Error();new URL(`http://[${G}]`)}catch{Y.issues.push({code:"invalid_format",format:"cidrv6",input:Y.value,inst:Q,continue:!X.abort})}}});function WV(Q){if(Q==="")return!0;if(Q.length%4!==0)return!1;try{return atob(Q),!0}catch{return!1}}var GV=V0("$ZodBase64",(Q,X)=>{X.pattern??(X.pattern=Y4),TQ.init(Q,X),Q._zod.bag.contentEncoding="base64",Q._zod.check=(Y)=>{if(WV(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64",input:Y.value,inst:Q,continue:!X.abort})}});function VS(Q){if(!CH.test(Q))return!1;let X=Q.replace(/[-_]/g,(W)=>W==="-"?"+":"/"),Y=X.padEnd(Math.ceil(X.length/4)*4,"=");return WV(Y)}var $V=V0("$ZodBase64URL",(Q,X)=>{X.pattern??(X.pattern=CH),TQ.init(Q,X),Q._zod.bag.contentEncoding="base64url",Q._zod.check=(Y)=>{if(VS(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64url",input:Y.value,inst:Q,continue:!X.abort})}}),ZV=V0("$ZodE164",(Q,X)=>{X.pattern??(X.pattern=J4),TQ.init(Q,X)});function zS(Q,X=null){try{let Y=Q.split(".");if(Y.length!==3)return!1;let[W]=Y;if(!W)return!1;let G=JSON.parse(atob(W));if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(X&&(!("alg"in G)||G.alg!==X))return!1;return!0}catch{return!1}}var HV=V0("$ZodJWT",(Q,X)=>{TQ.init(Q,X),Q._zod.check=(Y)=>{if(zS(Y.value,X.alg))return;Y.issues.push({code:"invalid_format",format:"jwt",input:Y.value,inst:Q,continue:!X.abort})}});var vH=V0("$ZodNumber",(Q,X)=>{EQ.init(Q,X),Q._zod.pattern=Q._zod.bag.pattern??F4,Q._zod.parse=(Y,W)=>{if(X.coerce)try{Y.value=Number(Y.value)}catch(Z){}let G=Y.value;if(typeof G==="number"&&!Number.isNaN(G)&&Number.isFinite(G))return Y;let K=typeof G==="number"?Number.isNaN(G)?"NaN":!Number.isFinite(G)?"Infinity":void 0:void 0;return Y.issues.push({expected:"number",code:"invalid_type",input:G,inst:Q,...K?{received:K}:{}}),Y}}),UV=V0("$ZodNumberFormat",(Q,X)=>{I4.init(Q,X),vH.init(Q,X)}),KV=V0("$ZodBoolean",(Q,X)=>{EQ.init(Q,X),Q._zod.pattern=V4,Q._zod.parse=(Y,W)=>{if(X.coerce)try{Y.value=Boolean(Y.value)}catch(K){}let G=Y.value;if(typeof G==="boolean")return Y;return Y.issues.push({expected:"boolean",code:"invalid_type",input:G,inst:Q}),Y}});var FV=V0("$ZodNull",(Q,X)=>{EQ.init(Q,X),Q._zod.pattern=z4,Q._zod.values=new Set([null]),Q._zod.parse=(Y,W)=>{let G=Y.value;if(G===null)return Y;return Y.issues.push({expected:"null",code:"invalid_type",input:G,inst:Q}),Y}});var VV=V0("$ZodUnknown",(Q,X)=>{EQ.init(Q,X),Q._zod.parse=(Y)=>Y}),zV=V0("$ZodNever",(Q,X)=>{EQ.init(Q,X),Q._zod.parse=(Y,W)=>{return Y.issues.push({expected:"never",code:"invalid_type",input:Y.value,inst:Q}),Y}});function w4(Q,X,Y){if(Q.issues.length)X.issues.push(...jY(Y,Q.issues));X.value[Y]=Q.value}var OV=V0("$ZodArray",(Q,X)=>{EQ.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value;if(!Array.isArray(G))return Y.issues.push({expected:"array",code:"invalid_type",input:G,inst:Q}),Y;Y.value=Array(G.length);let K=[];for(let Z=0;Z<G.length;Z++){let q=G[Z],E=X.element._zod.run({value:q,issues:[]},W);if(E instanceof Promise)K.push(E.then((I)=>w4(I,Y,Z)));else w4(E,Y,Z)}if(K.length)return Promise.all(K).then(()=>Y);return Y}});function CG(Q,X,Y,W){if(Q.issues.length)X.issues.push(...jY(Y,Q.issues));if(Q.value===void 0){if(Y in W)X.value[Y]=void 0}else X.value[Y]=Q.value}function AV(Q){let X=Object.keys(Q.shape);for(let W of X)if(!Q.shape?.[W]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${W}": expected a Zod schema`);let Y=RH(Q.shape);return{...Q,keys:X,keySet:new Set(X),numKeys:X.length,optionalKeys:new Set(Y)}}function DV(Q,X,Y,W,G,K){let Z=[],q=G.keySet,E=G.catchall._zod,I=E.def.type;for(let L in X){if(q.has(L))continue;if(I==="never"){Z.push(L);continue}let D=E.run({value:X[L],issues:[]},W);if(D instanceof Promise)Q.push(D.then((T)=>CG(T,Y,L,X)));else CG(D,Y,L,X)}if(Z.length)Y.issues.push({code:"unrecognized_keys",keys:Z,input:X,inst:K});if(!Q.length)return Y;return Promise.all(Q).then(()=>{return Y})}var OS=V0("$ZodObject",(Q,X)=>{if(EQ.init(Q,X),!Object.getOwnPropertyDescriptor(X,"shape")?.get){let q=X.shape;Object.defineProperty(X,"shape",{get:()=>{let E={...q};return Object.defineProperty(X,"shape",{value:E}),E}})}let W=u1(()=>AV(X));zQ(Q._zod,"propValues",()=>{let q=X.shape,E={};for(let I in q){let L=q[I]._zod;if(L.values){E[I]??(E[I]=new Set);for(let D of L.values)E[I].add(D)}}return E});let G=q1,K=X.catchall,Z;Q._zod.parse=(q,E)=>{Z??(Z=W.value);let I=q.value;if(!G(I))return q.issues.push({expected:"object",code:"invalid_type",input:I,inst:Q}),q;q.value={};let L=[],D=Z.shape;for(let T of Z.keys){let B=D[T]._zod.run({value:I[T],issues:[]},E);if(B instanceof Promise)L.push(B.then((j)=>CG(j,q,T,I)));else CG(B,q,T,I)}if(!K)return L.length?Promise.all(L).then(()=>q):q;return DV(L,I,q,E,W.value,Q)}}),qV=V0("$ZodObjectJIT",(Q,X)=>{OS.init(Q,X);let Y=Q._zod.parse,W=u1(()=>AV(X)),G=(T)=>{let P=new kH(["shape","payload","ctx"]),B=W.value,j=(v)=>{let _=MG(v);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};P.write("const input = payload.value;");let S=Object.create(null),N=0;for(let v of B.keys)S[v]=`key_${N++}`;P.write("const newResult = {};");for(let v of B.keys){let _=S[v],x=MG(v);P.write(`const ${_} = ${j(v)};`),P.write(`
|
|
33
|
+
if (${_}.issues.length) {
|
|
34
|
+
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
35
|
+
...iss,
|
|
36
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
37
|
+
})));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if (${_}.value === undefined) {
|
|
42
|
+
if (${x} in input) {
|
|
43
|
+
newResult[${x}] = undefined;
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
newResult[${x}] = ${_}.value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
`)}P.write("payload.value = newResult;"),P.write("return payload;");let k=P.compile();return(v,_)=>k(T,v,_)},K,Z=q1,q=!qG.jitless,I=q&&EH.value,L=X.catchall,D;Q._zod.parse=(T,P)=>{D??(D=W.value);let B=T.value;if(!Z(B))return T.issues.push({expected:"object",code:"invalid_type",input:B,inst:Q}),T;if(q&&I&&P?.async===!1&&P.jitless!==!0){if(!K)K=G(X.shape);if(T=K(T,P),!L)return T;return DV([],B,T,P,D,Q)}return Y(T,P)}});function v4(Q,X,Y,W){for(let K of Q)if(K.issues.length===0)return X.value=K.value,X;let G=Q.filter((K)=>!rY(K));if(G.length===1)return X.value=G[0].value,G[0];return X.issues.push({code:"invalid_union",input:X.value,inst:Y,errors:Q.map((K)=>K.issues.map((Z)=>XY(Z,W,dX())))}),X}var _H=V0("$ZodUnion",(Q,X)=>{EQ.init(Q,X),zQ(Q._zod,"optin",()=>X.options.some((G)=>G._zod.optin==="optional")?"optional":void 0),zQ(Q._zod,"optout",()=>X.options.some((G)=>G._zod.optout==="optional")?"optional":void 0),zQ(Q._zod,"values",()=>{if(X.options.every((G)=>G._zod.values))return new Set(X.options.flatMap((G)=>Array.from(G._zod.values)));return}),zQ(Q._zod,"pattern",()=>{if(X.options.every((G)=>G._zod.pattern)){let G=X.options.map((K)=>K._zod.pattern);return new RegExp(`^(${G.map((K)=>gJ(K.source)).join("|")})$`)}return});let Y=X.options.length===1,W=X.options[0]._zod.run;Q._zod.parse=(G,K)=>{if(Y)return W(G,K);let Z=!1,q=[];for(let E of X.options){let I=E._zod.run({value:G.value,issues:[]},K);if(I instanceof Promise)q.push(I),Z=!0;else{if(I.issues.length===0)return I;q.push(I)}}if(!Z)return v4(q,G,Q,K);return Promise.all(q).then((E)=>{return v4(E,G,Q,K)})}});var IV=V0("$ZodDiscriminatedUnion",(Q,X)=>{X.inclusive=!1,_H.init(Q,X);let Y=Q._zod.parse;zQ(Q._zod,"propValues",()=>{let G={};for(let K of X.options){let Z=K._zod.propValues;if(!Z||Object.keys(Z).length===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf(K)}"`);for(let[q,E]of Object.entries(Z)){if(!G[q])G[q]=new Set;for(let I of E)G[q].add(I)}}return G});let W=u1(()=>{let G=X.options,K=new Map;for(let Z of G){let q=Z._zod.propValues?.[X.discriminator];if(!q||q.size===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf(Z)}"`);for(let E of q){if(K.has(E))throw Error(`Duplicate discriminator value "${String(E)}"`);K.set(E,Z)}}return K});Q._zod.parse=(G,K)=>{let Z=G.value;if(!q1(Z))return G.issues.push({code:"invalid_type",expected:"object",input:Z,inst:Q}),G;let q=W.value.get(Z?.[X.discriminator]);if(q)return q._zod.run(G,K);if(X.unionFallback)return Y(G,K);return G.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:X.discriminator,input:Z,path:[X.discriminator],inst:Q}),G}}),MV=V0("$ZodIntersection",(Q,X)=>{EQ.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value,K=X.left._zod.run({value:G,issues:[]},W),Z=X.right._zod.run({value:G,issues:[]},W);if(K instanceof Promise||Z instanceof Promise)return Promise.all([K,Z]).then(([E,I])=>{return _4(Y,E,I)});return _4(Y,K,Z)}});function wH(Q,X){if(Q===X)return{valid:!0,data:Q};if(Q instanceof Date&&X instanceof Date&&+Q===+X)return{valid:!0,data:Q};if(oY(Q)&&oY(X)){let Y=Object.keys(X),W=Object.keys(Q).filter((K)=>Y.indexOf(K)!==-1),G={...Q,...X};for(let K of W){let Z=wH(Q[K],X[K]);if(!Z.valid)return{valid:!1,mergeErrorPath:[K,...Z.mergeErrorPath]};G[K]=Z.data}return{valid:!0,data:G}}if(Array.isArray(Q)&&Array.isArray(X)){if(Q.length!==X.length)return{valid:!1,mergeErrorPath:[]};let Y=[];for(let W=0;W<Q.length;W++){let G=Q[W],K=X[W],Z=wH(G,K);if(!Z.valid)return{valid:!1,mergeErrorPath:[W,...Z.mergeErrorPath]};Y.push(Z.data)}return{valid:!0,data:Y}}return{valid:!1,mergeErrorPath:[]}}function _4(Q,X,Y){if(X.issues.length)Q.issues.push(...X.issues);if(Y.issues.length)Q.issues.push(...Y.issues);if(rY(Q))return Q;let W=wH(X.value,Y.value);if(!W.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(W.mergeErrorPath)}`);return Q.value=W.data,Q}var LV=V0("$ZodRecord",(Q,X)=>{EQ.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value;if(!oY(G))return Y.issues.push({expected:"record",code:"invalid_type",input:G,inst:Q}),Y;let K=[],Z=X.keyType._zod.values;if(Z){Y.value={};let q=new Set;for(let I of Z)if(typeof I==="string"||typeof I==="number"||typeof I==="symbol"){q.add(typeof I==="number"?I.toString():I);let L=X.valueType._zod.run({value:G[I],issues:[]},W);if(L instanceof Promise)K.push(L.then((D)=>{if(D.issues.length)Y.issues.push(...jY(I,D.issues));Y.value[I]=D.value}));else{if(L.issues.length)Y.issues.push(...jY(I,L.issues));Y.value[I]=L.value}}let E;for(let I in G)if(!q.has(I))E=E??[],E.push(I);if(E&&E.length>0)Y.issues.push({code:"unrecognized_keys",input:G,inst:Q,keys:E})}else{Y.value={};for(let q of Reflect.ownKeys(G)){if(q==="__proto__")continue;let E=X.keyType._zod.run({value:q,issues:[]},W);if(E instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(E.issues.length){if(X.mode==="loose")Y.value[q]=G[q];else Y.issues.push({code:"invalid_key",origin:"record",issues:E.issues.map((L)=>XY(L,W,dX())),input:q,path:[q],inst:Q});continue}let I=X.valueType._zod.run({value:G[q],issues:[]},W);if(I instanceof Promise)K.push(I.then((L)=>{if(L.issues.length)Y.issues.push(...jY(q,L.issues));Y.value[E.value]=L.value}));else{if(I.issues.length)Y.issues.push(...jY(q,I.issues));Y.value[E.value]=I.value}}}if(K.length)return Promise.all(K).then(()=>Y);return Y}});var EV=V0("$ZodEnum",(Q,X)=>{EQ.init(Q,X);let Y=xJ(X.entries),W=new Set(Y);Q._zod.values=W,Q._zod.pattern=new RegExp(`^(${Y.filter((G)=>TH.has(typeof G)).map((G)=>typeof G==="string"?CY(G):G.toString()).join("|")})$`),Q._zod.parse=(G,K)=>{let Z=G.value;if(W.has(Z))return G;return G.issues.push({code:"invalid_value",values:Y,input:Z,inst:Q}),G}}),TV=V0("$ZodLiteral",(Q,X)=>{if(EQ.init(Q,X),X.values.length===0)throw Error("Cannot create literal schema with no valid values");let Y=new Set(X.values);Q._zod.values=Y,Q._zod.pattern=new RegExp(`^(${X.values.map((W)=>typeof W==="string"?CY(W):W?CY(W.toString()):String(W)).join("|")})$`),Q._zod.parse=(W,G)=>{let K=W.value;if(Y.has(K))return W;return W.issues.push({code:"invalid_value",values:X.values,input:K,inst:Q}),W}});var RV=V0("$ZodTransform",(Q,X)=>{EQ.init(Q,X),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")throw new vJ(Q.constructor.name);let G=X.transform(Y.value,Y);if(W.async)return(G instanceof Promise?G:Promise.resolve(G)).then((Z)=>{return Y.value=Z,Y});if(G instanceof Promise)throw new SY;return Y.value=G,Y}});function x4(Q,X){if(Q.issues.length&&X===void 0)return{issues:[],value:void 0};return Q}var PV=V0("$ZodOptional",(Q,X)=>{EQ.init(Q,X),Q._zod.optin="optional",Q._zod.optout="optional",zQ(Q._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,void 0]):void 0}),zQ(Q._zod,"pattern",()=>{let Y=X.innerType._zod.pattern;return Y?new RegExp(`^(${gJ(Y.source)})?$`):void 0}),Q._zod.parse=(Y,W)=>{if(X.innerType._zod.optin==="optional"){let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((K)=>x4(K,Y.value));return x4(G,Y.value)}if(Y.value===void 0)return Y;return X.innerType._zod.run(Y,W)}}),BV=V0("$ZodNullable",(Q,X)=>{EQ.init(Q,X),zQ(Q._zod,"optin",()=>X.innerType._zod.optin),zQ(Q._zod,"optout",()=>X.innerType._zod.optout),zQ(Q._zod,"pattern",()=>{let Y=X.innerType._zod.pattern;return Y?new RegExp(`^(${gJ(Y.source)}|null)$`):void 0}),zQ(Q._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,null]):void 0}),Q._zod.parse=(Y,W)=>{if(Y.value===null)return Y;return X.innerType._zod.run(Y,W)}}),SV=V0("$ZodDefault",(Q,X)=>{EQ.init(Q,X),Q._zod.optin="optional",zQ(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);if(Y.value===void 0)return Y.value=X.defaultValue,Y;let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((K)=>y4(K,X));return y4(G,X)}});function y4(Q,X){if(Q.value===void 0)Q.value=X.defaultValue;return Q}var CV=V0("$ZodPrefault",(Q,X)=>{EQ.init(Q,X),Q._zod.optin="optional",zQ(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);if(Y.value===void 0)Y.value=X.defaultValue;return X.innerType._zod.run(Y,W)}}),jV=V0("$ZodNonOptional",(Q,X)=>{EQ.init(Q,X),zQ(Q._zod,"values",()=>{let Y=X.innerType._zod.values;return Y?new Set([...Y].filter((W)=>W!==void 0)):void 0}),Q._zod.parse=(Y,W)=>{let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((K)=>g4(K,Q));return g4(G,Q)}});function g4(Q,X){if(!Q.issues.length&&Q.value===void 0)Q.issues.push({code:"invalid_type",expected:"nonoptional",input:Q.value,inst:X});return Q}var NV=V0("$ZodCatch",(Q,X)=>{EQ.init(Q,X),zQ(Q._zod,"optin",()=>X.innerType._zod.optin),zQ(Q._zod,"optout",()=>X.innerType._zod.optout),zQ(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((K)=>{if(Y.value=K.value,K.issues.length)Y.value=X.catchValue({...Y,error:{issues:K.issues.map((Z)=>XY(Z,W,dX()))},input:Y.value}),Y.issues=[];return Y});if(Y.value=G.value,G.issues.length)Y.value=X.catchValue({...Y,error:{issues:G.issues.map((K)=>XY(K,W,dX()))},input:Y.value}),Y.issues=[];return Y}});var kV=V0("$ZodPipe",(Q,X)=>{EQ.init(Q,X),zQ(Q._zod,"values",()=>X.in._zod.values),zQ(Q._zod,"optin",()=>X.in._zod.optin),zQ(Q._zod,"optout",()=>X.out._zod.optout),zQ(Q._zod,"propValues",()=>X.in._zod.propValues),Q._zod.parse=(Y,W)=>{if(W.direction==="backward"){let K=X.out._zod.run(Y,W);if(K instanceof Promise)return K.then((Z)=>SG(Z,X.in,W));return SG(K,X.in,W)}let G=X.in._zod.run(Y,W);if(G instanceof Promise)return G.then((K)=>SG(K,X.out,W));return SG(G,X.out,W)}});function SG(Q,X,Y){if(Q.issues.length)return Q.aborted=!0,Q;return X._zod.run({value:Q.value,issues:Q.issues},Y)}var wV=V0("$ZodReadonly",(Q,X)=>{EQ.init(Q,X),zQ(Q._zod,"propValues",()=>X.innerType._zod.propValues),zQ(Q._zod,"values",()=>X.innerType._zod.values),zQ(Q._zod,"optin",()=>X.innerType?._zod?.optin),zQ(Q._zod,"optout",()=>X.innerType?._zod?.optout),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then(f4);return f4(G)}});function f4(Q){return Q.value=Object.freeze(Q.value),Q}var vV=V0("$ZodCustom",(Q,X)=>{ZX.init(Q,X),EQ.init(Q,X),Q._zod.parse=(Y,W)=>{return Y},Q._zod.check=(Y)=>{let W=Y.value,G=X.fn(W);if(G instanceof Promise)return G.then((K)=>b4(K,Y,W,Q));b4(G,Y,W,Q);return}});function b4(Q,X,Y,W){if(!Q){let G={code:"custom",input:Y,inst:W,path:[...W._zod.def.path??[]],continue:!W._zod.def.abort};if(W._zod.def.params)G.params=W._zod.def.params;X.issues.push(p1(G))}}var AS=(Q)=>{let X=typeof Q;switch(X){case"number":return Number.isNaN(Q)?"NaN":"number";case"object":{if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Object.getPrototypeOf(Q)!==Object.prototype&&Q.constructor)return Q.constructor.name}}return X},DS=()=>{let Q={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function X(W){return Q[W]??null}let Y={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(W)=>{switch(W.code){case"invalid_type":return`Invalid input: expected ${W.expected}, received ${AS(W.input)}`;case"invalid_value":if(W.values.length===1)return`Invalid input: expected ${EG(W.values[0])}`;return`Invalid option: expected one of ${IG(W.values,"|")}`;case"too_big":{let G=W.inclusive?"<=":"<",K=X(W.origin);if(K)return`Too big: expected ${W.origin??"value"} to have ${G}${W.maximum.toString()} ${K.unit??"elements"}`;return`Too big: expected ${W.origin??"value"} to be ${G}${W.maximum.toString()}`}case"too_small":{let G=W.inclusive?">=":">",K=X(W.origin);if(K)return`Too small: expected ${W.origin} to have ${G}${W.minimum.toString()} ${K.unit}`;return`Too small: expected ${W.origin} to be ${G}${W.minimum.toString()}`}case"invalid_format":{let G=W;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${Y[G.format]??W.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${W.divisor}`;case"unrecognized_keys":return`Unrecognized key${W.keys.length>1?"s":""}: ${IG(W.keys,", ")}`;case"invalid_key":return`Invalid key in ${W.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${W.origin}`;default:return"Invalid input"}}};function xH(){return{localeError:DS()}}var _V,Vo=Symbol("ZodOutput"),zo=Symbol("ZodInput");class xV{constructor(){this._map=new WeakMap,this._idmap=new Map}add(Q,...X){let Y=X[0];if(this._map.set(Q,Y),Y&&typeof Y==="object"&&"id"in Y){if(this._idmap.has(Y.id))throw Error(`ID ${Y.id} already exists in the registry`);this._idmap.set(Y.id,Q)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(Q){let X=this._map.get(Q);if(X&&typeof X==="object"&&"id"in X)this._idmap.delete(X.id);return this._map.delete(Q),this}get(Q){let X=Q._zod.parent;if(X){let Y={...this.get(X)??{}};delete Y.id;let W={...Y,...this._map.get(Q)};return Object.keys(W).length?W:void 0}return this._map.get(Q)}has(Q){return this._map.has(Q)}}function qS(){return new xV}(_V=globalThis).__zod_globalRegistry??(_V.__zod_globalRegistry=qS());var I1=globalThis.__zod_globalRegistry;function yV(Q,X){return new Q({type:"string",...l0(X)})}function gV(Q,X){return new Q({type:"string",format:"email",check:"string_format",abort:!1,...l0(X)})}function yH(Q,X){return new Q({type:"string",format:"guid",check:"string_format",abort:!1,...l0(X)})}function fV(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,...l0(X)})}function bV(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...l0(X)})}function hV(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...l0(X)})}function uV(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...l0(X)})}function pV(Q,X){return new Q({type:"string",format:"url",check:"string_format",abort:!1,...l0(X)})}function cV(Q,X){return new Q({type:"string",format:"emoji",check:"string_format",abort:!1,...l0(X)})}function lV(Q,X){return new Q({type:"string",format:"nanoid",check:"string_format",abort:!1,...l0(X)})}function mV(Q,X){return new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...l0(X)})}function dV(Q,X){return new Q({type:"string",format:"cuid2",check:"string_format",abort:!1,...l0(X)})}function nV(Q,X){return new Q({type:"string",format:"ulid",check:"string_format",abort:!1,...l0(X)})}function oV(Q,X){return new Q({type:"string",format:"xid",check:"string_format",abort:!1,...l0(X)})}function rV(Q,X){return new Q({type:"string",format:"ksuid",check:"string_format",abort:!1,...l0(X)})}function iV(Q,X){return new Q({type:"string",format:"ipv4",check:"string_format",abort:!1,...l0(X)})}function tV(Q,X){return new Q({type:"string",format:"ipv6",check:"string_format",abort:!1,...l0(X)})}function sV(Q,X){return new Q({type:"string",format:"cidrv4",check:"string_format",abort:!1,...l0(X)})}function aV(Q,X){return new Q({type:"string",format:"cidrv6",check:"string_format",abort:!1,...l0(X)})}function eV(Q,X){return new Q({type:"string",format:"base64",check:"string_format",abort:!1,...l0(X)})}function Qz(Q,X){return new Q({type:"string",format:"base64url",check:"string_format",abort:!1,...l0(X)})}function Xz(Q,X){return new Q({type:"string",format:"e164",check:"string_format",abort:!1,...l0(X)})}function Yz(Q,X){return new Q({type:"string",format:"jwt",check:"string_format",abort:!1,...l0(X)})}function Jz(Q,X){return new Q({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...l0(X)})}function Wz(Q,X){return new Q({type:"string",format:"date",check:"string_format",...l0(X)})}function Gz(Q,X){return new Q({type:"string",format:"time",check:"string_format",precision:null,...l0(X)})}function $z(Q,X){return new Q({type:"string",format:"duration",check:"string_format",...l0(X)})}function Zz(Q,X){return new Q({type:"number",checks:[],...l0(X)})}function Hz(Q,X){return new Q({type:"number",check:"number_format",abort:!1,format:"safeint",...l0(X)})}function Uz(Q,X){return new Q({type:"boolean",...l0(X)})}function Kz(Q,X){return new Q({type:"null",...l0(X)})}function Fz(Q){return new Q({type:"unknown"})}function Vz(Q,X){return new Q({type:"never",...l0(X)})}function NG(Q,X){return new jH({check:"less_than",...l0(X),value:Q,inclusive:!1})}function pJ(Q,X){return new jH({check:"less_than",...l0(X),value:Q,inclusive:!0})}function kG(Q,X){return new NH({check:"greater_than",...l0(X),value:Q,inclusive:!1})}function cJ(Q,X){return new NH({check:"greater_than",...l0(X),value:Q,inclusive:!0})}function wG(Q,X){return new q4({check:"multiple_of",...l0(X),value:Q})}function vG(Q,X){return new M4({check:"max_length",...l0(X),maximum:Q})}function c1(Q,X){return new L4({check:"min_length",...l0(X),minimum:Q})}function _G(Q,X){return new E4({check:"length_equals",...l0(X),length:Q})}function gH(Q,X){return new T4({check:"string_format",format:"regex",...l0(X),pattern:Q})}function fH(Q){return new R4({check:"string_format",format:"lowercase",...l0(Q)})}function bH(Q){return new P4({check:"string_format",format:"uppercase",...l0(Q)})}function hH(Q,X){return new B4({check:"string_format",format:"includes",...l0(X),includes:Q})}function uH(Q,X){return new S4({check:"string_format",format:"starts_with",...l0(X),prefix:Q})}function pH(Q,X){return new C4({check:"string_format",format:"ends_with",...l0(X),suffix:Q})}function iY(Q){return new j4({check:"overwrite",tx:Q})}function cH(Q){return iY((X)=>X.normalize(Q))}function lH(){return iY((Q)=>Q.trim())}function mH(){return iY((Q)=>Q.toLowerCase())}function dH(){return iY((Q)=>Q.toUpperCase())}function nH(){return iY((Q)=>LH(Q))}function zz(Q,X,Y){return new Q({type:"array",element:X,...l0(Y)})}function Oz(Q,X,Y){let W=l0(Y);return W.abort??(W.abort=!0),new Q({type:"custom",check:"custom",fn:X,...W})}function Az(Q,X,Y){return new Q({type:"custom",check:"custom",fn:X,...l0(Y)})}function Dz(Q){let X=IS((Y)=>{return Y.addIssue=(W)=>{if(typeof W==="string")Y.issues.push(p1(W,Y.value,X._zod.def));else{let G=W;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=Y.value),G.inst??(G.inst=X),G.continue??(G.continue=!X._zod.def.abort),Y.issues.push(p1(G))}},Q(Y.value,Y)});return X}function IS(Q,X){let Y=new ZX({check:"custom",...l0(X)});return Y._zod.check=Q,Y}function oH(Q){let X=Q?.target??"draft-2020-12";if(X==="draft-4")X="draft-04";if(X==="draft-7")X="draft-07";return{processors:Q.processors??{},metadataRegistry:Q?.metadata??I1,target:X,unrepresentable:Q?.unrepresentable??"throw",override:Q?.override??(()=>{}),io:Q?.io??"output",counter:0,seen:new Map,cycles:Q?.cycles??"ref",reused:Q?.reused??"inline",external:Q?.external??void 0}}function bQ(Q,X,Y={path:[],schemaPath:[]}){var W;let G=Q._zod.def,K=X.seen.get(Q);if(K){if(K.count++,Y.schemaPath.includes(Q))K.cycle=Y.path;return K.schema}let Z={schema:{},count:1,cycle:void 0,path:Y.path};X.seen.set(Q,Z);let q=Q._zod.toJSONSchema?.();if(q)Z.schema=q;else{let L={...Y,schemaPath:[...Y.schemaPath,Q],path:Y.path},D=Q._zod.parent;if(D)Z.ref=D,bQ(D,X,L),X.seen.get(D).isParent=!0;else if(Q._zod.processJSONSchema)Q._zod.processJSONSchema(X,Z.schema,L);else{let T=Z.schema,P=X.processors[G.type];if(!P)throw Error(`[toJSONSchema]: Non-representable type encountered: ${G.type}`);P(Q,X,T,L)}}let E=X.metadataRegistry.get(Q);if(E)Object.assign(Z.schema,E);if(X.io==="input"&&TX(Q))delete Z.schema.examples,delete Z.schema.default;if(X.io==="input"&&Z.schema._prefault)(W=Z.schema).default??(W.default=Z.schema._prefault);return delete Z.schema._prefault,X.seen.get(Q).schema}function rH(Q,X){let Y=Q.seen.get(X);if(!Y)throw Error("Unprocessed schema. This is a bug in Zod.");let W=(K)=>{let Z=Q.target==="draft-2020-12"?"$defs":"definitions";if(Q.external){let L=Q.external.registry.get(K[0])?.id,D=Q.external.uri??((P)=>P);if(L)return{ref:D(L)};let T=K[1].defId??K[1].schema.id??`schema${Q.counter++}`;return K[1].defId=T,{defId:T,ref:`${D("__shared")}#/${Z}/${T}`}}if(K[1]===Y)return{ref:"#"};let E=`${"#"}/${Z}/`,I=K[1].schema.id??`__schema${Q.counter++}`;return{defId:I,ref:E+I}},G=(K)=>{if(K[1].schema.$ref)return;let Z=K[1],{ref:q,defId:E}=W(K);if(Z.def={...Z.schema},E)Z.defId=E;let I=Z.schema;for(let L in I)delete I[L];I.$ref=q};if(Q.cycles==="throw")for(let K of Q.seen.entries()){let Z=K[1];if(Z.cycle)throw Error(`Cycle detected: #/${Z.cycle?.join("/")}/<root>
|
|
5
50
|
|
|
6
|
-
export { LifecycleAdvisorAgent, LifecycleAssessmentService, LifecycleEventBridge, createLifecycleHandlers };
|
|
51
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let K of Q.seen.entries()){let Z=K[1];if(X===K[0]){G(K);continue}if(Q.external){let E=Q.external.registry.get(K[0])?.id;if(X!==K[0]&&E){G(K);continue}}if(Q.metadataRegistry.get(K[0])?.id){G(K);continue}if(Z.cycle){G(K);continue}if(Z.count>1){if(Q.reused==="ref"){G(K);continue}}}}function iH(Q,X){let Y=Q.seen.get(X);if(!Y)throw Error("Unprocessed schema. This is a bug in Zod.");let W=(Z)=>{let q=Q.seen.get(Z),E=q.def??q.schema,I={...E};if(q.ref===null)return;let L=q.ref;if(q.ref=null,L){W(L);let D=Q.seen.get(L).schema;if(D.$ref&&(Q.target==="draft-07"||Q.target==="draft-04"||Q.target==="openapi-3.0"))E.allOf=E.allOf??[],E.allOf.push(D);else Object.assign(E,D),Object.assign(E,I)}if(!q.isParent)Q.override({zodSchema:Z,jsonSchema:E,path:q.path??[]})};for(let Z of[...Q.seen.entries()].reverse())W(Z[0]);let G={};if(Q.target==="draft-2020-12")G.$schema="https://json-schema.org/draft/2020-12/schema";else if(Q.target==="draft-07")G.$schema="http://json-schema.org/draft-07/schema#";else if(Q.target==="draft-04")G.$schema="http://json-schema.org/draft-04/schema#";else if(Q.target==="openapi-3.0");if(Q.external?.uri){let Z=Q.external.registry.get(X)?.id;if(!Z)throw Error("Schema is missing an `id` property");G.$id=Q.external.uri(Z)}Object.assign(G,Y.def??Y.schema);let K=Q.external?.defs??{};for(let Z of Q.seen.entries()){let q=Z[1];if(q.def&&q.defId)K[q.defId]=q.def}if(Q.external);else if(Object.keys(K).length>0)if(Q.target==="draft-2020-12")G.$defs=K;else G.definitions=K;try{let Z=JSON.parse(JSON.stringify(G));return Object.defineProperty(Z,"~standard",{value:{...X["~standard"],jsonSchema:{input:lJ(X,"input"),output:lJ(X,"output")}},enumerable:!1,writable:!1}),Z}catch(Z){throw Error("Error converting schema to JSON.")}}function TX(Q,X){let Y=X??{seen:new Set};if(Y.seen.has(Q))return!1;Y.seen.add(Q);let W=Q._zod.def;if(W.type==="transform")return!0;if(W.type==="array")return TX(W.element,Y);if(W.type==="set")return TX(W.valueType,Y);if(W.type==="lazy")return TX(W.getter(),Y);if(W.type==="promise"||W.type==="optional"||W.type==="nonoptional"||W.type==="nullable"||W.type==="readonly"||W.type==="default"||W.type==="prefault")return TX(W.innerType,Y);if(W.type==="intersection")return TX(W.left,Y)||TX(W.right,Y);if(W.type==="record"||W.type==="map")return TX(W.keyType,Y)||TX(W.valueType,Y);if(W.type==="pipe")return TX(W.in,Y)||TX(W.out,Y);if(W.type==="object"){for(let G in W.shape)if(TX(W.shape[G],Y))return!0;return!1}if(W.type==="union"){for(let G of W.options)if(TX(G,Y))return!0;return!1}if(W.type==="tuple"){for(let G of W.items)if(TX(G,Y))return!0;if(W.rest&&TX(W.rest,Y))return!0;return!1}return!1}var qz=(Q,X={})=>(Y)=>{let W=oH({...Y,processors:X});return bQ(Q,W),rH(W,Q),iH(W,Q)},lJ=(Q,X)=>(Y)=>{let{libraryOptions:W,target:G}=Y??{},K=oH({...W??{},target:G,io:X,processors:{}});return bQ(Q,K),rH(K,Q),iH(K,Q)};var MS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Iz=(Q,X,Y,W)=>{let G=Y;G.type="string";let{minimum:K,maximum:Z,format:q,patterns:E,contentEncoding:I}=Q._zod.bag;if(typeof K==="number")G.minLength=K;if(typeof Z==="number")G.maxLength=Z;if(q){if(G.format=MS[q]??q,G.format==="")delete G.format}if(I)G.contentEncoding=I;if(E&&E.size>0){let L=[...E];if(L.length===1)G.pattern=L[0].source;else if(L.length>1)G.allOf=[...L.map((D)=>({...X.target==="draft-07"||X.target==="draft-04"||X.target==="openapi-3.0"?{type:"string"}:{},pattern:D.source}))]}},Mz=(Q,X,Y,W)=>{let G=Y,{minimum:K,maximum:Z,format:q,multipleOf:E,exclusiveMaximum:I,exclusiveMinimum:L}=Q._zod.bag;if(typeof q==="string"&&q.includes("int"))G.type="integer";else G.type="number";if(typeof L==="number")if(X.target==="draft-04"||X.target==="openapi-3.0")G.minimum=L,G.exclusiveMinimum=!0;else G.exclusiveMinimum=L;if(typeof K==="number"){if(G.minimum=K,typeof L==="number"&&X.target!=="draft-04")if(L>=K)delete G.minimum;else delete G.exclusiveMinimum}if(typeof I==="number")if(X.target==="draft-04"||X.target==="openapi-3.0")G.maximum=I,G.exclusiveMaximum=!0;else G.exclusiveMaximum=I;if(typeof Z==="number"){if(G.maximum=Z,typeof I==="number"&&X.target!=="draft-04")if(I<=Z)delete G.maximum;else delete G.exclusiveMaximum}if(typeof E==="number")G.multipleOf=E},Lz=(Q,X,Y,W)=>{Y.type="boolean"};var Ez=(Q,X,Y,W)=>{if(X.target==="openapi-3.0")Y.type="string",Y.nullable=!0,Y.enum=[null];else Y.type="null"};var Tz=(Q,X,Y,W)=>{Y.not={}};var Rz=(Q,X,Y,W)=>{};var Pz=(Q,X,Y,W)=>{let G=Q._zod.def,K=xJ(G.entries);if(K.every((Z)=>typeof Z==="number"))Y.type="number";if(K.every((Z)=>typeof Z==="string"))Y.type="string";Y.enum=K},Bz=(Q,X,Y,W)=>{let G=Q._zod.def,K=[];for(let Z of G.values)if(Z===void 0){if(X.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof Z==="bigint")if(X.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else K.push(Number(Z));else K.push(Z);if(K.length===0);else if(K.length===1){let Z=K[0];if(Y.type=Z===null?"null":typeof Z,X.target==="draft-04"||X.target==="openapi-3.0")Y.enum=[Z];else Y.const=Z}else{if(K.every((Z)=>typeof Z==="number"))Y.type="number";if(K.every((Z)=>typeof Z==="string"))Y.type="string";if(K.every((Z)=>typeof Z==="boolean"))Y.type="boolean";if(K.every((Z)=>Z===null))Y.type="null";Y.enum=K}};var Sz=(Q,X,Y,W)=>{if(X.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var Cz=(Q,X,Y,W)=>{if(X.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var jz=(Q,X,Y,W)=>{let G=Y,K=Q._zod.def,{minimum:Z,maximum:q}=Q._zod.bag;if(typeof Z==="number")G.minItems=Z;if(typeof q==="number")G.maxItems=q;G.type="array",G.items=bQ(K.element,X,{...W,path:[...W.path,"items"]})},Nz=(Q,X,Y,W)=>{let G=Y,K=Q._zod.def;G.type="object",G.properties={};let Z=K.shape;for(let I in Z)G.properties[I]=bQ(Z[I],X,{...W,path:[...W.path,"properties",I]});let q=new Set(Object.keys(Z)),E=new Set([...q].filter((I)=>{let L=K.shape[I]._zod;if(X.io==="input")return L.optin===void 0;else return L.optout===void 0}));if(E.size>0)G.required=Array.from(E);if(K.catchall?._zod.def.type==="never")G.additionalProperties=!1;else if(!K.catchall){if(X.io==="output")G.additionalProperties=!1}else if(K.catchall)G.additionalProperties=bQ(K.catchall,X,{...W,path:[...W.path,"additionalProperties"]})},kz=(Q,X,Y,W)=>{let G=Q._zod.def,K=G.inclusive===!1,Z=G.options.map((q,E)=>bQ(q,X,{...W,path:[...W.path,K?"oneOf":"anyOf",E]}));if(K)Y.oneOf=Z;else Y.anyOf=Z},wz=(Q,X,Y,W)=>{let G=Q._zod.def,K=bQ(G.left,X,{...W,path:[...W.path,"allOf",0]}),Z=bQ(G.right,X,{...W,path:[...W.path,"allOf",1]}),q=(I)=>("allOf"in I)&&Object.keys(I).length===1,E=[...q(K)?K.allOf:[K],...q(Z)?Z.allOf:[Z]];Y.allOf=E};var vz=(Q,X,Y,W)=>{let G=Y,K=Q._zod.def;if(G.type="object",X.target==="draft-07"||X.target==="draft-2020-12")G.propertyNames=bQ(K.keyType,X,{...W,path:[...W.path,"propertyNames"]});G.additionalProperties=bQ(K.valueType,X,{...W,path:[...W.path,"additionalProperties"]})},_z=(Q,X,Y,W)=>{let G=Q._zod.def,K=bQ(G.innerType,X,W),Z=X.seen.get(Q);if(X.target==="openapi-3.0")Z.ref=G.innerType,Y.nullable=!0;else Y.anyOf=[K,{type:"null"}]},xz=(Q,X,Y,W)=>{let G=Q._zod.def;bQ(G.innerType,X,W);let K=X.seen.get(Q);K.ref=G.innerType},yz=(Q,X,Y,W)=>{let G=Q._zod.def;bQ(G.innerType,X,W);let K=X.seen.get(Q);K.ref=G.innerType,Y.default=JSON.parse(JSON.stringify(G.defaultValue))},gz=(Q,X,Y,W)=>{let G=Q._zod.def;bQ(G.innerType,X,W);let K=X.seen.get(Q);if(K.ref=G.innerType,X.io==="input")Y._prefault=JSON.parse(JSON.stringify(G.defaultValue))},fz=(Q,X,Y,W)=>{let G=Q._zod.def;bQ(G.innerType,X,W);let K=X.seen.get(Q);K.ref=G.innerType;let Z;try{Z=G.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}Y.default=Z},bz=(Q,X,Y,W)=>{let G=Q._zod.def,K=X.io==="input"?G.in._zod.def.type==="transform"?G.out:G.in:G.out;bQ(K,X,W);let Z=X.seen.get(Q);Z.ref=K},hz=(Q,X,Y,W)=>{let G=Q._zod.def;bQ(G.innerType,X,W);let K=X.seen.get(Q);K.ref=G.innerType,Y.readOnly=!0};var uz=(Q,X,Y,W)=>{let G=Q._zod.def;bQ(G.innerType,X,W);let K=X.seen.get(Q);K.ref=G.innerType};var dJ={};w1(dJ,{time:()=>aH,duration:()=>eH,datetime:()=>tH,date:()=>sH,ZodISOTime:()=>lz,ZodISODuration:()=>mz,ZodISODateTime:()=>pz,ZodISODate:()=>cz});var pz=V0("ZodISODateTime",(Q,X)=>{t4.init(Q,X),SQ.init(Q,X)});function tH(Q){return Jz(pz,Q)}var cz=V0("ZodISODate",(Q,X)=>{s4.init(Q,X),SQ.init(Q,X)});function sH(Q){return Wz(cz,Q)}var lz=V0("ZodISOTime",(Q,X)=>{a4.init(Q,X),SQ.init(Q,X)});function aH(Q){return Gz(lz,Q)}var mz=V0("ZodISODuration",(Q,X)=>{e4.init(Q,X),SQ.init(Q,X)});function eH(Q){return $z(mz,Q)}var dz=(Q,X)=>{TG.init(Q,X),Q.name="ZodError",Object.defineProperties(Q,{format:{value:(Y)=>wF(Q,Y)},flatten:{value:(Y)=>kF(Q,Y)},addIssue:{value:(Y)=>{Q.issues.push(Y),Q.message=JSON.stringify(Q.issues,h1,2)}},addIssues:{value:(Y)=>{Q.issues.push(...Y),Q.message=JSON.stringify(Q.issues,h1,2)}},isEmpty:{get(){return Q.issues.length===0}}})},lo=V0("ZodError",dz),pX=V0("ZodError",dz,{Parent:Error});var nz=RG(pX),oz=PG(pX),rz=bJ(pX),iz=hJ(pX),tz=xF(pX),sz=yF(pX),az=gF(pX),ez=fF(pX),Q5=bF(pX),X5=hF(pX),Y5=uF(pX),J5=pF(pX);var NQ=V0("ZodType",(Q,X)=>{return EQ.init(Q,X),Object.assign(Q["~standard"],{jsonSchema:{input:lJ(Q,"input"),output:lJ(Q,"output")}}),Q.toJSONSchema=qz(Q,{}),Q.def=X,Q.type=X.type,Object.defineProperty(Q,"_def",{value:X}),Q.check=(...Y)=>{return Q.clone(ZQ.mergeDefs(X,{checks:[...X.checks??[],...Y.map((W)=>typeof W==="function"?{_zod:{check:W,def:{check:"custom"},onattach:[]}}:W)]}))},Q.clone=(Y,W)=>QY(Q,Y,W),Q.brand=()=>Q,Q.register=(Y,W)=>{return Y.add(Q,W),Q},Q.parse=(Y,W)=>nz(Q,Y,W,{callee:Q.parse}),Q.safeParse=(Y,W)=>rz(Q,Y,W),Q.parseAsync=async(Y,W)=>oz(Q,Y,W,{callee:Q.parseAsync}),Q.safeParseAsync=async(Y,W)=>iz(Q,Y,W),Q.spa=Q.safeParseAsync,Q.encode=(Y,W)=>tz(Q,Y,W),Q.decode=(Y,W)=>sz(Q,Y,W),Q.encodeAsync=async(Y,W)=>az(Q,Y,W),Q.decodeAsync=async(Y,W)=>ez(Q,Y,W),Q.safeEncode=(Y,W)=>Q5(Q,Y,W),Q.safeDecode=(Y,W)=>X5(Q,Y,W),Q.safeEncodeAsync=async(Y,W)=>Y5(Q,Y,W),Q.safeDecodeAsync=async(Y,W)=>J5(Q,Y,W),Q.refine=(Y,W)=>Q.check(DC(Y,W)),Q.superRefine=(Y)=>Q.check(qC(Y)),Q.overwrite=(Y)=>Q.check(iY(Y)),Q.optional=()=>jQ(Q),Q.nullable=()=>$5(Q),Q.nullish=()=>jQ($5(Q)),Q.nonoptional=(Y)=>KC(Q,Y),Q.array=()=>XQ(Q),Q.or=(Y)=>IQ([Q,Y]),Q.and=(Y)=>yG(Q,Y),Q.transform=(Y)=>X8(Q,F5(Y)),Q.default=(Y)=>ZC(Q,Y),Q.prefault=(Y)=>UC(Q,Y),Q.catch=(Y)=>VC(Q,Y),Q.pipe=(Y)=>X8(Q,Y),Q.readonly=()=>AC(Q),Q.describe=(Y)=>{let W=Q.clone();return I1.add(W,{description:Y}),W},Object.defineProperty(Q,"description",{get(){return I1.get(Q)?.description},configurable:!0}),Q.meta=(...Y)=>{if(Y.length===0)return I1.get(Q);let W=Q.clone();return I1.add(W,Y[0]),W},Q.isOptional=()=>Q.safeParse(void 0).success,Q.isNullable=()=>Q.safeParse(null).success,Q}),Z5=V0("_ZodString",(Q,X)=>{jG.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(W,G,K)=>Iz(Q,W,G,K);let Y=Q._zod.bag;Q.format=Y.format??null,Q.minLength=Y.minimum??null,Q.maxLength=Y.maximum??null,Q.regex=(...W)=>Q.check(gH(...W)),Q.includes=(...W)=>Q.check(hH(...W)),Q.startsWith=(...W)=>Q.check(uH(...W)),Q.endsWith=(...W)=>Q.check(pH(...W)),Q.min=(...W)=>Q.check(c1(...W)),Q.max=(...W)=>Q.check(vG(...W)),Q.length=(...W)=>Q.check(_G(...W)),Q.nonempty=(...W)=>Q.check(c1(1,...W)),Q.lowercase=(W)=>Q.check(fH(W)),Q.uppercase=(W)=>Q.check(bH(W)),Q.trim=()=>Q.check(lH()),Q.normalize=(...W)=>Q.check(cH(...W)),Q.toLowerCase=()=>Q.check(mH()),Q.toUpperCase=()=>Q.check(dH()),Q.slugify=()=>Q.check(nH())}),NS=V0("ZodString",(Q,X)=>{jG.init(Q,X),Z5.init(Q,X),Q.email=(Y)=>Q.check(gV(kS,Y)),Q.url=(Y)=>Q.check(pV(wS,Y)),Q.jwt=(Y)=>Q.check(Yz(nS,Y)),Q.emoji=(Y)=>Q.check(cV(vS,Y)),Q.guid=(Y)=>Q.check(yH(W5,Y)),Q.uuid=(Y)=>Q.check(fV(xG,Y)),Q.uuidv4=(Y)=>Q.check(bV(xG,Y)),Q.uuidv6=(Y)=>Q.check(hV(xG,Y)),Q.uuidv7=(Y)=>Q.check(uV(xG,Y)),Q.nanoid=(Y)=>Q.check(lV(_S,Y)),Q.guid=(Y)=>Q.check(yH(W5,Y)),Q.cuid=(Y)=>Q.check(mV(xS,Y)),Q.cuid2=(Y)=>Q.check(dV(yS,Y)),Q.ulid=(Y)=>Q.check(nV(gS,Y)),Q.base64=(Y)=>Q.check(eV(lS,Y)),Q.base64url=(Y)=>Q.check(Qz(mS,Y)),Q.xid=(Y)=>Q.check(oV(fS,Y)),Q.ksuid=(Y)=>Q.check(rV(bS,Y)),Q.ipv4=(Y)=>Q.check(iV(hS,Y)),Q.ipv6=(Y)=>Q.check(tV(uS,Y)),Q.cidrv4=(Y)=>Q.check(sV(pS,Y)),Q.cidrv6=(Y)=>Q.check(aV(cS,Y)),Q.e164=(Y)=>Q.check(Xz(dS,Y)),Q.datetime=(Y)=>Q.check(tH(Y)),Q.date=(Y)=>Q.check(sH(Y)),Q.time=(Y)=>Q.check(aH(Y)),Q.duration=(Y)=>Q.check(eH(Y))});function U0(Q){return yV(NS,Q)}var SQ=V0("ZodStringFormat",(Q,X)=>{TQ.init(Q,X),Z5.init(Q,X)}),kS=V0("ZodEmail",(Q,X)=>{p4.init(Q,X),SQ.init(Q,X)});var W5=V0("ZodGUID",(Q,X)=>{h4.init(Q,X),SQ.init(Q,X)});var xG=V0("ZodUUID",(Q,X)=>{u4.init(Q,X),SQ.init(Q,X)});var wS=V0("ZodURL",(Q,X)=>{c4.init(Q,X),SQ.init(Q,X)});var vS=V0("ZodEmoji",(Q,X)=>{l4.init(Q,X),SQ.init(Q,X)});var _S=V0("ZodNanoID",(Q,X)=>{m4.init(Q,X),SQ.init(Q,X)});var xS=V0("ZodCUID",(Q,X)=>{d4.init(Q,X),SQ.init(Q,X)});var yS=V0("ZodCUID2",(Q,X)=>{n4.init(Q,X),SQ.init(Q,X)});var gS=V0("ZodULID",(Q,X)=>{o4.init(Q,X),SQ.init(Q,X)});var fS=V0("ZodXID",(Q,X)=>{r4.init(Q,X),SQ.init(Q,X)});var bS=V0("ZodKSUID",(Q,X)=>{i4.init(Q,X),SQ.init(Q,X)});var hS=V0("ZodIPv4",(Q,X)=>{QV.init(Q,X),SQ.init(Q,X)});var uS=V0("ZodIPv6",(Q,X)=>{XV.init(Q,X),SQ.init(Q,X)});var pS=V0("ZodCIDRv4",(Q,X)=>{YV.init(Q,X),SQ.init(Q,X)});var cS=V0("ZodCIDRv6",(Q,X)=>{JV.init(Q,X),SQ.init(Q,X)});var lS=V0("ZodBase64",(Q,X)=>{GV.init(Q,X),SQ.init(Q,X)});var mS=V0("ZodBase64URL",(Q,X)=>{$V.init(Q,X),SQ.init(Q,X)});var dS=V0("ZodE164",(Q,X)=>{ZV.init(Q,X),SQ.init(Q,X)});var nS=V0("ZodJWT",(Q,X)=>{HV.init(Q,X),SQ.init(Q,X)});var H5=V0("ZodNumber",(Q,X)=>{vH.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(W,G,K)=>Mz(Q,W,G,K),Q.gt=(W,G)=>Q.check(kG(W,G)),Q.gte=(W,G)=>Q.check(cJ(W,G)),Q.min=(W,G)=>Q.check(cJ(W,G)),Q.lt=(W,G)=>Q.check(NG(W,G)),Q.lte=(W,G)=>Q.check(pJ(W,G)),Q.max=(W,G)=>Q.check(pJ(W,G)),Q.int=(W)=>Q.check(G5(W)),Q.safe=(W)=>Q.check(G5(W)),Q.positive=(W)=>Q.check(kG(0,W)),Q.nonnegative=(W)=>Q.check(cJ(0,W)),Q.negative=(W)=>Q.check(NG(0,W)),Q.nonpositive=(W)=>Q.check(pJ(0,W)),Q.multipleOf=(W,G)=>Q.check(wG(W,G)),Q.step=(W,G)=>Q.check(wG(W,G)),Q.finite=()=>Q;let Y=Q._zod.bag;Q.minValue=Math.max(Y.minimum??Number.NEGATIVE_INFINITY,Y.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,Q.maxValue=Math.min(Y.maximum??Number.POSITIVE_INFINITY,Y.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,Q.isInt=(Y.format??"").includes("int")||Number.isSafeInteger(Y.multipleOf??0.5),Q.isFinite=!0,Q.format=Y.format??null});function VQ(Q){return Zz(H5,Q)}var oS=V0("ZodNumberFormat",(Q,X)=>{UV.init(Q,X),H5.init(Q,X)});function G5(Q){return Hz(oS,Q)}var rS=V0("ZodBoolean",(Q,X)=>{KV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Lz(Q,Y,W,G)});function WX(Q){return Uz(rS,Q)}var iS=V0("ZodNull",(Q,X)=>{FV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Ez(Q,Y,W,G)});function Y8(Q){return Kz(iS,Q)}var tS=V0("ZodUnknown",(Q,X)=>{VV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Rz(Q,Y,W,G)});function qQ(){return Fz(tS)}var sS=V0("ZodNever",(Q,X)=>{zV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Tz(Q,Y,W,G)});function aS(Q){return Vz(sS,Q)}var eS=V0("ZodArray",(Q,X)=>{OV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>jz(Q,Y,W,G),Q.element=X.element,Q.min=(Y,W)=>Q.check(c1(Y,W)),Q.nonempty=(Y)=>Q.check(c1(1,Y)),Q.max=(Y,W)=>Q.check(vG(Y,W)),Q.length=(Y,W)=>Q.check(_G(Y,W)),Q.unwrap=()=>Q.element});function XQ(Q,X){return zz(eS,Q,X)}var U5=V0("ZodObject",(Q,X)=>{qV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Nz(Q,Y,W,G),ZQ.defineLazy(Q,"shape",()=>{return X.shape}),Q.keyof=()=>kX(Object.keys(Q._zod.def.shape)),Q.catchall=(Y)=>Q.clone({...Q._zod.def,catchall:Y}),Q.passthrough=()=>Q.clone({...Q._zod.def,catchall:qQ()}),Q.loose=()=>Q.clone({...Q._zod.def,catchall:qQ()}),Q.strict=()=>Q.clone({...Q._zod.def,catchall:aS()}),Q.strip=()=>Q.clone({...Q._zod.def,catchall:void 0}),Q.extend=(Y)=>{return ZQ.extend(Q,Y)},Q.safeExtend=(Y)=>{return ZQ.safeExtend(Q,Y)},Q.merge=(Y)=>ZQ.merge(Q,Y),Q.pick=(Y)=>ZQ.pick(Q,Y),Q.omit=(Y)=>ZQ.omit(Q,Y),Q.partial=(...Y)=>ZQ.partial(V5,Q,Y[0]),Q.required=(...Y)=>ZQ.required(z5,Q,Y[0])});function h0(Q,X){let Y={type:"object",shape:Q??{},...ZQ.normalizeParams(X)};return new U5(Y)}function RX(Q,X){return new U5({type:"object",shape:Q,catchall:qQ(),...ZQ.normalizeParams(X)})}var K5=V0("ZodUnion",(Q,X)=>{_H.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>kz(Q,Y,W,G),Q.options=X.options});function IQ(Q,X){return new K5({type:"union",options:Q,...ZQ.normalizeParams(X)})}var QC=V0("ZodDiscriminatedUnion",(Q,X)=>{K5.init(Q,X),IV.init(Q,X)});function J8(Q,X,Y){return new QC({type:"union",options:X,discriminator:Q,...ZQ.normalizeParams(Y)})}var XC=V0("ZodIntersection",(Q,X)=>{MV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>wz(Q,Y,W,G)});function yG(Q,X){return new XC({type:"intersection",left:Q,right:X})}var YC=V0("ZodRecord",(Q,X)=>{LV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>vz(Q,Y,W,G),Q.keyType=X.keyType,Q.valueType=X.valueType});function MQ(Q,X,Y){return new YC({type:"record",keyType:Q,valueType:X,...ZQ.normalizeParams(Y)})}var Q8=V0("ZodEnum",(Q,X)=>{EV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(W,G,K)=>Pz(Q,W,G,K),Q.enum=X.entries,Q.options=Object.values(X.entries);let Y=new Set(Object.keys(X.entries));Q.extract=(W,G)=>{let K={};for(let Z of W)if(Y.has(Z))K[Z]=X.entries[Z];else throw Error(`Key ${Z} not found in enum`);return new Q8({...X,checks:[],...ZQ.normalizeParams(G),entries:K})},Q.exclude=(W,G)=>{let K={...X.entries};for(let Z of W)if(Y.has(Z))delete K[Z];else throw Error(`Key ${Z} not found in enum`);return new Q8({...X,checks:[],...ZQ.normalizeParams(G),entries:K})}});function kX(Q,X){let Y=Array.isArray(Q)?Object.fromEntries(Q.map((W)=>[W,W])):Q;return new Q8({type:"enum",entries:Y,...ZQ.normalizeParams(X)})}var JC=V0("ZodLiteral",(Q,X)=>{TV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Bz(Q,Y,W,G),Q.values=new Set(X.values),Object.defineProperty(Q,"value",{get(){if(X.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return X.values[0]}})});function u0(Q,X){return new JC({type:"literal",values:Array.isArray(Q)?Q:[Q],...ZQ.normalizeParams(X)})}var WC=V0("ZodTransform",(Q,X)=>{RV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Cz(Q,Y,W,G),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")throw new vJ(Q.constructor.name);Y.addIssue=(K)=>{if(typeof K==="string")Y.issues.push(ZQ.issue(K,Y.value,X));else{let Z=K;if(Z.fatal)Z.continue=!1;Z.code??(Z.code="custom"),Z.input??(Z.input=Y.value),Z.inst??(Z.inst=Q),Y.issues.push(ZQ.issue(Z))}};let G=X.transform(Y.value,Y);if(G instanceof Promise)return G.then((K)=>{return Y.value=K,Y});return Y.value=G,Y}});function F5(Q){return new WC({type:"transform",transform:Q})}var V5=V0("ZodOptional",(Q,X)=>{PV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>uz(Q,Y,W,G),Q.unwrap=()=>Q._zod.def.innerType});function jQ(Q){return new V5({type:"optional",innerType:Q})}var GC=V0("ZodNullable",(Q,X)=>{BV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>_z(Q,Y,W,G),Q.unwrap=()=>Q._zod.def.innerType});function $5(Q){return new GC({type:"nullable",innerType:Q})}var $C=V0("ZodDefault",(Q,X)=>{SV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>yz(Q,Y,W,G),Q.unwrap=()=>Q._zod.def.innerType,Q.removeDefault=Q.unwrap});function ZC(Q,X){return new $C({type:"default",innerType:Q,get defaultValue(){return typeof X==="function"?X():ZQ.shallowClone(X)}})}var HC=V0("ZodPrefault",(Q,X)=>{CV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>gz(Q,Y,W,G),Q.unwrap=()=>Q._zod.def.innerType});function UC(Q,X){return new HC({type:"prefault",innerType:Q,get defaultValue(){return typeof X==="function"?X():ZQ.shallowClone(X)}})}var z5=V0("ZodNonOptional",(Q,X)=>{jV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>xz(Q,Y,W,G),Q.unwrap=()=>Q._zod.def.innerType});function KC(Q,X){return new z5({type:"nonoptional",innerType:Q,...ZQ.normalizeParams(X)})}var FC=V0("ZodCatch",(Q,X)=>{NV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>fz(Q,Y,W,G),Q.unwrap=()=>Q._zod.def.innerType,Q.removeCatch=Q.unwrap});function VC(Q,X){return new FC({type:"catch",innerType:Q,catchValue:typeof X==="function"?X:()=>X})}var zC=V0("ZodPipe",(Q,X)=>{kV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>bz(Q,Y,W,G),Q.in=X.in,Q.out=X.out});function X8(Q,X){return new zC({type:"pipe",in:Q,out:X})}var OC=V0("ZodReadonly",(Q,X)=>{wV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>hz(Q,Y,W,G),Q.unwrap=()=>Q._zod.def.innerType});function AC(Q){return new OC({type:"readonly",innerType:Q})}var O5=V0("ZodCustom",(Q,X)=>{vV.init(Q,X),NQ.init(Q,X),Q._zod.processJSONSchema=(Y,W,G)=>Sz(Q,Y,W,G)});function A5(Q,X){return Oz(O5,Q??(()=>!0),X)}function DC(Q,X={}){return Az(O5,Q,X)}function qC(Q){return Dz(Q)}function W8(Q,X){return X8(F5(Q),X)}dX(xH());var Li=h0({tenantId:U0().optional(),actorId:U0().optional(),sessionId:U0().optional(),metadata:MQ(U0(),qQ()).optional()});var L5="io.modelcontextprotocol/related-task",fG="2.0",HX=A5((Q)=>Q!==null&&(typeof Q==="object"||typeof Q==="function")),E5=IQ([U0(),VQ().int()]),T5=U0(),vi=RX({ttl:IQ([VQ(),Y8()]).optional(),pollInterval:VQ().optional()}),RC=h0({ttl:VQ().optional()}),PC=h0({taskId:U0()}),$8=RX({progressToken:E5.optional(),[L5]:PC.optional()}),cX=h0({_meta:$8.optional()}),bG=cX.extend({task:RC.optional()});var UX=h0({method:U0(),params:cX.loose().optional()}),nX=h0({_meta:$8.optional()}),oX=h0({method:U0(),params:nX.loose().optional()}),KX=RX({_meta:$8.optional()}),hG=IQ([U0(),VQ().int()]),BC=h0({jsonrpc:u0(fG),id:hG,...UX.shape}).strict();var SC=h0({jsonrpc:u0(fG),...oX.shape}).strict();var R5=h0({jsonrpc:u0(fG),id:hG,result:KX}).strict();var nJ;(function(Q){Q[Q.ConnectionClosed=-32000]="ConnectionClosed",Q[Q.RequestTimeout=-32001]="RequestTimeout",Q[Q.ParseError=-32700]="ParseError",Q[Q.InvalidRequest=-32600]="InvalidRequest",Q[Q.MethodNotFound=-32601]="MethodNotFound",Q[Q.InvalidParams=-32602]="InvalidParams",Q[Q.InternalError=-32603]="InternalError",Q[Q.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(nJ||(nJ={}));var P5=h0({jsonrpc:u0(fG),id:hG.optional(),error:h0({code:VQ().int(),message:U0(),data:qQ().optional()})}).strict();var _i=IQ([BC,SC,R5,P5]),xi=IQ([R5,P5]),Z8=KX.strict(),CC=nX.extend({requestId:hG.optional(),reason:U0().optional()}),H8=oX.extend({method:u0("notifications/cancelled"),params:CC}),jC=h0({src:U0(),mimeType:U0().optional(),sizes:XQ(U0()).optional(),theme:kX(["light","dark"]).optional()}),oJ=h0({icons:XQ(jC).optional()}),l1=h0({name:U0(),title:U0().optional()}),B5=l1.extend({...l1.shape,...oJ.shape,version:U0(),websiteUrl:U0().optional(),description:U0().optional()}),NC=yG(h0({applyDefaults:WX().optional()}),MQ(U0(),qQ())),kC=W8((Q)=>{if(Q&&typeof Q==="object"&&!Array.isArray(Q)){if(Object.keys(Q).length===0)return{form:{}}}return Q},yG(h0({form:NC.optional(),url:HX.optional()}),MQ(U0(),qQ()).optional())),wC=RX({list:HX.optional(),cancel:HX.optional(),requests:RX({sampling:RX({createMessage:HX.optional()}).optional(),elicitation:RX({create:HX.optional()}).optional()}).optional()}),vC=RX({list:HX.optional(),cancel:HX.optional(),requests:RX({tools:RX({call:HX.optional()}).optional()}).optional()}),_C=h0({experimental:MQ(U0(),HX).optional(),sampling:h0({context:HX.optional(),tools:HX.optional()}).optional(),elicitation:kC.optional(),roots:h0({listChanged:WX().optional()}).optional(),tasks:wC.optional()}),xC=cX.extend({protocolVersion:U0(),capabilities:_C,clientInfo:B5}),S5=UX.extend({method:u0("initialize"),params:xC});var yC=h0({experimental:MQ(U0(),HX).optional(),logging:HX.optional(),completions:HX.optional(),prompts:h0({listChanged:WX().optional()}).optional(),resources:h0({subscribe:WX().optional(),listChanged:WX().optional()}).optional(),tools:h0({listChanged:WX().optional()}).optional(),tasks:vC.optional()}),gC=KX.extend({protocolVersion:U0(),capabilities:yC,serverInfo:B5,instructions:U0().optional()}),C5=oX.extend({method:u0("notifications/initialized"),params:nX.optional()});var U8=UX.extend({method:u0("ping"),params:cX.optional()}),fC=h0({progress:VQ(),total:jQ(VQ()),message:jQ(U0())}),bC=h0({...nX.shape,...fC.shape,progressToken:E5}),K8=oX.extend({method:u0("notifications/progress"),params:bC}),hC=cX.extend({cursor:T5.optional()}),rJ=UX.extend({params:hC.optional()}),iJ=KX.extend({nextCursor:T5.optional()}),uC=kX(["working","input_required","completed","failed","cancelled"]),tJ=h0({taskId:U0(),status:uC,ttl:IQ([VQ(),Y8()]),createdAt:U0(),lastUpdatedAt:U0(),pollInterval:jQ(VQ()),statusMessage:jQ(U0())}),uG=KX.extend({task:tJ}),pC=nX.merge(tJ),F8=oX.extend({method:u0("notifications/tasks/status"),params:pC}),V8=UX.extend({method:u0("tasks/get"),params:cX.extend({taskId:U0()})}),z8=KX.merge(tJ),O8=UX.extend({method:u0("tasks/result"),params:cX.extend({taskId:U0()})}),yi=KX.loose(),A8=rJ.extend({method:u0("tasks/list")}),D8=iJ.extend({tasks:XQ(tJ)}),q8=UX.extend({method:u0("tasks/cancel"),params:cX.extend({taskId:U0()})}),cC=KX.merge(tJ),j5=h0({uri:U0(),mimeType:jQ(U0()),_meta:MQ(U0(),qQ()).optional()}),N5=j5.extend({text:U0()}),I8=U0().refine((Q)=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),k5=j5.extend({blob:I8}),sJ=kX(["user","assistant"]),m1=h0({audience:XQ(sJ).optional(),priority:VQ().min(0).max(1).optional(),lastModified:dJ.datetime({offset:!0}).optional()}),w5=h0({...l1.shape,...oJ.shape,uri:U0(),description:jQ(U0()),mimeType:jQ(U0()),annotations:m1.optional(),_meta:jQ(RX({}))}),lC=h0({...l1.shape,...oJ.shape,uriTemplate:U0(),description:jQ(U0()),mimeType:jQ(U0()),annotations:m1.optional(),_meta:jQ(RX({}))}),v5=rJ.extend({method:u0("resources/list")}),mC=iJ.extend({resources:XQ(w5)}),_5=rJ.extend({method:u0("resources/templates/list")}),dC=iJ.extend({resourceTemplates:XQ(lC)}),M8=cX.extend({uri:U0()}),nC=M8,x5=UX.extend({method:u0("resources/read"),params:nC}),oC=KX.extend({contents:XQ(IQ([N5,k5]))}),rC=oX.extend({method:u0("notifications/resources/list_changed"),params:nX.optional()}),iC=M8,tC=UX.extend({method:u0("resources/subscribe"),params:iC}),sC=M8,aC=UX.extend({method:u0("resources/unsubscribe"),params:sC}),eC=nX.extend({uri:U0()}),Q3=oX.extend({method:u0("notifications/resources/updated"),params:eC}),X3=h0({name:U0(),description:jQ(U0()),required:jQ(WX())}),Y3=h0({...l1.shape,...oJ.shape,description:jQ(U0()),arguments:jQ(XQ(X3)),_meta:jQ(RX({}))}),y5=rJ.extend({method:u0("prompts/list")}),J3=iJ.extend({prompts:XQ(Y3)}),W3=cX.extend({name:U0(),arguments:MQ(U0(),U0()).optional()}),g5=UX.extend({method:u0("prompts/get"),params:W3}),L8=h0({type:u0("text"),text:U0(),annotations:m1.optional(),_meta:MQ(U0(),qQ()).optional()}),E8=h0({type:u0("image"),data:I8,mimeType:U0(),annotations:m1.optional(),_meta:MQ(U0(),qQ()).optional()}),T8=h0({type:u0("audio"),data:I8,mimeType:U0(),annotations:m1.optional(),_meta:MQ(U0(),qQ()).optional()}),G3=h0({type:u0("tool_use"),name:U0(),id:U0(),input:MQ(U0(),qQ()),_meta:MQ(U0(),qQ()).optional()}),$3=h0({type:u0("resource"),resource:IQ([N5,k5]),annotations:m1.optional(),_meta:MQ(U0(),qQ()).optional()}),Z3=w5.extend({type:u0("resource_link")}),R8=IQ([L8,E8,T8,Z3,$3]),H3=h0({role:sJ,content:R8}),U3=KX.extend({description:U0().optional(),messages:XQ(H3)}),K3=oX.extend({method:u0("notifications/prompts/list_changed"),params:nX.optional()}),F3=h0({title:U0().optional(),readOnlyHint:WX().optional(),destructiveHint:WX().optional(),idempotentHint:WX().optional(),openWorldHint:WX().optional()}),V3=h0({taskSupport:kX(["required","optional","forbidden"]).optional()}),f5=h0({...l1.shape,...oJ.shape,description:U0().optional(),inputSchema:h0({type:u0("object"),properties:MQ(U0(),HX).optional(),required:XQ(U0()).optional()}).catchall(qQ()),outputSchema:h0({type:u0("object"),properties:MQ(U0(),HX).optional(),required:XQ(U0()).optional()}).catchall(qQ()).optional(),annotations:F3.optional(),execution:V3.optional(),_meta:MQ(U0(),qQ()).optional()}),b5=rJ.extend({method:u0("tools/list")}),z3=iJ.extend({tools:XQ(f5)}),P8=KX.extend({content:XQ(R8).default([]),structuredContent:MQ(U0(),qQ()).optional(),isError:WX().optional()}),gi=P8.or(KX.extend({toolResult:qQ()})),O3=bG.extend({name:U0(),arguments:MQ(U0(),qQ()).optional()}),B8=UX.extend({method:u0("tools/call"),params:O3}),A3=oX.extend({method:u0("notifications/tools/list_changed"),params:nX.optional()}),fi=h0({autoRefresh:WX().default(!0),debounceMs:VQ().int().nonnegative().default(300)}),S8=kX(["debug","info","notice","warning","error","critical","alert","emergency"]),D3=cX.extend({level:S8}),h5=UX.extend({method:u0("logging/setLevel"),params:D3}),q3=nX.extend({level:S8,logger:U0().optional(),data:qQ()}),I3=oX.extend({method:u0("notifications/message"),params:q3}),M3=h0({name:U0().optional()}),L3=h0({hints:XQ(M3).optional(),costPriority:VQ().min(0).max(1).optional(),speedPriority:VQ().min(0).max(1).optional(),intelligencePriority:VQ().min(0).max(1).optional()}),E3=h0({mode:kX(["auto","required","none"]).optional()}),T3=h0({type:u0("tool_result"),toolUseId:U0().describe("The unique identifier for the corresponding tool call."),content:XQ(R8).default([]),structuredContent:h0({}).loose().optional(),isError:WX().optional(),_meta:MQ(U0(),qQ()).optional()}),R3=J8("type",[L8,E8,T8]),gG=J8("type",[L8,E8,T8,G3,T3]),P3=h0({role:sJ,content:IQ([gG,XQ(gG)]),_meta:MQ(U0(),qQ()).optional()}),B3=bG.extend({messages:XQ(P3),modelPreferences:L3.optional(),systemPrompt:U0().optional(),includeContext:kX(["none","thisServer","allServers"]).optional(),temperature:VQ().optional(),maxTokens:VQ().int(),stopSequences:XQ(U0()).optional(),metadata:HX.optional(),tools:XQ(f5).optional(),toolChoice:E3.optional()}),S3=UX.extend({method:u0("sampling/createMessage"),params:B3}),u5=KX.extend({model:U0(),stopReason:jQ(kX(["endTurn","stopSequence","maxTokens"]).or(U0())),role:sJ,content:R3}),p5=KX.extend({model:U0(),stopReason:jQ(kX(["endTurn","stopSequence","maxTokens","toolUse"]).or(U0())),role:sJ,content:IQ([gG,XQ(gG)])}),C3=h0({type:u0("boolean"),title:U0().optional(),description:U0().optional(),default:WX().optional()}),j3=h0({type:u0("string"),title:U0().optional(),description:U0().optional(),minLength:VQ().optional(),maxLength:VQ().optional(),format:kX(["email","uri","date","date-time"]).optional(),default:U0().optional()}),N3=h0({type:kX(["number","integer"]),title:U0().optional(),description:U0().optional(),minimum:VQ().optional(),maximum:VQ().optional(),default:VQ().optional()}),k3=h0({type:u0("string"),title:U0().optional(),description:U0().optional(),enum:XQ(U0()),default:U0().optional()}),w3=h0({type:u0("string"),title:U0().optional(),description:U0().optional(),oneOf:XQ(h0({const:U0(),title:U0()})),default:U0().optional()}),v3=h0({type:u0("string"),title:U0().optional(),description:U0().optional(),enum:XQ(U0()),enumNames:XQ(U0()).optional(),default:U0().optional()}),_3=IQ([k3,w3]),x3=h0({type:u0("array"),title:U0().optional(),description:U0().optional(),minItems:VQ().optional(),maxItems:VQ().optional(),items:h0({type:u0("string"),enum:XQ(U0())}),default:XQ(U0()).optional()}),y3=h0({type:u0("array"),title:U0().optional(),description:U0().optional(),minItems:VQ().optional(),maxItems:VQ().optional(),items:h0({anyOf:XQ(h0({const:U0(),title:U0()}))}),default:XQ(U0()).optional()}),g3=IQ([x3,y3]),f3=IQ([v3,_3,g3]),b3=IQ([f3,C3,j3,N3]),h3=bG.extend({mode:u0("form").optional(),message:U0(),requestedSchema:h0({type:u0("object"),properties:MQ(U0(),b3),required:XQ(U0()).optional()})}),u3=bG.extend({mode:u0("url"),message:U0(),elicitationId:U0(),url:U0().url()}),p3=IQ([h3,u3]),c3=UX.extend({method:u0("elicitation/create"),params:p3}),l3=nX.extend({elicitationId:U0()}),m3=oX.extend({method:u0("notifications/elicitation/complete"),params:l3}),c5=KX.extend({action:kX(["accept","decline","cancel"]),content:W8((Q)=>Q===null?void 0:Q,MQ(U0(),IQ([U0(),VQ(),WX(),XQ(U0())])).optional())}),d3=h0({type:u0("ref/resource"),uri:U0()});var n3=h0({type:u0("ref/prompt"),name:U0()}),o3=cX.extend({ref:IQ([n3,d3]),argument:h0({name:U0(),value:U0()}),context:h0({arguments:MQ(U0(),U0()).optional()}).optional()}),l5=UX.extend({method:u0("completion/complete"),params:o3});var r3=KX.extend({completion:RX({values:XQ(U0()).max(100),total:jQ(VQ().int()),hasMore:jQ(WX())})}),i3=h0({uri:U0().startsWith("file://"),name:U0().optional(),_meta:MQ(U0(),qQ()).optional()}),t3=UX.extend({method:u0("roots/list"),params:cX.optional()}),m5=KX.extend({roots:XQ(i3)}),s3=oX.extend({method:u0("notifications/roots/list_changed"),params:nX.optional()}),bi=IQ([U8,S5,l5,h5,g5,y5,v5,_5,x5,tC,aC,B8,b5,V8,O8,A8,q8]),hi=IQ([H8,K8,C5,s3,F8]),ui=IQ([Z8,u5,p5,c5,m5,z8,D8,uG]),pi=IQ([U8,S3,c3,t3,V8,O8,A8,q8]),ci=IQ([H8,K8,I3,Q3,rC,A3,K3,F8,m3]),li=IQ([Z8,gC,r3,U3,J3,mC,dC,oC,P8,z3,z8,D8,uG]);var a3=Symbol("Let zodToJsonSchema decide on which parser to use");var Tt=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Sc=mW(ZD(),1),Cc=mW(BL(),1);var SL;(function(Q){Q.Completable="McpCompletable"})(SL||(SL={}));EX();var x10=qH({meta:{name:"lifecycle.advisor",version:1,title:"Lifecycle Advisor Agent",description:"Guides artisans through lifecycle detection, focus areas, and ceremonies.",owners:["team-lifecycle"],domain:"operations",tags:["guide","lifecycle","ops"],stability:"experimental"},description:"Guides users through lifecycle assessments, highlights gaps, and recommends actions tied to ContractSpec libraries.",instructions:`You are the Lifecycle Advisor. Always clarify the user's current stage, confidence, and blockers before suggesting actions.
|
|
52
|
+
- Prioritize simple, mobile-friendly instructions.
|
|
53
|
+
- When in early stages, focus on learning loops, not heavy infra.
|
|
54
|
+
- When in later stages, emphasize repeatability, telemetry, and managed ceremonies.
|
|
55
|
+
- Suggest at most 3 actions at a time. Reference ContractSpec libraries or modules when relevant.`,tools:[{name:"run_assessment",description:"Trigger a lifecycle assessment for a tenant.",schema:{type:"object",properties:{tenantId:{type:"string"},questionnaire:{type:"object",additionalProperties:!0}},required:["tenantId"]},automationSafe:!0},{name:"fetch_playbook",description:"Retrieve stage-specific playbook (actions, ceremonies, libraries).",schema:{type:"object",properties:{stage:{type:"integer",minimum:0,maximum:6,description:"Lifecycle stage number (0-6)"}},required:["stage"]},automationSafe:!0}],memory:{maxEntries:25,ttlMinutes:120},policy:{confidence:{min:0.7},escalation:{confidenceThreshold:0.5,approvalWorkflow:"ops.lifecycle.escalation"},flags:["lifecycle_advisor"]}});var g10=(Q)=>({runAssessment:async(X)=>{let Y=X.body??{};return{status:200,body:await Q.runAssessment(Y)}},getPlaybook:async(X)=>{let Y=Number(X.params?.stage??0);return{status:200,body:Q.getStagePlaybook(Y)}}});export{g10 as createLifecycleHandlers,bB as LifecycleEventBridge,_B as LifecycleAssessmentService,x10 as LifecycleAdvisorAgent};
|