wapi-client 0.15.4 → 0.15.5

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.
@@ -24,7 +24,7 @@ __export(env_exports, {
24
24
  getEnvConfig: () => getEnvConfig
25
25
  });
26
26
  module.exports = __toCommonJS(env_exports);
27
- var CLIENT_VERSION = "0.15.4";
27
+ var CLIENT_VERSION = "0.15.5";
28
28
  function getEnvConfig(key, defaultValue) {
29
29
  const val = getVariable(key);
30
30
  if (val === void 0) {
@@ -1,5 +1,5 @@
1
1
  // src/lib/env.ts
2
- var CLIENT_VERSION = "0.15.4";
2
+ var CLIENT_VERSION = "0.15.5";
3
3
  function getEnvConfig(key, defaultValue) {
4
4
  const val = getVariable(key);
5
5
  if (val === void 0) {
package/dist/lib/env.cjs CHANGED
@@ -24,7 +24,7 @@ __export(env_exports, {
24
24
  getEnvConfig: () => getEnvConfig
25
25
  });
26
26
  module.exports = __toCommonJS(env_exports);
27
- var CLIENT_VERSION = "0.15.4";
27
+ var CLIENT_VERSION = "0.15.5";
28
28
  function getEnvConfig(key, defaultValue) {
29
29
  const val = getVariable(key);
30
30
  if (val === void 0) {
package/dist/lib/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/lib/env.ts
2
- var CLIENT_VERSION = "0.15.4";
2
+ var CLIENT_VERSION = "0.15.5";
3
3
  function getEnvConfig(key, defaultValue) {
4
4
  const val = getVariable(key);
5
5
  if (val === void 0) {
@@ -457,6 +457,11 @@ var ERROR_GROUPS = {
457
457
  message: "TR_DIFFERENT_WALLETS",
458
458
  description: `To and from wallets have to be different`
459
459
  },
460
+ TR_AMOUNT_CONSTRAINT: {
461
+ code: -19117,
462
+ message: "TR_AMOUNT_CONSTRAINT",
463
+ description: `The transfer amount is outside of allowed bounds`
464
+ },
460
465
  TRG_SINGLE_PENDING_TR_CANT_RV: {
461
466
  code: -19200,
462
467
  message: "TRG_SINGLE_PENDING_TR_CANT_RV",
@@ -419,6 +419,11 @@ var ERROR_GROUPS = {
419
419
  message: "TR_DIFFERENT_WALLETS",
420
420
  description: `To and from wallets have to be different`
421
421
  },
422
+ TR_AMOUNT_CONSTRAINT: {
423
+ code: -19117,
424
+ message: "TR_AMOUNT_CONSTRAINT",
425
+ description: `The transfer amount is outside of allowed bounds`
426
+ },
422
427
  TRG_SINGLE_PENDING_TR_CANT_RV: {
423
428
  code: -19200,
424
429
  message: "TRG_SINGLE_PENDING_TR_CANT_RV",
@@ -457,6 +457,11 @@ var ERROR_GROUPS = {
457
457
  message: "TR_DIFFERENT_WALLETS",
458
458
  description: `To and from wallets have to be different`
459
459
  },
460
+ TR_AMOUNT_CONSTRAINT: {
461
+ code: -19117,
462
+ message: "TR_AMOUNT_CONSTRAINT",
463
+ description: `The transfer amount is outside of allowed bounds`
464
+ },
460
465
  TRG_SINGLE_PENDING_TR_CANT_RV: {
461
466
  code: -19200,
462
467
  message: "TRG_SINGLE_PENDING_TR_CANT_RV",
@@ -419,6 +419,11 @@ var ERROR_GROUPS = {
419
419
  message: "TR_DIFFERENT_WALLETS",
420
420
  description: `To and from wallets have to be different`
421
421
  },
422
+ TR_AMOUNT_CONSTRAINT: {
423
+ code: -19117,
424
+ message: "TR_AMOUNT_CONSTRAINT",
425
+ description: `The transfer amount is outside of allowed bounds`
426
+ },
422
427
  TRG_SINGLE_PENDING_TR_CANT_RV: {
423
428
  code: -19200,
424
429
  message: "TRG_SINGLE_PENDING_TR_CANT_RV",
@@ -192,6 +192,7 @@ declare module "wapi-client/lib/errors" {
192
192
  TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG: ErrorSpec;
193
193
  TR_UNIQUE_IDENTIFIER: ErrorSpec;
194
194
  TR_DIFFERENT_WALLETS: ErrorSpec;
195
+ TR_AMOUNT_CONSTRAINT: ErrorSpec;
195
196
  TRG_SINGLE_PENDING_TR_CANT_RV: ErrorSpec;
196
197
  TRG_CANCELLED_CANT_RV: ErrorSpec;
197
198
  TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG: ErrorSpec;
@@ -246,6 +247,7 @@ declare module "wapi-client/lib/errors" {
246
247
  TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG: ErrorSpec;
247
248
  TR_UNIQUE_IDENTIFIER: ErrorSpec;
248
249
  TR_DIFFERENT_WALLETS: ErrorSpec;
250
+ TR_AMOUNT_CONSTRAINT: ErrorSpec;
249
251
  TRG_SINGLE_PENDING_TR_CANT_RV: ErrorSpec;
250
252
  TRG_CANCELLED_CANT_RV: ErrorSpec;
251
253
  TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG: ErrorSpec;
@@ -349,6 +351,7 @@ declare module "wapi-client/lib/errors" {
349
351
  TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG: "TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG";
350
352
  TR_UNIQUE_IDENTIFIER: "TR_UNIQUE_IDENTIFIER";
351
353
  TR_DIFFERENT_WALLETS: "TR_DIFFERENT_WALLETS";
354
+ TR_AMOUNT_CONSTRAINT: "TR_AMOUNT_CONSTRAINT";
352
355
  TRG_SINGLE_PENDING_TR_CANT_RV: "TRG_SINGLE_PENDING_TR_CANT_RV";
353
356
  TRG_CANCELLED_CANT_RV: "TRG_CANCELLED_CANT_RV";
354
357
  TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG: "TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG";
@@ -36419,6 +36422,7 @@ declare module "wapi-client" {
36419
36422
  TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG: "TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG";
36420
36423
  TR_UNIQUE_IDENTIFIER: "TR_UNIQUE_IDENTIFIER";
36421
36424
  TR_DIFFERENT_WALLETS: "TR_DIFFERENT_WALLETS";
36425
+ TR_AMOUNT_CONSTRAINT: "TR_AMOUNT_CONSTRAINT";
36422
36426
  TRG_SINGLE_PENDING_TR_CANT_RV: "TRG_SINGLE_PENDING_TR_CANT_RV";
36423
36427
  TRG_CANCELLED_CANT_RV: "TRG_CANCELLED_CANT_RV";
36424
36428
  TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG: "TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG";
@@ -36513,6 +36517,7 @@ declare module "wapi-client" {
36513
36517
  TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG: import("wapi-client/lib/errors").ErrorSpec;
36514
36518
  TR_UNIQUE_IDENTIFIER: import("wapi-client/lib/errors").ErrorSpec;
36515
36519
  TR_DIFFERENT_WALLETS: import("wapi-client/lib/errors").ErrorSpec;
36520
+ TR_AMOUNT_CONSTRAINT: import("wapi-client/lib/errors").ErrorSpec;
36516
36521
  TRG_SINGLE_PENDING_TR_CANT_RV: import("wapi-client/lib/errors").ErrorSpec;
36517
36522
  TRG_CANCELLED_CANT_RV: import("wapi-client/lib/errors").ErrorSpec;
36518
36523
  TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG: import("wapi-client/lib/errors").ErrorSpec;
@@ -1,5 +1,5 @@
1
1
  "use strict";var WAPI=(()=>{var Pb=Object.create;var Dr=Object.defineProperty,Gb=Object.defineProperties,Wb=Object.getOwnPropertyDescriptor,Ub=Object.getOwnPropertyDescriptors,Bb=Object.getOwnPropertyNames,no=Object.getOwnPropertySymbols,Zb=Object.getPrototypeOf,Hi=Object.prototype.hasOwnProperty,Pd=Object.prototype.propertyIsEnumerable;var Gd=Math.pow,qi=(e,t,n)=>t in e?Dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t)=>{for(var n in t||(t={}))Hi.call(t,n)&&qi(e,n,t[n]);if(no)for(var n of no(t))Pd.call(t,n)&&qi(e,n,t[n]);return e},v=(e,t)=>Gb(e,Ub(t));var de=(e,t)=>{var n={};for(var o in e)Hi.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&no)for(var o of no(e))t.indexOf(o)<0&&Pd.call(e,o)&&(n[o]=e[o]);return n};var Vb=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xt=(e,t)=>{for(var n in t)Dr(e,n,{get:t[n],enumerable:!0})},Wd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bb(t))!Hi.call(e,r)&&r!==n&&Dr(e,r,{get:()=>t[r],enumerable:!(o=Wb(t,r))||o.enumerable});return e};var Lb=(e,t,n)=>(n=e!=null?Pb(Zb(e)):{},Wd(t||!e||!e.__esModule?Dr(n,"default",{value:e,enumerable:!0}):n,e)),qb=e=>Wd(Dr({},"__esModule",{value:!0}),e);var E=(e,t,n)=>qi(e,typeof t!="symbol"?t+"":t,n);var Y=(e,t,n)=>new Promise((o,r)=>{var a=c=>{try{p(n.next(c))}catch(i){r(i)}},u=c=>{try{p(n.throw(c))}catch(i){r(i)}},p=c=>c.done?o(c.value):Promise.resolve(c.value).then(a,u);p((n=n.apply(e,t)).next())});var UT=Vb((Dt,WT)=>{var Bi=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof global!="undefined"&&global,Zi=(function(){function e(){this.fetch=!1,this.DOMException=Bi.DOMException}return e.prototype=Bi,new e})();(function(e){var t=(function(n){var o=typeof e!="undefined"&&e||typeof self!="undefined"&&self||typeof global!="undefined"&&global||{},r={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&(function(){try{return new Blob,!0}catch(T){return!1}})(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function a(T){return T&&DataView.prototype.isPrototypeOf(T)}if(r.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(T){return T&&u.indexOf(Object.prototype.toString.call(T))>-1};function c(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(T)||T==="")throw new TypeError('Invalid character in header field name: "'+T+'"');return T.toLowerCase()}function i(T){return typeof T!="string"&&(T=String(T)),T}function d(T){var _={next:function(){var C=T.shift();return{done:C===void 0,value:C}}};return r.iterable&&(_[Symbol.iterator]=function(){return _}),_}function g(T){this.map={},T instanceof g?T.forEach(function(_,C){this.append(C,_)},this):Array.isArray(T)?T.forEach(function(_){if(_.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+_.length);this.append(_[0],_[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(_){this.append(_,T[_])},this)}g.prototype.append=function(T,_){T=c(T),_=i(_);var C=this.map[T];this.map[T]=C?C+", "+_:_},g.prototype.delete=function(T){delete this.map[c(T)]},g.prototype.get=function(T){return T=c(T),this.has(T)?this.map[T]:null},g.prototype.has=function(T){return this.map.hasOwnProperty(c(T))},g.prototype.set=function(T,_){this.map[c(T)]=i(_)},g.prototype.forEach=function(T,_){for(var C in this.map)this.map.hasOwnProperty(C)&&T.call(_,this.map[C],C,this)},g.prototype.keys=function(){var T=[];return this.forEach(function(_,C){T.push(C)}),d(T)},g.prototype.values=function(){var T=[];return this.forEach(function(_){T.push(_)}),d(T)},g.prototype.entries=function(){var T=[];return this.forEach(function(_,C){T.push([C,_])}),d(T)},r.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function h(T){if(!T._noBody){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}}function x(T){return new Promise(function(_,C){T.onload=function(){_(T.result)},T.onerror=function(){C(T.error)}})}function z(T){var _=new FileReader,C=x(_);return _.readAsArrayBuffer(T),C}function H(T){var _=new FileReader,C=x(_),te=/charset=([A-Za-z0-9_-]+)/.exec(T.type),ue=te?te[1]:"utf-8";return _.readAsText(T,ue),C}function N(T){for(var _=new Uint8Array(T),C=new Array(_.length),te=0;te<_.length;te++)C[te]=String.fromCharCode(_[te]);return C.join("")}function D(T){if(T.slice)return T.slice(0);var _=new Uint8Array(T.byteLength);return _.set(new Uint8Array(T)),_.buffer}function j(){return this.bodyUsed=!1,this._initBody=function(T){this.bodyUsed=this.bodyUsed,this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:r.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:r.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():r.arrayBuffer&&r.blob&&a(T)?(this._bodyArrayBuffer=D(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||p(T))?this._bodyArrayBuffer=D(T):this._bodyText=T=Object.prototype.toString.call(T):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var T=h(this);if(T)return T;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var T=h(this);return T||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(r.blob)return this.blob().then(z);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var T=h(this);if(T)return T;if(this._bodyBlob)return H(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(N(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(Q)}),this.json=function(){return this.text().then(JSON.parse)},this}var y=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function S(T){var _=T.toUpperCase();return y.indexOf(_)>-1?_:T}function F(T,_){if(!(this instanceof F))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');_=_||{};var C=_.body;if(T instanceof F){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,_.headers||(this.headers=new g(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!C&&T._bodyInit!=null&&(C=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=_.credentials||this.credentials||"same-origin",(_.headers||!this.headers)&&(this.headers=new g(_.headers)),this.method=S(_.method||this.method||"GET"),this.mode=_.mode||this.mode||null,this.signal=_.signal||this.signal||(function(){if("AbortController"in o){var q=new AbortController;return q.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&C)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(C),(this.method==="GET"||this.method==="HEAD")&&(_.cache==="no-store"||_.cache==="no-cache")){var te=/([?&])_=[^&]*/;if(te.test(this.url))this.url=this.url.replace(te,"$1_="+new Date().getTime());else{var ue=/\?/;this.url+=(ue.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})};function Q(T){var _=new FormData;return T.trim().split("&").forEach(function(C){if(C){var te=C.split("="),ue=te.shift().replace(/\+/g," "),q=te.join("=").replace(/\+/g," ");_.append(decodeURIComponent(ue),decodeURIComponent(q))}}),_}function U(T){var _=new g,C=T.replace(/\r?\n[\t ]+/g," ");return C.split("\r").map(function(te){return te.indexOf(`
2
- `)===0?te.substr(1,te.length):te}).forEach(function(te){var ue=te.split(":"),q=ue.shift().trim();if(q){var ur=ue.join(":").trim();try{_.append(q,ur)}catch(Li){console.warn("Response "+Li.message)}}}),_}j.call(F.prototype);function V(T,_){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=_.statusText===void 0?"":""+_.statusText,this.headers=new g(_.headers),this.url=_.url||"",this._initBody(T)}j.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},V.error=function(){var T=new V(null,{status:200,statusText:""});return T.ok=!1,T.status=0,T.type="error",T};var fe=[301,302,303,307,308];V.redirect=function(T,_){if(fe.indexOf(_)===-1)throw new RangeError("Invalid status code");return new V(null,{status:_,headers:{location:T}})},n.DOMException=o.DOMException;try{new n.DOMException}catch(T){n.DOMException=function(_,C){this.message=_,this.name=C;var te=Error(_);this.stack=te.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function Je(T,_){return new Promise(function(C,te){var ue=new F(T,_);if(ue.signal&&ue.signal.aborted)return te(new n.DOMException("Aborted","AbortError"));var q=new XMLHttpRequest;function ur(){q.abort()}q.onload=function(){var ye={statusText:q.statusText,headers:U(q.getAllResponseHeaders()||"")};ue.url.indexOf("file://")===0&&(q.status<200||q.status>599)?ye.status=200:ye.status=q.status,ye.url="responseURL"in q?q.responseURL:ye.headers.get("X-Request-URL");var Pt="response"in q?q.response:q.responseText;setTimeout(function(){C(new V(Pt,ye))},0)},q.onerror=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},q.ontimeout=function(){setTimeout(function(){te(new TypeError("Network request timed out"))},0)},q.onabort=function(){setTimeout(function(){te(new n.DOMException("Aborted","AbortError"))},0)};function Li(ye){try{return ye===""&&o.location.href?o.location.href:ye}catch(Pt){return ye}}if(q.open(ue.method,Li(ue.url),!0),ue.credentials==="include"?q.withCredentials=!0:ue.credentials==="omit"&&(q.withCredentials=!1),"responseType"in q&&(r.blob?q.responseType="blob":r.arrayBuffer&&(q.responseType="arraybuffer")),_&&typeof _.headers=="object"&&!(_.headers instanceof g||o.Headers&&_.headers instanceof o.Headers)){var Cd=[];Object.getOwnPropertyNames(_.headers).forEach(function(ye){Cd.push(c(ye)),q.setRequestHeader(ye,i(_.headers[ye]))}),ue.headers.forEach(function(ye,Pt){Cd.indexOf(Pt)===-1&&q.setRequestHeader(Pt,ye)})}else ue.headers.forEach(function(ye,Pt){q.setRequestHeader(Pt,ye)});ue.signal&&(ue.signal.addEventListener("abort",ur),q.onreadystatechange=function(){q.readyState===4&&ue.signal.removeEventListener("abort",ur)}),q.send(typeof ue._bodyInit=="undefined"?null:ue._bodyInit)})}return Je.polyfill=!0,o.fetch||(o.fetch=Je,o.Headers=g,o.Request=F,o.Response=V),n.Headers=g,n.Request=F,n.Response=V,n.fetch=Je,n})({})})(Zi);Zi.fetch.ponyfill=!0;delete Zi.fetch.polyfill;var Nr=Bi.fetch?Bi:Zi;Dt=Nr.fetch;Dt.default=Nr.fetch;Dt.fetch=Nr.fetch;Dt.Headers=Nr.Headers;Dt.Request=Nr.Request;Dt.Response=Nr.Response;WT.exports=Dt});var kF={};xt(kF,{AggregateQueryBuilder:()=>Mr,AuthError:()=>cr,AuthenticationError:()=>pr,AuthorizationError:()=>Ji,Client:()=>Ar,ConfigError:()=>Ce,ConstraintError:()=>ao,ERRORS:()=>Fe,ERROR_DESCRIPTIONS:()=>Xi,ERROR_GROUPS:()=>De,ERROR_MESSAGES:()=>Qi,ERROR_TYPES:()=>lr,ErrorDescription:()=>Xi,ErrorMessage:()=>Qi,ErrorType:()=>lr,Errors:()=>Fe,FindQueryBuilder:()=>le,InputError:()=>oe,InternalError:()=>io,JSONRPCError:()=>Pr,QueryBuilder:()=>He,ReverseQueryBuilder:()=>jr,StreamError:()=>yt,StreamPromise:()=>fr,TokenStatusEnum:()=>gh,TokenTypeEnum:()=>Th,TransferGroupStatusEnum:()=>Oa,TransferGroupTypeEnum:()=>xh,TransferStatusEnum:()=>mh,TransferTypeEnum:()=>Jt,UnknownError:()=>Ki,UpdateQueryBuilder:()=>Ct,ValidationError:()=>Se,Validator:()=>M,WAPIError:()=>Ke,WAPIErrorInfo:()=>FF,WalletStatusEnum:()=>dh,WalletTypeEnum:()=>fh,WapiApikeyStatusEnum:()=>fT,WapiApikeyTypeEnum:()=>dT,WapiClientType:()=>pt,WapiSettingTypeEnum:()=>Cb,create:()=>OF,getError:()=>so,getIdentifier:()=>ns,utils:()=>IF});var Ud=WebSocket;var oo="0.15.4";function Cr(e,t){let n=Hb(e);return n===void 0?t:typeof t=="number"?parseInt(n,10):n}function Hb(e){if(typeof window=="object")return window[e];if(typeof process!="undefined"&&process.versions&&process.versions.node)return process.env[e]}function P(...e){Cr("WAPI_DEBUG")&&console.log(...e.map(t=>t&&typeof t=="object"?JSON.stringify(t):t))}var De={JSONRPC:{min:-32700,max:-32600,ERRORS:{PARSE_ERROR:{code:-32700,message:"Parse error",description:"Unable to parse JSON input"},INVALID_REQUEST:{code:-32600,message:"Invalid request",description:"JSON input does not match JSONRPC spec"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found",description:"Requested method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params",description:"Invalid params provided for method"},INTERNAL_SERVER_ERROR:{code:-32603,message:"Internal server error",description:"Unknown error occurred"}}},AUTH:{min:-20999,max:-2e4,ERRORS:{AUTHENTICATION_ERROR:{code:-2e4,message:"Authentication error",description:"Invalid authentication credentials"},AUTHORIZATION_ERROR:{code:-20001,message:"AUTHORIZATION_ERROR",description:"Provided credentials lack access rights"}}},STREAM:{min:-10999,max:-1e4,ERRORS:{CONNECTION_LOST:{code:-1e4,message:"CONNECTION_LOST",description:"Lost connection to server"},INPUT_STREAM_INVALID:{code:-10001,message:"INPUT_STREAM_INVALID",description:"Invalid input stream identifier provided"},INVALID_RESPONSE_STREAM_CHUNK:{code:-10002,message:"INVALID_RESPONSE_STREAM_CHUNK",description:"Received multiple chunks for non-array property"},INVALID_INPUT_STREAM_CHUNK:{code:-10003,message:"INVALID_INPUT_STREAM_CHUNK",description:"Invalid chunk sent to input stream"},INPUT_STREAM_TIMEOUT:{code:-10004,message:"INPUT_STREAM_TIMEOUT",description:"Input stream failed to finish in allotted time"},INPUT_STREAM_ERROR:{code:-10005,message:"INPUT_STREAM_ERROR",description:"Unknown error in input stream"},INPUT_STREAM_NOT_ALLOWED:{code:-10006,message:"INPUT_STREAM_NOT_ALLOWED",description:"Stream input not allowed for method"},INVALID_STREAM_START_METHOD:{code:-10007,message:"INVALID_STREAM_START_METHOD",description:"Stream start message invalid, method missing"}}},INPUT:{min:-14999,max:-11e3,ERRORS:{HTTP_BODY_SIZE:{code:-11e3,message:"HTTP_BODY_SIZE",description:"Http body size can't be more than 100MB"},DATABASE_EXPORT_CONFLICT:{code:-12e3,message:"DATABASE_EXPORT_CONFLICT",description:"Database export already in progress"},DATABASE_IMPORT_CONFLICT:{code:-12001,message:"DATABASE_IMPORT_CONFLICT",description:"Database import already in progress"},DATABASE_EXPORT_PROGRESS_NOT_FOUND:{code:-12002,message:"DATABASE_EXPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_PROGRESS_NOT_FOUND:{code:-12003,message:"DATABASE_IMPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_NOT_FOUND:{code:-12004,message:"DATABASE_IMPORT_NOT_FOUND",description:"Database import file not found"},TR_CANT_UPDATE_TO_PENDING:{code:-12100,message:"TR_CANT_UPDATE_TO_PENDING",description:"Transfer status can only move from 'pending'->'finished'/'cancelled"},TR_CANT_UPDATE_TIMESTAMP:{code:-12101,message:"TR_CANT_UPDATE_TIMESTAMP",description:"Cant update transfer.updated_at - allow_timestamps flag is set to off"},TR_CANT_INSERT_TIMESTAMP:{code:-12102,message:"TR_CANT_INSERT_TIMESTAMP",description:"Cant insert transfer.created_at - allow_timestamps flag is set to off"},TR_EMPTY_UPDATE_REQUEST:{code:-12103,message:"TR_EMPTY_UPDATE_REQUEST",description:"Update request for transfer is empty"},TR_MISSING_FILTER:{code:-12104,message:"TR_MISSING_FILTER",description:"Transactions can't reversed or updated without valid filter"},TR_TO_WALLET_WITHDRAWAL:{code:-12105,message:"TR_TO_WALLET_WITHDRAWAL",description:"To wallet can't be specified when doing a withdrawal"},TR_FROM_WALLET_DEPOSIT:{code:-12106,message:"TR_FROM_WALLET_DEPOSIT",description:"From wallet can't be specified when doing a deposit"},TR_FROM_TO_CONFLICT:{code:-12107,message:"TR_FROM_TO_CONFLICT",description:"from_wallet and to_wallet can not be the same"},TR_UNABLE_TO_RESOLVE_INPUT:{code:-12108,message:"TR_UNABLE_TO_RESOLVE_INPUT",description:"Unable to resolve references to foreign keys"},TRG_MISSING_FILTER:{code:-12200,message:"TRG_MISSING_FILTER",description:"Transaction groups can't reversed or updated without valid filter"},INVALID_FIELD_AGR_COMB:{code:-12300,message:"INVALID_FIELD_AGR_COMB",description:"Provided aggregation field was not found on Model"},INVALID_FIELD_FOR_MODEL:{code:-12301,message:"INVALID_FIELD_FOR_MODEL",description:"Provided field was not found on Model"},NO_METADATA_ON_MODEL:{code:-12302,message:"NO_METADATA_ON_MODEL",description:"Can't use metadata field for grouping as current Model does not have metadata"},INVALID_MODEL:{code:-12303,message:"INVALID_MODEL",description:"Provided Model name is invalid"},INVALID_COMPLEX_FILTER:{code:-12304,message:"INVALID_COMPLEX_FILTER",description:"The provided complex filter does not pass validation"},UNCLEAR_AGGREGATOR:{code:-12305,message:"UNCLEAR_AGGREGATOR",description:"Invalid aggregator function provided"},CONTRACT_OWNER_NOT_FOUND:{code:-12306,message:"CONTRACT_OWNER_NOT_FOUND",description:"Unable to find Wallet specified as Contract token owner"},DISTRIBUTION_MISSING_TARGETS:{code:-12307,message:"DISTRIBUTION_MISSING_TARGETS",description:"Unable to resolve all targets (Wallets, Tokens) for distribution request"},TOKEN_INVALID_WALLET:{code:-12308,message:"TOKEN_INVALID_WALLET",description:"Invalid belongs_to wallet provided"},BAL_FUTURE_DATETIME:{code:-12309,message:"BAL_FUTURE_DATETIME",description:"Balance datetime can't be in the future"},INPUT_NEEDS_IDENTIFIER:{code:-12310,message:"INPUT_NEEDS_IDENTIFIER",description:"Missing identifier - automatically calculated identifiers conflict on identical input for 30s To make an identical transfer during that window you need to provide a unique identifier"},RESET_INVALID_CONFIRMATION:{code:-12311,message:"RESET_INVALID_CONFIRMATION",description:"Provided reset confirmation code is invalid"},INPUT_NEEDS_TOKEN:{code:-12312,message:"INPUT_NEEDS_TOKEN",description:"token must be specified on input or in client config"},CONFLICTING_OPTIONS_FOR_BALANCE:{code:-12313,message:"CONFLICTING_OPTIONS_FOR_BALANCE",description:"return_running_balance and return_running_balance_for can't be specified together"},CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT:{code:-12314,message:"CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT",description:"return_signed_amount and return_signed_amount_for_wallet can't be specified together"},RUNNING_BALANCE_WITHOUT_WALLET:{code:-12315,message:"RUNNING_BALANCE_WITHOUT_WALLET",description:"return_running_balance option requires Wallet filter to be specified"},SIGNED_AMOUNT_WITHOUT_WALLET:{code:-12316,message:"SIGNED_AMOUNT_WITHOUT_WALLET",description:"return_signed_amount option requires Wallet filter to be specified"},REQUIRED_INPUT_MISSING:{code:-12317,message:"REQUIRED_INPUT_MISSING",description:"input does not specify required keys"},EMPTY_UPDATE_REQUEST:{code:-12318,message:"EMPTY_UPDATE_REQUEST",description:"Need to modify at least one field"},ALL_INTERVALS_GROUP_BY:{code:-12319,message:"ALL_INTERVALS_GROUP_BY",description:"return_all_intervals requires at least one groupBy"},TOKEN_MISSING_FOR_BALANCE:{code:-12320,message:"TOKEN_MISSING_FOR_BALANCE",description:"Need to specify include_balance_for_token to access balance fields"},TRX_NOT_ALLOWED:{code:-12400,message:"TRX_NOT_ALLOWED",description:"This method can not run in a transaction"},TRANSACTION_NOT_FOUND:{code:-12401,message:"TRANSACTION_NOT_FOUND",description:"Transaction not found"},ONLY_SELECT_ALLOWED:{code:-12402,message:"ONLY_SELECT_ALLOWED",description:"Only select queries are allowed"},CNT_DEPOSIT_TOKEN_MISMATCH:{code:-12500,message:"CNT_DEPOSIT_TOKEN_MISMATCH",description:"Unable to find tokens specified in deposits"}}},CONSTRAINT:{min:-19999,max:-19e3,ERRORS:{INVALID_LATEST_HASH:{code:-19e3,message:"INVALID_LATEST_HASH",description:"Http body size can't be more than 100MB"},TOKEN_LIMIT_REACHED:{code:-19001,message:"TOKEN_LIMIT_REACHED",description:"Unable to issue more tokens as Token.limit has been reached"},TR_INVALID_BALANCE:{code:-19101,message:"TR_INVALID_BALANCE",description:"Transfer would result in invalid balance for a Wallet"},TR_AMOUNT_NOT_DIVISIBLE:{code:-19102,message:"TR_AMOUNT_NOT_DIVISIBLE",description:"Transfer amount is not divisible by specified Token.divisor"},TR_TOKEN_DISABLED:{code:-19103,message:"TR_TOKEN_DISABLED",description:"Token status is set to 'disabled' - no new transfers allowed"},TR_TOKEN_DWONLY:{code:-19104,message:"TR_TOKEN_DWONLY",description:"Token status is set to 'dw-only' - only deposits or withdrawals allowed"},TR_TRG_STATUS_MISMATCH:{code:-19105,message:"TR_TRG_STATUS_MISMATCH",description:"Transfers in transfer_group must match transfer_group.transfer_status"},TR_TRG_CLOSED:{code:-19106,message:"TR_TRG_CLOSED",description:"Cant add Transfer to group. TransferGroup is closed"},TR_TIMESTAMP_IN_PAST:{code:-19107,message:"TR_TIMESTAMP_IN_PAST",description:"Transfer.created_at must not be in the past"},TR_TIMESTAMP_MUST_BE_LATEST:{code:-19108,message:"TR_TIMESTAMP_MUST_BE_LATEST",description:"Transfer.created_at must be the latest"},TR_INVALID_CANCELLED:{code:-19109,message:"TR_INVALID_CANCELLED",description:"Cant create cancelled transfer"},TR_FROM_WALLET_STATUS_CONSTRAINT:{code:-19110,message:"TR_FROM_WALLET_STATUS_CONSTRAINT",description:"From wallet.status doesn't allow this type of transfers"},TR_TO_WALLET_STATUS_CONSTRAINT:{code:-19111,message:"TR_TO_WALLET_STATUS_CONSTRAINT",description:"To wallet.status doesn't allow this type of transfers"},TR_CANCELLED_CANT_RV:{code:-19112,message:"TR_CANCELLED_CANT_RV",description:"Cancelled Transfer can not be reversed"},TR_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19113,message:"TR_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"Deposits are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'deposit' requires reverse_deposit option to be true."},TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19114,message:"TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"Withdrawals are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'withdrawal' requires reverse_withdrawal option to be true."},TR_UNIQUE_IDENTIFIER:{code:-19115,message:"TR_UNIQUE_IDENTIFIER",description:"The identifier for Transfer object must be unique"},TR_DIFFERENT_WALLETS:{code:-19116,message:"TR_DIFFERENT_WALLETS",description:"To and from wallets have to be different"},TRG_SINGLE_PENDING_TR_CANT_RV:{code:-19200,message:"TRG_SINGLE_PENDING_TR_CANT_RV",description:"Transfer is part of TransferGroup and can not be reversed separately"},TRG_CANCELLED_CANT_RV:{code:-19201,message:"TRG_CANCELLED_CANT_RV",description:"Cancelled TransferGroup can not be reversed"},TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19202,message:"TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true"},TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19203,message:"TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true"},TRG_UNIQUE_IDENTIFIER:{code:-19204,message:"TRG_UNIQUE_IDENTIFIER",description:"The identifier for TransferGroup object must be unique"},TOKEN_UNIQUE_FOREIGN:{code:-19300,message:"TOKEN_UNIQUE_FOREIGN",description:"The foreign for Token object must be unique"},WALLET_UNIQUE_FOREIGN:{code:-19400,message:"WALLET_UNIQUE_FOREIGN",description:"The foreign for Wallet object must be unique"},UNIQUE_CONSTRAINT:{code:-19500,message:"UNIQUE_CONSTRAINT",description:"Insert violates unique constraint"},APIKEY_DELETED_CANT_UPDATE:{code:-19600,message:"APIKEY_DELETED_CANT_UPDATE",description:"Cant update deleted apikeys"},APIKEY_NOT_OWNED_CANT_UPDATE:{code:-19601,message:"APIKEY_NOT_OWNED_CANT_UPDATE",description:"Cant update apikeys you dont own"},APIKEY_LIMIT_REACHED:{code:-19610,message:"APIKEY_LIMIT_REACHED",description:"Cant create any more api keys, limit reached"}}},CONFIG:{min:-16e3,max:-15e3,ERRORS:{METHOD_DISABLED:{code:-15e3,message:"METHOD_DISABLED",description:"Method is disabled"},FLAG_PRODUCTION_ON:{code:-15001,message:"FLAG_PRODUCTION_ON",description:'Production flag is "on" - this method is disabled'},FLAG_PRODUCTION_LOCKED:{code:-15002,message:"FLAG_PRODUCTION_LOCKED",description:"Cant update production flag to false in this server"},TRANSACTION_TIMEOUT:{code:-15003,message:"TRANSACTION_TIMEOUT",description:"Database transaction timed out"},CONNECTION_TIMEOUT:{code:-15004,message:"CONNECTION_TIMEOUT",description:"Unable to get initial response in specified time"},SENDING_TIMEOUT:{code:-15005,message:"SENDING_TIMEOUT",description:"Unable to get ack from server in specified time"},CONFIG_INVALID:{code:-15100,message:"CONFIG_INVALID",description:"Provided configuration is invalid"}}}},Fe=l(l(l(l(l(l({},De.JSONRPC.ERRORS),De.AUTH.ERRORS),De.CONFIG.ERRORS),De.STREAM.ERRORS),De.INPUT.ERRORS),De.CONSTRAINT.ERRORS);function Jb(e){return Object.fromEntries(Object.keys(e).map(t=>[t,t]))}var lr=Jb(Fe),Ke=class extends Error{constructor({type:n,code:o,message:r,data:a}){var p;super(r);E(this,"type");E(this,"code");E(this,"data");let u=(p=Fe[n])!=null?p:Fe.INTERNAL_SERVER_ERROR;this.type=n!=null?n:lr.INTERNAL_SERVER_ERROR,this.code=o!=null?o:u.code,this.message=r!=null?r:u.message,this.data=l({description:u.description},a&&typeof a=="object"?a:{error:a})}toJSON(){return{code:this.code,message:this.message,data:this.data}}},Pr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},yt=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},oe=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Ce=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},cr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},ao=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Se=class extends Pr{constructor(t,n){super("INVALID_PARAMS",t,n)}},pr=class extends cr{constructor(t){super("AUTHENTICATION_ERROR",t)}},Ji=class extends cr{constructor(t){super("AUTHORIZATION_ERROR",t)}},io=class extends Ke{constructor(t){super({type:lr.INTERNAL_SERVER_ERROR,data:t})}toJSON(){return{code:this.code,message:this.message,data:{description:Fe.INTERNAL_SERVER_ERROR.description}}}},Ki=class extends io{constructor(t){super({data:{message:t}})}toJSON(){let t=super.toJSON();return t.data={description:t.data.description,message:this.data.message},{code:this.code,message:this.message,data:{message:this.data.message,description:Fe.INTERNAL_SERVER_ERROR.description}}}},Kb=Object.fromEntries(Object.keys(Fe).map(e=>[Fe[e].code,e]));function Qb(e){let t=Kb[e];if(!t){let o=Object.entries(De).find(([,r])=>e>=r.min&&e<=r.max);return{group:o==null?void 0:o[0],type:void 0}}let n=Object.keys(De).find(o=>t in De[o].ERRORS);return n?{group:n,type:t}:(console.error("ERRORS and ERROR_GROUPS are out of sync",t),{group:void 0,type:t})}function so({code:e,message:t,data:n}){let o=Qb(e),r=o.type,a=o.group;t=t&&t!==r||!r?t:Fe[r].description;let u;switch(a&&a!=="JSONRPC"&&r===void 0&&(P("Novel error from server",e,t,n),r=t,u=e,t=n&&typeof n=="object"&&"description"in n&&typeof n.description=="string"?n.description:t),a){case"JSONRPC":return new Pr(r,n,t);case"AUTH":return new cr(r,n,t,u);case"CONFIG":return new Ce(r,n,t,u);case"CONSTRAINT":return new ao(r,n,t,u);case"INPUT":return new oe(r,n,t,u);case"STREAM":return new yt(r,n,t,u);default:return new Ke({code:e,message:t,data:n,type:r!=null?r:lr.INTERNAL_SERVER_ERROR})}}var Qi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].message])),Xi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].description]));var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function Bd(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}var Yi,Xb=new Uint8Array(16);function es(){if(!Yi){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yi=crypto.getRandomValues.bind(crypto)}return Yi(Xb)}var Yb=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ts={randomUUID:Yb};function ex(e,t,n){var r,a,u;if(ts.randomUUID&&!t&&!e)return ts.randomUUID();e=e||{};let o=(u=(a=e.random)!=null?a:(r=e.rng)==null?void 0:r.call(e))!=null?u:es();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let p=0;p<16;++p)t[n+p]=o[p];return t}return Bd(o)}var Gr=ex;var rs={timeouts:{},values:{},set(e,t){this.timeouts[e]=setTimeout(()=>this.clear(e),3e4),this.values[e]=t},get(e){return this.values[e]},getKey(e){let t=JSON.parse(JSON.stringify(e)),n="";return Object.keys(t).sort().forEach(o=>{let r="";t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?r=this.getKey(t[o]):r=JSON.stringify(t[o]),n+=o+":"+r}),n},clear(e){this.timeouts[e]&&clearTimeout(this.timeouts[e]),delete this.timeouts[e],delete this.values[e]},clearAll(){Object.keys(this.timeouts).forEach(e=>{clearTimeout(this.timeouts[e])}),this.timeouts={},this.values={}}};function uo(e=8){return Gr().replace(/-/g,"").slice(-e)}function ke(e){if(!e)return Gr();let t=rs.getKey(e);if(rs.get(t))throw new oe("INPUT_NEEDS_IDENTIFIER",{object:e});let n=Gr();return rs.set(t,n),n}function Vd(e){return new Promise(t=>setTimeout(t,e))}function ns(){return ke()}function tx(e){return JSON.parse(JSON.stringify(e))}function St(e,t,n){if(t in e){if(e[t]===void 0)throw new Se({input:e},`undefined provided for ${t}`);return e}if(!n)throw new Se({input:e},`${t} is required if no default set`);let o=tx(e);return o[t]=n,o}function rx(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Zd(e){return e.host.replace(/^https:/,"wss:")+"?"+rx({apikey:e.apikey,apisecret:e.apisecret,db:e.database,clientVersion:e.clientVersion,connectionName:e.connectionName})}function Ld(e){return typeof window=="undefined"?[Zd(e),{rejectUnauthorized:e.rejectUnauthorized}]:[Zd(e)]}function co(e,t){let n={},o=!e||typeof e!="object"?{}:e;return Object.keys(o).forEach(r=>{t[r]?typeof t[r]=="string"?n[t[r]]=o[r]:n[r]=t[r](o[r]):n[r]=o[r]}),n}function nx(e){return e.split(",").map(t=>t.split(" ")).map(t=>{let[n,o,r,a]=t;return l({field:n,direction:o==="desc"?"desc":"asc"},r==="nulls"&&["first","last"].includes(a)?{nulls:a}:{})})}function ae(e,t){var a;let r=e!=null?e:{},{options:n}=r;return{filter:de(r,["options"]),options:(a=t!=null?t:n)!=null?a:{}}}function et(e){let o=e,{order_by:t}=o,n=de(o,["order_by"]);return!n.order&&t&&(n.order=nx(t)),n}function qd(e){if(e!=null)return e+""}function dr(e){return typeof e=="number"?e:parseFloat(e)}function Hd(e){return new Date(e).setHours(0,0,0,0)>new Date().setHours(0,0,0,0)}var we={version:"2.0",acknowledgement:"ack",ping:"ping",pong:"pong",streamChunk:"streamChunk",streamPause:"streamPause",streamResume:"streamResume"};var Wr=class{constructor(t){E(this,"_data",[]);E(this,"_error",[]);E(this,"_end",[]);E(this,"_finished",!1);E(this,"_options");this._options=t}on(t,n){switch(t){case"data":return this._data.push(n),this;case"end":return this._end.push(n),this;case"error":return this._error.push(n),this}}push(t){if(this._finished)throw new Error("Stream is closed");return t===null?this.end():(this._data.forEach(n=>n(t)),this)}error(t){if(this._finished)throw new Error("Stream is closed");return this._error.forEach(n=>n(t)),this}end(){if(this._finished)throw new Error("Stream is closed");return this._end.forEach(t=>t()),this._finished=!0,this}destroy(t){return this.error(t),this.end(),this}get destroyed(){return this._finished}};var fr=class{constructor(t){E(this,"resolve");E(this,"reject");E(this,"makeRequest");E(this,"streamObject",new Wr({objectMode:!0}));E(this,"outStreamObject",new Wr({objectMode:!0}));E(this,"mode");E(this,"started",!1);E(this,"promise");this.makeRequest=t}start(t){var u;if(P("start request as",t),this.mode&&this.mode!==t)throw new Error("Already in use as "+this.mode);if(this.started)return;let{promise:n,resolve:o,reject:r}=Promise.withResolvers();if(this.promise=n,this.resolve=o,this.reject=r,this.started=!0,this.mode=t,this.makeRequest===void 0){this.streamObject.push(null),(u=this.resolve)==null||u.call(this,void 0);return}this.makeRequest(this.streamObject).catch(this.reject);let a=[];if(this.mode==="stream"){this.streamObject.on("data",p=>{if(P("stream data",p),p||this.outStreamObject.push(p),p.error){let c=so(p.error);return this.outStreamObject.destroy(c),this.streamObject.destroy(c)}if(!p.prop){a.push(p);return}if(p.dataArr){let c=l({},p);delete c.dataArr,p.dataArr.forEach(i=>{this.outStreamObject.push(v(l({},c),{data:i}))});return}this.outStreamObject.push(p)}).on("end",()=>{P("stream ended");let p=a.pop();if(!p)return;let c=p.result;Object.keys(c).forEach(i=>{Array.isArray(c[i])&&(c[i].forEach(d=>{this.outStreamObject.push({type:we.streamChunk,prop:i,data:d})}),c[i]=[])}),this.outStreamObject.push(p),this.outStreamObject.push(null)}).on("error",p=>{P("stream error",p),this.outStreamObject.destroy(p)});return}if(this.mode==="promise"){let p=new Map;this.streamObject.on("data",c=>{var d;if(P("streamPromise data",c),c===void 0)return;if(c.error){let g=so(c.error);return this.streamObject.destroy(g)}if(!c.prop){a.push(c);return}let i=(d=p.get(c.prop))!=null?d:[];c.dataArr?i.push(...c.dataArr):i.push(c.data),p.set(c.prop,i)}).on("end",()=>{P("streamPromise end");let c=a.pop();if(!c)return;let i=c.result;if(!p.size)return this.resolve(i);let d=!1;p.forEach((g,h)=>{Array.isArray(i[h])?(g.push(...i[h]),i[h]=g):g.length===1?i[h]=g:(this.streamObject.destroy(new yt("INVALID_RESPONSE_STREAM_CHUNK",{property:h,value:g})),d=!0)}),d||this.resolve(i)}).on("error",c=>{var i;return P("streamPromise error",c),(i=this.reject)==null?void 0:i.call(this,c)})}}then(t,n){return this.start("promise"),this.promise.then(t,n)}catch(t){return this.start("promise"),this.promise.catch(t)}get[Symbol.toStringTag](){return"StreamPromise"}finally(t){return this.start("promise"),this.promise.finally(t)}stream(){return this.start("stream"),this.outStreamObject}};var po={};var ox=(e,t)=>{if(e)return new Se({message:e.message,data:e.format()})},os=(e,t,n=ox)=>{let{success:o,error:r,data:a}=e.safeParse(t);return{data:a,success:o,isValid:o,error:n(r,t)}},Jd=(e,t,n,o)=>!t||typeof t!="object"?{success:!1,isValid:!1,error:new Se({message:`Invalid input - expected object, got ${typeof t}`,data:{input:t}})}:os(e,l({options:n!=null?n:{}},t),o),lt=(e,t,n,o)=>{var u;let{data:r,error:a}=os(e,t,o);if(a)throw((u=n==null?void 0:n.warn)!=null?u:P)(l({err:a},po),"Invalid input"),a;return r},ax=(e,t,n,o,r)=>{!o&&n&&typeof(n==null?void 0:n.warn)=="function"&&(o=n,n={});let{data:a,error:u}=Jd(e,t,n,r);if(u)throw o?o.warn(l({err:u},po),"Invalid input"):P(l({err:u},po),"Invalid input"),u;return a},f=(e,t)=>({validateInput:(n,o)=>lt(e,n,o,t),validateInputWOptions:(n,o,r)=>ax(e,n,o,r,t),softValidateInput:n=>os(e,n,t),softValidateWOptions:(n,o)=>Jd(e,n,o,t)});var s={};xt(s,{$brand:()=>is,$input:()=>_c,$output:()=>vc,NEVER:()=>as,TimePrecision:()=>Fc,ZodAny:()=>ym,ZodArray:()=>Om,ZodBase64:()=>Zp,ZodBase64URL:()=>Vp,ZodBigInt:()=>In,ZodBigIntFormat:()=>Hp,ZodBoolean:()=>On,ZodCIDRv4:()=>Up,ZodCIDRv6:()=>Bp,ZodCUID:()=>jp,ZodCUID2:()=>Ap,ZodCatch:()=>Bm,ZodCodec:()=>ol,ZodCustom:()=>ga,ZodCustomStringFormat:()=>vn,ZodDate:()=>fa,ZodDefault:()=>Dm,ZodDiscriminatedUnion:()=>Im,ZodE164:()=>Lp,ZodEmail:()=>zp,ZodEmoji:()=>Np,ZodEnum:()=>yn,ZodError:()=>$S,ZodFile:()=>Mm,ZodFirstPartyTypeKind:()=>al,ZodFunction:()=>Xm,ZodGUID:()=>ua,ZodIPv4:()=>Gp,ZodIPv6:()=>Wp,ZodISODate:()=>aa,ZodISODateTime:()=>oa,ZodISODuration:()=>sa,ZodISOTime:()=>ia,ZodIntersection:()=>Fm,ZodIssueCode:()=>Gv,ZodJWT:()=>qp,ZodKSUID:()=>Pp,ZodLazy:()=>Jm,ZodLiteral:()=>Nm,ZodMap:()=>Rm,ZodNaN:()=>Vm,ZodNanoID:()=>Mp,ZodNever:()=>vm,ZodNonOptional:()=>rl,ZodNull:()=>bm,ZodNullable:()=>Am,ZodNumber:()=>_n,ZodNumberFormat:()=>wr,ZodObject:()=>ha,ZodOptional:()=>tl,ZodPipe:()=>nl,ZodPrefault:()=>Pm,ZodPromise:()=>Qm,ZodReadonly:()=>Lm,ZodRealError:()=>Ne,ZodRecord:()=>Xp,ZodSet:()=>zm,ZodString:()=>Sn,ZodStringFormat:()=>ce,ZodSuccess:()=>Um,ZodSymbol:()=>gm,ZodTemplateLiteral:()=>Hm,ZodTransform:()=>jm,ZodTuple:()=>wm,ZodType:()=>B,ZodULID:()=>Dp,ZodURL:()=>da,ZodUUID:()=>ht,ZodUndefined:()=>Tm,ZodUnion:()=>Kp,ZodUnknown:()=>Sm,ZodVoid:()=>_m,ZodXID:()=>Cp,_ZodString:()=>Rp,_default:()=>Cm,_function:()=>Nv,any:()=>fv,array:()=>ma,base64:()=>KS,base64url:()=>QS,bigint:()=>uv,boolean:()=>hm,catch:()=>Zm,check:()=>Mv,cidrv4:()=>HS,cidrv6:()=>JS,clone:()=>$e,codec:()=>Ev,coerce:()=>Ta,config:()=>Te,core:()=>nt,cuid:()=>WS,cuid2:()=>US,custom:()=>jv,date:()=>hv,decode:()=>vp,decodeAsync:()=>Op,discriminatedUnion:()=>yv,e164:()=>XS,email:()=>RS,emoji:()=>PS,encode:()=>Sp,encodeAsync:()=>_p,endsWith:()=>dn,enum:()=>Yp,file:()=>Fv,flattenError:()=>Kr,float32:()=>ov,float64:()=>av,formatError:()=>Qr,function:()=>Nv,getErrorMap:()=>Uv,globalRegistry:()=>rt,gt:()=>ft,gte:()=>ze,guid:()=>zS,hash:()=>nv,hex:()=>rv,hostname:()=>tv,httpUrl:()=>CS,includes:()=>pn,instanceof:()=>Av,int:()=>Ep,int32:()=>iv,int64:()=>cv,intersection:()=>km,ipv4:()=>LS,ipv6:()=>qS,iso:()=>xn,json:()=>Cv,jwt:()=>YS,keyof:()=>gv,ksuid:()=>VS,lazy:()=>Km,length:()=>Ir,literal:()=>Iv,locales:()=>Bt,looseObject:()=>xv,lowercase:()=>un,lt:()=>dt,lte:()=>Ze,map:()=>vv,maxLength:()=>Or,maxSize:()=>_r,mime:()=>fn,minLength:()=>wt,minSize:()=>Vt,multipleOf:()=>Zt,nan:()=>$v,nanoid:()=>GS,nativeEnum:()=>Ov,negative:()=>tp,never:()=>Jp,nonnegative:()=>np,nonoptional:()=>Wm,nonpositive:()=>rp,normalize:()=>mn,null:()=>xm,nullable:()=>pa,nullish:()=>kv,number:()=>mm,object:()=>Tv,optional:()=>ca,overwrite:()=>mt,parse:()=>Tp,parseAsync:()=>bp,partialRecord:()=>Sv,pipe:()=>la,positive:()=>ep,prefault:()=>Gm,preprocess:()=>Pv,prettifyError:()=>Ts,promise:()=>zv,property:()=>op,readonly:()=>qm,record:()=>Em,refine:()=>Ym,regex:()=>sn,regexes:()=>We,registry:()=>Do,safeDecode:()=>Fp,safeDecodeAsync:()=>wp,safeEncode:()=>Ip,safeEncodeAsync:()=>kp,safeParse:()=>xp,safeParseAsync:()=>yp,set:()=>_v,setErrorMap:()=>Wv,size:()=>an,startsWith:()=>ln,strictObject:()=>bv,string:()=>$p,stringFormat:()=>ev,stringbool:()=>Dv,success:()=>wv,superRefine:()=>eh,symbol:()=>lv,templateLiteral:()=>Rv,toJSONSchema:()=>lp,toLowerCase:()=>gn,toUpperCase:()=>Tn,transform:()=>el,treeifyError:()=>gs,trim:()=>hn,tuple:()=>$m,uint32:()=>sv,uint64:()=>pv,ulid:()=>BS,undefined:()=>dv,union:()=>Qp,unknown:()=>kr,uppercase:()=>cn,url:()=>DS,uuid:()=>NS,uuidv4:()=>MS,uuidv6:()=>jS,uuidv7:()=>AS,void:()=>mv,xid:()=>ZS});var nt={};xt(nt,{$ZodAny:()=>Vu,$ZodArray:()=>Ku,$ZodAsyncError:()=>Qe,$ZodBase64:()=>ju,$ZodBase64URL:()=>Au,$ZodBigInt:()=>No,$ZodBigIntFormat:()=>Wu,$ZodBoolean:()=>tn,$ZodCIDRv4:()=>zu,$ZodCIDRv6:()=>Nu,$ZodCUID:()=>Su,$ZodCUID2:()=>vu,$ZodCatch:()=>fc,$ZodCheck:()=>pe,$ZodCheckBigIntFormat:()=>Qs,$ZodCheckEndsWith:()=>cu,$ZodCheckGreaterThan:()=>Fo,$ZodCheckIncludes:()=>su,$ZodCheckLengthEquals:()=>nu,$ZodCheckLessThan:()=>Io,$ZodCheckLowerCase:()=>au,$ZodCheckMaxLength:()=>tu,$ZodCheckMaxSize:()=>Xs,$ZodCheckMimeType:()=>lu,$ZodCheckMinLength:()=>ru,$ZodCheckMinSize:()=>Ys,$ZodCheckMultipleOf:()=>Js,$ZodCheckNumberFormat:()=>Ks,$ZodCheckOverwrite:()=>du,$ZodCheckProperty:()=>pu,$ZodCheckRegex:()=>ou,$ZodCheckSizeEquals:()=>eu,$ZodCheckStartsWith:()=>uu,$ZodCheckStringFormat:()=>Sr,$ZodCheckUpperCase:()=>iu,$ZodCodec:()=>rn,$ZodCustom:()=>Sc,$ZodCustomStringFormat:()=>Pu,$ZodDate:()=>Ju,$ZodDefault:()=>cc,$ZodDiscriminatedUnion:()=>Xu,$ZodE164:()=>Du,$ZodEmail:()=>Tu,$ZodEmoji:()=>xu,$ZodEncodeError:()=>vt,$ZodEnum:()=>nc,$ZodError:()=>Jr,$ZodFile:()=>ac,$ZodFunction:()=>bc,$ZodGUID:()=>hu,$ZodIPv4:()=>Eu,$ZodIPv6:()=>Ru,$ZodISODate:()=>ku,$ZodISODateTime:()=>Fu,$ZodISODuration:()=>$u,$ZodISOTime:()=>wu,$ZodIntersection:()=>Yu,$ZodJWT:()=>Cu,$ZodKSUID:()=>Iu,$ZodLazy:()=>yc,$ZodLiteral:()=>oc,$ZodMap:()=>tc,$ZodNaN:()=>mc,$ZodNanoID:()=>yu,$ZodNever:()=>qu,$ZodNonOptional:()=>lc,$ZodNull:()=>Zu,$ZodNullable:()=>uc,$ZodNumber:()=>zo,$ZodNumberFormat:()=>Gu,$ZodObject:()=>Sf,$ZodObjectJIT:()=>Qu,$ZodOptional:()=>sc,$ZodPipe:()=>hc,$ZodPrefault:()=>pc,$ZodPromise:()=>xc,$ZodReadonly:()=>gc,$ZodRealError:()=>Re,$ZodRecord:()=>ec,$ZodRegistry:()=>vr,$ZodSet:()=>rc,$ZodString:()=>Ut,$ZodStringFormat:()=>se,$ZodSuccess:()=>dc,$ZodSymbol:()=>Uu,$ZodTemplateLiteral:()=>Tc,$ZodTransform:()=>ic,$ZodTuple:()=>jo,$ZodType:()=>A,$ZodULID:()=>_u,$ZodURL:()=>bu,$ZodUUID:()=>gu,$ZodUndefined:()=>Bu,$ZodUnion:()=>Mo,$ZodUnknown:()=>Lu,$ZodVoid:()=>Hu,$ZodXID:()=>Ou,$brand:()=>is,$constructor:()=>m,$input:()=>_c,$output:()=>vc,Doc:()=>en,JSONSchema:()=>dp,JSONSchemaGenerator:()=>bn,NEVER:()=>as,TimePrecision:()=>Fc,_any:()=>qc,_array:()=>ap,_base64:()=>ea,_base64url:()=>ta,_bigint:()=>Gc,_boolean:()=>Cc,_catch:()=>vS,_check:()=>lm,_cidrv4:()=>Xo,_cidrv6:()=>Yo,_coercedBigint:()=>Wc,_coercedBoolean:()=>Pc,_coercedDate:()=>Xc,_coercedNumber:()=>zc,_coercedString:()=>Ic,_cuid:()=>Vo,_cuid2:()=>Lo,_custom:()=>sp,_date:()=>Qc,_decode:()=>To,_decodeAsync:()=>xo,_default:()=>xS,_discriminatedUnion:()=>sS,_e164:()=>ra,_email:()=>Co,_emoji:()=>Bo,_encode:()=>go,_encodeAsync:()=>bo,_endsWith:()=>dn,_enum:()=>fS,_file:()=>ip,_float32:()=>Mc,_float64:()=>jc,_gt:()=>ft,_gte:()=>ze,_guid:()=>nn,_includes:()=>pn,_int:()=>Nc,_int32:()=>Ac,_int64:()=>Uc,_intersection:()=>uS,_ipv4:()=>Ko,_ipv6:()=>Qo,_isoDate:()=>wc,_isoDateTime:()=>kc,_isoDuration:()=>Ec,_isoTime:()=>$c,_jwt:()=>na,_ksuid:()=>Jo,_lazy:()=>FS,_length:()=>Ir,_literal:()=>hS,_lowercase:()=>un,_lt:()=>dt,_lte:()=>Ze,_map:()=>lS,_max:()=>Ze,_maxLength:()=>Or,_maxSize:()=>_r,_mime:()=>fn,_min:()=>ze,_minLength:()=>wt,_minSize:()=>Vt,_multipleOf:()=>Zt,_nan:()=>Yc,_nanoid:()=>Zo,_nativeEnum:()=>mS,_negative:()=>tp,_never:()=>Jc,_nonnegative:()=>np,_nonoptional:()=>yS,_nonpositive:()=>rp,_normalize:()=>mn,_null:()=>Lc,_nullable:()=>bS,_number:()=>Rc,_optional:()=>TS,_overwrite:()=>mt,_parse:()=>Tr,_parseAsync:()=>br,_pipe:()=>_S,_positive:()=>ep,_promise:()=>kS,_property:()=>op,_readonly:()=>OS,_record:()=>pS,_refine:()=>up,_regex:()=>sn,_safeDecode:()=>So,_safeDecodeAsync:()=>_o,_safeEncode:()=>yo,_safeEncodeAsync:()=>vo,_safeParse:()=>xr,_safeParseAsync:()=>yr,_set:()=>dS,_size:()=>an,_startsWith:()=>ln,_string:()=>Oc,_stringFormat:()=>Fr,_stringbool:()=>pp,_success:()=>SS,_superRefine:()=>cp,_symbol:()=>Zc,_templateLiteral:()=>IS,_toLowerCase:()=>gn,_toUpperCase:()=>Tn,_transform:()=>gS,_trim:()=>hn,_tuple:()=>cS,_uint32:()=>Dc,_uint64:()=>Bc,_ulid:()=>qo,_undefined:()=>Vc,_union:()=>iS,_unknown:()=>Hc,_uppercase:()=>cn,_url:()=>on,_uuid:()=>Po,_uuidv4:()=>Go,_uuidv6:()=>Wo,_uuidv7:()=>Uo,_void:()=>Kc,_xid:()=>Ho,clone:()=>$e,config:()=>Te,decode:()=>Nx,decodeAsync:()=>jx,encode:()=>zx,encodeAsync:()=>Mx,flattenError:()=>Kr,formatError:()=>Qr,globalConfig:()=>Ur,globalRegistry:()=>rt,isValidBase64:()=>Mu,isValidBase64URL:()=>Tf,isValidJWT:()=>bf,locales:()=>Bt,parse:()=>mo,parseAsync:()=>ho,prettifyError:()=>Ts,regexes:()=>We,registry:()=>Do,safeDecode:()=>Dx,safeDecodeAsync:()=>Px,safeEncode:()=>Ax,safeEncodeAsync:()=>Cx,safeParse:()=>bs,safeParseAsync:()=>xs,toDotPath:()=>ef,toJSONSchema:()=>lp,treeifyError:()=>gs,util:()=>I,version:()=>fu});var as=Object.freeze({status:"aborted"});function m(e,t,n){var p;function o(c,i){var g,h;var d;Object.defineProperty(c,"_zod",{value:(g=c._zod)!=null?g:{},enumerable:!1}),(h=(d=c._zod).traits)!=null||(d.traits=new Set),c._zod.traits.add(e),t(c,i);for(let x in u.prototype)x in c||Object.defineProperty(c,x,{value:u.prototype[x].bind(c)});c._zod.constr=u,c._zod.def=i}let r=(p=n==null?void 0:n.Parent)!=null?p:Object;class a extends r{}Object.defineProperty(a,"name",{value:e});function u(c){var g;var i;let d=n!=null&&n.Parent?new a:this;o(d,c),(g=(i=d._zod).deferred)!=null||(i.deferred=[]);for(let h of d._zod.deferred)h();return d}return Object.defineProperty(u,"init",{value:o}),Object.defineProperty(u,Symbol.hasInstance,{value:c=>{var i,d;return n!=null&&n.Parent&&c instanceof n.Parent?!0:(d=(i=c==null?void 0:c._zod)==null?void 0:i.traits)==null?void 0:d.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}var is=Symbol("zod_brand"),Qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ur={};function Te(e){return e&&Object.assign(Ur,e),Ur}var I={};xt(I,{BIGINT_FORMAT_RANGES:()=>hs,Class:()=>us,NUMBER_FORMAT_RANGES:()=>ms,aborted:()=>kt,allowsEval:()=>ps,assert:()=>px,assertEqual:()=>ix,assertIs:()=>ux,assertNever:()=>cx,assertNotEqual:()=>sx,assignProp:()=>Ot,base64ToUint8Array:()=>Qd,base64urlToUint8Array:()=>kx,cached:()=>hr,captureStackTrace:()=>fo,cleanEnum:()=>Fx,cleanRegex:()=>Vr,clone:()=>$e,cloneDef:()=>dx,createTransparentProxy:()=>bx,defineLazy:()=>J,esc:()=>lo,escapeRegex:()=>tt,extend:()=>Sx,finalizeIssue:()=>Ge,floatSafeRemainder:()=>cs,getElementAtPath:()=>fx,getEnumValues:()=>Zr,getLengthableOrigin:()=>Hr,getParsedType:()=>Tx,getSizableOrigin:()=>qr,hexToUint8Array:()=>$x,isObject:()=>Gt,isPlainObject:()=>Ft,issue:()=>gr,joinValues:()=>b,jsonStringifyReplacer:()=>mr,merge:()=>_x,mergeDefs:()=>It,normalizeParams:()=>k,nullish:()=>_t,numKeys:()=>gx,objectClone:()=>lx,omit:()=>yx,optionalKeys:()=>fs,partial:()=>Ox,pick:()=>xx,prefixIssues:()=>Pe,primitiveTypes:()=>ds,promiseAllObject:()=>mx,propertyKeyTypes:()=>Lr,randomString:()=>hx,required:()=>Ix,safeExtend:()=>vx,shallowClone:()=>ls,stringifyPrimitive:()=>$,uint8ArrayToBase64:()=>Xd,uint8ArrayToBase64url:()=>wx,uint8ArrayToHex:()=>Ex,unwrapMessage:()=>Br});function ix(e){return e}function sx(e){return e}function ux(e){}function cx(e){throw new Error}function px(e){}function Zr(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function b(e,t="|"){return e.map(n=>$(n)).join(t)}function mr(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function _t(e){return e==null}function Vr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function cs(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c!=null&&c[1]&&(r=Number.parseInt(c[1]))}let a=n>r?n:r,u=Number.parseInt(e.toFixed(a).replace(".","")),p=Number.parseInt(t.toFixed(a).replace(".",""));return u%p/Gd(10,a)}var Kd=Symbol("evaluating");function J(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==Kd)return o===void 0&&(o=Kd,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lx(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function It(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function dx(e){return It(e._zod.def)}function fx(e,t){return t?t.reduce((n,o)=>n==null?void 0:n[o],e):e}function mx(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let a=0;a<t.length;a++)r[t[a]]=o[a];return r})}function hx(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function lo(e){return JSON.stringify(e)}var fo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ps=hr(()=>{var e;if(typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{let t=Function;return new t(""),!0}catch(t){return!1}});function Ft(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Gt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ls(e){return Ft(e)?l({},e):e}function gx(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Tx=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map!="undefined"&&e instanceof Map?"map":typeof Set!="undefined"&&e instanceof Set?"set":typeof Date!="undefined"&&e instanceof Date?"date":typeof File!="undefined"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Lr=new Set(["string","number","symbol"]),ds=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(e,t,n){let o=new e._zod.constr(t!=null?t:e._zod.def);return(!t||n!=null&&n.parent)&&(o._zod.parent=e),o}function k(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?v(l({},t),{error:()=>t.error}):t}function bx(e){let t;return new Proxy({},{get(n,o,r){return t!=null||(t=e()),Reflect.get(t,o,r)},set(n,o,r,a){return t!=null||(t=e()),Reflect.set(t,o,r,a)},has(n,o){return t!=null||(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t!=null||(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t!=null||(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t!=null||(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t!=null||(t=e()),Reflect.defineProperty(t,o,r)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ms={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r={};for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=n.shape[a])}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function yx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r=l({},e._zod.def.shape);for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function Sx(e,t){if(!Ft(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=It(e._zod.def,{get shape(){let a=l(l({},e._zod.def.shape),t);return Ot(this,"shape",a),a},checks:[]});return $e(e,r)}function vx(e,t){if(!Ft(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=v(l({},e._zod.def),{get shape(){let o=l(l({},e._zod.def.shape),t);return Ot(this,"shape",o),o},checks:e._zod.def.checks});return $e(e,n)}function _x(e,t){let n=It(e._zod.def,{get shape(){let o=l(l({},e._zod.def.shape),t._zod.def.shape);return Ot(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return $e(e,n)}function Ox(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in r))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:r[u]}):r[u])}else for(let u in r)a[u]=e?new e({type:"optional",innerType:r[u]}):r[u];return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function Ix(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=new e({type:"nonoptional",innerType:r[u]}))}else for(let u in r)a[u]=new e({type:"nonoptional",innerType:r[u]});return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function kt(e,t=0){var n;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((n=e.issues[o])==null?void 0:n.continue)!==!0)return!0;return!1}function Pe(e,t){return t.map(n=>{var r;var o;return(r=(o=n).path)!=null||(o.path=[]),n.path.unshift(e),n})}function Br(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ge(e,t,n){var r,a,u,p,c,i,d,g,h,x,z;let o=v(l({},e),{path:(r=e.path)!=null?r:[]});if(!e.message){let H=(z=(x=(g=(i=Br((p=(u=(a=e.inst)==null?void 0:a._zod.def)==null?void 0:u.error)==null?void 0:p.call(u,e)))!=null?i:Br((c=t==null?void 0:t.error)==null?void 0:c.call(t,e)))!=null?g:Br((d=n.customError)==null?void 0:d.call(n,e)))!=null?x:Br((h=n.localeError)==null?void 0:h.call(n,e)))!=null?z:"Invalid input";o.message=H}return delete o.inst,delete o.continue,t!=null&&t.reportInput||delete o.input,o}function qr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Hr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gr(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:l({},t)}function Fx(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Qd(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Xd(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function kx(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Qd(t+n)}function wx(e){return Xd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $x(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Ex(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var us=class{constructor(...t){}};var Yd=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,mr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jr=m("$ZodError",Yd),Re=m("$ZodError",Yd,{Parent:Error});function Kr(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Qr(e,t){let n=t||function(a){return a.message},o={_errors:[]},r=a=>{for(let u of a.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(p=>r({issues:p}));else if(u.code==="invalid_key")r({issues:u.issues});else if(u.code==="invalid_element")r({issues:u.issues});else if(u.path.length===0)o._errors.push(n(u));else{let p=o,c=0;for(;c<u.path.length;){let i=u.path[c];c===u.path.length-1?(p[i]=p[i]||{_errors:[]},p[i]._errors.push(n(u))):p[i]=p[i]||{_errors:[]},p=p[i],c++}}};return r(e),o}function gs(e,t){let n=t||function(a){return a.message},o={errors:[]},r=(a,u=[])=>{var i,d,g,h;var p,c;for(let x of a.issues)if(x.code==="invalid_union"&&x.errors.length)x.errors.map(z=>r({issues:z},x.path));else if(x.code==="invalid_key")r({issues:x.issues},x.path);else if(x.code==="invalid_element")r({issues:x.issues},x.path);else{let z=[...u,...x.path];if(z.length===0){o.errors.push(n(x));continue}let H=o,N=0;for(;N<z.length;){let D=z[N],j=N===z.length-1;typeof D=="string"?((i=H.properties)!=null||(H.properties={}),(d=(p=H.properties)[D])!=null||(p[D]={errors:[]}),H=H.properties[D]):((g=H.items)!=null||(H.items=[]),(h=(c=H.items)[D])!=null||(c[D]={errors:[]}),H=H.items[D]),j&&H.errors.push(n(x)),N++}}};return r(e),o}function ef(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Ts(e){var o;let t=[],n=[...e.issues].sort((r,a)=>{var u,p;return((u=r.path)!=null?u:[]).length-((p=a.path)!=null?p:[]).length});for(let r of n)t.push(`\u2716 ${r.message}`),(o=r.path)!=null&&o.length&&t.push(` \u2192 at ${ef(r.path)}`);return t.join(`
2
+ `)===0?te.substr(1,te.length):te}).forEach(function(te){var ue=te.split(":"),q=ue.shift().trim();if(q){var ur=ue.join(":").trim();try{_.append(q,ur)}catch(Li){console.warn("Response "+Li.message)}}}),_}j.call(F.prototype);function V(T,_){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=_.statusText===void 0?"":""+_.statusText,this.headers=new g(_.headers),this.url=_.url||"",this._initBody(T)}j.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},V.error=function(){var T=new V(null,{status:200,statusText:""});return T.ok=!1,T.status=0,T.type="error",T};var fe=[301,302,303,307,308];V.redirect=function(T,_){if(fe.indexOf(_)===-1)throw new RangeError("Invalid status code");return new V(null,{status:_,headers:{location:T}})},n.DOMException=o.DOMException;try{new n.DOMException}catch(T){n.DOMException=function(_,C){this.message=_,this.name=C;var te=Error(_);this.stack=te.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function Je(T,_){return new Promise(function(C,te){var ue=new F(T,_);if(ue.signal&&ue.signal.aborted)return te(new n.DOMException("Aborted","AbortError"));var q=new XMLHttpRequest;function ur(){q.abort()}q.onload=function(){var ye={statusText:q.statusText,headers:U(q.getAllResponseHeaders()||"")};ue.url.indexOf("file://")===0&&(q.status<200||q.status>599)?ye.status=200:ye.status=q.status,ye.url="responseURL"in q?q.responseURL:ye.headers.get("X-Request-URL");var Pt="response"in q?q.response:q.responseText;setTimeout(function(){C(new V(Pt,ye))},0)},q.onerror=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},q.ontimeout=function(){setTimeout(function(){te(new TypeError("Network request timed out"))},0)},q.onabort=function(){setTimeout(function(){te(new n.DOMException("Aborted","AbortError"))},0)};function Li(ye){try{return ye===""&&o.location.href?o.location.href:ye}catch(Pt){return ye}}if(q.open(ue.method,Li(ue.url),!0),ue.credentials==="include"?q.withCredentials=!0:ue.credentials==="omit"&&(q.withCredentials=!1),"responseType"in q&&(r.blob?q.responseType="blob":r.arrayBuffer&&(q.responseType="arraybuffer")),_&&typeof _.headers=="object"&&!(_.headers instanceof g||o.Headers&&_.headers instanceof o.Headers)){var Cd=[];Object.getOwnPropertyNames(_.headers).forEach(function(ye){Cd.push(c(ye)),q.setRequestHeader(ye,i(_.headers[ye]))}),ue.headers.forEach(function(ye,Pt){Cd.indexOf(Pt)===-1&&q.setRequestHeader(Pt,ye)})}else ue.headers.forEach(function(ye,Pt){q.setRequestHeader(Pt,ye)});ue.signal&&(ue.signal.addEventListener("abort",ur),q.onreadystatechange=function(){q.readyState===4&&ue.signal.removeEventListener("abort",ur)}),q.send(typeof ue._bodyInit=="undefined"?null:ue._bodyInit)})}return Je.polyfill=!0,o.fetch||(o.fetch=Je,o.Headers=g,o.Request=F,o.Response=V),n.Headers=g,n.Request=F,n.Response=V,n.fetch=Je,n})({})})(Zi);Zi.fetch.ponyfill=!0;delete Zi.fetch.polyfill;var Nr=Bi.fetch?Bi:Zi;Dt=Nr.fetch;Dt.default=Nr.fetch;Dt.fetch=Nr.fetch;Dt.Headers=Nr.Headers;Dt.Request=Nr.Request;Dt.Response=Nr.Response;WT.exports=Dt});var kF={};xt(kF,{AggregateQueryBuilder:()=>Mr,AuthError:()=>cr,AuthenticationError:()=>pr,AuthorizationError:()=>Ji,Client:()=>Ar,ConfigError:()=>Ce,ConstraintError:()=>ao,ERRORS:()=>Fe,ERROR_DESCRIPTIONS:()=>Xi,ERROR_GROUPS:()=>De,ERROR_MESSAGES:()=>Qi,ERROR_TYPES:()=>lr,ErrorDescription:()=>Xi,ErrorMessage:()=>Qi,ErrorType:()=>lr,Errors:()=>Fe,FindQueryBuilder:()=>le,InputError:()=>oe,InternalError:()=>io,JSONRPCError:()=>Pr,QueryBuilder:()=>He,ReverseQueryBuilder:()=>jr,StreamError:()=>yt,StreamPromise:()=>fr,TokenStatusEnum:()=>gh,TokenTypeEnum:()=>Th,TransferGroupStatusEnum:()=>Oa,TransferGroupTypeEnum:()=>xh,TransferStatusEnum:()=>mh,TransferTypeEnum:()=>Jt,UnknownError:()=>Ki,UpdateQueryBuilder:()=>Ct,ValidationError:()=>Se,Validator:()=>M,WAPIError:()=>Ke,WAPIErrorInfo:()=>FF,WalletStatusEnum:()=>dh,WalletTypeEnum:()=>fh,WapiApikeyStatusEnum:()=>fT,WapiApikeyTypeEnum:()=>dT,WapiClientType:()=>pt,WapiSettingTypeEnum:()=>Cb,create:()=>OF,getError:()=>so,getIdentifier:()=>ns,utils:()=>IF});var Ud=WebSocket;var oo="0.15.5";function Cr(e,t){let n=Hb(e);return n===void 0?t:typeof t=="number"?parseInt(n,10):n}function Hb(e){if(typeof window=="object")return window[e];if(typeof process!="undefined"&&process.versions&&process.versions.node)return process.env[e]}function P(...e){Cr("WAPI_DEBUG")&&console.log(...e.map(t=>t&&typeof t=="object"?JSON.stringify(t):t))}var De={JSONRPC:{min:-32700,max:-32600,ERRORS:{PARSE_ERROR:{code:-32700,message:"Parse error",description:"Unable to parse JSON input"},INVALID_REQUEST:{code:-32600,message:"Invalid request",description:"JSON input does not match JSONRPC spec"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found",description:"Requested method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params",description:"Invalid params provided for method"},INTERNAL_SERVER_ERROR:{code:-32603,message:"Internal server error",description:"Unknown error occurred"}}},AUTH:{min:-20999,max:-2e4,ERRORS:{AUTHENTICATION_ERROR:{code:-2e4,message:"Authentication error",description:"Invalid authentication credentials"},AUTHORIZATION_ERROR:{code:-20001,message:"AUTHORIZATION_ERROR",description:"Provided credentials lack access rights"}}},STREAM:{min:-10999,max:-1e4,ERRORS:{CONNECTION_LOST:{code:-1e4,message:"CONNECTION_LOST",description:"Lost connection to server"},INPUT_STREAM_INVALID:{code:-10001,message:"INPUT_STREAM_INVALID",description:"Invalid input stream identifier provided"},INVALID_RESPONSE_STREAM_CHUNK:{code:-10002,message:"INVALID_RESPONSE_STREAM_CHUNK",description:"Received multiple chunks for non-array property"},INVALID_INPUT_STREAM_CHUNK:{code:-10003,message:"INVALID_INPUT_STREAM_CHUNK",description:"Invalid chunk sent to input stream"},INPUT_STREAM_TIMEOUT:{code:-10004,message:"INPUT_STREAM_TIMEOUT",description:"Input stream failed to finish in allotted time"},INPUT_STREAM_ERROR:{code:-10005,message:"INPUT_STREAM_ERROR",description:"Unknown error in input stream"},INPUT_STREAM_NOT_ALLOWED:{code:-10006,message:"INPUT_STREAM_NOT_ALLOWED",description:"Stream input not allowed for method"},INVALID_STREAM_START_METHOD:{code:-10007,message:"INVALID_STREAM_START_METHOD",description:"Stream start message invalid, method missing"}}},INPUT:{min:-14999,max:-11e3,ERRORS:{HTTP_BODY_SIZE:{code:-11e3,message:"HTTP_BODY_SIZE",description:"Http body size can't be more than 100MB"},DATABASE_EXPORT_CONFLICT:{code:-12e3,message:"DATABASE_EXPORT_CONFLICT",description:"Database export already in progress"},DATABASE_IMPORT_CONFLICT:{code:-12001,message:"DATABASE_IMPORT_CONFLICT",description:"Database import already in progress"},DATABASE_EXPORT_PROGRESS_NOT_FOUND:{code:-12002,message:"DATABASE_EXPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_PROGRESS_NOT_FOUND:{code:-12003,message:"DATABASE_IMPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_NOT_FOUND:{code:-12004,message:"DATABASE_IMPORT_NOT_FOUND",description:"Database import file not found"},TR_CANT_UPDATE_TO_PENDING:{code:-12100,message:"TR_CANT_UPDATE_TO_PENDING",description:"Transfer status can only move from 'pending'->'finished'/'cancelled"},TR_CANT_UPDATE_TIMESTAMP:{code:-12101,message:"TR_CANT_UPDATE_TIMESTAMP",description:"Cant update transfer.updated_at - allow_timestamps flag is set to off"},TR_CANT_INSERT_TIMESTAMP:{code:-12102,message:"TR_CANT_INSERT_TIMESTAMP",description:"Cant insert transfer.created_at - allow_timestamps flag is set to off"},TR_EMPTY_UPDATE_REQUEST:{code:-12103,message:"TR_EMPTY_UPDATE_REQUEST",description:"Update request for transfer is empty"},TR_MISSING_FILTER:{code:-12104,message:"TR_MISSING_FILTER",description:"Transactions can't reversed or updated without valid filter"},TR_TO_WALLET_WITHDRAWAL:{code:-12105,message:"TR_TO_WALLET_WITHDRAWAL",description:"To wallet can't be specified when doing a withdrawal"},TR_FROM_WALLET_DEPOSIT:{code:-12106,message:"TR_FROM_WALLET_DEPOSIT",description:"From wallet can't be specified when doing a deposit"},TR_FROM_TO_CONFLICT:{code:-12107,message:"TR_FROM_TO_CONFLICT",description:"from_wallet and to_wallet can not be the same"},TR_UNABLE_TO_RESOLVE_INPUT:{code:-12108,message:"TR_UNABLE_TO_RESOLVE_INPUT",description:"Unable to resolve references to foreign keys"},TRG_MISSING_FILTER:{code:-12200,message:"TRG_MISSING_FILTER",description:"Transaction groups can't reversed or updated without valid filter"},INVALID_FIELD_AGR_COMB:{code:-12300,message:"INVALID_FIELD_AGR_COMB",description:"Provided aggregation field was not found on Model"},INVALID_FIELD_FOR_MODEL:{code:-12301,message:"INVALID_FIELD_FOR_MODEL",description:"Provided field was not found on Model"},NO_METADATA_ON_MODEL:{code:-12302,message:"NO_METADATA_ON_MODEL",description:"Can't use metadata field for grouping as current Model does not have metadata"},INVALID_MODEL:{code:-12303,message:"INVALID_MODEL",description:"Provided Model name is invalid"},INVALID_COMPLEX_FILTER:{code:-12304,message:"INVALID_COMPLEX_FILTER",description:"The provided complex filter does not pass validation"},UNCLEAR_AGGREGATOR:{code:-12305,message:"UNCLEAR_AGGREGATOR",description:"Invalid aggregator function provided"},CONTRACT_OWNER_NOT_FOUND:{code:-12306,message:"CONTRACT_OWNER_NOT_FOUND",description:"Unable to find Wallet specified as Contract token owner"},DISTRIBUTION_MISSING_TARGETS:{code:-12307,message:"DISTRIBUTION_MISSING_TARGETS",description:"Unable to resolve all targets (Wallets, Tokens) for distribution request"},TOKEN_INVALID_WALLET:{code:-12308,message:"TOKEN_INVALID_WALLET",description:"Invalid belongs_to wallet provided"},BAL_FUTURE_DATETIME:{code:-12309,message:"BAL_FUTURE_DATETIME",description:"Balance datetime can't be in the future"},INPUT_NEEDS_IDENTIFIER:{code:-12310,message:"INPUT_NEEDS_IDENTIFIER",description:"Missing identifier - automatically calculated identifiers conflict on identical input for 30s To make an identical transfer during that window you need to provide a unique identifier"},RESET_INVALID_CONFIRMATION:{code:-12311,message:"RESET_INVALID_CONFIRMATION",description:"Provided reset confirmation code is invalid"},INPUT_NEEDS_TOKEN:{code:-12312,message:"INPUT_NEEDS_TOKEN",description:"token must be specified on input or in client config"},CONFLICTING_OPTIONS_FOR_BALANCE:{code:-12313,message:"CONFLICTING_OPTIONS_FOR_BALANCE",description:"return_running_balance and return_running_balance_for can't be specified together"},CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT:{code:-12314,message:"CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT",description:"return_signed_amount and return_signed_amount_for_wallet can't be specified together"},RUNNING_BALANCE_WITHOUT_WALLET:{code:-12315,message:"RUNNING_BALANCE_WITHOUT_WALLET",description:"return_running_balance option requires Wallet filter to be specified"},SIGNED_AMOUNT_WITHOUT_WALLET:{code:-12316,message:"SIGNED_AMOUNT_WITHOUT_WALLET",description:"return_signed_amount option requires Wallet filter to be specified"},REQUIRED_INPUT_MISSING:{code:-12317,message:"REQUIRED_INPUT_MISSING",description:"input does not specify required keys"},EMPTY_UPDATE_REQUEST:{code:-12318,message:"EMPTY_UPDATE_REQUEST",description:"Need to modify at least one field"},ALL_INTERVALS_GROUP_BY:{code:-12319,message:"ALL_INTERVALS_GROUP_BY",description:"return_all_intervals requires at least one groupBy"},TOKEN_MISSING_FOR_BALANCE:{code:-12320,message:"TOKEN_MISSING_FOR_BALANCE",description:"Need to specify include_balance_for_token to access balance fields"},TRX_NOT_ALLOWED:{code:-12400,message:"TRX_NOT_ALLOWED",description:"This method can not run in a transaction"},TRANSACTION_NOT_FOUND:{code:-12401,message:"TRANSACTION_NOT_FOUND",description:"Transaction not found"},ONLY_SELECT_ALLOWED:{code:-12402,message:"ONLY_SELECT_ALLOWED",description:"Only select queries are allowed"},CNT_DEPOSIT_TOKEN_MISMATCH:{code:-12500,message:"CNT_DEPOSIT_TOKEN_MISMATCH",description:"Unable to find tokens specified in deposits"}}},CONSTRAINT:{min:-19999,max:-19e3,ERRORS:{INVALID_LATEST_HASH:{code:-19e3,message:"INVALID_LATEST_HASH",description:"Http body size can't be more than 100MB"},TOKEN_LIMIT_REACHED:{code:-19001,message:"TOKEN_LIMIT_REACHED",description:"Unable to issue more tokens as Token.limit has been reached"},TR_INVALID_BALANCE:{code:-19101,message:"TR_INVALID_BALANCE",description:"Transfer would result in invalid balance for a Wallet"},TR_AMOUNT_NOT_DIVISIBLE:{code:-19102,message:"TR_AMOUNT_NOT_DIVISIBLE",description:"Transfer amount is not divisible by specified Token.divisor"},TR_TOKEN_DISABLED:{code:-19103,message:"TR_TOKEN_DISABLED",description:"Token status is set to 'disabled' - no new transfers allowed"},TR_TOKEN_DWONLY:{code:-19104,message:"TR_TOKEN_DWONLY",description:"Token status is set to 'dw-only' - only deposits or withdrawals allowed"},TR_TRG_STATUS_MISMATCH:{code:-19105,message:"TR_TRG_STATUS_MISMATCH",description:"Transfers in transfer_group must match transfer_group.transfer_status"},TR_TRG_CLOSED:{code:-19106,message:"TR_TRG_CLOSED",description:"Cant add Transfer to group. TransferGroup is closed"},TR_TIMESTAMP_IN_PAST:{code:-19107,message:"TR_TIMESTAMP_IN_PAST",description:"Transfer.created_at must not be in the past"},TR_TIMESTAMP_MUST_BE_LATEST:{code:-19108,message:"TR_TIMESTAMP_MUST_BE_LATEST",description:"Transfer.created_at must be the latest"},TR_INVALID_CANCELLED:{code:-19109,message:"TR_INVALID_CANCELLED",description:"Cant create cancelled transfer"},TR_FROM_WALLET_STATUS_CONSTRAINT:{code:-19110,message:"TR_FROM_WALLET_STATUS_CONSTRAINT",description:"From wallet.status doesn't allow this type of transfers"},TR_TO_WALLET_STATUS_CONSTRAINT:{code:-19111,message:"TR_TO_WALLET_STATUS_CONSTRAINT",description:"To wallet.status doesn't allow this type of transfers"},TR_CANCELLED_CANT_RV:{code:-19112,message:"TR_CANCELLED_CANT_RV",description:"Cancelled Transfer can not be reversed"},TR_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19113,message:"TR_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"Deposits are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'deposit' requires reverse_deposit option to be true."},TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19114,message:"TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"Withdrawals are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'withdrawal' requires reverse_withdrawal option to be true."},TR_UNIQUE_IDENTIFIER:{code:-19115,message:"TR_UNIQUE_IDENTIFIER",description:"The identifier for Transfer object must be unique"},TR_DIFFERENT_WALLETS:{code:-19116,message:"TR_DIFFERENT_WALLETS",description:"To and from wallets have to be different"},TR_AMOUNT_CONSTRAINT:{code:-19117,message:"TR_AMOUNT_CONSTRAINT",description:"The transfer amount is outside of allowed bounds"},TRG_SINGLE_PENDING_TR_CANT_RV:{code:-19200,message:"TRG_SINGLE_PENDING_TR_CANT_RV",description:"Transfer is part of TransferGroup and can not be reversed separately"},TRG_CANCELLED_CANT_RV:{code:-19201,message:"TRG_CANCELLED_CANT_RV",description:"Cancelled TransferGroup can not be reversed"},TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19202,message:"TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true"},TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19203,message:"TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true"},TRG_UNIQUE_IDENTIFIER:{code:-19204,message:"TRG_UNIQUE_IDENTIFIER",description:"The identifier for TransferGroup object must be unique"},TOKEN_UNIQUE_FOREIGN:{code:-19300,message:"TOKEN_UNIQUE_FOREIGN",description:"The foreign for Token object must be unique"},WALLET_UNIQUE_FOREIGN:{code:-19400,message:"WALLET_UNIQUE_FOREIGN",description:"The foreign for Wallet object must be unique"},UNIQUE_CONSTRAINT:{code:-19500,message:"UNIQUE_CONSTRAINT",description:"Insert violates unique constraint"},APIKEY_DELETED_CANT_UPDATE:{code:-19600,message:"APIKEY_DELETED_CANT_UPDATE",description:"Cant update deleted apikeys"},APIKEY_NOT_OWNED_CANT_UPDATE:{code:-19601,message:"APIKEY_NOT_OWNED_CANT_UPDATE",description:"Cant update apikeys you dont own"},APIKEY_LIMIT_REACHED:{code:-19610,message:"APIKEY_LIMIT_REACHED",description:"Cant create any more api keys, limit reached"}}},CONFIG:{min:-16e3,max:-15e3,ERRORS:{METHOD_DISABLED:{code:-15e3,message:"METHOD_DISABLED",description:"Method is disabled"},FLAG_PRODUCTION_ON:{code:-15001,message:"FLAG_PRODUCTION_ON",description:'Production flag is "on" - this method is disabled'},FLAG_PRODUCTION_LOCKED:{code:-15002,message:"FLAG_PRODUCTION_LOCKED",description:"Cant update production flag to false in this server"},TRANSACTION_TIMEOUT:{code:-15003,message:"TRANSACTION_TIMEOUT",description:"Database transaction timed out"},CONNECTION_TIMEOUT:{code:-15004,message:"CONNECTION_TIMEOUT",description:"Unable to get initial response in specified time"},SENDING_TIMEOUT:{code:-15005,message:"SENDING_TIMEOUT",description:"Unable to get ack from server in specified time"},CONFIG_INVALID:{code:-15100,message:"CONFIG_INVALID",description:"Provided configuration is invalid"}}}},Fe=l(l(l(l(l(l({},De.JSONRPC.ERRORS),De.AUTH.ERRORS),De.CONFIG.ERRORS),De.STREAM.ERRORS),De.INPUT.ERRORS),De.CONSTRAINT.ERRORS);function Jb(e){return Object.fromEntries(Object.keys(e).map(t=>[t,t]))}var lr=Jb(Fe),Ke=class extends Error{constructor({type:n,code:o,message:r,data:a}){var p;super(r);E(this,"type");E(this,"code");E(this,"data");let u=(p=Fe[n])!=null?p:Fe.INTERNAL_SERVER_ERROR;this.type=n!=null?n:lr.INTERNAL_SERVER_ERROR,this.code=o!=null?o:u.code,this.message=r!=null?r:u.message,this.data=l({description:u.description},a&&typeof a=="object"?a:{error:a})}toJSON(){return{code:this.code,message:this.message,data:this.data}}},Pr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},yt=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},oe=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Ce=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},cr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},ao=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Se=class extends Pr{constructor(t,n){super("INVALID_PARAMS",t,n)}},pr=class extends cr{constructor(t){super("AUTHENTICATION_ERROR",t)}},Ji=class extends cr{constructor(t){super("AUTHORIZATION_ERROR",t)}},io=class extends Ke{constructor(t){super({type:lr.INTERNAL_SERVER_ERROR,data:t})}toJSON(){return{code:this.code,message:this.message,data:{description:Fe.INTERNAL_SERVER_ERROR.description}}}},Ki=class extends io{constructor(t){super({data:{message:t}})}toJSON(){let t=super.toJSON();return t.data={description:t.data.description,message:this.data.message},{code:this.code,message:this.message,data:{message:this.data.message,description:Fe.INTERNAL_SERVER_ERROR.description}}}},Kb=Object.fromEntries(Object.keys(Fe).map(e=>[Fe[e].code,e]));function Qb(e){let t=Kb[e];if(!t){let o=Object.entries(De).find(([,r])=>e>=r.min&&e<=r.max);return{group:o==null?void 0:o[0],type:void 0}}let n=Object.keys(De).find(o=>t in De[o].ERRORS);return n?{group:n,type:t}:(console.error("ERRORS and ERROR_GROUPS are out of sync",t),{group:void 0,type:t})}function so({code:e,message:t,data:n}){let o=Qb(e),r=o.type,a=o.group;t=t&&t!==r||!r?t:Fe[r].description;let u;switch(a&&a!=="JSONRPC"&&r===void 0&&(P("Novel error from server",e,t,n),r=t,u=e,t=n&&typeof n=="object"&&"description"in n&&typeof n.description=="string"?n.description:t),a){case"JSONRPC":return new Pr(r,n,t);case"AUTH":return new cr(r,n,t,u);case"CONFIG":return new Ce(r,n,t,u);case"CONSTRAINT":return new ao(r,n,t,u);case"INPUT":return new oe(r,n,t,u);case"STREAM":return new yt(r,n,t,u);default:return new Ke({code:e,message:t,data:n,type:r!=null?r:lr.INTERNAL_SERVER_ERROR})}}var Qi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].message])),Xi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].description]));var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function Bd(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}var Yi,Xb=new Uint8Array(16);function es(){if(!Yi){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yi=crypto.getRandomValues.bind(crypto)}return Yi(Xb)}var Yb=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ts={randomUUID:Yb};function ex(e,t,n){var r,a,u;if(ts.randomUUID&&!t&&!e)return ts.randomUUID();e=e||{};let o=(u=(a=e.random)!=null?a:(r=e.rng)==null?void 0:r.call(e))!=null?u:es();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let p=0;p<16;++p)t[n+p]=o[p];return t}return Bd(o)}var Gr=ex;var rs={timeouts:{},values:{},set(e,t){this.timeouts[e]=setTimeout(()=>this.clear(e),3e4),this.values[e]=t},get(e){return this.values[e]},getKey(e){let t=JSON.parse(JSON.stringify(e)),n="";return Object.keys(t).sort().forEach(o=>{let r="";t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?r=this.getKey(t[o]):r=JSON.stringify(t[o]),n+=o+":"+r}),n},clear(e){this.timeouts[e]&&clearTimeout(this.timeouts[e]),delete this.timeouts[e],delete this.values[e]},clearAll(){Object.keys(this.timeouts).forEach(e=>{clearTimeout(this.timeouts[e])}),this.timeouts={},this.values={}}};function uo(e=8){return Gr().replace(/-/g,"").slice(-e)}function ke(e){if(!e)return Gr();let t=rs.getKey(e);if(rs.get(t))throw new oe("INPUT_NEEDS_IDENTIFIER",{object:e});let n=Gr();return rs.set(t,n),n}function Vd(e){return new Promise(t=>setTimeout(t,e))}function ns(){return ke()}function tx(e){return JSON.parse(JSON.stringify(e))}function St(e,t,n){if(t in e){if(e[t]===void 0)throw new Se({input:e},`undefined provided for ${t}`);return e}if(!n)throw new Se({input:e},`${t} is required if no default set`);let o=tx(e);return o[t]=n,o}function rx(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Zd(e){return e.host.replace(/^https:/,"wss:")+"?"+rx({apikey:e.apikey,apisecret:e.apisecret,db:e.database,clientVersion:e.clientVersion,connectionName:e.connectionName})}function Ld(e){return typeof window=="undefined"?[Zd(e),{rejectUnauthorized:e.rejectUnauthorized}]:[Zd(e)]}function co(e,t){let n={},o=!e||typeof e!="object"?{}:e;return Object.keys(o).forEach(r=>{t[r]?typeof t[r]=="string"?n[t[r]]=o[r]:n[r]=t[r](o[r]):n[r]=o[r]}),n}function nx(e){return e.split(",").map(t=>t.split(" ")).map(t=>{let[n,o,r,a]=t;return l({field:n,direction:o==="desc"?"desc":"asc"},r==="nulls"&&["first","last"].includes(a)?{nulls:a}:{})})}function ae(e,t){var a;let r=e!=null?e:{},{options:n}=r;return{filter:de(r,["options"]),options:(a=t!=null?t:n)!=null?a:{}}}function et(e){let o=e,{order_by:t}=o,n=de(o,["order_by"]);return!n.order&&t&&(n.order=nx(t)),n}function qd(e){if(e!=null)return e+""}function dr(e){return typeof e=="number"?e:parseFloat(e)}function Hd(e){return new Date(e).setHours(0,0,0,0)>new Date().setHours(0,0,0,0)}var we={version:"2.0",acknowledgement:"ack",ping:"ping",pong:"pong",streamChunk:"streamChunk",streamPause:"streamPause",streamResume:"streamResume"};var Wr=class{constructor(t){E(this,"_data",[]);E(this,"_error",[]);E(this,"_end",[]);E(this,"_finished",!1);E(this,"_options");this._options=t}on(t,n){switch(t){case"data":return this._data.push(n),this;case"end":return this._end.push(n),this;case"error":return this._error.push(n),this}}push(t){if(this._finished)throw new Error("Stream is closed");return t===null?this.end():(this._data.forEach(n=>n(t)),this)}error(t){if(this._finished)throw new Error("Stream is closed");return this._error.forEach(n=>n(t)),this}end(){if(this._finished)throw new Error("Stream is closed");return this._end.forEach(t=>t()),this._finished=!0,this}destroy(t){return this.error(t),this.end(),this}get destroyed(){return this._finished}};var fr=class{constructor(t){E(this,"resolve");E(this,"reject");E(this,"makeRequest");E(this,"streamObject",new Wr({objectMode:!0}));E(this,"outStreamObject",new Wr({objectMode:!0}));E(this,"mode");E(this,"started",!1);E(this,"promise");this.makeRequest=t}start(t){var u;if(P("start request as",t),this.mode&&this.mode!==t)throw new Error("Already in use as "+this.mode);if(this.started)return;let{promise:n,resolve:o,reject:r}=Promise.withResolvers();if(this.promise=n,this.resolve=o,this.reject=r,this.started=!0,this.mode=t,this.makeRequest===void 0){this.streamObject.push(null),(u=this.resolve)==null||u.call(this,void 0);return}this.makeRequest(this.streamObject).catch(this.reject);let a=[];if(this.mode==="stream"){this.streamObject.on("data",p=>{if(P("stream data",p),p||this.outStreamObject.push(p),p.error){let c=so(p.error);return this.outStreamObject.destroy(c),this.streamObject.destroy(c)}if(!p.prop){a.push(p);return}if(p.dataArr){let c=l({},p);delete c.dataArr,p.dataArr.forEach(i=>{this.outStreamObject.push(v(l({},c),{data:i}))});return}this.outStreamObject.push(p)}).on("end",()=>{P("stream ended");let p=a.pop();if(!p)return;let c=p.result;Object.keys(c).forEach(i=>{Array.isArray(c[i])&&(c[i].forEach(d=>{this.outStreamObject.push({type:we.streamChunk,prop:i,data:d})}),c[i]=[])}),this.outStreamObject.push(p),this.outStreamObject.push(null)}).on("error",p=>{P("stream error",p),this.outStreamObject.destroy(p)});return}if(this.mode==="promise"){let p=new Map;this.streamObject.on("data",c=>{var d;if(P("streamPromise data",c),c===void 0)return;if(c.error){let g=so(c.error);return this.streamObject.destroy(g)}if(!c.prop){a.push(c);return}let i=(d=p.get(c.prop))!=null?d:[];c.dataArr?i.push(...c.dataArr):i.push(c.data),p.set(c.prop,i)}).on("end",()=>{P("streamPromise end");let c=a.pop();if(!c)return;let i=c.result;if(!p.size)return this.resolve(i);let d=!1;p.forEach((g,h)=>{Array.isArray(i[h])?(g.push(...i[h]),i[h]=g):g.length===1?i[h]=g:(this.streamObject.destroy(new yt("INVALID_RESPONSE_STREAM_CHUNK",{property:h,value:g})),d=!0)}),d||this.resolve(i)}).on("error",c=>{var i;return P("streamPromise error",c),(i=this.reject)==null?void 0:i.call(this,c)})}}then(t,n){return this.start("promise"),this.promise.then(t,n)}catch(t){return this.start("promise"),this.promise.catch(t)}get[Symbol.toStringTag](){return"StreamPromise"}finally(t){return this.start("promise"),this.promise.finally(t)}stream(){return this.start("stream"),this.outStreamObject}};var po={};var ox=(e,t)=>{if(e)return new Se({message:e.message,data:e.format()})},os=(e,t,n=ox)=>{let{success:o,error:r,data:a}=e.safeParse(t);return{data:a,success:o,isValid:o,error:n(r,t)}},Jd=(e,t,n,o)=>!t||typeof t!="object"?{success:!1,isValid:!1,error:new Se({message:`Invalid input - expected object, got ${typeof t}`,data:{input:t}})}:os(e,l({options:n!=null?n:{}},t),o),lt=(e,t,n,o)=>{var u;let{data:r,error:a}=os(e,t,o);if(a)throw((u=n==null?void 0:n.warn)!=null?u:P)(l({err:a},po),"Invalid input"),a;return r},ax=(e,t,n,o,r)=>{!o&&n&&typeof(n==null?void 0:n.warn)=="function"&&(o=n,n={});let{data:a,error:u}=Jd(e,t,n,r);if(u)throw o?o.warn(l({err:u},po),"Invalid input"):P(l({err:u},po),"Invalid input"),u;return a},f=(e,t)=>({validateInput:(n,o)=>lt(e,n,o,t),validateInputWOptions:(n,o,r)=>ax(e,n,o,r,t),softValidateInput:n=>os(e,n,t),softValidateWOptions:(n,o)=>Jd(e,n,o,t)});var s={};xt(s,{$brand:()=>is,$input:()=>_c,$output:()=>vc,NEVER:()=>as,TimePrecision:()=>Fc,ZodAny:()=>ym,ZodArray:()=>Om,ZodBase64:()=>Zp,ZodBase64URL:()=>Vp,ZodBigInt:()=>In,ZodBigIntFormat:()=>Hp,ZodBoolean:()=>On,ZodCIDRv4:()=>Up,ZodCIDRv6:()=>Bp,ZodCUID:()=>jp,ZodCUID2:()=>Ap,ZodCatch:()=>Bm,ZodCodec:()=>ol,ZodCustom:()=>ga,ZodCustomStringFormat:()=>vn,ZodDate:()=>fa,ZodDefault:()=>Dm,ZodDiscriminatedUnion:()=>Im,ZodE164:()=>Lp,ZodEmail:()=>zp,ZodEmoji:()=>Np,ZodEnum:()=>yn,ZodError:()=>$S,ZodFile:()=>Mm,ZodFirstPartyTypeKind:()=>al,ZodFunction:()=>Xm,ZodGUID:()=>ua,ZodIPv4:()=>Gp,ZodIPv6:()=>Wp,ZodISODate:()=>aa,ZodISODateTime:()=>oa,ZodISODuration:()=>sa,ZodISOTime:()=>ia,ZodIntersection:()=>Fm,ZodIssueCode:()=>Gv,ZodJWT:()=>qp,ZodKSUID:()=>Pp,ZodLazy:()=>Jm,ZodLiteral:()=>Nm,ZodMap:()=>Rm,ZodNaN:()=>Vm,ZodNanoID:()=>Mp,ZodNever:()=>vm,ZodNonOptional:()=>rl,ZodNull:()=>bm,ZodNullable:()=>Am,ZodNumber:()=>_n,ZodNumberFormat:()=>wr,ZodObject:()=>ha,ZodOptional:()=>tl,ZodPipe:()=>nl,ZodPrefault:()=>Pm,ZodPromise:()=>Qm,ZodReadonly:()=>Lm,ZodRealError:()=>Ne,ZodRecord:()=>Xp,ZodSet:()=>zm,ZodString:()=>Sn,ZodStringFormat:()=>ce,ZodSuccess:()=>Um,ZodSymbol:()=>gm,ZodTemplateLiteral:()=>Hm,ZodTransform:()=>jm,ZodTuple:()=>wm,ZodType:()=>B,ZodULID:()=>Dp,ZodURL:()=>da,ZodUUID:()=>ht,ZodUndefined:()=>Tm,ZodUnion:()=>Kp,ZodUnknown:()=>Sm,ZodVoid:()=>_m,ZodXID:()=>Cp,_ZodString:()=>Rp,_default:()=>Cm,_function:()=>Nv,any:()=>fv,array:()=>ma,base64:()=>KS,base64url:()=>QS,bigint:()=>uv,boolean:()=>hm,catch:()=>Zm,check:()=>Mv,cidrv4:()=>HS,cidrv6:()=>JS,clone:()=>$e,codec:()=>Ev,coerce:()=>Ta,config:()=>Te,core:()=>nt,cuid:()=>WS,cuid2:()=>US,custom:()=>jv,date:()=>hv,decode:()=>vp,decodeAsync:()=>Op,discriminatedUnion:()=>yv,e164:()=>XS,email:()=>RS,emoji:()=>PS,encode:()=>Sp,encodeAsync:()=>_p,endsWith:()=>dn,enum:()=>Yp,file:()=>Fv,flattenError:()=>Kr,float32:()=>ov,float64:()=>av,formatError:()=>Qr,function:()=>Nv,getErrorMap:()=>Uv,globalRegistry:()=>rt,gt:()=>ft,gte:()=>ze,guid:()=>zS,hash:()=>nv,hex:()=>rv,hostname:()=>tv,httpUrl:()=>CS,includes:()=>pn,instanceof:()=>Av,int:()=>Ep,int32:()=>iv,int64:()=>cv,intersection:()=>km,ipv4:()=>LS,ipv6:()=>qS,iso:()=>xn,json:()=>Cv,jwt:()=>YS,keyof:()=>gv,ksuid:()=>VS,lazy:()=>Km,length:()=>Ir,literal:()=>Iv,locales:()=>Bt,looseObject:()=>xv,lowercase:()=>un,lt:()=>dt,lte:()=>Ze,map:()=>vv,maxLength:()=>Or,maxSize:()=>_r,mime:()=>fn,minLength:()=>wt,minSize:()=>Vt,multipleOf:()=>Zt,nan:()=>$v,nanoid:()=>GS,nativeEnum:()=>Ov,negative:()=>tp,never:()=>Jp,nonnegative:()=>np,nonoptional:()=>Wm,nonpositive:()=>rp,normalize:()=>mn,null:()=>xm,nullable:()=>pa,nullish:()=>kv,number:()=>mm,object:()=>Tv,optional:()=>ca,overwrite:()=>mt,parse:()=>Tp,parseAsync:()=>bp,partialRecord:()=>Sv,pipe:()=>la,positive:()=>ep,prefault:()=>Gm,preprocess:()=>Pv,prettifyError:()=>Ts,promise:()=>zv,property:()=>op,readonly:()=>qm,record:()=>Em,refine:()=>Ym,regex:()=>sn,regexes:()=>We,registry:()=>Do,safeDecode:()=>Fp,safeDecodeAsync:()=>wp,safeEncode:()=>Ip,safeEncodeAsync:()=>kp,safeParse:()=>xp,safeParseAsync:()=>yp,set:()=>_v,setErrorMap:()=>Wv,size:()=>an,startsWith:()=>ln,strictObject:()=>bv,string:()=>$p,stringFormat:()=>ev,stringbool:()=>Dv,success:()=>wv,superRefine:()=>eh,symbol:()=>lv,templateLiteral:()=>Rv,toJSONSchema:()=>lp,toLowerCase:()=>gn,toUpperCase:()=>Tn,transform:()=>el,treeifyError:()=>gs,trim:()=>hn,tuple:()=>$m,uint32:()=>sv,uint64:()=>pv,ulid:()=>BS,undefined:()=>dv,union:()=>Qp,unknown:()=>kr,uppercase:()=>cn,url:()=>DS,uuid:()=>NS,uuidv4:()=>MS,uuidv6:()=>jS,uuidv7:()=>AS,void:()=>mv,xid:()=>ZS});var nt={};xt(nt,{$ZodAny:()=>Vu,$ZodArray:()=>Ku,$ZodAsyncError:()=>Qe,$ZodBase64:()=>ju,$ZodBase64URL:()=>Au,$ZodBigInt:()=>No,$ZodBigIntFormat:()=>Wu,$ZodBoolean:()=>tn,$ZodCIDRv4:()=>zu,$ZodCIDRv6:()=>Nu,$ZodCUID:()=>Su,$ZodCUID2:()=>vu,$ZodCatch:()=>fc,$ZodCheck:()=>pe,$ZodCheckBigIntFormat:()=>Qs,$ZodCheckEndsWith:()=>cu,$ZodCheckGreaterThan:()=>Fo,$ZodCheckIncludes:()=>su,$ZodCheckLengthEquals:()=>nu,$ZodCheckLessThan:()=>Io,$ZodCheckLowerCase:()=>au,$ZodCheckMaxLength:()=>tu,$ZodCheckMaxSize:()=>Xs,$ZodCheckMimeType:()=>lu,$ZodCheckMinLength:()=>ru,$ZodCheckMinSize:()=>Ys,$ZodCheckMultipleOf:()=>Js,$ZodCheckNumberFormat:()=>Ks,$ZodCheckOverwrite:()=>du,$ZodCheckProperty:()=>pu,$ZodCheckRegex:()=>ou,$ZodCheckSizeEquals:()=>eu,$ZodCheckStartsWith:()=>uu,$ZodCheckStringFormat:()=>Sr,$ZodCheckUpperCase:()=>iu,$ZodCodec:()=>rn,$ZodCustom:()=>Sc,$ZodCustomStringFormat:()=>Pu,$ZodDate:()=>Ju,$ZodDefault:()=>cc,$ZodDiscriminatedUnion:()=>Xu,$ZodE164:()=>Du,$ZodEmail:()=>Tu,$ZodEmoji:()=>xu,$ZodEncodeError:()=>vt,$ZodEnum:()=>nc,$ZodError:()=>Jr,$ZodFile:()=>ac,$ZodFunction:()=>bc,$ZodGUID:()=>hu,$ZodIPv4:()=>Eu,$ZodIPv6:()=>Ru,$ZodISODate:()=>ku,$ZodISODateTime:()=>Fu,$ZodISODuration:()=>$u,$ZodISOTime:()=>wu,$ZodIntersection:()=>Yu,$ZodJWT:()=>Cu,$ZodKSUID:()=>Iu,$ZodLazy:()=>yc,$ZodLiteral:()=>oc,$ZodMap:()=>tc,$ZodNaN:()=>mc,$ZodNanoID:()=>yu,$ZodNever:()=>qu,$ZodNonOptional:()=>lc,$ZodNull:()=>Zu,$ZodNullable:()=>uc,$ZodNumber:()=>zo,$ZodNumberFormat:()=>Gu,$ZodObject:()=>Sf,$ZodObjectJIT:()=>Qu,$ZodOptional:()=>sc,$ZodPipe:()=>hc,$ZodPrefault:()=>pc,$ZodPromise:()=>xc,$ZodReadonly:()=>gc,$ZodRealError:()=>Re,$ZodRecord:()=>ec,$ZodRegistry:()=>vr,$ZodSet:()=>rc,$ZodString:()=>Ut,$ZodStringFormat:()=>se,$ZodSuccess:()=>dc,$ZodSymbol:()=>Uu,$ZodTemplateLiteral:()=>Tc,$ZodTransform:()=>ic,$ZodTuple:()=>jo,$ZodType:()=>A,$ZodULID:()=>_u,$ZodURL:()=>bu,$ZodUUID:()=>gu,$ZodUndefined:()=>Bu,$ZodUnion:()=>Mo,$ZodUnknown:()=>Lu,$ZodVoid:()=>Hu,$ZodXID:()=>Ou,$brand:()=>is,$constructor:()=>m,$input:()=>_c,$output:()=>vc,Doc:()=>en,JSONSchema:()=>dp,JSONSchemaGenerator:()=>bn,NEVER:()=>as,TimePrecision:()=>Fc,_any:()=>qc,_array:()=>ap,_base64:()=>ea,_base64url:()=>ta,_bigint:()=>Gc,_boolean:()=>Cc,_catch:()=>vS,_check:()=>lm,_cidrv4:()=>Xo,_cidrv6:()=>Yo,_coercedBigint:()=>Wc,_coercedBoolean:()=>Pc,_coercedDate:()=>Xc,_coercedNumber:()=>zc,_coercedString:()=>Ic,_cuid:()=>Vo,_cuid2:()=>Lo,_custom:()=>sp,_date:()=>Qc,_decode:()=>To,_decodeAsync:()=>xo,_default:()=>xS,_discriminatedUnion:()=>sS,_e164:()=>ra,_email:()=>Co,_emoji:()=>Bo,_encode:()=>go,_encodeAsync:()=>bo,_endsWith:()=>dn,_enum:()=>fS,_file:()=>ip,_float32:()=>Mc,_float64:()=>jc,_gt:()=>ft,_gte:()=>ze,_guid:()=>nn,_includes:()=>pn,_int:()=>Nc,_int32:()=>Ac,_int64:()=>Uc,_intersection:()=>uS,_ipv4:()=>Ko,_ipv6:()=>Qo,_isoDate:()=>wc,_isoDateTime:()=>kc,_isoDuration:()=>Ec,_isoTime:()=>$c,_jwt:()=>na,_ksuid:()=>Jo,_lazy:()=>FS,_length:()=>Ir,_literal:()=>hS,_lowercase:()=>un,_lt:()=>dt,_lte:()=>Ze,_map:()=>lS,_max:()=>Ze,_maxLength:()=>Or,_maxSize:()=>_r,_mime:()=>fn,_min:()=>ze,_minLength:()=>wt,_minSize:()=>Vt,_multipleOf:()=>Zt,_nan:()=>Yc,_nanoid:()=>Zo,_nativeEnum:()=>mS,_negative:()=>tp,_never:()=>Jc,_nonnegative:()=>np,_nonoptional:()=>yS,_nonpositive:()=>rp,_normalize:()=>mn,_null:()=>Lc,_nullable:()=>bS,_number:()=>Rc,_optional:()=>TS,_overwrite:()=>mt,_parse:()=>Tr,_parseAsync:()=>br,_pipe:()=>_S,_positive:()=>ep,_promise:()=>kS,_property:()=>op,_readonly:()=>OS,_record:()=>pS,_refine:()=>up,_regex:()=>sn,_safeDecode:()=>So,_safeDecodeAsync:()=>_o,_safeEncode:()=>yo,_safeEncodeAsync:()=>vo,_safeParse:()=>xr,_safeParseAsync:()=>yr,_set:()=>dS,_size:()=>an,_startsWith:()=>ln,_string:()=>Oc,_stringFormat:()=>Fr,_stringbool:()=>pp,_success:()=>SS,_superRefine:()=>cp,_symbol:()=>Zc,_templateLiteral:()=>IS,_toLowerCase:()=>gn,_toUpperCase:()=>Tn,_transform:()=>gS,_trim:()=>hn,_tuple:()=>cS,_uint32:()=>Dc,_uint64:()=>Bc,_ulid:()=>qo,_undefined:()=>Vc,_union:()=>iS,_unknown:()=>Hc,_uppercase:()=>cn,_url:()=>on,_uuid:()=>Po,_uuidv4:()=>Go,_uuidv6:()=>Wo,_uuidv7:()=>Uo,_void:()=>Kc,_xid:()=>Ho,clone:()=>$e,config:()=>Te,decode:()=>Nx,decodeAsync:()=>jx,encode:()=>zx,encodeAsync:()=>Mx,flattenError:()=>Kr,formatError:()=>Qr,globalConfig:()=>Ur,globalRegistry:()=>rt,isValidBase64:()=>Mu,isValidBase64URL:()=>Tf,isValidJWT:()=>bf,locales:()=>Bt,parse:()=>mo,parseAsync:()=>ho,prettifyError:()=>Ts,regexes:()=>We,registry:()=>Do,safeDecode:()=>Dx,safeDecodeAsync:()=>Px,safeEncode:()=>Ax,safeEncodeAsync:()=>Cx,safeParse:()=>bs,safeParseAsync:()=>xs,toDotPath:()=>ef,toJSONSchema:()=>lp,treeifyError:()=>gs,util:()=>I,version:()=>fu});var as=Object.freeze({status:"aborted"});function m(e,t,n){var p;function o(c,i){var g,h;var d;Object.defineProperty(c,"_zod",{value:(g=c._zod)!=null?g:{},enumerable:!1}),(h=(d=c._zod).traits)!=null||(d.traits=new Set),c._zod.traits.add(e),t(c,i);for(let x in u.prototype)x in c||Object.defineProperty(c,x,{value:u.prototype[x].bind(c)});c._zod.constr=u,c._zod.def=i}let r=(p=n==null?void 0:n.Parent)!=null?p:Object;class a extends r{}Object.defineProperty(a,"name",{value:e});function u(c){var g;var i;let d=n!=null&&n.Parent?new a:this;o(d,c),(g=(i=d._zod).deferred)!=null||(i.deferred=[]);for(let h of d._zod.deferred)h();return d}return Object.defineProperty(u,"init",{value:o}),Object.defineProperty(u,Symbol.hasInstance,{value:c=>{var i,d;return n!=null&&n.Parent&&c instanceof n.Parent?!0:(d=(i=c==null?void 0:c._zod)==null?void 0:i.traits)==null?void 0:d.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}var is=Symbol("zod_brand"),Qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ur={};function Te(e){return e&&Object.assign(Ur,e),Ur}var I={};xt(I,{BIGINT_FORMAT_RANGES:()=>hs,Class:()=>us,NUMBER_FORMAT_RANGES:()=>ms,aborted:()=>kt,allowsEval:()=>ps,assert:()=>px,assertEqual:()=>ix,assertIs:()=>ux,assertNever:()=>cx,assertNotEqual:()=>sx,assignProp:()=>Ot,base64ToUint8Array:()=>Qd,base64urlToUint8Array:()=>kx,cached:()=>hr,captureStackTrace:()=>fo,cleanEnum:()=>Fx,cleanRegex:()=>Vr,clone:()=>$e,cloneDef:()=>dx,createTransparentProxy:()=>bx,defineLazy:()=>J,esc:()=>lo,escapeRegex:()=>tt,extend:()=>Sx,finalizeIssue:()=>Ge,floatSafeRemainder:()=>cs,getElementAtPath:()=>fx,getEnumValues:()=>Zr,getLengthableOrigin:()=>Hr,getParsedType:()=>Tx,getSizableOrigin:()=>qr,hexToUint8Array:()=>$x,isObject:()=>Gt,isPlainObject:()=>Ft,issue:()=>gr,joinValues:()=>b,jsonStringifyReplacer:()=>mr,merge:()=>_x,mergeDefs:()=>It,normalizeParams:()=>k,nullish:()=>_t,numKeys:()=>gx,objectClone:()=>lx,omit:()=>yx,optionalKeys:()=>fs,partial:()=>Ox,pick:()=>xx,prefixIssues:()=>Pe,primitiveTypes:()=>ds,promiseAllObject:()=>mx,propertyKeyTypes:()=>Lr,randomString:()=>hx,required:()=>Ix,safeExtend:()=>vx,shallowClone:()=>ls,stringifyPrimitive:()=>$,uint8ArrayToBase64:()=>Xd,uint8ArrayToBase64url:()=>wx,uint8ArrayToHex:()=>Ex,unwrapMessage:()=>Br});function ix(e){return e}function sx(e){return e}function ux(e){}function cx(e){throw new Error}function px(e){}function Zr(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function b(e,t="|"){return e.map(n=>$(n)).join(t)}function mr(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function _t(e){return e==null}function Vr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function cs(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c!=null&&c[1]&&(r=Number.parseInt(c[1]))}let a=n>r?n:r,u=Number.parseInt(e.toFixed(a).replace(".","")),p=Number.parseInt(t.toFixed(a).replace(".",""));return u%p/Gd(10,a)}var Kd=Symbol("evaluating");function J(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==Kd)return o===void 0&&(o=Kd,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lx(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function It(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function dx(e){return It(e._zod.def)}function fx(e,t){return t?t.reduce((n,o)=>n==null?void 0:n[o],e):e}function mx(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let a=0;a<t.length;a++)r[t[a]]=o[a];return r})}function hx(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function lo(e){return JSON.stringify(e)}var fo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ps=hr(()=>{var e;if(typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{let t=Function;return new t(""),!0}catch(t){return!1}});function Ft(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Gt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ls(e){return Ft(e)?l({},e):e}function gx(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Tx=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map!="undefined"&&e instanceof Map?"map":typeof Set!="undefined"&&e instanceof Set?"set":typeof Date!="undefined"&&e instanceof Date?"date":typeof File!="undefined"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Lr=new Set(["string","number","symbol"]),ds=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(e,t,n){let o=new e._zod.constr(t!=null?t:e._zod.def);return(!t||n!=null&&n.parent)&&(o._zod.parent=e),o}function k(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?v(l({},t),{error:()=>t.error}):t}function bx(e){let t;return new Proxy({},{get(n,o,r){return t!=null||(t=e()),Reflect.get(t,o,r)},set(n,o,r,a){return t!=null||(t=e()),Reflect.set(t,o,r,a)},has(n,o){return t!=null||(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t!=null||(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t!=null||(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t!=null||(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t!=null||(t=e()),Reflect.defineProperty(t,o,r)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ms={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r={};for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=n.shape[a])}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function yx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r=l({},e._zod.def.shape);for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function Sx(e,t){if(!Ft(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=It(e._zod.def,{get shape(){let a=l(l({},e._zod.def.shape),t);return Ot(this,"shape",a),a},checks:[]});return $e(e,r)}function vx(e,t){if(!Ft(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=v(l({},e._zod.def),{get shape(){let o=l(l({},e._zod.def.shape),t);return Ot(this,"shape",o),o},checks:e._zod.def.checks});return $e(e,n)}function _x(e,t){let n=It(e._zod.def,{get shape(){let o=l(l({},e._zod.def.shape),t._zod.def.shape);return Ot(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return $e(e,n)}function Ox(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in r))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:r[u]}):r[u])}else for(let u in r)a[u]=e?new e({type:"optional",innerType:r[u]}):r[u];return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function Ix(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=new e({type:"nonoptional",innerType:r[u]}))}else for(let u in r)a[u]=new e({type:"nonoptional",innerType:r[u]});return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function kt(e,t=0){var n;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((n=e.issues[o])==null?void 0:n.continue)!==!0)return!0;return!1}function Pe(e,t){return t.map(n=>{var r;var o;return(r=(o=n).path)!=null||(o.path=[]),n.path.unshift(e),n})}function Br(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ge(e,t,n){var r,a,u,p,c,i,d,g,h,x,z;let o=v(l({},e),{path:(r=e.path)!=null?r:[]});if(!e.message){let H=(z=(x=(g=(i=Br((p=(u=(a=e.inst)==null?void 0:a._zod.def)==null?void 0:u.error)==null?void 0:p.call(u,e)))!=null?i:Br((c=t==null?void 0:t.error)==null?void 0:c.call(t,e)))!=null?g:Br((d=n.customError)==null?void 0:d.call(n,e)))!=null?x:Br((h=n.localeError)==null?void 0:h.call(n,e)))!=null?z:"Invalid input";o.message=H}return delete o.inst,delete o.continue,t!=null&&t.reportInput||delete o.input,o}function qr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Hr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gr(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:l({},t)}function Fx(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Qd(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Xd(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function kx(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Qd(t+n)}function wx(e){return Xd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $x(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Ex(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var us=class{constructor(...t){}};var Yd=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,mr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jr=m("$ZodError",Yd),Re=m("$ZodError",Yd,{Parent:Error});function Kr(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Qr(e,t){let n=t||function(a){return a.message},o={_errors:[]},r=a=>{for(let u of a.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(p=>r({issues:p}));else if(u.code==="invalid_key")r({issues:u.issues});else if(u.code==="invalid_element")r({issues:u.issues});else if(u.path.length===0)o._errors.push(n(u));else{let p=o,c=0;for(;c<u.path.length;){let i=u.path[c];c===u.path.length-1?(p[i]=p[i]||{_errors:[]},p[i]._errors.push(n(u))):p[i]=p[i]||{_errors:[]},p=p[i],c++}}};return r(e),o}function gs(e,t){let n=t||function(a){return a.message},o={errors:[]},r=(a,u=[])=>{var i,d,g,h;var p,c;for(let x of a.issues)if(x.code==="invalid_union"&&x.errors.length)x.errors.map(z=>r({issues:z},x.path));else if(x.code==="invalid_key")r({issues:x.issues},x.path);else if(x.code==="invalid_element")r({issues:x.issues},x.path);else{let z=[...u,...x.path];if(z.length===0){o.errors.push(n(x));continue}let H=o,N=0;for(;N<z.length;){let D=z[N],j=N===z.length-1;typeof D=="string"?((i=H.properties)!=null||(H.properties={}),(d=(p=H.properties)[D])!=null||(p[D]={errors:[]}),H=H.properties[D]):((g=H.items)!=null||(H.items=[]),(h=(c=H.items)[D])!=null||(c[D]={errors:[]}),H=H.items[D]),j&&H.errors.push(n(x)),N++}}};return r(e),o}function ef(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Ts(e){var o;let t=[],n=[...e.issues].sort((r,a)=>{var u,p;return((u=r.path)!=null?u:[]).length-((p=a.path)!=null?p:[]).length});for(let r of n)t.push(`\u2716 ${r.message}`),(o=r.path)!=null&&o.length&&t.push(` \u2192 at ${ef(r.path)}`);return t.join(`
3
3
  `)}var Tr=e=>(t,n,o,r)=>{var p;let a=o?Object.assign(o,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},a);if(u instanceof Promise)throw new Qe;if(u.issues.length){let c=new((p=r==null?void 0:r.Err)!=null?p:e)(u.issues.map(i=>Ge(i,a,Te())));throw fo(c,r==null?void 0:r.callee),c}return u.value},mo=Tr(Re),br=e=>(t,n,o,r)=>Y(null,null,function*(){var p;let a=o?Object.assign(o,{async:!0}):{async:!0},u=t._zod.run({value:n,issues:[]},a);if(u instanceof Promise&&(u=yield u),u.issues.length){let c=new((p=r==null?void 0:r.Err)!=null?p:e)(u.issues.map(i=>Ge(i,a,Te())));throw fo(c,r==null?void 0:r.callee),c}return u.value}),ho=br(Re),xr=e=>(t,n,o)=>{let r=o?v(l({},o),{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise)throw new Qe;return a.issues.length?{success:!1,error:new(e!=null?e:Jr)(a.issues.map(u=>Ge(u,r,Te())))}:{success:!0,data:a.value}},bs=xr(Re),yr=e=>(t,n,o)=>Y(null,null,function*(){let r=o?Object.assign(o,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},r);return a instanceof Promise&&(a=yield a),a.issues.length?{success:!1,error:new e(a.issues.map(u=>Ge(u,r,Te())))}:{success:!0,data:a.value}}),xs=yr(Re),go=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Tr(e)(t,n,r)},zx=go(Re),To=e=>(t,n,o)=>Tr(e)(t,n,o),Nx=To(Re),bo=e=>(t,n,o)=>Y(null,null,function*(){let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return br(e)(t,n,r)}),Mx=bo(Re),xo=e=>(t,n,o)=>Y(null,null,function*(){return br(e)(t,n,o)}),jx=xo(Re),yo=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return xr(e)(t,n,r)},Ax=yo(Re),So=e=>(t,n,o)=>xr(e)(t,n,o),Dx=So(Re),vo=e=>(t,n,o)=>Y(null,null,function*(){let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return yr(e)(t,n,r)}),Cx=vo(Re),_o=e=>(t,n,o)=>Y(null,null,function*(){return yr(e)(t,n,o)}),Px=_o(Re);var We={};xt(We,{base64:()=>Ms,base64url:()=>Oo,bigint:()=>Ws,boolean:()=>Zs,browserEmail:()=>Hx,cidrv4:()=>zs,cidrv6:()=>Ns,cuid:()=>ys,cuid2:()=>Ss,date:()=>Ds,datetime:()=>Ps,domain:()=>Kx,duration:()=>Fs,e164:()=>As,email:()=>ws,emoji:()=>$s,extendedDuration:()=>Gx,guid:()=>ks,hex:()=>Qx,hostname:()=>js,html5Email:()=>Zx,idnEmail:()=>qx,integer:()=>Us,ipv4:()=>Es,ipv6:()=>Rs,ksuid:()=>Os,lowercase:()=>qs,md5_base64:()=>Yx,md5_base64url:()=>ey,md5_hex:()=>Xx,nanoid:()=>Is,null:()=>Vs,number:()=>Bs,rfc5322Email:()=>Vx,sha1_base64:()=>ry,sha1_base64url:()=>ny,sha1_hex:()=>ty,sha256_base64:()=>ay,sha256_base64url:()=>iy,sha256_hex:()=>oy,sha384_base64:()=>uy,sha384_base64url:()=>cy,sha384_hex:()=>sy,sha512_base64:()=>ly,sha512_base64url:()=>dy,sha512_hex:()=>py,string:()=>Gs,time:()=>Cs,ulid:()=>vs,undefined:()=>Ls,unicodeEmail:()=>Lx,uppercase:()=>Hs,uuid:()=>Wt,uuid4:()=>Wx,uuid6:()=>Ux,uuid7:()=>Bx,xid:()=>_s});var ys=/^[cC][^\s-]{8,}$/,Ss=/^[0-9a-z]+$/,vs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_s=/^[0-9a-vA-V]{20}$/,Os=/^[A-Za-z0-9]{27}$/,Is=/^[a-zA-Z0-9_-]{21}$/,Fs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gx=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ks=/^([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})$/,Wt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,Wx=Wt(4),Ux=Wt(6),Bx=Wt(7),ws=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Vx=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Lx=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,qx=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Hx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Jx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function $s(){return new RegExp(Jx,"u")}var Es=/^(?:(?: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])$/,Rs=/^(([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})$/,zs=/^((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])$/,Ns=/^(([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])$/,Ms=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Oo=/^[A-Za-z0-9_-]*$/,js=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Kx=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,As=/^\+(?:[0-9]){6,14}[0-9]$/,tf="(?:(?:\\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])))",Ds=new RegExp(`^${tf}$`);function rf(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cs(e){return new RegExp(`^${rf(e)}$`)}function Ps(e){let t=rf({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${tf}T(?:${o})$`)}var Gs=e=>{var n,o;let t=e?`[\\s\\S]{${(n=e==null?void 0:e.minimum)!=null?n:0},${(o=e==null?void 0:e.maximum)!=null?o:""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ws=/^\d+n?$/,Us=/^\d+$/,Bs=/^-?\d+(?:\.\d+)?/i,Zs=/true|false/i,Vs=/null/i;var Ls=/undefined/i;var qs=/^[^A-Z]*$/,Hs=/^[^a-z]*$/,Qx=/^[0-9a-fA-F]*$/;function Xr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Yr(e){return new RegExp(`^[A-Za-z0-9-_]{${e}}$`)}var Xx=/^[0-9a-fA-F]{32}$/,Yx=Xr(22,"=="),ey=Yr(22),ty=/^[0-9a-fA-F]{40}$/,ry=Xr(27,"="),ny=Yr(27),oy=/^[0-9a-fA-F]{64}$/,ay=Xr(43,"="),iy=Yr(43),sy=/^[0-9a-fA-F]{96}$/,uy=Xr(64,""),cy=Yr(64),py=/^[0-9a-fA-F]{128}$/,ly=Xr(86,"=="),dy=Yr(86);var pe=m("$ZodCheck",(e,t)=>{var o,r;var n;(o=e._zod)!=null||(e._zod={}),e._zod.def=t,(r=(n=e._zod).onattach)!=null||(n.onattach=[])}),of={number:"number",bigint:"bigint",object:"date"},Io=m("$ZodCheckLessThan",(e,t)=>{pe.init(e,t);let n=of[typeof t.value];e._zod.onattach.push(o=>{var u;let r=o._zod.bag,a=(u=t.inclusive?r.maximum:r.exclusiveMaximum)!=null?u:Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fo=m("$ZodCheckGreaterThan",(e,t)=>{pe.init(e,t);let n=of[typeof t.value];e._zod.onattach.push(o=>{var u;let r=o._zod.bag,a=(u=t.inclusive?r.minimum:r.exclusiveMinimum)!=null?u:Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Js=m("$ZodCheckMultipleOf",(e,t)=>{pe.init(e,t),e._zod.onattach.push(n=>{var r;var o;(r=(o=n._zod.bag).multipleOf)!=null||(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):cs(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ks=m("$ZodCheckNumberFormat",(e,t)=>{var u;pe.init(e,t),t.format=t.format||"float64";let n=(u=t.format)==null?void 0:u.includes("int"),o=n?"int":"number",[r,a]=ms[t.format];e._zod.onattach.push(p=>{let c=p._zod.bag;c.format=t.format,c.minimum=r,c.maximum=a,n&&(c.pattern=Us)}),e._zod.check=p=>{let c=p.value;if(n){if(!Number.isInteger(c)){p.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?p.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):p.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}c<r&&p.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>a&&p.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inst:e})}}),Qs=m("$ZodCheckBigIntFormat",(e,t)=>{pe.init(e,t);let[n,o]=hs[t.format];e._zod.onattach.push(r=>{let a=r._zod.bag;a.format=t.format,a.minimum=n,a.maximum=o}),e._zod.check=r=>{let a=r.value;a<n&&r.issues.push({origin:"bigint",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>o&&r.issues.push({origin:"bigint",input:a,code:"too_big",maximum:o,inst:e})}}),Xs=m("$ZodCheckMaxSize",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.size!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.maximum)!=null?u:Number.POSITIVE_INFINITY;t.maximum<a&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;a.size<=t.maximum||r.issues.push({origin:qr(a),code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Ys=m("$ZodCheckMinSize",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.size!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.minimum)!=null?u:Number.NEGATIVE_INFINITY;t.minimum>a&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;a.size>=t.minimum||r.issues.push({origin:qr(a),code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),eu=m("$ZodCheckSizeEquals",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.size!==void 0}),e._zod.onattach.push(r=>{let a=r._zod.bag;a.minimum=t.size,a.maximum=t.size,a.size=t.size}),e._zod.check=r=>{let a=r.value,u=a.size;if(u===t.size)return;let p=u>t.size;r.issues.push(v(l({origin:qr(a)},p?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size}),{inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort}))}}),tu=m("$ZodCheckMaxLength",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.maximum)!=null?u:Number.POSITIVE_INFINITY;t.maximum<a&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;if(a.length<=t.maximum)return;let p=Hr(a);r.issues.push({origin:p,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),ru=m("$ZodCheckMinLength",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.minimum)!=null?u:Number.NEGATIVE_INFINITY;t.minimum>a&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;if(a.length>=t.minimum)return;let p=Hr(a);r.issues.push({origin:p,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),nu=m("$ZodCheckLengthEquals",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{let a=r._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=r=>{let a=r.value,u=a.length;if(u===t.length)return;let p=Hr(a),c=u>t.length;r.issues.push(v(l({origin:p},c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length}),{inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort}))}}),Sr=m("$ZodCheckStringFormat",(e,t)=>{var r,a;var n,o;pe.init(e,t),e._zod.onattach.push(u=>{var c;let p=u._zod.bag;p.format=t.format,t.pattern&&((c=p.patterns)!=null||(p.patterns=new Set),p.patterns.add(t.pattern))}),t.pattern?(r=(n=e._zod).check)!=null||(n.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push(v(l({origin:"string",code:"invalid_format",format:t.format,input:u.value},t.pattern?{pattern:t.pattern.toString()}:{}),{inst:e,continue:!t.abort}))}):(a=(o=e._zod).check)!=null||(o.check=()=>{})}),ou=m("$ZodCheckRegex",(e,t)=>{Sr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),au=m("$ZodCheckLowerCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=qs),Sr.init(e,t)}),iu=m("$ZodCheckUpperCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Hs),Sr.init(e,t)}),su=m("$ZodCheckIncludes",(e,t)=>{pe.init(e,t);let n=tt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{var u;let a=r._zod.bag;(u=a.patterns)!=null||(a.patterns=new Set),a.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),uu=m("$ZodCheckStartsWith",(e,t)=>{var o;pe.init(e,t);let n=new RegExp(`^${tt(t.prefix)}.*`);(o=t.pattern)!=null||(t.pattern=n),e._zod.onattach.push(r=>{var u;let a=r._zod.bag;(u=a.patterns)!=null||(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),cu=m("$ZodCheckEndsWith",(e,t)=>{var o;pe.init(e,t);let n=new RegExp(`.*${tt(t.suffix)}$`);(o=t.pattern)!=null||(t.pattern=n),e._zod.onattach.push(r=>{var u;let a=r._zod.bag;(u=a.patterns)!=null||(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function nf(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues))}var pu=m("$ZodCheckProperty",(e,t)=>{pe.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>nf(r,n,t.property));nf(o,n,t.property)}}),lu=m("$ZodCheckMimeType",(e,t)=>{pe.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),du=m("$ZodCheckOverwrite",(e,t)=>{pe.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var en=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
4
4
  `).filter(u=>u),r=Math.min(...o.map(u=>u.length-u.trimStart().length)),a=o.map(u=>u.slice(r)).map(u=>" ".repeat(this.indent*2)+u);for(let u of a)this.content.push(u)}compile(){var a;let t=Function,n=this==null?void 0:this.args,r=[...((a=this==null?void 0:this.content)!=null?a:[""]).map(u=>` ${u}`)];return new t(...n,r.join(`
5
5
  `))}};var fu={major:4,minor:1,patch:1};var A=m("$ZodType",(e,t)=>{var r,a,u;var n;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fu;let o=[...(r=e._zod.def.checks)!=null?r:[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let p of o)for(let c of p._zod.onattach)c(e);if(o.length===0)(a=(n=e._zod).deferred)!=null||(n.deferred=[]),(u=e._zod.deferred)==null||u.push(()=>{e._zod.run=e._zod.parse});else{let p=(i,d,g)=>{let h=kt(i),x;for(let z of d){if(z._zod.def.when){if(!z._zod.def.when(i))continue}else if(h)continue;let H=i.issues.length,N=z._zod.check(i);if(N instanceof Promise&&(g==null?void 0:g.async)===!1)throw new Qe;if(x||N instanceof Promise)x=(x!=null?x:Promise.resolve()).then(()=>Y(null,null,function*(){yield N,i.issues.length!==H&&(h||(h=kt(i,H)))}));else{if(i.issues.length===H)continue;h||(h=kt(i,H))}}return x?x.then(()=>i):i},c=(i,d,g)=>{if(kt(i))return i.aborted=!0,i;let h=p(d,o,g);if(h instanceof Promise){if(g.async===!1)throw new Qe;return h.then(x=>e._zod.parse(x,g))}return e._zod.parse(h,g)};e._zod.run=(i,d)=>{if(d.skipChecks)return e._zod.parse(i,d);if(d.direction==="backward"){let h=e._zod.parse({value:i.value,issues:[]},v(l({},d),{skipChecks:!0}));return h instanceof Promise?h.then(x=>c(x,i,d)):c(h,i,d)}let g=e._zod.parse(i,d);if(g instanceof Promise){if(d.async===!1)throw new Qe;return g.then(h=>p(h,o,d))}return p(g,o,d)}}e["~standard"]={validate:p=>{var c;try{let i=bs(e,p);return i.success?{value:i.data}:{issues:(c=i.error)==null?void 0:c.issues}}catch(i){return xs(e,p).then(d=>{var g;return d.success?{value:d.data}:{issues:(g=d.error)==null?void 0:g.issues}})}},vendor:"zod",version:1}}),Ut=m("$ZodString",(e,t)=>{var n,o,r;A.init(e,t),e._zod.pattern=(r=[...(o=(n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)!=null?o:[]].pop())!=null?r:Gs(e._zod.bag),e._zod.parse=(a,u)=>{if(t.coerce)try{a.value=String(a.value)}catch(p){}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),se=m("$ZodStringFormat",(e,t)=>{Sr.init(e,t),Ut.init(e,t)}),hu=m("$ZodGUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ks),se.init(e,t)}),gu=m("$ZodUUID",(e,t)=>{var n,o;if(t.version){let a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);(n=t.pattern)!=null||(t.pattern=Wt(a))}else(o=t.pattern)!=null||(t.pattern=Wt());se.init(e,t)}),Tu=m("$ZodEmail",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ws),se.init(e,t)}),bu=m("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=n=>{try{let o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:js.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),xu=m("$ZodEmoji",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=$s()),se.init(e,t)}),yu=m("$ZodNanoID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Is),se.init(e,t)}),Su=m("$ZodCUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ys),se.init(e,t)}),vu=m("$ZodCUID2",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ss),se.init(e,t)}),_u=m("$ZodULID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=vs),se.init(e,t)}),Ou=m("$ZodXID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=_s),se.init(e,t)}),Iu=m("$ZodKSUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Os),se.init(e,t)}),Fu=m("$ZodISODateTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ps(t)),se.init(e,t)}),ku=m("$ZodISODate",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ds),se.init(e,t)}),wu=m("$ZodISOTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Cs(t)),se.init(e,t)}),$u=m("$ZodISODuration",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Fs),se.init(e,t)}),Eu=m("$ZodIPv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Es),se.init(e,t),e._zod.onattach.push(o=>{let r=o._zod.bag;r.format="ipv4"})}),Ru=m("$ZodIPv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Rs),se.init(e,t),e._zod.onattach.push(o=>{let r=o._zod.bag;r.format="ipv6"}),e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch(r){o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),zu=m("$ZodCIDRv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=zs),se.init(e,t)}),Nu=m("$ZodCIDRv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ns),se.init(e,t),e._zod.check=o=>{let[r,a]=o.value.split("/");try{if(!a)throw new Error;let u=Number(a);if(`${u}`!==a)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${r}]`)}catch(u){o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Mu(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch(t){return!1}}var ju=m("$ZodBase64",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ms),se.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{Mu(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Tf(e){if(!Oo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Mu(n)}var Au=m("$ZodBase64URL",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Oo),se.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{Tf(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Du=m("$ZodE164",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=As),se.init(e,t)});function bf(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch(n){return!1}}var Cu=m("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=n=>{bf(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Pu=m("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),zo=m("$ZodNumber",(e,t)=>{var n;A.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)!=null?n:Bs,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Number(o.value)}catch(p){}let a=o.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return o;let u=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return o.issues.push(l({expected:"number",code:"invalid_type",input:a,inst:e},u?{received:u}:{})),o}}),Gu=m("$ZodNumber",(e,t)=>{Ks.init(e,t),zo.init(e,t)}),tn=m("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=Zs,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch(a){}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),No=m("$ZodBigInt",(e,t)=>{A.init(e,t),e._zod.pattern=Ws,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(r){}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Wu=m("$ZodBigInt",(e,t)=>{Qs.init(e,t),No.init(e,t)}),Uu=m("$ZodSymbol",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Bu=m("$ZodUndefined",(e,t)=>{A.init(e,t),e._zod.pattern=Ls,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="undefined"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),Zu=m("$ZodNull",(e,t)=>{A.init(e,t),e._zod.pattern=Vs,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Vu=m("$ZodAny",(e,t)=>{A.init(e,t),e._zod.parse=n=>n}),Lu=m("$ZodUnknown",(e,t)=>{A.init(e,t),e._zod.parse=n=>n}),qu=m("$ZodNever",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Hu=m("$ZodVoid",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="undefined"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),Ju=m("$ZodDate",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(p){}let r=n.value,a=r instanceof Date;return a&&!Number.isNaN(r.getTime())||n.issues.push(v(l({expected:"date",code:"invalid_type",input:r},a?{received:"Invalid Date"}:{}),{inst:e})),n}});function sf(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues)),t.value[n]=e.value}var Ku=m("$ZodArray",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let a=[];for(let u=0;u<r.length;u++){let p=r[u],c=t.element._zod.run({value:p,issues:[]},o);c instanceof Promise?a.push(c.then(i=>sf(i,n,u))):sf(c,n,u)}return a.length?Promise.all(a).then(()=>n):n}});function Ro(e,t,n,o){e.issues.length&&t.issues.push(...Pe(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function xf(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape[o]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=fs(e.shape);return v(l({},e),{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)})}function yf(e,t,n,o,r,a){let u=[],p=r.keySet,c=r.catchall._zod,i=c.def.type;for(let d of Object.keys(t)){if(p.has(d))continue;if(i==="never"){u.push(d);continue}let g=c.run({value:t[d],issues:[]},o);g instanceof Promise?e.push(g.then(h=>Ro(h,n,d,t))):Ro(g,n,d,t)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Sf=m("$ZodObject",(e,t)=>{A.init(e,t);let n=hr(()=>xf(t));J(e._zod,"propValues",()=>{var c;let u=t.shape,p={};for(let i in u){let d=u[i]._zod;if(d.values){(c=p[i])!=null||(p[i]=new Set);for(let g of d.values)p[i].add(g)}}return p});let o=Gt,r=t.catchall,a;e._zod.parse=(u,p)=>{a!=null||(a=n.value);let c=u.value;if(!o(c))return u.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),u;u.value={};let i=[],d=a.shape;for(let g of a.keys){let x=d[g]._zod.run({value:c[g],issues:[]},p);x instanceof Promise?i.push(x.then(z=>Ro(z,u,g,c))):Ro(x,u,g,c)}return r?yf(i,c,u,p,n.value,e):i.length?Promise.all(i).then(()=>u):u}}),Qu=m("$ZodObjectJIT",(e,t)=>{Sf.init(e,t);let n=e._zod.parse,o=hr(()=>xf(t)),r=h=>{let x=new en(["shape","payload","ctx"]),z=o.value,H=y=>{let S=lo(y);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};x.write("const input = payload.value;");let N=Object.create(null),D=0;for(let y of z.keys)N[y]=`key_${D++}`;x.write("const newResult = {}");for(let y of z.keys){let S=N[y],F=lo(y);x.write(`const ${S} = ${H(y)};`),x.write(`
@@ -1,5 +1,5 @@
1
1
  "use strict";var WAPI=(()=>{var Pb=Object.create;var Dr=Object.defineProperty,Gb=Object.defineProperties,Wb=Object.getOwnPropertyDescriptor,Ub=Object.getOwnPropertyDescriptors,Bb=Object.getOwnPropertyNames,no=Object.getOwnPropertySymbols,Zb=Object.getPrototypeOf,Hi=Object.prototype.hasOwnProperty,Pd=Object.prototype.propertyIsEnumerable;var Gd=Math.pow,qi=(e,t,n)=>t in e?Dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t)=>{for(var n in t||(t={}))Hi.call(t,n)&&qi(e,n,t[n]);if(no)for(var n of no(t))Pd.call(t,n)&&qi(e,n,t[n]);return e},v=(e,t)=>Gb(e,Ub(t));var de=(e,t)=>{var n={};for(var o in e)Hi.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&no)for(var o of no(e))t.indexOf(o)<0&&Pd.call(e,o)&&(n[o]=e[o]);return n};var Vb=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xt=(e,t)=>{for(var n in t)Dr(e,n,{get:t[n],enumerable:!0})},Wd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bb(t))!Hi.call(e,r)&&r!==n&&Dr(e,r,{get:()=>t[r],enumerable:!(o=Wb(t,r))||o.enumerable});return e};var Lb=(e,t,n)=>(n=e!=null?Pb(Zb(e)):{},Wd(t||!e||!e.__esModule?Dr(n,"default",{value:e,enumerable:!0}):n,e)),qb=e=>Wd(Dr({},"__esModule",{value:!0}),e);var E=(e,t,n)=>qi(e,typeof t!="symbol"?t+"":t,n);var Y=(e,t,n)=>new Promise((o,r)=>{var a=c=>{try{p(n.next(c))}catch(i){r(i)}},u=c=>{try{p(n.throw(c))}catch(i){r(i)}},p=c=>c.done?o(c.value):Promise.resolve(c.value).then(a,u);p((n=n.apply(e,t)).next())});var UT=Vb((Dt,WT)=>{var Bi=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof global!="undefined"&&global,Zi=(function(){function e(){this.fetch=!1,this.DOMException=Bi.DOMException}return e.prototype=Bi,new e})();(function(e){var t=(function(n){var o=typeof e!="undefined"&&e||typeof self!="undefined"&&self||typeof global!="undefined"&&global||{},r={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&(function(){try{return new Blob,!0}catch(T){return!1}})(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function a(T){return T&&DataView.prototype.isPrototypeOf(T)}if(r.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(T){return T&&u.indexOf(Object.prototype.toString.call(T))>-1};function c(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(T)||T==="")throw new TypeError('Invalid character in header field name: "'+T+'"');return T.toLowerCase()}function i(T){return typeof T!="string"&&(T=String(T)),T}function d(T){var _={next:function(){var C=T.shift();return{done:C===void 0,value:C}}};return r.iterable&&(_[Symbol.iterator]=function(){return _}),_}function g(T){this.map={},T instanceof g?T.forEach(function(_,C){this.append(C,_)},this):Array.isArray(T)?T.forEach(function(_){if(_.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+_.length);this.append(_[0],_[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(_){this.append(_,T[_])},this)}g.prototype.append=function(T,_){T=c(T),_=i(_);var C=this.map[T];this.map[T]=C?C+", "+_:_},g.prototype.delete=function(T){delete this.map[c(T)]},g.prototype.get=function(T){return T=c(T),this.has(T)?this.map[T]:null},g.prototype.has=function(T){return this.map.hasOwnProperty(c(T))},g.prototype.set=function(T,_){this.map[c(T)]=i(_)},g.prototype.forEach=function(T,_){for(var C in this.map)this.map.hasOwnProperty(C)&&T.call(_,this.map[C],C,this)},g.prototype.keys=function(){var T=[];return this.forEach(function(_,C){T.push(C)}),d(T)},g.prototype.values=function(){var T=[];return this.forEach(function(_){T.push(_)}),d(T)},g.prototype.entries=function(){var T=[];return this.forEach(function(_,C){T.push([C,_])}),d(T)},r.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function h(T){if(!T._noBody){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}}function x(T){return new Promise(function(_,C){T.onload=function(){_(T.result)},T.onerror=function(){C(T.error)}})}function z(T){var _=new FileReader,C=x(_);return _.readAsArrayBuffer(T),C}function H(T){var _=new FileReader,C=x(_),te=/charset=([A-Za-z0-9_-]+)/.exec(T.type),ue=te?te[1]:"utf-8";return _.readAsText(T,ue),C}function N(T){for(var _=new Uint8Array(T),C=new Array(_.length),te=0;te<_.length;te++)C[te]=String.fromCharCode(_[te]);return C.join("")}function D(T){if(T.slice)return T.slice(0);var _=new Uint8Array(T.byteLength);return _.set(new Uint8Array(T)),_.buffer}function j(){return this.bodyUsed=!1,this._initBody=function(T){this.bodyUsed=this.bodyUsed,this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:r.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:r.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():r.arrayBuffer&&r.blob&&a(T)?(this._bodyArrayBuffer=D(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||p(T))?this._bodyArrayBuffer=D(T):this._bodyText=T=Object.prototype.toString.call(T):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var T=h(this);if(T)return T;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var T=h(this);return T||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(r.blob)return this.blob().then(z);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var T=h(this);if(T)return T;if(this._bodyBlob)return H(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(N(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(Q)}),this.json=function(){return this.text().then(JSON.parse)},this}var y=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function S(T){var _=T.toUpperCase();return y.indexOf(_)>-1?_:T}function F(T,_){if(!(this instanceof F))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');_=_||{};var C=_.body;if(T instanceof F){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,_.headers||(this.headers=new g(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!C&&T._bodyInit!=null&&(C=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=_.credentials||this.credentials||"same-origin",(_.headers||!this.headers)&&(this.headers=new g(_.headers)),this.method=S(_.method||this.method||"GET"),this.mode=_.mode||this.mode||null,this.signal=_.signal||this.signal||(function(){if("AbortController"in o){var q=new AbortController;return q.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&C)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(C),(this.method==="GET"||this.method==="HEAD")&&(_.cache==="no-store"||_.cache==="no-cache")){var te=/([?&])_=[^&]*/;if(te.test(this.url))this.url=this.url.replace(te,"$1_="+new Date().getTime());else{var ue=/\?/;this.url+=(ue.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})};function Q(T){var _=new FormData;return T.trim().split("&").forEach(function(C){if(C){var te=C.split("="),ue=te.shift().replace(/\+/g," "),q=te.join("=").replace(/\+/g," ");_.append(decodeURIComponent(ue),decodeURIComponent(q))}}),_}function U(T){var _=new g,C=T.replace(/\r?\n[\t ]+/g," ");return C.split("\r").map(function(te){return te.indexOf(`
2
- `)===0?te.substr(1,te.length):te}).forEach(function(te){var ue=te.split(":"),q=ue.shift().trim();if(q){var ur=ue.join(":").trim();try{_.append(q,ur)}catch(Li){console.warn("Response "+Li.message)}}}),_}j.call(F.prototype);function V(T,_){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=_.statusText===void 0?"":""+_.statusText,this.headers=new g(_.headers),this.url=_.url||"",this._initBody(T)}j.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},V.error=function(){var T=new V(null,{status:200,statusText:""});return T.ok=!1,T.status=0,T.type="error",T};var fe=[301,302,303,307,308];V.redirect=function(T,_){if(fe.indexOf(_)===-1)throw new RangeError("Invalid status code");return new V(null,{status:_,headers:{location:T}})},n.DOMException=o.DOMException;try{new n.DOMException}catch(T){n.DOMException=function(_,C){this.message=_,this.name=C;var te=Error(_);this.stack=te.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function Je(T,_){return new Promise(function(C,te){var ue=new F(T,_);if(ue.signal&&ue.signal.aborted)return te(new n.DOMException("Aborted","AbortError"));var q=new XMLHttpRequest;function ur(){q.abort()}q.onload=function(){var ye={statusText:q.statusText,headers:U(q.getAllResponseHeaders()||"")};ue.url.indexOf("file://")===0&&(q.status<200||q.status>599)?ye.status=200:ye.status=q.status,ye.url="responseURL"in q?q.responseURL:ye.headers.get("X-Request-URL");var Pt="response"in q?q.response:q.responseText;setTimeout(function(){C(new V(Pt,ye))},0)},q.onerror=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},q.ontimeout=function(){setTimeout(function(){te(new TypeError("Network request timed out"))},0)},q.onabort=function(){setTimeout(function(){te(new n.DOMException("Aborted","AbortError"))},0)};function Li(ye){try{return ye===""&&o.location.href?o.location.href:ye}catch(Pt){return ye}}if(q.open(ue.method,Li(ue.url),!0),ue.credentials==="include"?q.withCredentials=!0:ue.credentials==="omit"&&(q.withCredentials=!1),"responseType"in q&&(r.blob?q.responseType="blob":r.arrayBuffer&&(q.responseType="arraybuffer")),_&&typeof _.headers=="object"&&!(_.headers instanceof g||o.Headers&&_.headers instanceof o.Headers)){var Cd=[];Object.getOwnPropertyNames(_.headers).forEach(function(ye){Cd.push(c(ye)),q.setRequestHeader(ye,i(_.headers[ye]))}),ue.headers.forEach(function(ye,Pt){Cd.indexOf(Pt)===-1&&q.setRequestHeader(Pt,ye)})}else ue.headers.forEach(function(ye,Pt){q.setRequestHeader(Pt,ye)});ue.signal&&(ue.signal.addEventListener("abort",ur),q.onreadystatechange=function(){q.readyState===4&&ue.signal.removeEventListener("abort",ur)}),q.send(typeof ue._bodyInit=="undefined"?null:ue._bodyInit)})}return Je.polyfill=!0,o.fetch||(o.fetch=Je,o.Headers=g,o.Request=F,o.Response=V),n.Headers=g,n.Request=F,n.Response=V,n.fetch=Je,n})({})})(Zi);Zi.fetch.ponyfill=!0;delete Zi.fetch.polyfill;var Nr=Bi.fetch?Bi:Zi;Dt=Nr.fetch;Dt.default=Nr.fetch;Dt.fetch=Nr.fetch;Dt.Headers=Nr.Headers;Dt.Request=Nr.Request;Dt.Response=Nr.Response;WT.exports=Dt});var kF={};xt(kF,{AggregateQueryBuilder:()=>Mr,AuthError:()=>cr,AuthenticationError:()=>pr,AuthorizationError:()=>Ji,Client:()=>Ar,ConfigError:()=>Ce,ConstraintError:()=>ao,ERRORS:()=>Fe,ERROR_DESCRIPTIONS:()=>Xi,ERROR_GROUPS:()=>De,ERROR_MESSAGES:()=>Qi,ERROR_TYPES:()=>lr,ErrorDescription:()=>Xi,ErrorMessage:()=>Qi,ErrorType:()=>lr,Errors:()=>Fe,FindQueryBuilder:()=>le,InputError:()=>oe,InternalError:()=>io,JSONRPCError:()=>Pr,QueryBuilder:()=>He,ReverseQueryBuilder:()=>jr,StreamError:()=>yt,StreamPromise:()=>fr,TokenStatusEnum:()=>gh,TokenTypeEnum:()=>Th,TransferGroupStatusEnum:()=>Oa,TransferGroupTypeEnum:()=>xh,TransferStatusEnum:()=>mh,TransferTypeEnum:()=>Jt,UnknownError:()=>Ki,UpdateQueryBuilder:()=>Ct,ValidationError:()=>Se,Validator:()=>M,WAPIError:()=>Ke,WAPIErrorInfo:()=>FF,WalletStatusEnum:()=>dh,WalletTypeEnum:()=>fh,WapiApikeyStatusEnum:()=>fT,WapiApikeyTypeEnum:()=>dT,WapiClientType:()=>pt,WapiSettingTypeEnum:()=>Cb,create:()=>OF,getError:()=>so,getIdentifier:()=>ns,utils:()=>IF});var Ud=WebSocket;var oo="0.15.4";function Cr(e,t){let n=Hb(e);return n===void 0?t:typeof t=="number"?parseInt(n,10):n}function Hb(e){if(typeof window=="object")return window[e];if(typeof process!="undefined"&&process.versions&&process.versions.node)return process.env[e]}function P(...e){Cr("WAPI_DEBUG")&&console.log(...e.map(t=>t&&typeof t=="object"?JSON.stringify(t):t))}var De={JSONRPC:{min:-32700,max:-32600,ERRORS:{PARSE_ERROR:{code:-32700,message:"Parse error",description:"Unable to parse JSON input"},INVALID_REQUEST:{code:-32600,message:"Invalid request",description:"JSON input does not match JSONRPC spec"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found",description:"Requested method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params",description:"Invalid params provided for method"},INTERNAL_SERVER_ERROR:{code:-32603,message:"Internal server error",description:"Unknown error occurred"}}},AUTH:{min:-20999,max:-2e4,ERRORS:{AUTHENTICATION_ERROR:{code:-2e4,message:"Authentication error",description:"Invalid authentication credentials"},AUTHORIZATION_ERROR:{code:-20001,message:"AUTHORIZATION_ERROR",description:"Provided credentials lack access rights"}}},STREAM:{min:-10999,max:-1e4,ERRORS:{CONNECTION_LOST:{code:-1e4,message:"CONNECTION_LOST",description:"Lost connection to server"},INPUT_STREAM_INVALID:{code:-10001,message:"INPUT_STREAM_INVALID",description:"Invalid input stream identifier provided"},INVALID_RESPONSE_STREAM_CHUNK:{code:-10002,message:"INVALID_RESPONSE_STREAM_CHUNK",description:"Received multiple chunks for non-array property"},INVALID_INPUT_STREAM_CHUNK:{code:-10003,message:"INVALID_INPUT_STREAM_CHUNK",description:"Invalid chunk sent to input stream"},INPUT_STREAM_TIMEOUT:{code:-10004,message:"INPUT_STREAM_TIMEOUT",description:"Input stream failed to finish in allotted time"},INPUT_STREAM_ERROR:{code:-10005,message:"INPUT_STREAM_ERROR",description:"Unknown error in input stream"},INPUT_STREAM_NOT_ALLOWED:{code:-10006,message:"INPUT_STREAM_NOT_ALLOWED",description:"Stream input not allowed for method"},INVALID_STREAM_START_METHOD:{code:-10007,message:"INVALID_STREAM_START_METHOD",description:"Stream start message invalid, method missing"}}},INPUT:{min:-14999,max:-11e3,ERRORS:{HTTP_BODY_SIZE:{code:-11e3,message:"HTTP_BODY_SIZE",description:"Http body size can't be more than 100MB"},DATABASE_EXPORT_CONFLICT:{code:-12e3,message:"DATABASE_EXPORT_CONFLICT",description:"Database export already in progress"},DATABASE_IMPORT_CONFLICT:{code:-12001,message:"DATABASE_IMPORT_CONFLICT",description:"Database import already in progress"},DATABASE_EXPORT_PROGRESS_NOT_FOUND:{code:-12002,message:"DATABASE_EXPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_PROGRESS_NOT_FOUND:{code:-12003,message:"DATABASE_IMPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_NOT_FOUND:{code:-12004,message:"DATABASE_IMPORT_NOT_FOUND",description:"Database import file not found"},TR_CANT_UPDATE_TO_PENDING:{code:-12100,message:"TR_CANT_UPDATE_TO_PENDING",description:"Transfer status can only move from 'pending'->'finished'/'cancelled"},TR_CANT_UPDATE_TIMESTAMP:{code:-12101,message:"TR_CANT_UPDATE_TIMESTAMP",description:"Cant update transfer.updated_at - allow_timestamps flag is set to off"},TR_CANT_INSERT_TIMESTAMP:{code:-12102,message:"TR_CANT_INSERT_TIMESTAMP",description:"Cant insert transfer.created_at - allow_timestamps flag is set to off"},TR_EMPTY_UPDATE_REQUEST:{code:-12103,message:"TR_EMPTY_UPDATE_REQUEST",description:"Update request for transfer is empty"},TR_MISSING_FILTER:{code:-12104,message:"TR_MISSING_FILTER",description:"Transactions can't reversed or updated without valid filter"},TR_TO_WALLET_WITHDRAWAL:{code:-12105,message:"TR_TO_WALLET_WITHDRAWAL",description:"To wallet can't be specified when doing a withdrawal"},TR_FROM_WALLET_DEPOSIT:{code:-12106,message:"TR_FROM_WALLET_DEPOSIT",description:"From wallet can't be specified when doing a deposit"},TR_FROM_TO_CONFLICT:{code:-12107,message:"TR_FROM_TO_CONFLICT",description:"from_wallet and to_wallet can not be the same"},TR_UNABLE_TO_RESOLVE_INPUT:{code:-12108,message:"TR_UNABLE_TO_RESOLVE_INPUT",description:"Unable to resolve references to foreign keys"},TRG_MISSING_FILTER:{code:-12200,message:"TRG_MISSING_FILTER",description:"Transaction groups can't reversed or updated without valid filter"},INVALID_FIELD_AGR_COMB:{code:-12300,message:"INVALID_FIELD_AGR_COMB",description:"Provided aggregation field was not found on Model"},INVALID_FIELD_FOR_MODEL:{code:-12301,message:"INVALID_FIELD_FOR_MODEL",description:"Provided field was not found on Model"},NO_METADATA_ON_MODEL:{code:-12302,message:"NO_METADATA_ON_MODEL",description:"Can't use metadata field for grouping as current Model does not have metadata"},INVALID_MODEL:{code:-12303,message:"INVALID_MODEL",description:"Provided Model name is invalid"},INVALID_COMPLEX_FILTER:{code:-12304,message:"INVALID_COMPLEX_FILTER",description:"The provided complex filter does not pass validation"},UNCLEAR_AGGREGATOR:{code:-12305,message:"UNCLEAR_AGGREGATOR",description:"Invalid aggregator function provided"},CONTRACT_OWNER_NOT_FOUND:{code:-12306,message:"CONTRACT_OWNER_NOT_FOUND",description:"Unable to find Wallet specified as Contract token owner"},DISTRIBUTION_MISSING_TARGETS:{code:-12307,message:"DISTRIBUTION_MISSING_TARGETS",description:"Unable to resolve all targets (Wallets, Tokens) for distribution request"},TOKEN_INVALID_WALLET:{code:-12308,message:"TOKEN_INVALID_WALLET",description:"Invalid belongs_to wallet provided"},BAL_FUTURE_DATETIME:{code:-12309,message:"BAL_FUTURE_DATETIME",description:"Balance datetime can't be in the future"},INPUT_NEEDS_IDENTIFIER:{code:-12310,message:"INPUT_NEEDS_IDENTIFIER",description:"Missing identifier - automatically calculated identifiers conflict on identical input for 30s To make an identical transfer during that window you need to provide a unique identifier"},RESET_INVALID_CONFIRMATION:{code:-12311,message:"RESET_INVALID_CONFIRMATION",description:"Provided reset confirmation code is invalid"},INPUT_NEEDS_TOKEN:{code:-12312,message:"INPUT_NEEDS_TOKEN",description:"token must be specified on input or in client config"},CONFLICTING_OPTIONS_FOR_BALANCE:{code:-12313,message:"CONFLICTING_OPTIONS_FOR_BALANCE",description:"return_running_balance and return_running_balance_for can't be specified together"},CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT:{code:-12314,message:"CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT",description:"return_signed_amount and return_signed_amount_for_wallet can't be specified together"},RUNNING_BALANCE_WITHOUT_WALLET:{code:-12315,message:"RUNNING_BALANCE_WITHOUT_WALLET",description:"return_running_balance option requires Wallet filter to be specified"},SIGNED_AMOUNT_WITHOUT_WALLET:{code:-12316,message:"SIGNED_AMOUNT_WITHOUT_WALLET",description:"return_signed_amount option requires Wallet filter to be specified"},REQUIRED_INPUT_MISSING:{code:-12317,message:"REQUIRED_INPUT_MISSING",description:"input does not specify required keys"},EMPTY_UPDATE_REQUEST:{code:-12318,message:"EMPTY_UPDATE_REQUEST",description:"Need to modify at least one field"},ALL_INTERVALS_GROUP_BY:{code:-12319,message:"ALL_INTERVALS_GROUP_BY",description:"return_all_intervals requires at least one groupBy"},TOKEN_MISSING_FOR_BALANCE:{code:-12320,message:"TOKEN_MISSING_FOR_BALANCE",description:"Need to specify include_balance_for_token to access balance fields"},TRX_NOT_ALLOWED:{code:-12400,message:"TRX_NOT_ALLOWED",description:"This method can not run in a transaction"},TRANSACTION_NOT_FOUND:{code:-12401,message:"TRANSACTION_NOT_FOUND",description:"Transaction not found"},ONLY_SELECT_ALLOWED:{code:-12402,message:"ONLY_SELECT_ALLOWED",description:"Only select queries are allowed"},CNT_DEPOSIT_TOKEN_MISMATCH:{code:-12500,message:"CNT_DEPOSIT_TOKEN_MISMATCH",description:"Unable to find tokens specified in deposits"}}},CONSTRAINT:{min:-19999,max:-19e3,ERRORS:{INVALID_LATEST_HASH:{code:-19e3,message:"INVALID_LATEST_HASH",description:"Http body size can't be more than 100MB"},TOKEN_LIMIT_REACHED:{code:-19001,message:"TOKEN_LIMIT_REACHED",description:"Unable to issue more tokens as Token.limit has been reached"},TR_INVALID_BALANCE:{code:-19101,message:"TR_INVALID_BALANCE",description:"Transfer would result in invalid balance for a Wallet"},TR_AMOUNT_NOT_DIVISIBLE:{code:-19102,message:"TR_AMOUNT_NOT_DIVISIBLE",description:"Transfer amount is not divisible by specified Token.divisor"},TR_TOKEN_DISABLED:{code:-19103,message:"TR_TOKEN_DISABLED",description:"Token status is set to 'disabled' - no new transfers allowed"},TR_TOKEN_DWONLY:{code:-19104,message:"TR_TOKEN_DWONLY",description:"Token status is set to 'dw-only' - only deposits or withdrawals allowed"},TR_TRG_STATUS_MISMATCH:{code:-19105,message:"TR_TRG_STATUS_MISMATCH",description:"Transfers in transfer_group must match transfer_group.transfer_status"},TR_TRG_CLOSED:{code:-19106,message:"TR_TRG_CLOSED",description:"Cant add Transfer to group. TransferGroup is closed"},TR_TIMESTAMP_IN_PAST:{code:-19107,message:"TR_TIMESTAMP_IN_PAST",description:"Transfer.created_at must not be in the past"},TR_TIMESTAMP_MUST_BE_LATEST:{code:-19108,message:"TR_TIMESTAMP_MUST_BE_LATEST",description:"Transfer.created_at must be the latest"},TR_INVALID_CANCELLED:{code:-19109,message:"TR_INVALID_CANCELLED",description:"Cant create cancelled transfer"},TR_FROM_WALLET_STATUS_CONSTRAINT:{code:-19110,message:"TR_FROM_WALLET_STATUS_CONSTRAINT",description:"From wallet.status doesn't allow this type of transfers"},TR_TO_WALLET_STATUS_CONSTRAINT:{code:-19111,message:"TR_TO_WALLET_STATUS_CONSTRAINT",description:"To wallet.status doesn't allow this type of transfers"},TR_CANCELLED_CANT_RV:{code:-19112,message:"TR_CANCELLED_CANT_RV",description:"Cancelled Transfer can not be reversed"},TR_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19113,message:"TR_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"Deposits are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'deposit' requires reverse_deposit option to be true."},TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19114,message:"TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"Withdrawals are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'withdrawal' requires reverse_withdrawal option to be true."},TR_UNIQUE_IDENTIFIER:{code:-19115,message:"TR_UNIQUE_IDENTIFIER",description:"The identifier for Transfer object must be unique"},TR_DIFFERENT_WALLETS:{code:-19116,message:"TR_DIFFERENT_WALLETS",description:"To and from wallets have to be different"},TRG_SINGLE_PENDING_TR_CANT_RV:{code:-19200,message:"TRG_SINGLE_PENDING_TR_CANT_RV",description:"Transfer is part of TransferGroup and can not be reversed separately"},TRG_CANCELLED_CANT_RV:{code:-19201,message:"TRG_CANCELLED_CANT_RV",description:"Cancelled TransferGroup can not be reversed"},TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19202,message:"TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true"},TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19203,message:"TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true"},TRG_UNIQUE_IDENTIFIER:{code:-19204,message:"TRG_UNIQUE_IDENTIFIER",description:"The identifier for TransferGroup object must be unique"},TOKEN_UNIQUE_FOREIGN:{code:-19300,message:"TOKEN_UNIQUE_FOREIGN",description:"The foreign for Token object must be unique"},WALLET_UNIQUE_FOREIGN:{code:-19400,message:"WALLET_UNIQUE_FOREIGN",description:"The foreign for Wallet object must be unique"},UNIQUE_CONSTRAINT:{code:-19500,message:"UNIQUE_CONSTRAINT",description:"Insert violates unique constraint"},APIKEY_DELETED_CANT_UPDATE:{code:-19600,message:"APIKEY_DELETED_CANT_UPDATE",description:"Cant update deleted apikeys"},APIKEY_NOT_OWNED_CANT_UPDATE:{code:-19601,message:"APIKEY_NOT_OWNED_CANT_UPDATE",description:"Cant update apikeys you dont own"},APIKEY_LIMIT_REACHED:{code:-19610,message:"APIKEY_LIMIT_REACHED",description:"Cant create any more api keys, limit reached"}}},CONFIG:{min:-16e3,max:-15e3,ERRORS:{METHOD_DISABLED:{code:-15e3,message:"METHOD_DISABLED",description:"Method is disabled"},FLAG_PRODUCTION_ON:{code:-15001,message:"FLAG_PRODUCTION_ON",description:'Production flag is "on" - this method is disabled'},FLAG_PRODUCTION_LOCKED:{code:-15002,message:"FLAG_PRODUCTION_LOCKED",description:"Cant update production flag to false in this server"},TRANSACTION_TIMEOUT:{code:-15003,message:"TRANSACTION_TIMEOUT",description:"Database transaction timed out"},CONNECTION_TIMEOUT:{code:-15004,message:"CONNECTION_TIMEOUT",description:"Unable to get initial response in specified time"},SENDING_TIMEOUT:{code:-15005,message:"SENDING_TIMEOUT",description:"Unable to get ack from server in specified time"},CONFIG_INVALID:{code:-15100,message:"CONFIG_INVALID",description:"Provided configuration is invalid"}}}},Fe=l(l(l(l(l(l({},De.JSONRPC.ERRORS),De.AUTH.ERRORS),De.CONFIG.ERRORS),De.STREAM.ERRORS),De.INPUT.ERRORS),De.CONSTRAINT.ERRORS);function Jb(e){return Object.fromEntries(Object.keys(e).map(t=>[t,t]))}var lr=Jb(Fe),Ke=class extends Error{constructor({type:n,code:o,message:r,data:a}){var p;super(r);E(this,"type");E(this,"code");E(this,"data");let u=(p=Fe[n])!=null?p:Fe.INTERNAL_SERVER_ERROR;this.type=n!=null?n:lr.INTERNAL_SERVER_ERROR,this.code=o!=null?o:u.code,this.message=r!=null?r:u.message,this.data=l({description:u.description},a&&typeof a=="object"?a:{error:a})}toJSON(){return{code:this.code,message:this.message,data:this.data}}},Pr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},yt=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},oe=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Ce=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},cr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},ao=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Se=class extends Pr{constructor(t,n){super("INVALID_PARAMS",t,n)}},pr=class extends cr{constructor(t){super("AUTHENTICATION_ERROR",t)}},Ji=class extends cr{constructor(t){super("AUTHORIZATION_ERROR",t)}},io=class extends Ke{constructor(t){super({type:lr.INTERNAL_SERVER_ERROR,data:t})}toJSON(){return{code:this.code,message:this.message,data:{description:Fe.INTERNAL_SERVER_ERROR.description}}}},Ki=class extends io{constructor(t){super({data:{message:t}})}toJSON(){let t=super.toJSON();return t.data={description:t.data.description,message:this.data.message},{code:this.code,message:this.message,data:{message:this.data.message,description:Fe.INTERNAL_SERVER_ERROR.description}}}},Kb=Object.fromEntries(Object.keys(Fe).map(e=>[Fe[e].code,e]));function Qb(e){let t=Kb[e];if(!t){let o=Object.entries(De).find(([,r])=>e>=r.min&&e<=r.max);return{group:o==null?void 0:o[0],type:void 0}}let n=Object.keys(De).find(o=>t in De[o].ERRORS);return n?{group:n,type:t}:(console.error("ERRORS and ERROR_GROUPS are out of sync",t),{group:void 0,type:t})}function so({code:e,message:t,data:n}){let o=Qb(e),r=o.type,a=o.group;t=t&&t!==r||!r?t:Fe[r].description;let u;switch(a&&a!=="JSONRPC"&&r===void 0&&(P("Novel error from server",e,t,n),r=t,u=e,t=n&&typeof n=="object"&&"description"in n&&typeof n.description=="string"?n.description:t),a){case"JSONRPC":return new Pr(r,n,t);case"AUTH":return new cr(r,n,t,u);case"CONFIG":return new Ce(r,n,t,u);case"CONSTRAINT":return new ao(r,n,t,u);case"INPUT":return new oe(r,n,t,u);case"STREAM":return new yt(r,n,t,u);default:return new Ke({code:e,message:t,data:n,type:r!=null?r:lr.INTERNAL_SERVER_ERROR})}}var Qi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].message])),Xi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].description]));var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function Bd(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}var Yi,Xb=new Uint8Array(16);function es(){if(!Yi){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yi=crypto.getRandomValues.bind(crypto)}return Yi(Xb)}var Yb=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ts={randomUUID:Yb};function ex(e,t,n){var r,a,u;if(ts.randomUUID&&!t&&!e)return ts.randomUUID();e=e||{};let o=(u=(a=e.random)!=null?a:(r=e.rng)==null?void 0:r.call(e))!=null?u:es();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let p=0;p<16;++p)t[n+p]=o[p];return t}return Bd(o)}var Gr=ex;var rs={timeouts:{},values:{},set(e,t){this.timeouts[e]=setTimeout(()=>this.clear(e),3e4),this.values[e]=t},get(e){return this.values[e]},getKey(e){let t=JSON.parse(JSON.stringify(e)),n="";return Object.keys(t).sort().forEach(o=>{let r="";t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?r=this.getKey(t[o]):r=JSON.stringify(t[o]),n+=o+":"+r}),n},clear(e){this.timeouts[e]&&clearTimeout(this.timeouts[e]),delete this.timeouts[e],delete this.values[e]},clearAll(){Object.keys(this.timeouts).forEach(e=>{clearTimeout(this.timeouts[e])}),this.timeouts={},this.values={}}};function uo(e=8){return Gr().replace(/-/g,"").slice(-e)}function ke(e){if(!e)return Gr();let t=rs.getKey(e);if(rs.get(t))throw new oe("INPUT_NEEDS_IDENTIFIER",{object:e});let n=Gr();return rs.set(t,n),n}function Vd(e){return new Promise(t=>setTimeout(t,e))}function ns(){return ke()}function tx(e){return JSON.parse(JSON.stringify(e))}function St(e,t,n){if(t in e){if(e[t]===void 0)throw new Se({input:e},`undefined provided for ${t}`);return e}if(!n)throw new Se({input:e},`${t} is required if no default set`);let o=tx(e);return o[t]=n,o}function rx(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Zd(e){return e.host.replace(/^https:/,"wss:")+"?"+rx({apikey:e.apikey,apisecret:e.apisecret,db:e.database,clientVersion:e.clientVersion,connectionName:e.connectionName})}function Ld(e){return typeof window=="undefined"?[Zd(e),{rejectUnauthorized:e.rejectUnauthorized}]:[Zd(e)]}function co(e,t){let n={},o=!e||typeof e!="object"?{}:e;return Object.keys(o).forEach(r=>{t[r]?typeof t[r]=="string"?n[t[r]]=o[r]:n[r]=t[r](o[r]):n[r]=o[r]}),n}function nx(e){return e.split(",").map(t=>t.split(" ")).map(t=>{let[n,o,r,a]=t;return l({field:n,direction:o==="desc"?"desc":"asc"},r==="nulls"&&["first","last"].includes(a)?{nulls:a}:{})})}function ae(e,t){var a;let r=e!=null?e:{},{options:n}=r;return{filter:de(r,["options"]),options:(a=t!=null?t:n)!=null?a:{}}}function et(e){let o=e,{order_by:t}=o,n=de(o,["order_by"]);return!n.order&&t&&(n.order=nx(t)),n}function qd(e){if(e!=null)return e+""}function dr(e){return typeof e=="number"?e:parseFloat(e)}function Hd(e){return new Date(e).setHours(0,0,0,0)>new Date().setHours(0,0,0,0)}var we={version:"2.0",acknowledgement:"ack",ping:"ping",pong:"pong",streamChunk:"streamChunk",streamPause:"streamPause",streamResume:"streamResume"};var Wr=class{constructor(t){E(this,"_data",[]);E(this,"_error",[]);E(this,"_end",[]);E(this,"_finished",!1);E(this,"_options");this._options=t}on(t,n){switch(t){case"data":return this._data.push(n),this;case"end":return this._end.push(n),this;case"error":return this._error.push(n),this}}push(t){if(this._finished)throw new Error("Stream is closed");return t===null?this.end():(this._data.forEach(n=>n(t)),this)}error(t){if(this._finished)throw new Error("Stream is closed");return this._error.forEach(n=>n(t)),this}end(){if(this._finished)throw new Error("Stream is closed");return this._end.forEach(t=>t()),this._finished=!0,this}destroy(t){return this.error(t),this.end(),this}get destroyed(){return this._finished}};var fr=class{constructor(t){E(this,"resolve");E(this,"reject");E(this,"makeRequest");E(this,"streamObject",new Wr({objectMode:!0}));E(this,"outStreamObject",new Wr({objectMode:!0}));E(this,"mode");E(this,"started",!1);E(this,"promise");this.makeRequest=t}start(t){var u;if(P("start request as",t),this.mode&&this.mode!==t)throw new Error("Already in use as "+this.mode);if(this.started)return;let{promise:n,resolve:o,reject:r}=Promise.withResolvers();if(this.promise=n,this.resolve=o,this.reject=r,this.started=!0,this.mode=t,this.makeRequest===void 0){this.streamObject.push(null),(u=this.resolve)==null||u.call(this,void 0);return}this.makeRequest(this.streamObject).catch(this.reject);let a=[];if(this.mode==="stream"){this.streamObject.on("data",p=>{if(P("stream data",p),p||this.outStreamObject.push(p),p.error){let c=so(p.error);return this.outStreamObject.destroy(c),this.streamObject.destroy(c)}if(!p.prop){a.push(p);return}if(p.dataArr){let c=l({},p);delete c.dataArr,p.dataArr.forEach(i=>{this.outStreamObject.push(v(l({},c),{data:i}))});return}this.outStreamObject.push(p)}).on("end",()=>{P("stream ended");let p=a.pop();if(!p)return;let c=p.result;Object.keys(c).forEach(i=>{Array.isArray(c[i])&&(c[i].forEach(d=>{this.outStreamObject.push({type:we.streamChunk,prop:i,data:d})}),c[i]=[])}),this.outStreamObject.push(p),this.outStreamObject.push(null)}).on("error",p=>{P("stream error",p),this.outStreamObject.destroy(p)});return}if(this.mode==="promise"){let p=new Map;this.streamObject.on("data",c=>{var d;if(P("streamPromise data",c),c===void 0)return;if(c.error){let g=so(c.error);return this.streamObject.destroy(g)}if(!c.prop){a.push(c);return}let i=(d=p.get(c.prop))!=null?d:[];c.dataArr?i.push(...c.dataArr):i.push(c.data),p.set(c.prop,i)}).on("end",()=>{P("streamPromise end");let c=a.pop();if(!c)return;let i=c.result;if(!p.size)return this.resolve(i);let d=!1;p.forEach((g,h)=>{Array.isArray(i[h])?(g.push(...i[h]),i[h]=g):g.length===1?i[h]=g:(this.streamObject.destroy(new yt("INVALID_RESPONSE_STREAM_CHUNK",{property:h,value:g})),d=!0)}),d||this.resolve(i)}).on("error",c=>{var i;return P("streamPromise error",c),(i=this.reject)==null?void 0:i.call(this,c)})}}then(t,n){return this.start("promise"),this.promise.then(t,n)}catch(t){return this.start("promise"),this.promise.catch(t)}get[Symbol.toStringTag](){return"StreamPromise"}finally(t){return this.start("promise"),this.promise.finally(t)}stream(){return this.start("stream"),this.outStreamObject}};var po={};var ox=(e,t)=>{if(e)return new Se({message:e.message,data:e.format()})},os=(e,t,n=ox)=>{let{success:o,error:r,data:a}=e.safeParse(t);return{data:a,success:o,isValid:o,error:n(r,t)}},Jd=(e,t,n,o)=>!t||typeof t!="object"?{success:!1,isValid:!1,error:new Se({message:`Invalid input - expected object, got ${typeof t}`,data:{input:t}})}:os(e,l({options:n!=null?n:{}},t),o),lt=(e,t,n,o)=>{var u;let{data:r,error:a}=os(e,t,o);if(a)throw((u=n==null?void 0:n.warn)!=null?u:P)(l({err:a},po),"Invalid input"),a;return r},ax=(e,t,n,o,r)=>{!o&&n&&typeof(n==null?void 0:n.warn)=="function"&&(o=n,n={});let{data:a,error:u}=Jd(e,t,n,r);if(u)throw o?o.warn(l({err:u},po),"Invalid input"):P(l({err:u},po),"Invalid input"),u;return a},f=(e,t)=>({validateInput:(n,o)=>lt(e,n,o,t),validateInputWOptions:(n,o,r)=>ax(e,n,o,r,t),softValidateInput:n=>os(e,n,t),softValidateWOptions:(n,o)=>Jd(e,n,o,t)});var s={};xt(s,{$brand:()=>is,$input:()=>_c,$output:()=>vc,NEVER:()=>as,TimePrecision:()=>Fc,ZodAny:()=>ym,ZodArray:()=>Om,ZodBase64:()=>Zp,ZodBase64URL:()=>Vp,ZodBigInt:()=>In,ZodBigIntFormat:()=>Hp,ZodBoolean:()=>On,ZodCIDRv4:()=>Up,ZodCIDRv6:()=>Bp,ZodCUID:()=>jp,ZodCUID2:()=>Ap,ZodCatch:()=>Bm,ZodCodec:()=>ol,ZodCustom:()=>ga,ZodCustomStringFormat:()=>vn,ZodDate:()=>fa,ZodDefault:()=>Dm,ZodDiscriminatedUnion:()=>Im,ZodE164:()=>Lp,ZodEmail:()=>zp,ZodEmoji:()=>Np,ZodEnum:()=>yn,ZodError:()=>$S,ZodFile:()=>Mm,ZodFirstPartyTypeKind:()=>al,ZodFunction:()=>Xm,ZodGUID:()=>ua,ZodIPv4:()=>Gp,ZodIPv6:()=>Wp,ZodISODate:()=>aa,ZodISODateTime:()=>oa,ZodISODuration:()=>sa,ZodISOTime:()=>ia,ZodIntersection:()=>Fm,ZodIssueCode:()=>Gv,ZodJWT:()=>qp,ZodKSUID:()=>Pp,ZodLazy:()=>Jm,ZodLiteral:()=>Nm,ZodMap:()=>Rm,ZodNaN:()=>Vm,ZodNanoID:()=>Mp,ZodNever:()=>vm,ZodNonOptional:()=>rl,ZodNull:()=>bm,ZodNullable:()=>Am,ZodNumber:()=>_n,ZodNumberFormat:()=>wr,ZodObject:()=>ha,ZodOptional:()=>tl,ZodPipe:()=>nl,ZodPrefault:()=>Pm,ZodPromise:()=>Qm,ZodReadonly:()=>Lm,ZodRealError:()=>Ne,ZodRecord:()=>Xp,ZodSet:()=>zm,ZodString:()=>Sn,ZodStringFormat:()=>ce,ZodSuccess:()=>Um,ZodSymbol:()=>gm,ZodTemplateLiteral:()=>Hm,ZodTransform:()=>jm,ZodTuple:()=>wm,ZodType:()=>B,ZodULID:()=>Dp,ZodURL:()=>da,ZodUUID:()=>ht,ZodUndefined:()=>Tm,ZodUnion:()=>Kp,ZodUnknown:()=>Sm,ZodVoid:()=>_m,ZodXID:()=>Cp,_ZodString:()=>Rp,_default:()=>Cm,_function:()=>Nv,any:()=>fv,array:()=>ma,base64:()=>KS,base64url:()=>QS,bigint:()=>uv,boolean:()=>hm,catch:()=>Zm,check:()=>Mv,cidrv4:()=>HS,cidrv6:()=>JS,clone:()=>$e,codec:()=>Ev,coerce:()=>Ta,config:()=>Te,core:()=>nt,cuid:()=>WS,cuid2:()=>US,custom:()=>jv,date:()=>hv,decode:()=>vp,decodeAsync:()=>Op,discriminatedUnion:()=>yv,e164:()=>XS,email:()=>RS,emoji:()=>PS,encode:()=>Sp,encodeAsync:()=>_p,endsWith:()=>dn,enum:()=>Yp,file:()=>Fv,flattenError:()=>Kr,float32:()=>ov,float64:()=>av,formatError:()=>Qr,function:()=>Nv,getErrorMap:()=>Uv,globalRegistry:()=>rt,gt:()=>ft,gte:()=>ze,guid:()=>zS,hash:()=>nv,hex:()=>rv,hostname:()=>tv,httpUrl:()=>CS,includes:()=>pn,instanceof:()=>Av,int:()=>Ep,int32:()=>iv,int64:()=>cv,intersection:()=>km,ipv4:()=>LS,ipv6:()=>qS,iso:()=>xn,json:()=>Cv,jwt:()=>YS,keyof:()=>gv,ksuid:()=>VS,lazy:()=>Km,length:()=>Ir,literal:()=>Iv,locales:()=>Bt,looseObject:()=>xv,lowercase:()=>un,lt:()=>dt,lte:()=>Ze,map:()=>vv,maxLength:()=>Or,maxSize:()=>_r,mime:()=>fn,minLength:()=>wt,minSize:()=>Vt,multipleOf:()=>Zt,nan:()=>$v,nanoid:()=>GS,nativeEnum:()=>Ov,negative:()=>tp,never:()=>Jp,nonnegative:()=>np,nonoptional:()=>Wm,nonpositive:()=>rp,normalize:()=>mn,null:()=>xm,nullable:()=>pa,nullish:()=>kv,number:()=>mm,object:()=>Tv,optional:()=>ca,overwrite:()=>mt,parse:()=>Tp,parseAsync:()=>bp,partialRecord:()=>Sv,pipe:()=>la,positive:()=>ep,prefault:()=>Gm,preprocess:()=>Pv,prettifyError:()=>Ts,promise:()=>zv,property:()=>op,readonly:()=>qm,record:()=>Em,refine:()=>Ym,regex:()=>sn,regexes:()=>We,registry:()=>Do,safeDecode:()=>Fp,safeDecodeAsync:()=>wp,safeEncode:()=>Ip,safeEncodeAsync:()=>kp,safeParse:()=>xp,safeParseAsync:()=>yp,set:()=>_v,setErrorMap:()=>Wv,size:()=>an,startsWith:()=>ln,strictObject:()=>bv,string:()=>$p,stringFormat:()=>ev,stringbool:()=>Dv,success:()=>wv,superRefine:()=>eh,symbol:()=>lv,templateLiteral:()=>Rv,toJSONSchema:()=>lp,toLowerCase:()=>gn,toUpperCase:()=>Tn,transform:()=>el,treeifyError:()=>gs,trim:()=>hn,tuple:()=>$m,uint32:()=>sv,uint64:()=>pv,ulid:()=>BS,undefined:()=>dv,union:()=>Qp,unknown:()=>kr,uppercase:()=>cn,url:()=>DS,uuid:()=>NS,uuidv4:()=>MS,uuidv6:()=>jS,uuidv7:()=>AS,void:()=>mv,xid:()=>ZS});var nt={};xt(nt,{$ZodAny:()=>Vu,$ZodArray:()=>Ku,$ZodAsyncError:()=>Qe,$ZodBase64:()=>ju,$ZodBase64URL:()=>Au,$ZodBigInt:()=>No,$ZodBigIntFormat:()=>Wu,$ZodBoolean:()=>tn,$ZodCIDRv4:()=>zu,$ZodCIDRv6:()=>Nu,$ZodCUID:()=>Su,$ZodCUID2:()=>vu,$ZodCatch:()=>fc,$ZodCheck:()=>pe,$ZodCheckBigIntFormat:()=>Qs,$ZodCheckEndsWith:()=>cu,$ZodCheckGreaterThan:()=>Fo,$ZodCheckIncludes:()=>su,$ZodCheckLengthEquals:()=>nu,$ZodCheckLessThan:()=>Io,$ZodCheckLowerCase:()=>au,$ZodCheckMaxLength:()=>tu,$ZodCheckMaxSize:()=>Xs,$ZodCheckMimeType:()=>lu,$ZodCheckMinLength:()=>ru,$ZodCheckMinSize:()=>Ys,$ZodCheckMultipleOf:()=>Js,$ZodCheckNumberFormat:()=>Ks,$ZodCheckOverwrite:()=>du,$ZodCheckProperty:()=>pu,$ZodCheckRegex:()=>ou,$ZodCheckSizeEquals:()=>eu,$ZodCheckStartsWith:()=>uu,$ZodCheckStringFormat:()=>Sr,$ZodCheckUpperCase:()=>iu,$ZodCodec:()=>rn,$ZodCustom:()=>Sc,$ZodCustomStringFormat:()=>Pu,$ZodDate:()=>Ju,$ZodDefault:()=>cc,$ZodDiscriminatedUnion:()=>Xu,$ZodE164:()=>Du,$ZodEmail:()=>Tu,$ZodEmoji:()=>xu,$ZodEncodeError:()=>vt,$ZodEnum:()=>nc,$ZodError:()=>Jr,$ZodFile:()=>ac,$ZodFunction:()=>bc,$ZodGUID:()=>hu,$ZodIPv4:()=>Eu,$ZodIPv6:()=>Ru,$ZodISODate:()=>ku,$ZodISODateTime:()=>Fu,$ZodISODuration:()=>$u,$ZodISOTime:()=>wu,$ZodIntersection:()=>Yu,$ZodJWT:()=>Cu,$ZodKSUID:()=>Iu,$ZodLazy:()=>yc,$ZodLiteral:()=>oc,$ZodMap:()=>tc,$ZodNaN:()=>mc,$ZodNanoID:()=>yu,$ZodNever:()=>qu,$ZodNonOptional:()=>lc,$ZodNull:()=>Zu,$ZodNullable:()=>uc,$ZodNumber:()=>zo,$ZodNumberFormat:()=>Gu,$ZodObject:()=>Sf,$ZodObjectJIT:()=>Qu,$ZodOptional:()=>sc,$ZodPipe:()=>hc,$ZodPrefault:()=>pc,$ZodPromise:()=>xc,$ZodReadonly:()=>gc,$ZodRealError:()=>Re,$ZodRecord:()=>ec,$ZodRegistry:()=>vr,$ZodSet:()=>rc,$ZodString:()=>Ut,$ZodStringFormat:()=>se,$ZodSuccess:()=>dc,$ZodSymbol:()=>Uu,$ZodTemplateLiteral:()=>Tc,$ZodTransform:()=>ic,$ZodTuple:()=>jo,$ZodType:()=>A,$ZodULID:()=>_u,$ZodURL:()=>bu,$ZodUUID:()=>gu,$ZodUndefined:()=>Bu,$ZodUnion:()=>Mo,$ZodUnknown:()=>Lu,$ZodVoid:()=>Hu,$ZodXID:()=>Ou,$brand:()=>is,$constructor:()=>m,$input:()=>_c,$output:()=>vc,Doc:()=>en,JSONSchema:()=>dp,JSONSchemaGenerator:()=>bn,NEVER:()=>as,TimePrecision:()=>Fc,_any:()=>qc,_array:()=>ap,_base64:()=>ea,_base64url:()=>ta,_bigint:()=>Gc,_boolean:()=>Cc,_catch:()=>vS,_check:()=>lm,_cidrv4:()=>Xo,_cidrv6:()=>Yo,_coercedBigint:()=>Wc,_coercedBoolean:()=>Pc,_coercedDate:()=>Xc,_coercedNumber:()=>zc,_coercedString:()=>Ic,_cuid:()=>Vo,_cuid2:()=>Lo,_custom:()=>sp,_date:()=>Qc,_decode:()=>To,_decodeAsync:()=>xo,_default:()=>xS,_discriminatedUnion:()=>sS,_e164:()=>ra,_email:()=>Co,_emoji:()=>Bo,_encode:()=>go,_encodeAsync:()=>bo,_endsWith:()=>dn,_enum:()=>fS,_file:()=>ip,_float32:()=>Mc,_float64:()=>jc,_gt:()=>ft,_gte:()=>ze,_guid:()=>nn,_includes:()=>pn,_int:()=>Nc,_int32:()=>Ac,_int64:()=>Uc,_intersection:()=>uS,_ipv4:()=>Ko,_ipv6:()=>Qo,_isoDate:()=>wc,_isoDateTime:()=>kc,_isoDuration:()=>Ec,_isoTime:()=>$c,_jwt:()=>na,_ksuid:()=>Jo,_lazy:()=>FS,_length:()=>Ir,_literal:()=>hS,_lowercase:()=>un,_lt:()=>dt,_lte:()=>Ze,_map:()=>lS,_max:()=>Ze,_maxLength:()=>Or,_maxSize:()=>_r,_mime:()=>fn,_min:()=>ze,_minLength:()=>wt,_minSize:()=>Vt,_multipleOf:()=>Zt,_nan:()=>Yc,_nanoid:()=>Zo,_nativeEnum:()=>mS,_negative:()=>tp,_never:()=>Jc,_nonnegative:()=>np,_nonoptional:()=>yS,_nonpositive:()=>rp,_normalize:()=>mn,_null:()=>Lc,_nullable:()=>bS,_number:()=>Rc,_optional:()=>TS,_overwrite:()=>mt,_parse:()=>Tr,_parseAsync:()=>br,_pipe:()=>_S,_positive:()=>ep,_promise:()=>kS,_property:()=>op,_readonly:()=>OS,_record:()=>pS,_refine:()=>up,_regex:()=>sn,_safeDecode:()=>So,_safeDecodeAsync:()=>_o,_safeEncode:()=>yo,_safeEncodeAsync:()=>vo,_safeParse:()=>xr,_safeParseAsync:()=>yr,_set:()=>dS,_size:()=>an,_startsWith:()=>ln,_string:()=>Oc,_stringFormat:()=>Fr,_stringbool:()=>pp,_success:()=>SS,_superRefine:()=>cp,_symbol:()=>Zc,_templateLiteral:()=>IS,_toLowerCase:()=>gn,_toUpperCase:()=>Tn,_transform:()=>gS,_trim:()=>hn,_tuple:()=>cS,_uint32:()=>Dc,_uint64:()=>Bc,_ulid:()=>qo,_undefined:()=>Vc,_union:()=>iS,_unknown:()=>Hc,_uppercase:()=>cn,_url:()=>on,_uuid:()=>Po,_uuidv4:()=>Go,_uuidv6:()=>Wo,_uuidv7:()=>Uo,_void:()=>Kc,_xid:()=>Ho,clone:()=>$e,config:()=>Te,decode:()=>Nx,decodeAsync:()=>jx,encode:()=>zx,encodeAsync:()=>Mx,flattenError:()=>Kr,formatError:()=>Qr,globalConfig:()=>Ur,globalRegistry:()=>rt,isValidBase64:()=>Mu,isValidBase64URL:()=>Tf,isValidJWT:()=>bf,locales:()=>Bt,parse:()=>mo,parseAsync:()=>ho,prettifyError:()=>Ts,regexes:()=>We,registry:()=>Do,safeDecode:()=>Dx,safeDecodeAsync:()=>Px,safeEncode:()=>Ax,safeEncodeAsync:()=>Cx,safeParse:()=>bs,safeParseAsync:()=>xs,toDotPath:()=>ef,toJSONSchema:()=>lp,treeifyError:()=>gs,util:()=>I,version:()=>fu});var as=Object.freeze({status:"aborted"});function m(e,t,n){var p;function o(c,i){var g,h;var d;Object.defineProperty(c,"_zod",{value:(g=c._zod)!=null?g:{},enumerable:!1}),(h=(d=c._zod).traits)!=null||(d.traits=new Set),c._zod.traits.add(e),t(c,i);for(let x in u.prototype)x in c||Object.defineProperty(c,x,{value:u.prototype[x].bind(c)});c._zod.constr=u,c._zod.def=i}let r=(p=n==null?void 0:n.Parent)!=null?p:Object;class a extends r{}Object.defineProperty(a,"name",{value:e});function u(c){var g;var i;let d=n!=null&&n.Parent?new a:this;o(d,c),(g=(i=d._zod).deferred)!=null||(i.deferred=[]);for(let h of d._zod.deferred)h();return d}return Object.defineProperty(u,"init",{value:o}),Object.defineProperty(u,Symbol.hasInstance,{value:c=>{var i,d;return n!=null&&n.Parent&&c instanceof n.Parent?!0:(d=(i=c==null?void 0:c._zod)==null?void 0:i.traits)==null?void 0:d.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}var is=Symbol("zod_brand"),Qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ur={};function Te(e){return e&&Object.assign(Ur,e),Ur}var I={};xt(I,{BIGINT_FORMAT_RANGES:()=>hs,Class:()=>us,NUMBER_FORMAT_RANGES:()=>ms,aborted:()=>kt,allowsEval:()=>ps,assert:()=>px,assertEqual:()=>ix,assertIs:()=>ux,assertNever:()=>cx,assertNotEqual:()=>sx,assignProp:()=>Ot,base64ToUint8Array:()=>Qd,base64urlToUint8Array:()=>kx,cached:()=>hr,captureStackTrace:()=>fo,cleanEnum:()=>Fx,cleanRegex:()=>Vr,clone:()=>$e,cloneDef:()=>dx,createTransparentProxy:()=>bx,defineLazy:()=>J,esc:()=>lo,escapeRegex:()=>tt,extend:()=>Sx,finalizeIssue:()=>Ge,floatSafeRemainder:()=>cs,getElementAtPath:()=>fx,getEnumValues:()=>Zr,getLengthableOrigin:()=>Hr,getParsedType:()=>Tx,getSizableOrigin:()=>qr,hexToUint8Array:()=>$x,isObject:()=>Gt,isPlainObject:()=>Ft,issue:()=>gr,joinValues:()=>b,jsonStringifyReplacer:()=>mr,merge:()=>_x,mergeDefs:()=>It,normalizeParams:()=>k,nullish:()=>_t,numKeys:()=>gx,objectClone:()=>lx,omit:()=>yx,optionalKeys:()=>fs,partial:()=>Ox,pick:()=>xx,prefixIssues:()=>Pe,primitiveTypes:()=>ds,promiseAllObject:()=>mx,propertyKeyTypes:()=>Lr,randomString:()=>hx,required:()=>Ix,safeExtend:()=>vx,shallowClone:()=>ls,stringifyPrimitive:()=>$,uint8ArrayToBase64:()=>Xd,uint8ArrayToBase64url:()=>wx,uint8ArrayToHex:()=>Ex,unwrapMessage:()=>Br});function ix(e){return e}function sx(e){return e}function ux(e){}function cx(e){throw new Error}function px(e){}function Zr(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function b(e,t="|"){return e.map(n=>$(n)).join(t)}function mr(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function _t(e){return e==null}function Vr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function cs(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c!=null&&c[1]&&(r=Number.parseInt(c[1]))}let a=n>r?n:r,u=Number.parseInt(e.toFixed(a).replace(".","")),p=Number.parseInt(t.toFixed(a).replace(".",""));return u%p/Gd(10,a)}var Kd=Symbol("evaluating");function J(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==Kd)return o===void 0&&(o=Kd,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lx(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function It(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function dx(e){return It(e._zod.def)}function fx(e,t){return t?t.reduce((n,o)=>n==null?void 0:n[o],e):e}function mx(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let a=0;a<t.length;a++)r[t[a]]=o[a];return r})}function hx(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function lo(e){return JSON.stringify(e)}var fo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ps=hr(()=>{var e;if(typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{let t=Function;return new t(""),!0}catch(t){return!1}});function Ft(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Gt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ls(e){return Ft(e)?l({},e):e}function gx(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Tx=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map!="undefined"&&e instanceof Map?"map":typeof Set!="undefined"&&e instanceof Set?"set":typeof Date!="undefined"&&e instanceof Date?"date":typeof File!="undefined"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Lr=new Set(["string","number","symbol"]),ds=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(e,t,n){let o=new e._zod.constr(t!=null?t:e._zod.def);return(!t||n!=null&&n.parent)&&(o._zod.parent=e),o}function k(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?v(l({},t),{error:()=>t.error}):t}function bx(e){let t;return new Proxy({},{get(n,o,r){return t!=null||(t=e()),Reflect.get(t,o,r)},set(n,o,r,a){return t!=null||(t=e()),Reflect.set(t,o,r,a)},has(n,o){return t!=null||(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t!=null||(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t!=null||(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t!=null||(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t!=null||(t=e()),Reflect.defineProperty(t,o,r)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ms={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r={};for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=n.shape[a])}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function yx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r=l({},e._zod.def.shape);for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function Sx(e,t){if(!Ft(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=It(e._zod.def,{get shape(){let a=l(l({},e._zod.def.shape),t);return Ot(this,"shape",a),a},checks:[]});return $e(e,r)}function vx(e,t){if(!Ft(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=v(l({},e._zod.def),{get shape(){let o=l(l({},e._zod.def.shape),t);return Ot(this,"shape",o),o},checks:e._zod.def.checks});return $e(e,n)}function _x(e,t){let n=It(e._zod.def,{get shape(){let o=l(l({},e._zod.def.shape),t._zod.def.shape);return Ot(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return $e(e,n)}function Ox(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in r))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:r[u]}):r[u])}else for(let u in r)a[u]=e?new e({type:"optional",innerType:r[u]}):r[u];return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function Ix(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=new e({type:"nonoptional",innerType:r[u]}))}else for(let u in r)a[u]=new e({type:"nonoptional",innerType:r[u]});return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function kt(e,t=0){var n;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((n=e.issues[o])==null?void 0:n.continue)!==!0)return!0;return!1}function Pe(e,t){return t.map(n=>{var r;var o;return(r=(o=n).path)!=null||(o.path=[]),n.path.unshift(e),n})}function Br(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ge(e,t,n){var r,a,u,p,c,i,d,g,h,x,z;let o=v(l({},e),{path:(r=e.path)!=null?r:[]});if(!e.message){let H=(z=(x=(g=(i=Br((p=(u=(a=e.inst)==null?void 0:a._zod.def)==null?void 0:u.error)==null?void 0:p.call(u,e)))!=null?i:Br((c=t==null?void 0:t.error)==null?void 0:c.call(t,e)))!=null?g:Br((d=n.customError)==null?void 0:d.call(n,e)))!=null?x:Br((h=n.localeError)==null?void 0:h.call(n,e)))!=null?z:"Invalid input";o.message=H}return delete o.inst,delete o.continue,t!=null&&t.reportInput||delete o.input,o}function qr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Hr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gr(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:l({},t)}function Fx(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Qd(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Xd(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function kx(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Qd(t+n)}function wx(e){return Xd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $x(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Ex(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var us=class{constructor(...t){}};var Yd=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,mr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jr=m("$ZodError",Yd),Re=m("$ZodError",Yd,{Parent:Error});function Kr(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Qr(e,t){let n=t||function(a){return a.message},o={_errors:[]},r=a=>{for(let u of a.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(p=>r({issues:p}));else if(u.code==="invalid_key")r({issues:u.issues});else if(u.code==="invalid_element")r({issues:u.issues});else if(u.path.length===0)o._errors.push(n(u));else{let p=o,c=0;for(;c<u.path.length;){let i=u.path[c];c===u.path.length-1?(p[i]=p[i]||{_errors:[]},p[i]._errors.push(n(u))):p[i]=p[i]||{_errors:[]},p=p[i],c++}}};return r(e),o}function gs(e,t){let n=t||function(a){return a.message},o={errors:[]},r=(a,u=[])=>{var i,d,g,h;var p,c;for(let x of a.issues)if(x.code==="invalid_union"&&x.errors.length)x.errors.map(z=>r({issues:z},x.path));else if(x.code==="invalid_key")r({issues:x.issues},x.path);else if(x.code==="invalid_element")r({issues:x.issues},x.path);else{let z=[...u,...x.path];if(z.length===0){o.errors.push(n(x));continue}let H=o,N=0;for(;N<z.length;){let D=z[N],j=N===z.length-1;typeof D=="string"?((i=H.properties)!=null||(H.properties={}),(d=(p=H.properties)[D])!=null||(p[D]={errors:[]}),H=H.properties[D]):((g=H.items)!=null||(H.items=[]),(h=(c=H.items)[D])!=null||(c[D]={errors:[]}),H=H.items[D]),j&&H.errors.push(n(x)),N++}}};return r(e),o}function ef(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Ts(e){var o;let t=[],n=[...e.issues].sort((r,a)=>{var u,p;return((u=r.path)!=null?u:[]).length-((p=a.path)!=null?p:[]).length});for(let r of n)t.push(`\u2716 ${r.message}`),(o=r.path)!=null&&o.length&&t.push(` \u2192 at ${ef(r.path)}`);return t.join(`
2
+ `)===0?te.substr(1,te.length):te}).forEach(function(te){var ue=te.split(":"),q=ue.shift().trim();if(q){var ur=ue.join(":").trim();try{_.append(q,ur)}catch(Li){console.warn("Response "+Li.message)}}}),_}j.call(F.prototype);function V(T,_){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=_.statusText===void 0?"":""+_.statusText,this.headers=new g(_.headers),this.url=_.url||"",this._initBody(T)}j.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},V.error=function(){var T=new V(null,{status:200,statusText:""});return T.ok=!1,T.status=0,T.type="error",T};var fe=[301,302,303,307,308];V.redirect=function(T,_){if(fe.indexOf(_)===-1)throw new RangeError("Invalid status code");return new V(null,{status:_,headers:{location:T}})},n.DOMException=o.DOMException;try{new n.DOMException}catch(T){n.DOMException=function(_,C){this.message=_,this.name=C;var te=Error(_);this.stack=te.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function Je(T,_){return new Promise(function(C,te){var ue=new F(T,_);if(ue.signal&&ue.signal.aborted)return te(new n.DOMException("Aborted","AbortError"));var q=new XMLHttpRequest;function ur(){q.abort()}q.onload=function(){var ye={statusText:q.statusText,headers:U(q.getAllResponseHeaders()||"")};ue.url.indexOf("file://")===0&&(q.status<200||q.status>599)?ye.status=200:ye.status=q.status,ye.url="responseURL"in q?q.responseURL:ye.headers.get("X-Request-URL");var Pt="response"in q?q.response:q.responseText;setTimeout(function(){C(new V(Pt,ye))},0)},q.onerror=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},q.ontimeout=function(){setTimeout(function(){te(new TypeError("Network request timed out"))},0)},q.onabort=function(){setTimeout(function(){te(new n.DOMException("Aborted","AbortError"))},0)};function Li(ye){try{return ye===""&&o.location.href?o.location.href:ye}catch(Pt){return ye}}if(q.open(ue.method,Li(ue.url),!0),ue.credentials==="include"?q.withCredentials=!0:ue.credentials==="omit"&&(q.withCredentials=!1),"responseType"in q&&(r.blob?q.responseType="blob":r.arrayBuffer&&(q.responseType="arraybuffer")),_&&typeof _.headers=="object"&&!(_.headers instanceof g||o.Headers&&_.headers instanceof o.Headers)){var Cd=[];Object.getOwnPropertyNames(_.headers).forEach(function(ye){Cd.push(c(ye)),q.setRequestHeader(ye,i(_.headers[ye]))}),ue.headers.forEach(function(ye,Pt){Cd.indexOf(Pt)===-1&&q.setRequestHeader(Pt,ye)})}else ue.headers.forEach(function(ye,Pt){q.setRequestHeader(Pt,ye)});ue.signal&&(ue.signal.addEventListener("abort",ur),q.onreadystatechange=function(){q.readyState===4&&ue.signal.removeEventListener("abort",ur)}),q.send(typeof ue._bodyInit=="undefined"?null:ue._bodyInit)})}return Je.polyfill=!0,o.fetch||(o.fetch=Je,o.Headers=g,o.Request=F,o.Response=V),n.Headers=g,n.Request=F,n.Response=V,n.fetch=Je,n})({})})(Zi);Zi.fetch.ponyfill=!0;delete Zi.fetch.polyfill;var Nr=Bi.fetch?Bi:Zi;Dt=Nr.fetch;Dt.default=Nr.fetch;Dt.fetch=Nr.fetch;Dt.Headers=Nr.Headers;Dt.Request=Nr.Request;Dt.Response=Nr.Response;WT.exports=Dt});var kF={};xt(kF,{AggregateQueryBuilder:()=>Mr,AuthError:()=>cr,AuthenticationError:()=>pr,AuthorizationError:()=>Ji,Client:()=>Ar,ConfigError:()=>Ce,ConstraintError:()=>ao,ERRORS:()=>Fe,ERROR_DESCRIPTIONS:()=>Xi,ERROR_GROUPS:()=>De,ERROR_MESSAGES:()=>Qi,ERROR_TYPES:()=>lr,ErrorDescription:()=>Xi,ErrorMessage:()=>Qi,ErrorType:()=>lr,Errors:()=>Fe,FindQueryBuilder:()=>le,InputError:()=>oe,InternalError:()=>io,JSONRPCError:()=>Pr,QueryBuilder:()=>He,ReverseQueryBuilder:()=>jr,StreamError:()=>yt,StreamPromise:()=>fr,TokenStatusEnum:()=>gh,TokenTypeEnum:()=>Th,TransferGroupStatusEnum:()=>Oa,TransferGroupTypeEnum:()=>xh,TransferStatusEnum:()=>mh,TransferTypeEnum:()=>Jt,UnknownError:()=>Ki,UpdateQueryBuilder:()=>Ct,ValidationError:()=>Se,Validator:()=>M,WAPIError:()=>Ke,WAPIErrorInfo:()=>FF,WalletStatusEnum:()=>dh,WalletTypeEnum:()=>fh,WapiApikeyStatusEnum:()=>fT,WapiApikeyTypeEnum:()=>dT,WapiClientType:()=>pt,WapiSettingTypeEnum:()=>Cb,create:()=>OF,getError:()=>so,getIdentifier:()=>ns,utils:()=>IF});var Ud=WebSocket;var oo="0.15.5";function Cr(e,t){let n=Hb(e);return n===void 0?t:typeof t=="number"?parseInt(n,10):n}function Hb(e){if(typeof window=="object")return window[e];if(typeof process!="undefined"&&process.versions&&process.versions.node)return process.env[e]}function P(...e){Cr("WAPI_DEBUG")&&console.log(...e.map(t=>t&&typeof t=="object"?JSON.stringify(t):t))}var De={JSONRPC:{min:-32700,max:-32600,ERRORS:{PARSE_ERROR:{code:-32700,message:"Parse error",description:"Unable to parse JSON input"},INVALID_REQUEST:{code:-32600,message:"Invalid request",description:"JSON input does not match JSONRPC spec"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found",description:"Requested method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params",description:"Invalid params provided for method"},INTERNAL_SERVER_ERROR:{code:-32603,message:"Internal server error",description:"Unknown error occurred"}}},AUTH:{min:-20999,max:-2e4,ERRORS:{AUTHENTICATION_ERROR:{code:-2e4,message:"Authentication error",description:"Invalid authentication credentials"},AUTHORIZATION_ERROR:{code:-20001,message:"AUTHORIZATION_ERROR",description:"Provided credentials lack access rights"}}},STREAM:{min:-10999,max:-1e4,ERRORS:{CONNECTION_LOST:{code:-1e4,message:"CONNECTION_LOST",description:"Lost connection to server"},INPUT_STREAM_INVALID:{code:-10001,message:"INPUT_STREAM_INVALID",description:"Invalid input stream identifier provided"},INVALID_RESPONSE_STREAM_CHUNK:{code:-10002,message:"INVALID_RESPONSE_STREAM_CHUNK",description:"Received multiple chunks for non-array property"},INVALID_INPUT_STREAM_CHUNK:{code:-10003,message:"INVALID_INPUT_STREAM_CHUNK",description:"Invalid chunk sent to input stream"},INPUT_STREAM_TIMEOUT:{code:-10004,message:"INPUT_STREAM_TIMEOUT",description:"Input stream failed to finish in allotted time"},INPUT_STREAM_ERROR:{code:-10005,message:"INPUT_STREAM_ERROR",description:"Unknown error in input stream"},INPUT_STREAM_NOT_ALLOWED:{code:-10006,message:"INPUT_STREAM_NOT_ALLOWED",description:"Stream input not allowed for method"},INVALID_STREAM_START_METHOD:{code:-10007,message:"INVALID_STREAM_START_METHOD",description:"Stream start message invalid, method missing"}}},INPUT:{min:-14999,max:-11e3,ERRORS:{HTTP_BODY_SIZE:{code:-11e3,message:"HTTP_BODY_SIZE",description:"Http body size can't be more than 100MB"},DATABASE_EXPORT_CONFLICT:{code:-12e3,message:"DATABASE_EXPORT_CONFLICT",description:"Database export already in progress"},DATABASE_IMPORT_CONFLICT:{code:-12001,message:"DATABASE_IMPORT_CONFLICT",description:"Database import already in progress"},DATABASE_EXPORT_PROGRESS_NOT_FOUND:{code:-12002,message:"DATABASE_EXPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_PROGRESS_NOT_FOUND:{code:-12003,message:"DATABASE_IMPORT_PROGRESS_NOT_FOUND",description:"Database backup process not found"},DATABASE_IMPORT_NOT_FOUND:{code:-12004,message:"DATABASE_IMPORT_NOT_FOUND",description:"Database import file not found"},TR_CANT_UPDATE_TO_PENDING:{code:-12100,message:"TR_CANT_UPDATE_TO_PENDING",description:"Transfer status can only move from 'pending'->'finished'/'cancelled"},TR_CANT_UPDATE_TIMESTAMP:{code:-12101,message:"TR_CANT_UPDATE_TIMESTAMP",description:"Cant update transfer.updated_at - allow_timestamps flag is set to off"},TR_CANT_INSERT_TIMESTAMP:{code:-12102,message:"TR_CANT_INSERT_TIMESTAMP",description:"Cant insert transfer.created_at - allow_timestamps flag is set to off"},TR_EMPTY_UPDATE_REQUEST:{code:-12103,message:"TR_EMPTY_UPDATE_REQUEST",description:"Update request for transfer is empty"},TR_MISSING_FILTER:{code:-12104,message:"TR_MISSING_FILTER",description:"Transactions can't reversed or updated without valid filter"},TR_TO_WALLET_WITHDRAWAL:{code:-12105,message:"TR_TO_WALLET_WITHDRAWAL",description:"To wallet can't be specified when doing a withdrawal"},TR_FROM_WALLET_DEPOSIT:{code:-12106,message:"TR_FROM_WALLET_DEPOSIT",description:"From wallet can't be specified when doing a deposit"},TR_FROM_TO_CONFLICT:{code:-12107,message:"TR_FROM_TO_CONFLICT",description:"from_wallet and to_wallet can not be the same"},TR_UNABLE_TO_RESOLVE_INPUT:{code:-12108,message:"TR_UNABLE_TO_RESOLVE_INPUT",description:"Unable to resolve references to foreign keys"},TRG_MISSING_FILTER:{code:-12200,message:"TRG_MISSING_FILTER",description:"Transaction groups can't reversed or updated without valid filter"},INVALID_FIELD_AGR_COMB:{code:-12300,message:"INVALID_FIELD_AGR_COMB",description:"Provided aggregation field was not found on Model"},INVALID_FIELD_FOR_MODEL:{code:-12301,message:"INVALID_FIELD_FOR_MODEL",description:"Provided field was not found on Model"},NO_METADATA_ON_MODEL:{code:-12302,message:"NO_METADATA_ON_MODEL",description:"Can't use metadata field for grouping as current Model does not have metadata"},INVALID_MODEL:{code:-12303,message:"INVALID_MODEL",description:"Provided Model name is invalid"},INVALID_COMPLEX_FILTER:{code:-12304,message:"INVALID_COMPLEX_FILTER",description:"The provided complex filter does not pass validation"},UNCLEAR_AGGREGATOR:{code:-12305,message:"UNCLEAR_AGGREGATOR",description:"Invalid aggregator function provided"},CONTRACT_OWNER_NOT_FOUND:{code:-12306,message:"CONTRACT_OWNER_NOT_FOUND",description:"Unable to find Wallet specified as Contract token owner"},DISTRIBUTION_MISSING_TARGETS:{code:-12307,message:"DISTRIBUTION_MISSING_TARGETS",description:"Unable to resolve all targets (Wallets, Tokens) for distribution request"},TOKEN_INVALID_WALLET:{code:-12308,message:"TOKEN_INVALID_WALLET",description:"Invalid belongs_to wallet provided"},BAL_FUTURE_DATETIME:{code:-12309,message:"BAL_FUTURE_DATETIME",description:"Balance datetime can't be in the future"},INPUT_NEEDS_IDENTIFIER:{code:-12310,message:"INPUT_NEEDS_IDENTIFIER",description:"Missing identifier - automatically calculated identifiers conflict on identical input for 30s To make an identical transfer during that window you need to provide a unique identifier"},RESET_INVALID_CONFIRMATION:{code:-12311,message:"RESET_INVALID_CONFIRMATION",description:"Provided reset confirmation code is invalid"},INPUT_NEEDS_TOKEN:{code:-12312,message:"INPUT_NEEDS_TOKEN",description:"token must be specified on input or in client config"},CONFLICTING_OPTIONS_FOR_BALANCE:{code:-12313,message:"CONFLICTING_OPTIONS_FOR_BALANCE",description:"return_running_balance and return_running_balance_for can't be specified together"},CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT:{code:-12314,message:"CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT",description:"return_signed_amount and return_signed_amount_for_wallet can't be specified together"},RUNNING_BALANCE_WITHOUT_WALLET:{code:-12315,message:"RUNNING_BALANCE_WITHOUT_WALLET",description:"return_running_balance option requires Wallet filter to be specified"},SIGNED_AMOUNT_WITHOUT_WALLET:{code:-12316,message:"SIGNED_AMOUNT_WITHOUT_WALLET",description:"return_signed_amount option requires Wallet filter to be specified"},REQUIRED_INPUT_MISSING:{code:-12317,message:"REQUIRED_INPUT_MISSING",description:"input does not specify required keys"},EMPTY_UPDATE_REQUEST:{code:-12318,message:"EMPTY_UPDATE_REQUEST",description:"Need to modify at least one field"},ALL_INTERVALS_GROUP_BY:{code:-12319,message:"ALL_INTERVALS_GROUP_BY",description:"return_all_intervals requires at least one groupBy"},TOKEN_MISSING_FOR_BALANCE:{code:-12320,message:"TOKEN_MISSING_FOR_BALANCE",description:"Need to specify include_balance_for_token to access balance fields"},TRX_NOT_ALLOWED:{code:-12400,message:"TRX_NOT_ALLOWED",description:"This method can not run in a transaction"},TRANSACTION_NOT_FOUND:{code:-12401,message:"TRANSACTION_NOT_FOUND",description:"Transaction not found"},ONLY_SELECT_ALLOWED:{code:-12402,message:"ONLY_SELECT_ALLOWED",description:"Only select queries are allowed"},CNT_DEPOSIT_TOKEN_MISMATCH:{code:-12500,message:"CNT_DEPOSIT_TOKEN_MISMATCH",description:"Unable to find tokens specified in deposits"}}},CONSTRAINT:{min:-19999,max:-19e3,ERRORS:{INVALID_LATEST_HASH:{code:-19e3,message:"INVALID_LATEST_HASH",description:"Http body size can't be more than 100MB"},TOKEN_LIMIT_REACHED:{code:-19001,message:"TOKEN_LIMIT_REACHED",description:"Unable to issue more tokens as Token.limit has been reached"},TR_INVALID_BALANCE:{code:-19101,message:"TR_INVALID_BALANCE",description:"Transfer would result in invalid balance for a Wallet"},TR_AMOUNT_NOT_DIVISIBLE:{code:-19102,message:"TR_AMOUNT_NOT_DIVISIBLE",description:"Transfer amount is not divisible by specified Token.divisor"},TR_TOKEN_DISABLED:{code:-19103,message:"TR_TOKEN_DISABLED",description:"Token status is set to 'disabled' - no new transfers allowed"},TR_TOKEN_DWONLY:{code:-19104,message:"TR_TOKEN_DWONLY",description:"Token status is set to 'dw-only' - only deposits or withdrawals allowed"},TR_TRG_STATUS_MISMATCH:{code:-19105,message:"TR_TRG_STATUS_MISMATCH",description:"Transfers in transfer_group must match transfer_group.transfer_status"},TR_TRG_CLOSED:{code:-19106,message:"TR_TRG_CLOSED",description:"Cant add Transfer to group. TransferGroup is closed"},TR_TIMESTAMP_IN_PAST:{code:-19107,message:"TR_TIMESTAMP_IN_PAST",description:"Transfer.created_at must not be in the past"},TR_TIMESTAMP_MUST_BE_LATEST:{code:-19108,message:"TR_TIMESTAMP_MUST_BE_LATEST",description:"Transfer.created_at must be the latest"},TR_INVALID_CANCELLED:{code:-19109,message:"TR_INVALID_CANCELLED",description:"Cant create cancelled transfer"},TR_FROM_WALLET_STATUS_CONSTRAINT:{code:-19110,message:"TR_FROM_WALLET_STATUS_CONSTRAINT",description:"From wallet.status doesn't allow this type of transfers"},TR_TO_WALLET_STATUS_CONSTRAINT:{code:-19111,message:"TR_TO_WALLET_STATUS_CONSTRAINT",description:"To wallet.status doesn't allow this type of transfers"},TR_CANCELLED_CANT_RV:{code:-19112,message:"TR_CANCELLED_CANT_RV",description:"Cancelled Transfer can not be reversed"},TR_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19113,message:"TR_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"Deposits are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'deposit' requires reverse_deposit option to be true."},TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19114,message:"TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"Withdrawals are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'withdrawal' requires reverse_withdrawal option to be true."},TR_UNIQUE_IDENTIFIER:{code:-19115,message:"TR_UNIQUE_IDENTIFIER",description:"The identifier for Transfer object must be unique"},TR_DIFFERENT_WALLETS:{code:-19116,message:"TR_DIFFERENT_WALLETS",description:"To and from wallets have to be different"},TR_AMOUNT_CONSTRAINT:{code:-19117,message:"TR_AMOUNT_CONSTRAINT",description:"The transfer amount is outside of allowed bounds"},TRG_SINGLE_PENDING_TR_CANT_RV:{code:-19200,message:"TRG_SINGLE_PENDING_TR_CANT_RV",description:"Transfer is part of TransferGroup and can not be reversed separately"},TRG_CANCELLED_CANT_RV:{code:-19201,message:"TRG_CANCELLED_CANT_RV",description:"Cancelled TransferGroup can not be reversed"},TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG:{code:-19202,message:"TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true"},TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:{code:-19203,message:"TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",description:"TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true"},TRG_UNIQUE_IDENTIFIER:{code:-19204,message:"TRG_UNIQUE_IDENTIFIER",description:"The identifier for TransferGroup object must be unique"},TOKEN_UNIQUE_FOREIGN:{code:-19300,message:"TOKEN_UNIQUE_FOREIGN",description:"The foreign for Token object must be unique"},WALLET_UNIQUE_FOREIGN:{code:-19400,message:"WALLET_UNIQUE_FOREIGN",description:"The foreign for Wallet object must be unique"},UNIQUE_CONSTRAINT:{code:-19500,message:"UNIQUE_CONSTRAINT",description:"Insert violates unique constraint"},APIKEY_DELETED_CANT_UPDATE:{code:-19600,message:"APIKEY_DELETED_CANT_UPDATE",description:"Cant update deleted apikeys"},APIKEY_NOT_OWNED_CANT_UPDATE:{code:-19601,message:"APIKEY_NOT_OWNED_CANT_UPDATE",description:"Cant update apikeys you dont own"},APIKEY_LIMIT_REACHED:{code:-19610,message:"APIKEY_LIMIT_REACHED",description:"Cant create any more api keys, limit reached"}}},CONFIG:{min:-16e3,max:-15e3,ERRORS:{METHOD_DISABLED:{code:-15e3,message:"METHOD_DISABLED",description:"Method is disabled"},FLAG_PRODUCTION_ON:{code:-15001,message:"FLAG_PRODUCTION_ON",description:'Production flag is "on" - this method is disabled'},FLAG_PRODUCTION_LOCKED:{code:-15002,message:"FLAG_PRODUCTION_LOCKED",description:"Cant update production flag to false in this server"},TRANSACTION_TIMEOUT:{code:-15003,message:"TRANSACTION_TIMEOUT",description:"Database transaction timed out"},CONNECTION_TIMEOUT:{code:-15004,message:"CONNECTION_TIMEOUT",description:"Unable to get initial response in specified time"},SENDING_TIMEOUT:{code:-15005,message:"SENDING_TIMEOUT",description:"Unable to get ack from server in specified time"},CONFIG_INVALID:{code:-15100,message:"CONFIG_INVALID",description:"Provided configuration is invalid"}}}},Fe=l(l(l(l(l(l({},De.JSONRPC.ERRORS),De.AUTH.ERRORS),De.CONFIG.ERRORS),De.STREAM.ERRORS),De.INPUT.ERRORS),De.CONSTRAINT.ERRORS);function Jb(e){return Object.fromEntries(Object.keys(e).map(t=>[t,t]))}var lr=Jb(Fe),Ke=class extends Error{constructor({type:n,code:o,message:r,data:a}){var p;super(r);E(this,"type");E(this,"code");E(this,"data");let u=(p=Fe[n])!=null?p:Fe.INTERNAL_SERVER_ERROR;this.type=n!=null?n:lr.INTERNAL_SERVER_ERROR,this.code=o!=null?o:u.code,this.message=r!=null?r:u.message,this.data=l({description:u.description},a&&typeof a=="object"?a:{error:a})}toJSON(){return{code:this.code,message:this.message,data:this.data}}},Pr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},yt=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},oe=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Ce=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},cr=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},ao=class extends Ke{constructor(t,n,o,r){super({type:t,message:o,data:n,code:r})}},Se=class extends Pr{constructor(t,n){super("INVALID_PARAMS",t,n)}},pr=class extends cr{constructor(t){super("AUTHENTICATION_ERROR",t)}},Ji=class extends cr{constructor(t){super("AUTHORIZATION_ERROR",t)}},io=class extends Ke{constructor(t){super({type:lr.INTERNAL_SERVER_ERROR,data:t})}toJSON(){return{code:this.code,message:this.message,data:{description:Fe.INTERNAL_SERVER_ERROR.description}}}},Ki=class extends io{constructor(t){super({data:{message:t}})}toJSON(){let t=super.toJSON();return t.data={description:t.data.description,message:this.data.message},{code:this.code,message:this.message,data:{message:this.data.message,description:Fe.INTERNAL_SERVER_ERROR.description}}}},Kb=Object.fromEntries(Object.keys(Fe).map(e=>[Fe[e].code,e]));function Qb(e){let t=Kb[e];if(!t){let o=Object.entries(De).find(([,r])=>e>=r.min&&e<=r.max);return{group:o==null?void 0:o[0],type:void 0}}let n=Object.keys(De).find(o=>t in De[o].ERRORS);return n?{group:n,type:t}:(console.error("ERRORS and ERROR_GROUPS are out of sync",t),{group:void 0,type:t})}function so({code:e,message:t,data:n}){let o=Qb(e),r=o.type,a=o.group;t=t&&t!==r||!r?t:Fe[r].description;let u;switch(a&&a!=="JSONRPC"&&r===void 0&&(P("Novel error from server",e,t,n),r=t,u=e,t=n&&typeof n=="object"&&"description"in n&&typeof n.description=="string"?n.description:t),a){case"JSONRPC":return new Pr(r,n,t);case"AUTH":return new cr(r,n,t,u);case"CONFIG":return new Ce(r,n,t,u);case"CONSTRAINT":return new ao(r,n,t,u);case"INPUT":return new oe(r,n,t,u);case"STREAM":return new yt(r,n,t,u);default:return new Ke({code:e,message:t,data:n,type:r!=null?r:lr.INTERNAL_SERVER_ERROR})}}var Qi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].message])),Xi=Object.fromEntries(Object.keys(Fe).map(e=>[e,Fe[e].description]));var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function Bd(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}var Yi,Xb=new Uint8Array(16);function es(){if(!Yi){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yi=crypto.getRandomValues.bind(crypto)}return Yi(Xb)}var Yb=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ts={randomUUID:Yb};function ex(e,t,n){var r,a,u;if(ts.randomUUID&&!t&&!e)return ts.randomUUID();e=e||{};let o=(u=(a=e.random)!=null?a:(r=e.rng)==null?void 0:r.call(e))!=null?u:es();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let p=0;p<16;++p)t[n+p]=o[p];return t}return Bd(o)}var Gr=ex;var rs={timeouts:{},values:{},set(e,t){this.timeouts[e]=setTimeout(()=>this.clear(e),3e4),this.values[e]=t},get(e){return this.values[e]},getKey(e){let t=JSON.parse(JSON.stringify(e)),n="";return Object.keys(t).sort().forEach(o=>{let r="";t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?r=this.getKey(t[o]):r=JSON.stringify(t[o]),n+=o+":"+r}),n},clear(e){this.timeouts[e]&&clearTimeout(this.timeouts[e]),delete this.timeouts[e],delete this.values[e]},clearAll(){Object.keys(this.timeouts).forEach(e=>{clearTimeout(this.timeouts[e])}),this.timeouts={},this.values={}}};function uo(e=8){return Gr().replace(/-/g,"").slice(-e)}function ke(e){if(!e)return Gr();let t=rs.getKey(e);if(rs.get(t))throw new oe("INPUT_NEEDS_IDENTIFIER",{object:e});let n=Gr();return rs.set(t,n),n}function Vd(e){return new Promise(t=>setTimeout(t,e))}function ns(){return ke()}function tx(e){return JSON.parse(JSON.stringify(e))}function St(e,t,n){if(t in e){if(e[t]===void 0)throw new Se({input:e},`undefined provided for ${t}`);return e}if(!n)throw new Se({input:e},`${t} is required if no default set`);let o=tx(e);return o[t]=n,o}function rx(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Zd(e){return e.host.replace(/^https:/,"wss:")+"?"+rx({apikey:e.apikey,apisecret:e.apisecret,db:e.database,clientVersion:e.clientVersion,connectionName:e.connectionName})}function Ld(e){return typeof window=="undefined"?[Zd(e),{rejectUnauthorized:e.rejectUnauthorized}]:[Zd(e)]}function co(e,t){let n={},o=!e||typeof e!="object"?{}:e;return Object.keys(o).forEach(r=>{t[r]?typeof t[r]=="string"?n[t[r]]=o[r]:n[r]=t[r](o[r]):n[r]=o[r]}),n}function nx(e){return e.split(",").map(t=>t.split(" ")).map(t=>{let[n,o,r,a]=t;return l({field:n,direction:o==="desc"?"desc":"asc"},r==="nulls"&&["first","last"].includes(a)?{nulls:a}:{})})}function ae(e,t){var a;let r=e!=null?e:{},{options:n}=r;return{filter:de(r,["options"]),options:(a=t!=null?t:n)!=null?a:{}}}function et(e){let o=e,{order_by:t}=o,n=de(o,["order_by"]);return!n.order&&t&&(n.order=nx(t)),n}function qd(e){if(e!=null)return e+""}function dr(e){return typeof e=="number"?e:parseFloat(e)}function Hd(e){return new Date(e).setHours(0,0,0,0)>new Date().setHours(0,0,0,0)}var we={version:"2.0",acknowledgement:"ack",ping:"ping",pong:"pong",streamChunk:"streamChunk",streamPause:"streamPause",streamResume:"streamResume"};var Wr=class{constructor(t){E(this,"_data",[]);E(this,"_error",[]);E(this,"_end",[]);E(this,"_finished",!1);E(this,"_options");this._options=t}on(t,n){switch(t){case"data":return this._data.push(n),this;case"end":return this._end.push(n),this;case"error":return this._error.push(n),this}}push(t){if(this._finished)throw new Error("Stream is closed");return t===null?this.end():(this._data.forEach(n=>n(t)),this)}error(t){if(this._finished)throw new Error("Stream is closed");return this._error.forEach(n=>n(t)),this}end(){if(this._finished)throw new Error("Stream is closed");return this._end.forEach(t=>t()),this._finished=!0,this}destroy(t){return this.error(t),this.end(),this}get destroyed(){return this._finished}};var fr=class{constructor(t){E(this,"resolve");E(this,"reject");E(this,"makeRequest");E(this,"streamObject",new Wr({objectMode:!0}));E(this,"outStreamObject",new Wr({objectMode:!0}));E(this,"mode");E(this,"started",!1);E(this,"promise");this.makeRequest=t}start(t){var u;if(P("start request as",t),this.mode&&this.mode!==t)throw new Error("Already in use as "+this.mode);if(this.started)return;let{promise:n,resolve:o,reject:r}=Promise.withResolvers();if(this.promise=n,this.resolve=o,this.reject=r,this.started=!0,this.mode=t,this.makeRequest===void 0){this.streamObject.push(null),(u=this.resolve)==null||u.call(this,void 0);return}this.makeRequest(this.streamObject).catch(this.reject);let a=[];if(this.mode==="stream"){this.streamObject.on("data",p=>{if(P("stream data",p),p||this.outStreamObject.push(p),p.error){let c=so(p.error);return this.outStreamObject.destroy(c),this.streamObject.destroy(c)}if(!p.prop){a.push(p);return}if(p.dataArr){let c=l({},p);delete c.dataArr,p.dataArr.forEach(i=>{this.outStreamObject.push(v(l({},c),{data:i}))});return}this.outStreamObject.push(p)}).on("end",()=>{P("stream ended");let p=a.pop();if(!p)return;let c=p.result;Object.keys(c).forEach(i=>{Array.isArray(c[i])&&(c[i].forEach(d=>{this.outStreamObject.push({type:we.streamChunk,prop:i,data:d})}),c[i]=[])}),this.outStreamObject.push(p),this.outStreamObject.push(null)}).on("error",p=>{P("stream error",p),this.outStreamObject.destroy(p)});return}if(this.mode==="promise"){let p=new Map;this.streamObject.on("data",c=>{var d;if(P("streamPromise data",c),c===void 0)return;if(c.error){let g=so(c.error);return this.streamObject.destroy(g)}if(!c.prop){a.push(c);return}let i=(d=p.get(c.prop))!=null?d:[];c.dataArr?i.push(...c.dataArr):i.push(c.data),p.set(c.prop,i)}).on("end",()=>{P("streamPromise end");let c=a.pop();if(!c)return;let i=c.result;if(!p.size)return this.resolve(i);let d=!1;p.forEach((g,h)=>{Array.isArray(i[h])?(g.push(...i[h]),i[h]=g):g.length===1?i[h]=g:(this.streamObject.destroy(new yt("INVALID_RESPONSE_STREAM_CHUNK",{property:h,value:g})),d=!0)}),d||this.resolve(i)}).on("error",c=>{var i;return P("streamPromise error",c),(i=this.reject)==null?void 0:i.call(this,c)})}}then(t,n){return this.start("promise"),this.promise.then(t,n)}catch(t){return this.start("promise"),this.promise.catch(t)}get[Symbol.toStringTag](){return"StreamPromise"}finally(t){return this.start("promise"),this.promise.finally(t)}stream(){return this.start("stream"),this.outStreamObject}};var po={};var ox=(e,t)=>{if(e)return new Se({message:e.message,data:e.format()})},os=(e,t,n=ox)=>{let{success:o,error:r,data:a}=e.safeParse(t);return{data:a,success:o,isValid:o,error:n(r,t)}},Jd=(e,t,n,o)=>!t||typeof t!="object"?{success:!1,isValid:!1,error:new Se({message:`Invalid input - expected object, got ${typeof t}`,data:{input:t}})}:os(e,l({options:n!=null?n:{}},t),o),lt=(e,t,n,o)=>{var u;let{data:r,error:a}=os(e,t,o);if(a)throw((u=n==null?void 0:n.warn)!=null?u:P)(l({err:a},po),"Invalid input"),a;return r},ax=(e,t,n,o,r)=>{!o&&n&&typeof(n==null?void 0:n.warn)=="function"&&(o=n,n={});let{data:a,error:u}=Jd(e,t,n,r);if(u)throw o?o.warn(l({err:u},po),"Invalid input"):P(l({err:u},po),"Invalid input"),u;return a},f=(e,t)=>({validateInput:(n,o)=>lt(e,n,o,t),validateInputWOptions:(n,o,r)=>ax(e,n,o,r,t),softValidateInput:n=>os(e,n,t),softValidateWOptions:(n,o)=>Jd(e,n,o,t)});var s={};xt(s,{$brand:()=>is,$input:()=>_c,$output:()=>vc,NEVER:()=>as,TimePrecision:()=>Fc,ZodAny:()=>ym,ZodArray:()=>Om,ZodBase64:()=>Zp,ZodBase64URL:()=>Vp,ZodBigInt:()=>In,ZodBigIntFormat:()=>Hp,ZodBoolean:()=>On,ZodCIDRv4:()=>Up,ZodCIDRv6:()=>Bp,ZodCUID:()=>jp,ZodCUID2:()=>Ap,ZodCatch:()=>Bm,ZodCodec:()=>ol,ZodCustom:()=>ga,ZodCustomStringFormat:()=>vn,ZodDate:()=>fa,ZodDefault:()=>Dm,ZodDiscriminatedUnion:()=>Im,ZodE164:()=>Lp,ZodEmail:()=>zp,ZodEmoji:()=>Np,ZodEnum:()=>yn,ZodError:()=>$S,ZodFile:()=>Mm,ZodFirstPartyTypeKind:()=>al,ZodFunction:()=>Xm,ZodGUID:()=>ua,ZodIPv4:()=>Gp,ZodIPv6:()=>Wp,ZodISODate:()=>aa,ZodISODateTime:()=>oa,ZodISODuration:()=>sa,ZodISOTime:()=>ia,ZodIntersection:()=>Fm,ZodIssueCode:()=>Gv,ZodJWT:()=>qp,ZodKSUID:()=>Pp,ZodLazy:()=>Jm,ZodLiteral:()=>Nm,ZodMap:()=>Rm,ZodNaN:()=>Vm,ZodNanoID:()=>Mp,ZodNever:()=>vm,ZodNonOptional:()=>rl,ZodNull:()=>bm,ZodNullable:()=>Am,ZodNumber:()=>_n,ZodNumberFormat:()=>wr,ZodObject:()=>ha,ZodOptional:()=>tl,ZodPipe:()=>nl,ZodPrefault:()=>Pm,ZodPromise:()=>Qm,ZodReadonly:()=>Lm,ZodRealError:()=>Ne,ZodRecord:()=>Xp,ZodSet:()=>zm,ZodString:()=>Sn,ZodStringFormat:()=>ce,ZodSuccess:()=>Um,ZodSymbol:()=>gm,ZodTemplateLiteral:()=>Hm,ZodTransform:()=>jm,ZodTuple:()=>wm,ZodType:()=>B,ZodULID:()=>Dp,ZodURL:()=>da,ZodUUID:()=>ht,ZodUndefined:()=>Tm,ZodUnion:()=>Kp,ZodUnknown:()=>Sm,ZodVoid:()=>_m,ZodXID:()=>Cp,_ZodString:()=>Rp,_default:()=>Cm,_function:()=>Nv,any:()=>fv,array:()=>ma,base64:()=>KS,base64url:()=>QS,bigint:()=>uv,boolean:()=>hm,catch:()=>Zm,check:()=>Mv,cidrv4:()=>HS,cidrv6:()=>JS,clone:()=>$e,codec:()=>Ev,coerce:()=>Ta,config:()=>Te,core:()=>nt,cuid:()=>WS,cuid2:()=>US,custom:()=>jv,date:()=>hv,decode:()=>vp,decodeAsync:()=>Op,discriminatedUnion:()=>yv,e164:()=>XS,email:()=>RS,emoji:()=>PS,encode:()=>Sp,encodeAsync:()=>_p,endsWith:()=>dn,enum:()=>Yp,file:()=>Fv,flattenError:()=>Kr,float32:()=>ov,float64:()=>av,formatError:()=>Qr,function:()=>Nv,getErrorMap:()=>Uv,globalRegistry:()=>rt,gt:()=>ft,gte:()=>ze,guid:()=>zS,hash:()=>nv,hex:()=>rv,hostname:()=>tv,httpUrl:()=>CS,includes:()=>pn,instanceof:()=>Av,int:()=>Ep,int32:()=>iv,int64:()=>cv,intersection:()=>km,ipv4:()=>LS,ipv6:()=>qS,iso:()=>xn,json:()=>Cv,jwt:()=>YS,keyof:()=>gv,ksuid:()=>VS,lazy:()=>Km,length:()=>Ir,literal:()=>Iv,locales:()=>Bt,looseObject:()=>xv,lowercase:()=>un,lt:()=>dt,lte:()=>Ze,map:()=>vv,maxLength:()=>Or,maxSize:()=>_r,mime:()=>fn,minLength:()=>wt,minSize:()=>Vt,multipleOf:()=>Zt,nan:()=>$v,nanoid:()=>GS,nativeEnum:()=>Ov,negative:()=>tp,never:()=>Jp,nonnegative:()=>np,nonoptional:()=>Wm,nonpositive:()=>rp,normalize:()=>mn,null:()=>xm,nullable:()=>pa,nullish:()=>kv,number:()=>mm,object:()=>Tv,optional:()=>ca,overwrite:()=>mt,parse:()=>Tp,parseAsync:()=>bp,partialRecord:()=>Sv,pipe:()=>la,positive:()=>ep,prefault:()=>Gm,preprocess:()=>Pv,prettifyError:()=>Ts,promise:()=>zv,property:()=>op,readonly:()=>qm,record:()=>Em,refine:()=>Ym,regex:()=>sn,regexes:()=>We,registry:()=>Do,safeDecode:()=>Fp,safeDecodeAsync:()=>wp,safeEncode:()=>Ip,safeEncodeAsync:()=>kp,safeParse:()=>xp,safeParseAsync:()=>yp,set:()=>_v,setErrorMap:()=>Wv,size:()=>an,startsWith:()=>ln,strictObject:()=>bv,string:()=>$p,stringFormat:()=>ev,stringbool:()=>Dv,success:()=>wv,superRefine:()=>eh,symbol:()=>lv,templateLiteral:()=>Rv,toJSONSchema:()=>lp,toLowerCase:()=>gn,toUpperCase:()=>Tn,transform:()=>el,treeifyError:()=>gs,trim:()=>hn,tuple:()=>$m,uint32:()=>sv,uint64:()=>pv,ulid:()=>BS,undefined:()=>dv,union:()=>Qp,unknown:()=>kr,uppercase:()=>cn,url:()=>DS,uuid:()=>NS,uuidv4:()=>MS,uuidv6:()=>jS,uuidv7:()=>AS,void:()=>mv,xid:()=>ZS});var nt={};xt(nt,{$ZodAny:()=>Vu,$ZodArray:()=>Ku,$ZodAsyncError:()=>Qe,$ZodBase64:()=>ju,$ZodBase64URL:()=>Au,$ZodBigInt:()=>No,$ZodBigIntFormat:()=>Wu,$ZodBoolean:()=>tn,$ZodCIDRv4:()=>zu,$ZodCIDRv6:()=>Nu,$ZodCUID:()=>Su,$ZodCUID2:()=>vu,$ZodCatch:()=>fc,$ZodCheck:()=>pe,$ZodCheckBigIntFormat:()=>Qs,$ZodCheckEndsWith:()=>cu,$ZodCheckGreaterThan:()=>Fo,$ZodCheckIncludes:()=>su,$ZodCheckLengthEquals:()=>nu,$ZodCheckLessThan:()=>Io,$ZodCheckLowerCase:()=>au,$ZodCheckMaxLength:()=>tu,$ZodCheckMaxSize:()=>Xs,$ZodCheckMimeType:()=>lu,$ZodCheckMinLength:()=>ru,$ZodCheckMinSize:()=>Ys,$ZodCheckMultipleOf:()=>Js,$ZodCheckNumberFormat:()=>Ks,$ZodCheckOverwrite:()=>du,$ZodCheckProperty:()=>pu,$ZodCheckRegex:()=>ou,$ZodCheckSizeEquals:()=>eu,$ZodCheckStartsWith:()=>uu,$ZodCheckStringFormat:()=>Sr,$ZodCheckUpperCase:()=>iu,$ZodCodec:()=>rn,$ZodCustom:()=>Sc,$ZodCustomStringFormat:()=>Pu,$ZodDate:()=>Ju,$ZodDefault:()=>cc,$ZodDiscriminatedUnion:()=>Xu,$ZodE164:()=>Du,$ZodEmail:()=>Tu,$ZodEmoji:()=>xu,$ZodEncodeError:()=>vt,$ZodEnum:()=>nc,$ZodError:()=>Jr,$ZodFile:()=>ac,$ZodFunction:()=>bc,$ZodGUID:()=>hu,$ZodIPv4:()=>Eu,$ZodIPv6:()=>Ru,$ZodISODate:()=>ku,$ZodISODateTime:()=>Fu,$ZodISODuration:()=>$u,$ZodISOTime:()=>wu,$ZodIntersection:()=>Yu,$ZodJWT:()=>Cu,$ZodKSUID:()=>Iu,$ZodLazy:()=>yc,$ZodLiteral:()=>oc,$ZodMap:()=>tc,$ZodNaN:()=>mc,$ZodNanoID:()=>yu,$ZodNever:()=>qu,$ZodNonOptional:()=>lc,$ZodNull:()=>Zu,$ZodNullable:()=>uc,$ZodNumber:()=>zo,$ZodNumberFormat:()=>Gu,$ZodObject:()=>Sf,$ZodObjectJIT:()=>Qu,$ZodOptional:()=>sc,$ZodPipe:()=>hc,$ZodPrefault:()=>pc,$ZodPromise:()=>xc,$ZodReadonly:()=>gc,$ZodRealError:()=>Re,$ZodRecord:()=>ec,$ZodRegistry:()=>vr,$ZodSet:()=>rc,$ZodString:()=>Ut,$ZodStringFormat:()=>se,$ZodSuccess:()=>dc,$ZodSymbol:()=>Uu,$ZodTemplateLiteral:()=>Tc,$ZodTransform:()=>ic,$ZodTuple:()=>jo,$ZodType:()=>A,$ZodULID:()=>_u,$ZodURL:()=>bu,$ZodUUID:()=>gu,$ZodUndefined:()=>Bu,$ZodUnion:()=>Mo,$ZodUnknown:()=>Lu,$ZodVoid:()=>Hu,$ZodXID:()=>Ou,$brand:()=>is,$constructor:()=>m,$input:()=>_c,$output:()=>vc,Doc:()=>en,JSONSchema:()=>dp,JSONSchemaGenerator:()=>bn,NEVER:()=>as,TimePrecision:()=>Fc,_any:()=>qc,_array:()=>ap,_base64:()=>ea,_base64url:()=>ta,_bigint:()=>Gc,_boolean:()=>Cc,_catch:()=>vS,_check:()=>lm,_cidrv4:()=>Xo,_cidrv6:()=>Yo,_coercedBigint:()=>Wc,_coercedBoolean:()=>Pc,_coercedDate:()=>Xc,_coercedNumber:()=>zc,_coercedString:()=>Ic,_cuid:()=>Vo,_cuid2:()=>Lo,_custom:()=>sp,_date:()=>Qc,_decode:()=>To,_decodeAsync:()=>xo,_default:()=>xS,_discriminatedUnion:()=>sS,_e164:()=>ra,_email:()=>Co,_emoji:()=>Bo,_encode:()=>go,_encodeAsync:()=>bo,_endsWith:()=>dn,_enum:()=>fS,_file:()=>ip,_float32:()=>Mc,_float64:()=>jc,_gt:()=>ft,_gte:()=>ze,_guid:()=>nn,_includes:()=>pn,_int:()=>Nc,_int32:()=>Ac,_int64:()=>Uc,_intersection:()=>uS,_ipv4:()=>Ko,_ipv6:()=>Qo,_isoDate:()=>wc,_isoDateTime:()=>kc,_isoDuration:()=>Ec,_isoTime:()=>$c,_jwt:()=>na,_ksuid:()=>Jo,_lazy:()=>FS,_length:()=>Ir,_literal:()=>hS,_lowercase:()=>un,_lt:()=>dt,_lte:()=>Ze,_map:()=>lS,_max:()=>Ze,_maxLength:()=>Or,_maxSize:()=>_r,_mime:()=>fn,_min:()=>ze,_minLength:()=>wt,_minSize:()=>Vt,_multipleOf:()=>Zt,_nan:()=>Yc,_nanoid:()=>Zo,_nativeEnum:()=>mS,_negative:()=>tp,_never:()=>Jc,_nonnegative:()=>np,_nonoptional:()=>yS,_nonpositive:()=>rp,_normalize:()=>mn,_null:()=>Lc,_nullable:()=>bS,_number:()=>Rc,_optional:()=>TS,_overwrite:()=>mt,_parse:()=>Tr,_parseAsync:()=>br,_pipe:()=>_S,_positive:()=>ep,_promise:()=>kS,_property:()=>op,_readonly:()=>OS,_record:()=>pS,_refine:()=>up,_regex:()=>sn,_safeDecode:()=>So,_safeDecodeAsync:()=>_o,_safeEncode:()=>yo,_safeEncodeAsync:()=>vo,_safeParse:()=>xr,_safeParseAsync:()=>yr,_set:()=>dS,_size:()=>an,_startsWith:()=>ln,_string:()=>Oc,_stringFormat:()=>Fr,_stringbool:()=>pp,_success:()=>SS,_superRefine:()=>cp,_symbol:()=>Zc,_templateLiteral:()=>IS,_toLowerCase:()=>gn,_toUpperCase:()=>Tn,_transform:()=>gS,_trim:()=>hn,_tuple:()=>cS,_uint32:()=>Dc,_uint64:()=>Bc,_ulid:()=>qo,_undefined:()=>Vc,_union:()=>iS,_unknown:()=>Hc,_uppercase:()=>cn,_url:()=>on,_uuid:()=>Po,_uuidv4:()=>Go,_uuidv6:()=>Wo,_uuidv7:()=>Uo,_void:()=>Kc,_xid:()=>Ho,clone:()=>$e,config:()=>Te,decode:()=>Nx,decodeAsync:()=>jx,encode:()=>zx,encodeAsync:()=>Mx,flattenError:()=>Kr,formatError:()=>Qr,globalConfig:()=>Ur,globalRegistry:()=>rt,isValidBase64:()=>Mu,isValidBase64URL:()=>Tf,isValidJWT:()=>bf,locales:()=>Bt,parse:()=>mo,parseAsync:()=>ho,prettifyError:()=>Ts,regexes:()=>We,registry:()=>Do,safeDecode:()=>Dx,safeDecodeAsync:()=>Px,safeEncode:()=>Ax,safeEncodeAsync:()=>Cx,safeParse:()=>bs,safeParseAsync:()=>xs,toDotPath:()=>ef,toJSONSchema:()=>lp,treeifyError:()=>gs,util:()=>I,version:()=>fu});var as=Object.freeze({status:"aborted"});function m(e,t,n){var p;function o(c,i){var g,h;var d;Object.defineProperty(c,"_zod",{value:(g=c._zod)!=null?g:{},enumerable:!1}),(h=(d=c._zod).traits)!=null||(d.traits=new Set),c._zod.traits.add(e),t(c,i);for(let x in u.prototype)x in c||Object.defineProperty(c,x,{value:u.prototype[x].bind(c)});c._zod.constr=u,c._zod.def=i}let r=(p=n==null?void 0:n.Parent)!=null?p:Object;class a extends r{}Object.defineProperty(a,"name",{value:e});function u(c){var g;var i;let d=n!=null&&n.Parent?new a:this;o(d,c),(g=(i=d._zod).deferred)!=null||(i.deferred=[]);for(let h of d._zod.deferred)h();return d}return Object.defineProperty(u,"init",{value:o}),Object.defineProperty(u,Symbol.hasInstance,{value:c=>{var i,d;return n!=null&&n.Parent&&c instanceof n.Parent?!0:(d=(i=c==null?void 0:c._zod)==null?void 0:i.traits)==null?void 0:d.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}var is=Symbol("zod_brand"),Qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ur={};function Te(e){return e&&Object.assign(Ur,e),Ur}var I={};xt(I,{BIGINT_FORMAT_RANGES:()=>hs,Class:()=>us,NUMBER_FORMAT_RANGES:()=>ms,aborted:()=>kt,allowsEval:()=>ps,assert:()=>px,assertEqual:()=>ix,assertIs:()=>ux,assertNever:()=>cx,assertNotEqual:()=>sx,assignProp:()=>Ot,base64ToUint8Array:()=>Qd,base64urlToUint8Array:()=>kx,cached:()=>hr,captureStackTrace:()=>fo,cleanEnum:()=>Fx,cleanRegex:()=>Vr,clone:()=>$e,cloneDef:()=>dx,createTransparentProxy:()=>bx,defineLazy:()=>J,esc:()=>lo,escapeRegex:()=>tt,extend:()=>Sx,finalizeIssue:()=>Ge,floatSafeRemainder:()=>cs,getElementAtPath:()=>fx,getEnumValues:()=>Zr,getLengthableOrigin:()=>Hr,getParsedType:()=>Tx,getSizableOrigin:()=>qr,hexToUint8Array:()=>$x,isObject:()=>Gt,isPlainObject:()=>Ft,issue:()=>gr,joinValues:()=>b,jsonStringifyReplacer:()=>mr,merge:()=>_x,mergeDefs:()=>It,normalizeParams:()=>k,nullish:()=>_t,numKeys:()=>gx,objectClone:()=>lx,omit:()=>yx,optionalKeys:()=>fs,partial:()=>Ox,pick:()=>xx,prefixIssues:()=>Pe,primitiveTypes:()=>ds,promiseAllObject:()=>mx,propertyKeyTypes:()=>Lr,randomString:()=>hx,required:()=>Ix,safeExtend:()=>vx,shallowClone:()=>ls,stringifyPrimitive:()=>$,uint8ArrayToBase64:()=>Xd,uint8ArrayToBase64url:()=>wx,uint8ArrayToHex:()=>Ex,unwrapMessage:()=>Br});function ix(e){return e}function sx(e){return e}function ux(e){}function cx(e){throw new Error}function px(e){}function Zr(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function b(e,t="|"){return e.map(n=>$(n)).join(t)}function mr(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function _t(e){return e==null}function Vr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function cs(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c!=null&&c[1]&&(r=Number.parseInt(c[1]))}let a=n>r?n:r,u=Number.parseInt(e.toFixed(a).replace(".","")),p=Number.parseInt(t.toFixed(a).replace(".",""));return u%p/Gd(10,a)}var Kd=Symbol("evaluating");function J(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==Kd)return o===void 0&&(o=Kd,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lx(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function It(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function dx(e){return It(e._zod.def)}function fx(e,t){return t?t.reduce((n,o)=>n==null?void 0:n[o],e):e}function mx(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let a=0;a<t.length;a++)r[t[a]]=o[a];return r})}function hx(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function lo(e){return JSON.stringify(e)}var fo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ps=hr(()=>{var e;if(typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{let t=Function;return new t(""),!0}catch(t){return!1}});function Ft(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Gt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ls(e){return Ft(e)?l({},e):e}function gx(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Tx=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map!="undefined"&&e instanceof Map?"map":typeof Set!="undefined"&&e instanceof Set?"set":typeof Date!="undefined"&&e instanceof Date?"date":typeof File!="undefined"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Lr=new Set(["string","number","symbol"]),ds=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(e,t,n){let o=new e._zod.constr(t!=null?t:e._zod.def);return(!t||n!=null&&n.parent)&&(o._zod.parent=e),o}function k(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?v(l({},t),{error:()=>t.error}):t}function bx(e){let t;return new Proxy({},{get(n,o,r){return t!=null||(t=e()),Reflect.get(t,o,r)},set(n,o,r,a){return t!=null||(t=e()),Reflect.set(t,o,r,a)},has(n,o){return t!=null||(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t!=null||(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t!=null||(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t!=null||(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t!=null||(t=e()),Reflect.defineProperty(t,o,r)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ms={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r={};for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=n.shape[a])}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function yx(e,t){let n=e._zod.def,o=It(e._zod.def,{get shape(){let r=l({},e._zod.def.shape);for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return Ot(this,"shape",r),r},checks:[]});return $e(e,o)}function Sx(e,t){if(!Ft(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=It(e._zod.def,{get shape(){let a=l(l({},e._zod.def.shape),t);return Ot(this,"shape",a),a},checks:[]});return $e(e,r)}function vx(e,t){if(!Ft(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=v(l({},e._zod.def),{get shape(){let o=l(l({},e._zod.def.shape),t);return Ot(this,"shape",o),o},checks:e._zod.def.checks});return $e(e,n)}function _x(e,t){let n=It(e._zod.def,{get shape(){let o=l(l({},e._zod.def.shape),t._zod.def.shape);return Ot(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return $e(e,n)}function Ox(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in r))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:r[u]}):r[u])}else for(let u in r)a[u]=e?new e({type:"optional",innerType:r[u]}):r[u];return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function Ix(e,t,n){let o=It(t._zod.def,{get shape(){let r=t._zod.def.shape,a=l({},r);if(n)for(let u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=new e({type:"nonoptional",innerType:r[u]}))}else for(let u in r)a[u]=new e({type:"nonoptional",innerType:r[u]});return Ot(this,"shape",a),a},checks:[]});return $e(t,o)}function kt(e,t=0){var n;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((n=e.issues[o])==null?void 0:n.continue)!==!0)return!0;return!1}function Pe(e,t){return t.map(n=>{var r;var o;return(r=(o=n).path)!=null||(o.path=[]),n.path.unshift(e),n})}function Br(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ge(e,t,n){var r,a,u,p,c,i,d,g,h,x,z;let o=v(l({},e),{path:(r=e.path)!=null?r:[]});if(!e.message){let H=(z=(x=(g=(i=Br((p=(u=(a=e.inst)==null?void 0:a._zod.def)==null?void 0:u.error)==null?void 0:p.call(u,e)))!=null?i:Br((c=t==null?void 0:t.error)==null?void 0:c.call(t,e)))!=null?g:Br((d=n.customError)==null?void 0:d.call(n,e)))!=null?x:Br((h=n.localeError)==null?void 0:h.call(n,e)))!=null?z:"Invalid input";o.message=H}return delete o.inst,delete o.continue,t!=null&&t.reportInput||delete o.input,o}function qr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Hr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function gr(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:l({},t)}function Fx(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Qd(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Xd(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function kx(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Qd(t+n)}function wx(e){return Xd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $x(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Ex(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var us=class{constructor(...t){}};var Yd=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,mr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jr=m("$ZodError",Yd),Re=m("$ZodError",Yd,{Parent:Error});function Kr(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Qr(e,t){let n=t||function(a){return a.message},o={_errors:[]},r=a=>{for(let u of a.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(p=>r({issues:p}));else if(u.code==="invalid_key")r({issues:u.issues});else if(u.code==="invalid_element")r({issues:u.issues});else if(u.path.length===0)o._errors.push(n(u));else{let p=o,c=0;for(;c<u.path.length;){let i=u.path[c];c===u.path.length-1?(p[i]=p[i]||{_errors:[]},p[i]._errors.push(n(u))):p[i]=p[i]||{_errors:[]},p=p[i],c++}}};return r(e),o}function gs(e,t){let n=t||function(a){return a.message},o={errors:[]},r=(a,u=[])=>{var i,d,g,h;var p,c;for(let x of a.issues)if(x.code==="invalid_union"&&x.errors.length)x.errors.map(z=>r({issues:z},x.path));else if(x.code==="invalid_key")r({issues:x.issues},x.path);else if(x.code==="invalid_element")r({issues:x.issues},x.path);else{let z=[...u,...x.path];if(z.length===0){o.errors.push(n(x));continue}let H=o,N=0;for(;N<z.length;){let D=z[N],j=N===z.length-1;typeof D=="string"?((i=H.properties)!=null||(H.properties={}),(d=(p=H.properties)[D])!=null||(p[D]={errors:[]}),H=H.properties[D]):((g=H.items)!=null||(H.items=[]),(h=(c=H.items)[D])!=null||(c[D]={errors:[]}),H=H.items[D]),j&&H.errors.push(n(x)),N++}}};return r(e),o}function ef(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Ts(e){var o;let t=[],n=[...e.issues].sort((r,a)=>{var u,p;return((u=r.path)!=null?u:[]).length-((p=a.path)!=null?p:[]).length});for(let r of n)t.push(`\u2716 ${r.message}`),(o=r.path)!=null&&o.length&&t.push(` \u2192 at ${ef(r.path)}`);return t.join(`
3
3
  `)}var Tr=e=>(t,n,o,r)=>{var p;let a=o?Object.assign(o,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},a);if(u instanceof Promise)throw new Qe;if(u.issues.length){let c=new((p=r==null?void 0:r.Err)!=null?p:e)(u.issues.map(i=>Ge(i,a,Te())));throw fo(c,r==null?void 0:r.callee),c}return u.value},mo=Tr(Re),br=e=>(t,n,o,r)=>Y(null,null,function*(){var p;let a=o?Object.assign(o,{async:!0}):{async:!0},u=t._zod.run({value:n,issues:[]},a);if(u instanceof Promise&&(u=yield u),u.issues.length){let c=new((p=r==null?void 0:r.Err)!=null?p:e)(u.issues.map(i=>Ge(i,a,Te())));throw fo(c,r==null?void 0:r.callee),c}return u.value}),ho=br(Re),xr=e=>(t,n,o)=>{let r=o?v(l({},o),{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise)throw new Qe;return a.issues.length?{success:!1,error:new(e!=null?e:Jr)(a.issues.map(u=>Ge(u,r,Te())))}:{success:!0,data:a.value}},bs=xr(Re),yr=e=>(t,n,o)=>Y(null,null,function*(){let r=o?Object.assign(o,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},r);return a instanceof Promise&&(a=yield a),a.issues.length?{success:!1,error:new e(a.issues.map(u=>Ge(u,r,Te())))}:{success:!0,data:a.value}}),xs=yr(Re),go=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Tr(e)(t,n,r)},zx=go(Re),To=e=>(t,n,o)=>Tr(e)(t,n,o),Nx=To(Re),bo=e=>(t,n,o)=>Y(null,null,function*(){let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return br(e)(t,n,r)}),Mx=bo(Re),xo=e=>(t,n,o)=>Y(null,null,function*(){return br(e)(t,n,o)}),jx=xo(Re),yo=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return xr(e)(t,n,r)},Ax=yo(Re),So=e=>(t,n,o)=>xr(e)(t,n,o),Dx=So(Re),vo=e=>(t,n,o)=>Y(null,null,function*(){let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return yr(e)(t,n,r)}),Cx=vo(Re),_o=e=>(t,n,o)=>Y(null,null,function*(){return yr(e)(t,n,o)}),Px=_o(Re);var We={};xt(We,{base64:()=>Ms,base64url:()=>Oo,bigint:()=>Ws,boolean:()=>Zs,browserEmail:()=>Hx,cidrv4:()=>zs,cidrv6:()=>Ns,cuid:()=>ys,cuid2:()=>Ss,date:()=>Ds,datetime:()=>Ps,domain:()=>Kx,duration:()=>Fs,e164:()=>As,email:()=>ws,emoji:()=>$s,extendedDuration:()=>Gx,guid:()=>ks,hex:()=>Qx,hostname:()=>js,html5Email:()=>Zx,idnEmail:()=>qx,integer:()=>Us,ipv4:()=>Es,ipv6:()=>Rs,ksuid:()=>Os,lowercase:()=>qs,md5_base64:()=>Yx,md5_base64url:()=>ey,md5_hex:()=>Xx,nanoid:()=>Is,null:()=>Vs,number:()=>Bs,rfc5322Email:()=>Vx,sha1_base64:()=>ry,sha1_base64url:()=>ny,sha1_hex:()=>ty,sha256_base64:()=>ay,sha256_base64url:()=>iy,sha256_hex:()=>oy,sha384_base64:()=>uy,sha384_base64url:()=>cy,sha384_hex:()=>sy,sha512_base64:()=>ly,sha512_base64url:()=>dy,sha512_hex:()=>py,string:()=>Gs,time:()=>Cs,ulid:()=>vs,undefined:()=>Ls,unicodeEmail:()=>Lx,uppercase:()=>Hs,uuid:()=>Wt,uuid4:()=>Wx,uuid6:()=>Ux,uuid7:()=>Bx,xid:()=>_s});var ys=/^[cC][^\s-]{8,}$/,Ss=/^[0-9a-z]+$/,vs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_s=/^[0-9a-vA-V]{20}$/,Os=/^[A-Za-z0-9]{27}$/,Is=/^[a-zA-Z0-9_-]{21}$/,Fs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gx=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ks=/^([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})$/,Wt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,Wx=Wt(4),Ux=Wt(6),Bx=Wt(7),ws=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Vx=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Lx=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,qx=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Hx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Jx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function $s(){return new RegExp(Jx,"u")}var Es=/^(?:(?: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])$/,Rs=/^(([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})$/,zs=/^((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])$/,Ns=/^(([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])$/,Ms=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Oo=/^[A-Za-z0-9_-]*$/,js=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Kx=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,As=/^\+(?:[0-9]){6,14}[0-9]$/,tf="(?:(?:\\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])))",Ds=new RegExp(`^${tf}$`);function rf(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cs(e){return new RegExp(`^${rf(e)}$`)}function Ps(e){let t=rf({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${tf}T(?:${o})$`)}var Gs=e=>{var n,o;let t=e?`[\\s\\S]{${(n=e==null?void 0:e.minimum)!=null?n:0},${(o=e==null?void 0:e.maximum)!=null?o:""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ws=/^\d+n?$/,Us=/^\d+$/,Bs=/^-?\d+(?:\.\d+)?/i,Zs=/true|false/i,Vs=/null/i;var Ls=/undefined/i;var qs=/^[^A-Z]*$/,Hs=/^[^a-z]*$/,Qx=/^[0-9a-fA-F]*$/;function Xr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Yr(e){return new RegExp(`^[A-Za-z0-9-_]{${e}}$`)}var Xx=/^[0-9a-fA-F]{32}$/,Yx=Xr(22,"=="),ey=Yr(22),ty=/^[0-9a-fA-F]{40}$/,ry=Xr(27,"="),ny=Yr(27),oy=/^[0-9a-fA-F]{64}$/,ay=Xr(43,"="),iy=Yr(43),sy=/^[0-9a-fA-F]{96}$/,uy=Xr(64,""),cy=Yr(64),py=/^[0-9a-fA-F]{128}$/,ly=Xr(86,"=="),dy=Yr(86);var pe=m("$ZodCheck",(e,t)=>{var o,r;var n;(o=e._zod)!=null||(e._zod={}),e._zod.def=t,(r=(n=e._zod).onattach)!=null||(n.onattach=[])}),of={number:"number",bigint:"bigint",object:"date"},Io=m("$ZodCheckLessThan",(e,t)=>{pe.init(e,t);let n=of[typeof t.value];e._zod.onattach.push(o=>{var u;let r=o._zod.bag,a=(u=t.inclusive?r.maximum:r.exclusiveMaximum)!=null?u:Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fo=m("$ZodCheckGreaterThan",(e,t)=>{pe.init(e,t);let n=of[typeof t.value];e._zod.onattach.push(o=>{var u;let r=o._zod.bag,a=(u=t.inclusive?r.minimum:r.exclusiveMinimum)!=null?u:Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Js=m("$ZodCheckMultipleOf",(e,t)=>{pe.init(e,t),e._zod.onattach.push(n=>{var r;var o;(r=(o=n._zod.bag).multipleOf)!=null||(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):cs(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ks=m("$ZodCheckNumberFormat",(e,t)=>{var u;pe.init(e,t),t.format=t.format||"float64";let n=(u=t.format)==null?void 0:u.includes("int"),o=n?"int":"number",[r,a]=ms[t.format];e._zod.onattach.push(p=>{let c=p._zod.bag;c.format=t.format,c.minimum=r,c.maximum=a,n&&(c.pattern=Us)}),e._zod.check=p=>{let c=p.value;if(n){if(!Number.isInteger(c)){p.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?p.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):p.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}c<r&&p.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>a&&p.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inst:e})}}),Qs=m("$ZodCheckBigIntFormat",(e,t)=>{pe.init(e,t);let[n,o]=hs[t.format];e._zod.onattach.push(r=>{let a=r._zod.bag;a.format=t.format,a.minimum=n,a.maximum=o}),e._zod.check=r=>{let a=r.value;a<n&&r.issues.push({origin:"bigint",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>o&&r.issues.push({origin:"bigint",input:a,code:"too_big",maximum:o,inst:e})}}),Xs=m("$ZodCheckMaxSize",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.size!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.maximum)!=null?u:Number.POSITIVE_INFINITY;t.maximum<a&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;a.size<=t.maximum||r.issues.push({origin:qr(a),code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Ys=m("$ZodCheckMinSize",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.size!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.minimum)!=null?u:Number.NEGATIVE_INFINITY;t.minimum>a&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;a.size>=t.minimum||r.issues.push({origin:qr(a),code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),eu=m("$ZodCheckSizeEquals",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.size!==void 0}),e._zod.onattach.push(r=>{let a=r._zod.bag;a.minimum=t.size,a.maximum=t.size,a.size=t.size}),e._zod.check=r=>{let a=r.value,u=a.size;if(u===t.size)return;let p=u>t.size;r.issues.push(v(l({origin:qr(a)},p?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size}),{inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort}))}}),tu=m("$ZodCheckMaxLength",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.maximum)!=null?u:Number.POSITIVE_INFINITY;t.maximum<a&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;if(a.length<=t.maximum)return;let p=Hr(a);r.issues.push({origin:p,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),ru=m("$ZodCheckMinLength",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{var u;let a=(u=r._zod.bag.minimum)!=null?u:Number.NEGATIVE_INFINITY;t.minimum>a&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;if(a.length>=t.minimum)return;let p=Hr(a);r.issues.push({origin:p,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),nu=m("$ZodCheckLengthEquals",(e,t)=>{var o;var n;pe.init(e,t),(o=(n=e._zod.def).when)!=null||(n.when=r=>{let a=r.value;return!_t(a)&&a.length!==void 0}),e._zod.onattach.push(r=>{let a=r._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=r=>{let a=r.value,u=a.length;if(u===t.length)return;let p=Hr(a),c=u>t.length;r.issues.push(v(l({origin:p},c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length}),{inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort}))}}),Sr=m("$ZodCheckStringFormat",(e,t)=>{var r,a;var n,o;pe.init(e,t),e._zod.onattach.push(u=>{var c;let p=u._zod.bag;p.format=t.format,t.pattern&&((c=p.patterns)!=null||(p.patterns=new Set),p.patterns.add(t.pattern))}),t.pattern?(r=(n=e._zod).check)!=null||(n.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push(v(l({origin:"string",code:"invalid_format",format:t.format,input:u.value},t.pattern?{pattern:t.pattern.toString()}:{}),{inst:e,continue:!t.abort}))}):(a=(o=e._zod).check)!=null||(o.check=()=>{})}),ou=m("$ZodCheckRegex",(e,t)=>{Sr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),au=m("$ZodCheckLowerCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=qs),Sr.init(e,t)}),iu=m("$ZodCheckUpperCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Hs),Sr.init(e,t)}),su=m("$ZodCheckIncludes",(e,t)=>{pe.init(e,t);let n=tt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{var u;let a=r._zod.bag;(u=a.patterns)!=null||(a.patterns=new Set),a.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),uu=m("$ZodCheckStartsWith",(e,t)=>{var o;pe.init(e,t);let n=new RegExp(`^${tt(t.prefix)}.*`);(o=t.pattern)!=null||(t.pattern=n),e._zod.onattach.push(r=>{var u;let a=r._zod.bag;(u=a.patterns)!=null||(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),cu=m("$ZodCheckEndsWith",(e,t)=>{var o;pe.init(e,t);let n=new RegExp(`.*${tt(t.suffix)}$`);(o=t.pattern)!=null||(t.pattern=n),e._zod.onattach.push(r=>{var u;let a=r._zod.bag;(u=a.patterns)!=null||(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function nf(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues))}var pu=m("$ZodCheckProperty",(e,t)=>{pe.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>nf(r,n,t.property));nf(o,n,t.property)}}),lu=m("$ZodCheckMimeType",(e,t)=>{pe.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),du=m("$ZodCheckOverwrite",(e,t)=>{pe.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var en=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
4
4
  `).filter(u=>u),r=Math.min(...o.map(u=>u.length-u.trimStart().length)),a=o.map(u=>u.slice(r)).map(u=>" ".repeat(this.indent*2)+u);for(let u of a)this.content.push(u)}compile(){var a;let t=Function,n=this==null?void 0:this.args,r=[...((a=this==null?void 0:this.content)!=null?a:[""]).map(u=>` ${u}`)];return new t(...n,r.join(`
5
5
  `))}};var fu={major:4,minor:1,patch:1};var A=m("$ZodType",(e,t)=>{var r,a,u;var n;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fu;let o=[...(r=e._zod.def.checks)!=null?r:[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let p of o)for(let c of p._zod.onattach)c(e);if(o.length===0)(a=(n=e._zod).deferred)!=null||(n.deferred=[]),(u=e._zod.deferred)==null||u.push(()=>{e._zod.run=e._zod.parse});else{let p=(i,d,g)=>{let h=kt(i),x;for(let z of d){if(z._zod.def.when){if(!z._zod.def.when(i))continue}else if(h)continue;let H=i.issues.length,N=z._zod.check(i);if(N instanceof Promise&&(g==null?void 0:g.async)===!1)throw new Qe;if(x||N instanceof Promise)x=(x!=null?x:Promise.resolve()).then(()=>Y(null,null,function*(){yield N,i.issues.length!==H&&(h||(h=kt(i,H)))}));else{if(i.issues.length===H)continue;h||(h=kt(i,H))}}return x?x.then(()=>i):i},c=(i,d,g)=>{if(kt(i))return i.aborted=!0,i;let h=p(d,o,g);if(h instanceof Promise){if(g.async===!1)throw new Qe;return h.then(x=>e._zod.parse(x,g))}return e._zod.parse(h,g)};e._zod.run=(i,d)=>{if(d.skipChecks)return e._zod.parse(i,d);if(d.direction==="backward"){let h=e._zod.parse({value:i.value,issues:[]},v(l({},d),{skipChecks:!0}));return h instanceof Promise?h.then(x=>c(x,i,d)):c(h,i,d)}let g=e._zod.parse(i,d);if(g instanceof Promise){if(d.async===!1)throw new Qe;return g.then(h=>p(h,o,d))}return p(g,o,d)}}e["~standard"]={validate:p=>{var c;try{let i=bs(e,p);return i.success?{value:i.data}:{issues:(c=i.error)==null?void 0:c.issues}}catch(i){return xs(e,p).then(d=>{var g;return d.success?{value:d.data}:{issues:(g=d.error)==null?void 0:g.issues}})}},vendor:"zod",version:1}}),Ut=m("$ZodString",(e,t)=>{var n,o,r;A.init(e,t),e._zod.pattern=(r=[...(o=(n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)!=null?o:[]].pop())!=null?r:Gs(e._zod.bag),e._zod.parse=(a,u)=>{if(t.coerce)try{a.value=String(a.value)}catch(p){}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),se=m("$ZodStringFormat",(e,t)=>{Sr.init(e,t),Ut.init(e,t)}),hu=m("$ZodGUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ks),se.init(e,t)}),gu=m("$ZodUUID",(e,t)=>{var n,o;if(t.version){let a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);(n=t.pattern)!=null||(t.pattern=Wt(a))}else(o=t.pattern)!=null||(t.pattern=Wt());se.init(e,t)}),Tu=m("$ZodEmail",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ws),se.init(e,t)}),bu=m("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=n=>{try{let o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:js.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),xu=m("$ZodEmoji",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=$s()),se.init(e,t)}),yu=m("$ZodNanoID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Is),se.init(e,t)}),Su=m("$ZodCUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ys),se.init(e,t)}),vu=m("$ZodCUID2",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ss),se.init(e,t)}),_u=m("$ZodULID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=vs),se.init(e,t)}),Ou=m("$ZodXID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=_s),se.init(e,t)}),Iu=m("$ZodKSUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Os),se.init(e,t)}),Fu=m("$ZodISODateTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ps(t)),se.init(e,t)}),ku=m("$ZodISODate",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ds),se.init(e,t)}),wu=m("$ZodISOTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Cs(t)),se.init(e,t)}),$u=m("$ZodISODuration",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Fs),se.init(e,t)}),Eu=m("$ZodIPv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Es),se.init(e,t),e._zod.onattach.push(o=>{let r=o._zod.bag;r.format="ipv4"})}),Ru=m("$ZodIPv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Rs),se.init(e,t),e._zod.onattach.push(o=>{let r=o._zod.bag;r.format="ipv6"}),e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch(r){o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),zu=m("$ZodCIDRv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=zs),se.init(e,t)}),Nu=m("$ZodCIDRv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ns),se.init(e,t),e._zod.check=o=>{let[r,a]=o.value.split("/");try{if(!a)throw new Error;let u=Number(a);if(`${u}`!==a)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${r}]`)}catch(u){o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Mu(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch(t){return!1}}var ju=m("$ZodBase64",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ms),se.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{Mu(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Tf(e){if(!Oo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Mu(n)}var Au=m("$ZodBase64URL",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Oo),se.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{Tf(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Du=m("$ZodE164",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=As),se.init(e,t)});function bf(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch(n){return!1}}var Cu=m("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=n=>{bf(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Pu=m("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),zo=m("$ZodNumber",(e,t)=>{var n;A.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)!=null?n:Bs,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Number(o.value)}catch(p){}let a=o.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return o;let u=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return o.issues.push(l({expected:"number",code:"invalid_type",input:a,inst:e},u?{received:u}:{})),o}}),Gu=m("$ZodNumber",(e,t)=>{Ks.init(e,t),zo.init(e,t)}),tn=m("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=Zs,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch(a){}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),No=m("$ZodBigInt",(e,t)=>{A.init(e,t),e._zod.pattern=Ws,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(r){}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Wu=m("$ZodBigInt",(e,t)=>{Qs.init(e,t),No.init(e,t)}),Uu=m("$ZodSymbol",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Bu=m("$ZodUndefined",(e,t)=>{A.init(e,t),e._zod.pattern=Ls,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="undefined"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),Zu=m("$ZodNull",(e,t)=>{A.init(e,t),e._zod.pattern=Vs,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Vu=m("$ZodAny",(e,t)=>{A.init(e,t),e._zod.parse=n=>n}),Lu=m("$ZodUnknown",(e,t)=>{A.init(e,t),e._zod.parse=n=>n}),qu=m("$ZodNever",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Hu=m("$ZodVoid",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="undefined"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),Ju=m("$ZodDate",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(p){}let r=n.value,a=r instanceof Date;return a&&!Number.isNaN(r.getTime())||n.issues.push(v(l({expected:"date",code:"invalid_type",input:r},a?{received:"Invalid Date"}:{}),{inst:e})),n}});function sf(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues)),t.value[n]=e.value}var Ku=m("$ZodArray",(e,t)=>{A.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let a=[];for(let u=0;u<r.length;u++){let p=r[u],c=t.element._zod.run({value:p,issues:[]},o);c instanceof Promise?a.push(c.then(i=>sf(i,n,u))):sf(c,n,u)}return a.length?Promise.all(a).then(()=>n):n}});function Ro(e,t,n,o){e.issues.length&&t.issues.push(...Pe(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function xf(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape[o]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=fs(e.shape);return v(l({},e),{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)})}function yf(e,t,n,o,r,a){let u=[],p=r.keySet,c=r.catchall._zod,i=c.def.type;for(let d of Object.keys(t)){if(p.has(d))continue;if(i==="never"){u.push(d);continue}let g=c.run({value:t[d],issues:[]},o);g instanceof Promise?e.push(g.then(h=>Ro(h,n,d,t))):Ro(g,n,d,t)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Sf=m("$ZodObject",(e,t)=>{A.init(e,t);let n=hr(()=>xf(t));J(e._zod,"propValues",()=>{var c;let u=t.shape,p={};for(let i in u){let d=u[i]._zod;if(d.values){(c=p[i])!=null||(p[i]=new Set);for(let g of d.values)p[i].add(g)}}return p});let o=Gt,r=t.catchall,a;e._zod.parse=(u,p)=>{a!=null||(a=n.value);let c=u.value;if(!o(c))return u.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),u;u.value={};let i=[],d=a.shape;for(let g of a.keys){let x=d[g]._zod.run({value:c[g],issues:[]},p);x instanceof Promise?i.push(x.then(z=>Ro(z,u,g,c))):Ro(x,u,g,c)}return r?yf(i,c,u,p,n.value,e):i.length?Promise.all(i).then(()=>u):u}}),Qu=m("$ZodObjectJIT",(e,t)=>{Sf.init(e,t);let n=e._zod.parse,o=hr(()=>xf(t)),r=h=>{let x=new en(["shape","payload","ctx"]),z=o.value,H=y=>{let S=lo(y);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};x.write("const input = payload.value;");let N=Object.create(null),D=0;for(let y of z.keys)N[y]=`key_${D++}`;x.write("const newResult = {}");for(let y of z.keys){let S=N[y],F=lo(y);x.write(`const ${S} = ${H(y)};`),x.write(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wapi-client",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "description": "Client library to to access WAPI ledgering services",
5
5
  "main": "dist/wapi-client.cjs",
6
6
  "module": "dist/wapi-client.js",