@solidtime/api 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7116 -0
- package/dist/openapi.json.client.d.ts +14794 -0
- package/dist/solidtime-api.js +7048 -0
- package/dist/solidtime-api.umd.cjs +14 -0
- package/package.json +7 -4
- package/dist/index.js +0 -14246
- package/dist/package.json +0 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(function(le,he){typeof exports=="object"&&typeof module<"u"?he(exports):typeof define=="function"&&define.amd?define(["exports"],he):(le=typeof globalThis<"u"?globalThis:le||self,he(le.SolidtimeApi={}))})(this,function(le){"use strict";function he(s,e){return function(){return s.apply(e,arguments)}}const{toString:$s}=Object.prototype,{getPrototypeOf:dt}=Object,Be=(s=>e=>{const r=$s.call(e);return s[r]||(s[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),M=s=>(s=s.toLowerCase(),e=>Be(e)===s),Fe=s=>e=>typeof e===s,{isArray:pe}=Array,je=Fe("undefined");function Vs(s){return s!==null&&!je(s)&&s.constructor!==null&&!je(s.constructor)&&U(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const Zt=M("ArrayBuffer");function Hs(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&Zt(s.buffer),e}const Ws=Fe("string"),U=Fe("function"),qt=Fe("number"),$e=s=>s!==null&&typeof s=="object",Qs=s=>s===!0||s===!1,Ve=s=>{if(Be(s)!=="object")return!1;const e=dt(s);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},Js=M("Date"),Ks=M("File"),Gs=M("Blob"),Xs=M("FileList"),Ys=s=>$e(s)&&U(s.pipe),er=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||U(s.append)&&((e=Be(s))==="formdata"||e==="object"&&U(s.toString)&&s.toString()==="[object FormData]"))},tr=M("URLSearchParams"),[sr,rr,nr,ar]=["ReadableStream","Request","Response","Headers"].map(M),ir=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function we(s,e,{allOwnKeys:r=!1}={}){if(s===null||typeof s>"u")return;let n,a;if(typeof s!="object"&&(s=[s]),pe(s))for(n=0,a=s.length;n<a;n++)e.call(null,s[n],n,s);else{const i=r?Object.getOwnPropertyNames(s):Object.keys(s),o=i.length;let c;for(n=0;n<o;n++)c=i[n],e.call(null,s[c],c,s)}}function Mt(s,e){e=e.toLowerCase();const r=Object.keys(s);let n=r.length,a;for(;n-- >0;)if(a=r[n],e===a.toLowerCase())return a;return null}const ne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Lt=s=>!je(s)&&s!==ne;function lt(){const{caseless:s}=Lt(this)&&this||{},e={},r=(n,a)=>{const i=s&&Mt(e,a)||a;Ve(e[i])&&Ve(n)?e[i]=lt(e[i],n):Ve(n)?e[i]=lt({},n):pe(n)?e[i]=n.slice():e[i]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&we(arguments[n],r);return e}const or=(s,e,r,{allOwnKeys:n}={})=>(we(e,(a,i)=>{r&&U(a)?s[i]=he(a,r):s[i]=a},{allOwnKeys:n}),s),cr=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),ur=(s,e,r,n)=>{s.prototype=Object.create(e.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),r&&Object.assign(s.prototype,r)},dr=(s,e,r,n)=>{let a,i,o;const c={};if(e=e||{},s==null)return e;do{for(a=Object.getOwnPropertyNames(s),i=a.length;i-- >0;)o=a[i],(!n||n(o,s,e))&&!c[o]&&(e[o]=s[o],c[o]=!0);s=r!==!1&&dt(s)}while(s&&(!r||r(s,e))&&s!==Object.prototype);return e},lr=(s,e,r)=>{s=String(s),(r===void 0||r>s.length)&&(r=s.length),r-=e.length;const n=s.indexOf(e,r);return n!==-1&&n===r},hr=s=>{if(!s)return null;if(pe(s))return s;let e=s.length;if(!qt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=s[e];return r},pr=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&dt(Uint8Array)),mr=(s,e)=>{const n=(s&&s[Symbol.iterator]).call(s);let a;for(;(a=n.next())&&!a.done;){const i=a.value;e.call(s,i[0],i[1])}},fr=(s,e)=>{let r;const n=[];for(;(r=s.exec(e))!==null;)n.push(r);return n},gr=M("HTMLFormElement"),yr=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),Dt=(({hasOwnProperty:s})=>(e,r)=>s.call(e,r))(Object.prototype),br=M("RegExp"),Bt=(s,e)=>{const r=Object.getOwnPropertyDescriptors(s),n={};we(r,(a,i)=>{let o;(o=e(a,i,s))!==!1&&(n[i]=o||a)}),Object.defineProperties(s,n)},_r=s=>{Bt(s,(e,r)=>{if(U(s)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=s[r];if(U(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},vr=(s,e)=>{const r={},n=a=>{a.forEach(i=>{r[i]=!0})};return pe(s)?n(s):n(String(s).split(e)),r},jr=()=>{},wr=(s,e)=>s!=null&&Number.isFinite(s=+s)?s:e,ht="abcdefghijklmnopqrstuvwxyz",Ft="0123456789",$t={DIGIT:Ft,ALPHA:ht,ALPHA_DIGIT:ht+ht.toUpperCase()+Ft},xr=(s=16,e=$t.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;s--;)r+=e[Math.random()*n|0];return r};function kr(s){return!!(s&&U(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const Tr=s=>{const e=new Array(10),r=(n,a)=>{if($e(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[a]=n;const i=pe(n)?[]:{};return we(n,(o,c)=>{const d=r(o,a+1);!je(d)&&(i[c]=d)}),e[a]=void 0,i}}return n};return r(s,0)},Er=M("AsyncFunction"),Rr=s=>s&&($e(s)||U(s))&&U(s.then)&&U(s.catch),Vt=((s,e)=>s?setImmediate:e?((r,n)=>(ne.addEventListener("message",({source:a,data:i})=>{a===ne&&i===r&&n.length&&n.shift()()},!1),a=>{n.push(a),ne.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",U(ne.postMessage)),Sr=typeof queueMicrotask<"u"?queueMicrotask.bind(ne):typeof process<"u"&&process.nextTick||Vt,l={isArray:pe,isArrayBuffer:Zt,isBuffer:Vs,isFormData:er,isArrayBufferView:Hs,isString:Ws,isNumber:qt,isBoolean:Qs,isObject:$e,isPlainObject:Ve,isReadableStream:sr,isRequest:rr,isResponse:nr,isHeaders:ar,isUndefined:je,isDate:Js,isFile:Ks,isBlob:Gs,isRegExp:br,isFunction:U,isStream:Ys,isURLSearchParams:tr,isTypedArray:pr,isFileList:Xs,forEach:we,merge:lt,extend:or,trim:ir,stripBOM:cr,inherits:ur,toFlatObject:dr,kindOf:Be,kindOfTest:M,endsWith:lr,toArray:hr,forEachEntry:mr,matchAll:fr,isHTMLForm:gr,hasOwnProperty:Dt,hasOwnProp:Dt,reduceDescriptors:Bt,freezeMethods:_r,toObjectSet:vr,toCamelCase:yr,noop:jr,toFiniteNumber:wr,findKey:Mt,global:ne,isContextDefined:Lt,ALPHABET:$t,generateString:xr,isSpecCompliantForm:kr,toJSONObject:Tr,isAsyncFn:Er,isThenable:Rr,setImmediate:Vt,asap:Sr};function x(s,e,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a)}l.inherits(x,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ht=x.prototype,Wt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{Wt[s]={value:s}}),Object.defineProperties(x,Wt),Object.defineProperty(Ht,"isAxiosError",{value:!0}),x.from=(s,e,r,n,a,i)=>{const o=Object.create(Ht);return l.toFlatObject(s,o,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),x.call(o,s.message,e,r,n,a),o.cause=s,o.name=s.name,i&&Object.assign(o,i),o};const Ar=null;function pt(s){return l.isPlainObject(s)||l.isArray(s)}function Qt(s){return l.endsWith(s,"[]")?s.slice(0,-2):s}function Jt(s,e,r){return s?s.concat(e).map(function(a,i){return a=Qt(a),!r&&i?"["+a+"]":a}).join(r?".":""):e}function Or(s){return l.isArray(s)&&!s.some(pt)}const Pr=l.toFlatObject(l,{},null,function(e){return/^is[A-Z]/.test(e)});function He(s,e,r){if(!l.isObject(s))throw new TypeError("target must be an object");e=e||new FormData,r=l.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,y){return!l.isUndefined(y[E])});const n=r.metaTokens,a=r.visitor||h,i=r.dots,o=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(e);if(!l.isFunction(a))throw new TypeError("visitor must be a function");function u(_){if(_===null)return"";if(l.isDate(_))return _.toISOString();if(!d&&l.isBlob(_))throw new x("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(_)||l.isTypedArray(_)?d&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function h(_,E,y){let I=_;if(_&&!y&&typeof _=="object"){if(l.endsWith(E,"{}"))E=n?E:E.slice(0,-2),_=JSON.stringify(_);else if(l.isArray(_)&&Or(_)||(l.isFileList(_)||l.endsWith(E,"[]"))&&(I=l.toArray(_)))return E=Qt(E),I.forEach(function(S,$){!(l.isUndefined(S)||S===null)&&e.append(o===!0?Jt([E],$,i):o===null?E:E+"[]",u(S))}),!1}return pt(_)?!0:(e.append(Jt(y,E,i),u(_)),!1)}const m=[],w=Object.assign(Pr,{defaultVisitor:h,convertValue:u,isVisitable:pt});function A(_,E){if(!l.isUndefined(_)){if(m.indexOf(_)!==-1)throw Error("Circular reference detected in "+E.join("."));m.push(_),l.forEach(_,function(I,q){(!(l.isUndefined(I)||I===null)&&a.call(e,I,l.isString(q)?q.trim():q,E,w))===!0&&A(I,E?E.concat(q):[q])}),m.pop()}}if(!l.isObject(s))throw new TypeError("data must be an object");return A(s),e}function Kt(s){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function mt(s,e){this._pairs=[],s&&He(s,this,e)}const Gt=mt.prototype;Gt.append=function(e,r){this._pairs.push([e,r])},Gt.toString=function(e){const r=e?function(n){return e.call(this,n,Kt)}:Kt;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function Nr(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Xt(s,e,r){if(!e)return s;const n=r&&r.encode||Nr,a=r&&r.serialize;let i;if(a?i=a(e,r):i=l.isURLSearchParams(e)?e.toString():new mt(e,r).toString(n),i){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+i}return s}class Yt{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){l.forEach(this.handlers,function(n){n!==null&&e(n)})}}const es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:mt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ft=typeof window<"u"&&typeof document<"u",zr=(s=>ft&&["ReactNative","NativeScript","NS"].indexOf(s)<0)(typeof navigator<"u"&&navigator.product),Ir=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ur=ft&&window.location.href||"http://localhost",L={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ft,hasStandardBrowserEnv:zr,hasStandardBrowserWebWorkerEnv:Ir,origin:Ur},Symbol.toStringTag,{value:"Module"})),...Cr};function Zr(s,e){return He(s,new L.classes.URLSearchParams,Object.assign({visitor:function(r,n,a,i){return L.isNode&&l.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function qr(s){return l.matchAll(/\w+|\[(\w*)]/g,s).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Mr(s){const e={},r=Object.keys(s);let n;const a=r.length;let i;for(n=0;n<a;n++)i=r[n],e[i]=s[i];return e}function ts(s){function e(r,n,a,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),d=i>=r.length;return o=!o&&l.isArray(a)?a.length:o,d?(l.hasOwnProp(a,o)?a[o]=[a[o],n]:a[o]=n,!c):((!a[o]||!l.isObject(a[o]))&&(a[o]=[]),e(r,n,a[o],i)&&l.isArray(a[o])&&(a[o]=Mr(a[o])),!c)}if(l.isFormData(s)&&l.isFunction(s.entries)){const r={};return l.forEachEntry(s,(n,a)=>{e(qr(n),a,r,0)}),r}return null}function Lr(s,e,r){if(l.isString(s))try{return(e||JSON.parse)(s),l.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(s)}const xe={transitional:es,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",a=n.indexOf("application/json")>-1,i=l.isObject(e);if(i&&l.isHTMLForm(e)&&(e=new FormData(e)),l.isFormData(e))return a?JSON.stringify(ts(e)):e;if(l.isArrayBuffer(e)||l.isBuffer(e)||l.isStream(e)||l.isFile(e)||l.isBlob(e)||l.isReadableStream(e))return e;if(l.isArrayBufferView(e))return e.buffer;if(l.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Zr(e,this.formSerializer).toString();if((c=l.isFileList(e))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return He(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||a?(r.setContentType("application/json",!1),Lr(e)):e}],transformResponse:[function(e){const r=this.transitional||xe.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(l.isResponse(e)||l.isReadableStream(e))return e;if(e&&l.isString(e)&&(n&&!this.responseType||a)){const o=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(e)}catch(c){if(o)throw c.name==="SyntaxError"?x.from(c,x.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:L.classes.FormData,Blob:L.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],s=>{xe.headers[s]={}});const Dr=l.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Br=s=>{const e={};let r,n,a;return s&&s.split(`
|
|
2
|
+
`).forEach(function(o){a=o.indexOf(":"),r=o.substring(0,a).trim().toLowerCase(),n=o.substring(a+1).trim(),!(!r||e[r]&&Dr[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},ss=Symbol("internals");function ke(s){return s&&String(s).trim().toLowerCase()}function We(s){return s===!1||s==null?s:l.isArray(s)?s.map(We):String(s)}function Fr(s){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(s);)e[n[1]]=n[2];return e}const $r=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function gt(s,e,r,n,a){if(l.isFunction(n))return n.call(this,e,r);if(a&&(e=r),!!l.isString(e)){if(l.isString(n))return e.indexOf(n)!==-1;if(l.isRegExp(n))return n.test(e)}}function Vr(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Hr(s,e){const r=l.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+r,{value:function(a,i,o){return this[n].call(this,e,a,i,o)},configurable:!0})})}class z{constructor(e){e&&this.set(e)}set(e,r,n){const a=this;function i(c,d,u){const h=ke(d);if(!h)throw new Error("header name must be a non-empty string");const m=l.findKey(a,h);(!m||a[m]===void 0||u===!0||u===void 0&&a[m]!==!1)&&(a[m||d]=We(c))}const o=(c,d)=>l.forEach(c,(u,h)=>i(u,h,d));if(l.isPlainObject(e)||e instanceof this.constructor)o(e,r);else if(l.isString(e)&&(e=e.trim())&&!$r(e))o(Br(e),r);else if(l.isHeaders(e))for(const[c,d]of e.entries())i(d,c,n);else e!=null&&i(r,e,n);return this}get(e,r){if(e=ke(e),e){const n=l.findKey(this,e);if(n){const a=this[n];if(!r)return a;if(r===!0)return Fr(a);if(l.isFunction(r))return r.call(this,a,n);if(l.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=ke(e),e){const n=l.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||gt(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let a=!1;function i(o){if(o=ke(o),o){const c=l.findKey(n,o);c&&(!r||gt(n,n[c],c,r))&&(delete n[c],a=!0)}}return l.isArray(e)?e.forEach(i):i(e),a}clear(e){const r=Object.keys(this);let n=r.length,a=!1;for(;n--;){const i=r[n];(!e||gt(this,this[i],i,e,!0))&&(delete this[i],a=!0)}return a}normalize(e){const r=this,n={};return l.forEach(this,(a,i)=>{const o=l.findKey(n,i);if(o){r[o]=We(a),delete r[i];return}const c=e?Vr(i):String(i).trim();c!==i&&delete r[i],r[c]=We(a),n[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return l.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=e&&l.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
3
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(a=>n.set(a)),n}static accessor(e){const n=(this[ss]=this[ss]={accessors:{}}).accessors,a=this.prototype;function i(o){const c=ke(o);n[c]||(Hr(a,o),n[c]=!0)}return l.isArray(e)?e.forEach(i):i(e),this}}z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l.reduceDescriptors(z.prototype,({value:s},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(n){this[r]=n}}}),l.freezeMethods(z);function yt(s,e){const r=this||xe,n=e||r,a=z.from(n.headers);let i=n.data;return l.forEach(s,function(c){i=c.call(r,i,a.normalize(),e?e.status:void 0)}),a.normalize(),i}function rs(s){return!!(s&&s.__CANCEL__)}function me(s,e,r){x.call(this,s??"canceled",x.ERR_CANCELED,e,r),this.name="CanceledError"}l.inherits(me,x,{__CANCEL__:!0});function ns(s,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?s(r):e(new x("Request failed with status code "+r.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Wr(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function Qr(s,e){s=s||10;const r=new Array(s),n=new Array(s);let a=0,i=0,o;return e=e!==void 0?e:1e3,function(d){const u=Date.now(),h=n[i];o||(o=u),r[a]=d,n[a]=u;let m=i,w=0;for(;m!==a;)w+=r[m++],m=m%s;if(a=(a+1)%s,a===i&&(i=(i+1)%s),u-o<e)return;const A=h&&u-h;return A?Math.round(w*1e3/A):void 0}}function Jr(s,e){let r=0,n=1e3/e,a,i;const o=(u,h=Date.now())=>{r=h,a=null,i&&(clearTimeout(i),i=null),s.apply(null,u)};return[(...u)=>{const h=Date.now(),m=h-r;m>=n?o(u,h):(a=u,i||(i=setTimeout(()=>{i=null,o(a)},n-m)))},()=>a&&o(a)]}const Qe=(s,e,r=3)=>{let n=0;const a=Qr(50,250);return Jr(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,d=o-n,u=a(d),h=o<=c;n=o;const m={loaded:o,total:c,progress:c?o/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&h?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};s(m)},r)},as=(s,e)=>{const r=s!=null;return[n=>e[0]({lengthComputable:r,total:s,loaded:n}),e[1]]},is=s=>(...e)=>l.asap(()=>s(...e)),Kr=L.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function a(i){let o=i;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=a(window.location.href),function(o){const c=l.isString(o)?a(o):o;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}(),Gr=L.hasStandardBrowserEnv?{write(s,e,r,n,a,i){const o=[s+"="+encodeURIComponent(e)];l.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),l.isString(n)&&o.push("path="+n),l.isString(a)&&o.push("domain="+a),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const e=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Xr(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Yr(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function os(s,e){return s&&!Xr(e)?Yr(s,e):e}const cs=s=>s instanceof z?{...s}:s;function ae(s,e){e=e||{};const r={};function n(u,h,m){return l.isPlainObject(u)&&l.isPlainObject(h)?l.merge.call({caseless:m},u,h):l.isPlainObject(h)?l.merge({},h):l.isArray(h)?h.slice():h}function a(u,h,m){if(l.isUndefined(h)){if(!l.isUndefined(u))return n(void 0,u,m)}else return n(u,h,m)}function i(u,h){if(!l.isUndefined(h))return n(void 0,h)}function o(u,h){if(l.isUndefined(h)){if(!l.isUndefined(u))return n(void 0,u)}else return n(void 0,h)}function c(u,h,m){if(m in e)return n(u,h);if(m in s)return n(void 0,u)}const d={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,h)=>a(cs(u),cs(h),!0)};return l.forEach(Object.keys(Object.assign({},s,e)),function(h){const m=d[h]||a,w=m(s[h],e[h],h);l.isUndefined(w)&&m!==c||(r[h]=w)}),r}const us=s=>{const e=ae({},s);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:c}=e;e.headers=o=z.from(o),e.url=Xt(os(e.baseURL,e.url),s.params,s.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(l.isFormData(r)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((d=o.getContentType())!==!1){const[u,...h]=d?d.split(";").map(m=>m.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...h].join("; "))}}if(L.hasStandardBrowserEnv&&(n&&l.isFunction(n)&&(n=n(e)),n||n!==!1&&Kr(e.url))){const u=a&&i&&Gr.read(i);u&&o.set(a,u)}return e},en=typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(r,n){const a=us(s);let i=a.data;const o=z.from(a.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=a,h,m,w,A,_;function E(){A&&A(),_&&_(),a.cancelToken&&a.cancelToken.unsubscribe(h),a.signal&&a.signal.removeEventListener("abort",h)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function I(){if(!y)return;const S=z.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),de={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:s,request:y};ns(function(J){r(J),E()},function(J){n(J),E()},de),y=null}"onloadend"in y?y.onloadend=I:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(I)},y.onabort=function(){y&&(n(new x("Request aborted",x.ECONNABORTED,s,y)),y=null)},y.onerror=function(){n(new x("Network Error",x.ERR_NETWORK,s,y)),y=null},y.ontimeout=function(){let $=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const de=a.transitional||es;a.timeoutErrorMessage&&($=a.timeoutErrorMessage),n(new x($,de.clarifyTimeoutError?x.ETIMEDOUT:x.ECONNABORTED,s,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&l.forEach(o.toJSON(),function($,de){y.setRequestHeader(de,$)}),l.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),c&&c!=="json"&&(y.responseType=a.responseType),u&&([w,_]=Qe(u,!0),y.addEventListener("progress",w)),d&&y.upload&&([m,A]=Qe(d),y.upload.addEventListener("progress",m),y.upload.addEventListener("loadend",A)),(a.cancelToken||a.signal)&&(h=S=>{y&&(n(!S||S.type?new me(null,s,y):S),y.abort(),y=null)},a.cancelToken&&a.cancelToken.subscribe(h),a.signal&&(a.signal.aborted?h():a.signal.addEventListener("abort",h)));const q=Wr(a.url);if(q&&L.protocols.indexOf(q)===-1){n(new x("Unsupported protocol "+q+":",x.ERR_BAD_REQUEST,s));return}y.send(i||null)})},tn=(s,e)=>{let r=new AbortController,n;const a=function(d){if(!n){n=!0,o();const u=d instanceof Error?d:this.reason;r.abort(u instanceof x?u:new me(u instanceof Error?u.message:u))}};let i=e&&setTimeout(()=>{a(new x(`timeout ${e} of ms exceeded`,x.ETIMEDOUT))},e);const o=()=>{s&&(i&&clearTimeout(i),i=null,s.forEach(d=>{d&&(d.removeEventListener?d.removeEventListener("abort",a):d.unsubscribe(a))}),s=null)};s.forEach(d=>d&&d.addEventListener&&d.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=o,[c,()=>{i&&clearTimeout(i),i=null}]},sn=function*(s,e){let r=s.byteLength;if(!e||r<e){yield s;return}let n=0,a;for(;n<r;)a=n+e,yield s.slice(n,a),n=a},rn=async function*(s,e,r){for await(const n of s)yield*sn(ArrayBuffer.isView(n)?n:await r(String(n)),e)},ds=(s,e,r,n,a)=>{const i=rn(s,e,a);let o=0,c,d=u=>{c||(c=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:h,value:m}=await i.next();if(h){d(),u.close();return}let w=m.byteLength;if(r){let A=o+=w;r(A)}u.enqueue(new Uint8Array(m))}catch(h){throw d(h),h}},cancel(u){return d(u),i.return()}},{highWaterMark:2})},Je=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ls=Je&&typeof ReadableStream=="function",bt=Je&&(typeof TextEncoder=="function"?(s=>e=>s.encode(e))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),hs=(s,...e)=>{try{return!!s(...e)}catch{return!1}},nn=ls&&hs(()=>{let s=!1;const e=new Request(L.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!e}),ps=64*1024,_t=ls&&hs(()=>l.isReadableStream(new Response("").body)),Ke={stream:_t&&(s=>s.body)};Je&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ke[e]&&(Ke[e]=l.isFunction(s[e])?r=>r[e]():(r,n)=>{throw new x(`Response type '${e}' is not supported`,x.ERR_NOT_SUPPORT,n)})})})(new Response);const an=async s=>{if(s==null)return 0;if(l.isBlob(s))return s.size;if(l.isSpecCompliantForm(s))return(await new Request(s).arrayBuffer()).byteLength;if(l.isArrayBufferView(s)||l.isArrayBuffer(s))return s.byteLength;if(l.isURLSearchParams(s)&&(s=s+""),l.isString(s))return(await bt(s)).byteLength},on=async(s,e)=>{const r=l.toFiniteNumber(s.getContentLength());return r??an(e)},vt={http:Ar,xhr:en,fetch:Je&&(async s=>{let{url:e,method:r,data:n,signal:a,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:d,responseType:u,headers:h,withCredentials:m="same-origin",fetchOptions:w}=us(s);u=u?(u+"").toLowerCase():"text";let[A,_]=a||i||o?tn([a,i],o):[],E,y;const I=()=>{!E&&setTimeout(()=>{A&&A.unsubscribe()}),E=!0};let q;try{if(d&&nn&&r!=="get"&&r!=="head"&&(q=await on(h,n))!==0){let Q=new Request(e,{method:"POST",body:n,duplex:"half"}),J;if(l.isFormData(n)&&(J=Q.headers.get("content-type"))&&h.setContentType(J),Q.body){const[Ut,ut]=as(q,Qe(is(d)));n=ds(Q.body,ps,Ut,ut,bt)}}l.isString(m)||(m=m?"include":"omit"),y=new Request(e,{...w,signal:A,method:r.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:m});let S=await fetch(y);const $=_t&&(u==="stream"||u==="response");if(_t&&(c||$)){const Q={};["status","statusText","headers"].forEach(Fs=>{Q[Fs]=S[Fs]});const J=l.toFiniteNumber(S.headers.get("content-length")),[Ut,ut]=c&&as(J,Qe(is(c),!0))||[];S=new Response(ds(S.body,ps,Ut,()=>{ut&&ut(),$&&I()},bt),Q)}u=u||"text";let de=await Ke[l.findKey(Ke,u)||"text"](S,s);return!$&&I(),_&&_(),await new Promise((Q,J)=>{ns(Q,J,{data:de,headers:z.from(S.headers),status:S.status,statusText:S.statusText,config:s,request:y})})}catch(S){throw I(),S&&S.name==="TypeError"&&/fetch/i.test(S.message)?Object.assign(new x("Network Error",x.ERR_NETWORK,s,y),{cause:S.cause||S}):x.from(S,S&&S.code,s,y)}})};l.forEach(vt,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e})}catch{}Object.defineProperty(s,"adapterName",{value:e})}});const ms=s=>`- ${s}`,cn=s=>l.isFunction(s)||s===null||s===!1,fs={getAdapter:s=>{s=l.isArray(s)?s:[s];const{length:e}=s;let r,n;const a={};for(let i=0;i<e;i++){r=s[i];let o;if(n=r,!cn(r)&&(n=vt[(o=String(r)).toLowerCase()],n===void 0))throw new x(`Unknown adapter '${o}'`);if(n)break;a[o||"#"+i]=n}if(!n){const i=Object.entries(a).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
|
|
4
|
+
`+i.map(ms).join(`
|
|
5
|
+
`):" "+ms(i[0]):"as no adapter specified";throw new x("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:vt};function jt(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new me(null,s)}function gs(s){return jt(s),s.headers=z.from(s.headers),s.data=yt.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),fs.getAdapter(s.adapter||xe.adapter)(s).then(function(n){return jt(s),n.data=yt.call(s,s.transformResponse,n),n.headers=z.from(n.headers),n},function(n){return rs(n)||(jt(s),n&&n.response&&(n.response.data=yt.call(s,s.transformResponse,n.response),n.response.headers=z.from(n.response.headers))),Promise.reject(n)})}const ys="1.7.4",wt={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{wt[s]=function(n){return typeof n===s||"a"+(e<1?"n ":" ")+s}});const bs={};wt.transitional=function(e,r,n){function a(i,o){return"[Axios v"+ys+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,c)=>{if(e===!1)throw new x(a(o," has been removed"+(r?" in "+r:"")),x.ERR_DEPRECATED);return r&&!bs[o]&&(bs[o]=!0,console.warn(a(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,o,c):!0}};function un(s,e,r){if(typeof s!="object")throw new x("options must be an object",x.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let a=n.length;for(;a-- >0;){const i=n[a],o=e[i];if(o){const c=s[i],d=c===void 0||o(c,i,s);if(d!==!0)throw new x("option "+i+" must be "+d,x.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new x("Unknown option "+i,x.ERR_BAD_OPTION)}}const xt={assertOptions:un,validators:wt},X=xt.validators;class ie{constructor(e){this.defaults=e,this.interceptors={request:new Yt,response:new Yt}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let a;Error.captureStackTrace?Error.captureStackTrace(a={}):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ae(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&xt.assertOptions(n,{silentJSONParsing:X.transitional(X.boolean),forcedJSONParsing:X.transitional(X.boolean),clarifyTimeoutError:X.transitional(X.boolean)},!1),a!=null&&(l.isFunction(a)?r.paramsSerializer={serialize:a}:xt.assertOptions(a,{encode:X.function,serialize:X.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&l.merge(i.common,i[r.method]);i&&l.forEach(["delete","get","head","post","put","patch","common"],_=>{delete i[_]}),r.headers=z.concat(o,i);const c=[];let d=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(r)===!1||(d=d&&E.synchronous,c.unshift(E.fulfilled,E.rejected))});const u=[];this.interceptors.response.forEach(function(E){u.push(E.fulfilled,E.rejected)});let h,m=0,w;if(!d){const _=[gs.bind(this),void 0];for(_.unshift.apply(_,c),_.push.apply(_,u),w=_.length,h=Promise.resolve(r);m<w;)h=h.then(_[m++],_[m++]);return h}w=c.length;let A=r;for(m=0;m<w;){const _=c[m++],E=c[m++];try{A=_(A)}catch(y){E.call(this,y);break}}try{h=gs.call(this,A)}catch(_){return Promise.reject(_)}for(m=0,w=u.length;m<w;)h=h.then(u[m++],u[m++]);return h}getUri(e){e=ae(this.defaults,e);const r=os(e.baseURL,e.url);return Xt(r,e.params,e.paramsSerializer)}}l.forEach(["delete","get","head","options"],function(e){ie.prototype[e]=function(r,n){return this.request(ae(n||{},{method:e,url:r,data:(n||{}).data}))}}),l.forEach(["post","put","patch"],function(e){function r(n){return function(i,o,c){return this.request(ae(c||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}ie.prototype[e]=r(),ie.prototype[e+"Form"]=r(!0)});class kt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(a=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(a);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,c){n.reason||(n.reason=new me(i,o,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new kt(function(a){e=a}),cancel:e}}}function dn(s){return function(r){return s.apply(null,r)}}function ln(s){return l.isObject(s)&&s.isAxiosError===!0}const Tt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tt).forEach(([s,e])=>{Tt[e]=s});function _s(s){const e=new ie(s),r=he(ie.prototype.request,e);return l.extend(r,ie.prototype,e,{allOwnKeys:!0}),l.extend(r,e,null,{allOwnKeys:!0}),r.create=function(a){return _s(ae(s,a))},r}const P=_s(xe);P.Axios=ie,P.CanceledError=me,P.CancelToken=kt,P.isCancel=rs,P.VERSION=ys,P.toFormData=He,P.AxiosError=x,P.Cancel=P.CanceledError,P.all=function(e){return Promise.all(e)},P.spread=dn,P.isAxiosError=ln,P.mergeConfig=ae,P.AxiosHeaders=z,P.formToJSON=s=>ts(l.isHTMLForm(s)?new FormData(s):s),P.getAdapter=fs.getAdapter,P.HttpStatusCode=Tt,P.default=P;var R;(function(s){s.assertEqual=a=>a;function e(a){}s.assertIs=e;function r(a){throw new Error}s.assertNever=r,s.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},s.getValidEnumValues=a=>{const i=s.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),o={};for(const c of i)o[c]=a[c];return s.objectValues(o)},s.objectValues=a=>s.objectKeys(a).map(function(i){return a[i]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},s.find=(a,i)=>{for(const o of a)if(i(o))return o},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}s.joinValues=n,s.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(R||(R={}));var Et;(function(s){s.mergeShapes=(e,r)=>({...e,...r})})(Et||(Et={}));const g=R.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Y=s=>{switch(typeof s){case"undefined":return g.undefined;case"string":return g.string;case"number":return isNaN(s)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":return Array.isArray(s)?g.array:s===null?g.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?g.promise:typeof Map<"u"&&s instanceof Map?g.map:typeof Set<"u"&&s instanceof Set?g.set:typeof Date<"u"&&s instanceof Date?g.date:g.object;default:return g.unknown}},p=R.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hn=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:");class Z extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let c=n,d=0;for(;d<o.path.length;){const u=o.path[d];d===o.path.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(r(o))):c[u]=c[u]||{_errors:[]},c=c[u],d++}}};return a(this),n}static assert(e){if(!(e instanceof Z))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,R.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Z.create=s=>new Z(s);const fe=(s,e)=>{let r;switch(s.code){case p.invalid_type:s.received===g.undefined?r="Required":r=`Expected ${s.expected}, received ${s.received}`;break;case p.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(s.expected,R.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:r=`Unrecognized key(s) in object: ${R.joinValues(s.keys,", ")}`;break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${R.joinValues(s.options)}`;break;case p.invalid_enum_value:r=`Invalid enum value. Expected ${R.joinValues(s.options)}, received '${s.received}'`;break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(r=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?r=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?r=`Invalid input: must end with "${s.validation.endsWith}"`:R.assertNever(s.validation):s.validation!=="regex"?r=`Invalid ${s.validation}`:r="Invalid";break;case p.too_small:s.type==="array"?r=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?r=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?r=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?r=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:r="Invalid input";break;case p.too_big:s.type==="array"?r=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?r=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?r=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?r=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?r=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:r="Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r=`Number must be a multiple of ${s.multipleOf}`;break;case p.not_finite:r="Number must be finite";break;default:r=e.defaultError,R.assertNever(s)}return{message:r}};let vs=fe;function pn(s){vs=s}function Ge(){return vs}const Xe=s=>{const{data:e,path:r,errorMaps:n,issueData:a}=s,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let c="";const d=n.filter(u=>!!u).slice().reverse();for(const u of d)c=u(o,{data:e,defaultError:c}).message;return{...a,path:i,message:c}},mn=[];function f(s,e){const r=Ge(),n=Xe({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,r,r===fe?void 0:fe].filter(a=>!!a)});s.common.issues.push(n)}class N{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return j;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return N.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return j;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const j=Object.freeze({status:"aborted"}),ge=s=>({status:"dirty",value:s}),C=s=>({status:"valid",value:s}),Rt=s=>s.status==="aborted",St=s=>s.status==="dirty",Te=s=>s.status==="valid",Ee=s=>typeof Promise<"u"&&s instanceof Promise;function Ye(s,e,r,n){if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(s)}function js(s,e,r,n,a){if(typeof e=="function"?s!==e||!a:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(s,r),r}typeof SuppressedError=="function"&&SuppressedError;var b;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));var Re,Se;class V{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ws=(s,e)=>{if(Te(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Z(s.common.issues);return this._error=r,this._error}}};function k(s){if(!s)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=s;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,c)=>{var d,u;const{message:h}=s;return o.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:(d=h??n)!==null&&d!==void 0?d:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(u=h??r)!==null&&u!==void 0?u:c.defaultError}},description:a}}class T{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Y(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Y(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new N,ctx:{common:e.parent.common,data:e.data,parsedType:Y(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ee(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const a={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Y(e)},i=this._parseSync({data:e,path:a.path,parent:a});return ws(a,i)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Y(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Ee(a)?a:Promise.resolve(a));return ws(n,i)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=e(a),c=()=>i.addIssue({code:p.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new F({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this,this._def)}promise(){return ve.create(this,this._def)}or(e){return Ne.create([this,e],this._def)}and(e){return Ce.create(this,e,this._def)}transform(e){return new F({...k(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new qe({...k(this._def),innerType:this,defaultValue:r,typeName:v.ZodDefault})}brand(){return new Pt({typeName:v.ZodBranded,type:this,...k(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Me({...k(this._def),innerType:this,catchValue:r,typeName:v.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Le.create(this,e)}readonly(){return De.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const fn=/^c[^\s-]{8,}$/i,gn=/^[0-9a-z]+$/,yn=/^[0-9A-HJKMNP-TV-Z]{26}$/,bn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_n=/^[a-z0-9_-]{21}$/i,vn=/^[-+]?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)?)??$/,jn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let At;const xn=/^(?:(?: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])$/,kn=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Tn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xs="((\\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])))",En=new RegExp(`^${xs}$`);function ks(s){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Rn(s){return new RegExp(`^${ks(s)}$`)}function Ts(s){let e=`${xs}T${ks(s)}`;const r=[];return r.push(s.local?"Z?":"Z"),s.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Sn(s,e){return!!((e==="v4"||!e)&&xn.test(s)||(e==="v6"||!e)&&kn.test(s))}class D extends T{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_type,expected:g.string,received:i.parsedType}),j}const n=new N;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,c=e.data.length<i.value;(o||c)&&(a=this._getOrReturnCtx(e,a),o?f(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&f(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")jn.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"email",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")At||(At=new RegExp(wn,"u")),At.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"emoji",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")bn.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"uuid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")_n.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"nanoid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")fn.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"cuid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")gn.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"cuid2",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")yn.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"ulid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),f(a,{validation:"url",code:p.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"regex",code:p.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Ts(i).test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?En.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Rn(i).test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?vn.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"duration",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Sn(e.data,i.version)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"ip",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?Tn.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"base64",code:p.invalid_string,message:i.message}),n.dirty()):R.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:p.invalid_string,...b.errToObj(n)})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...b.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...b.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...b.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...b.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...b.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...b.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...b.errToObj(r)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}D.create=s=>{var e;return new D({checks:[],typeName:v.ZodString,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0?e:!1,...k(s)})};function An(s,e){const r=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,i=parseInt(s.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}class ee extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_type,expected:g.number,received:i.parsedType}),j}let n;const a=new N;for(const i of this._def.checks)i.kind==="int"?R.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:p.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?An(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:p.not_finite,message:i.message}),a.dirty()):R.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,b.toString(r))}gt(e,r){return this.setLimit("min",e,!1,b.toString(r))}lte(e,r){return this.setLimit("max",e,!0,b.toString(r))}lt(e,r){return this.setLimit("max",e,!1,b.toString(r))}setLimit(e,r,n,a){return new ee({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&R.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}ee.create=s=>new ee({checks:[],typeName:v.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...k(s)});class te extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==g.bigint){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_type,expected:g.bigint,received:i.parsedType}),j}let n;const a=new N;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):R.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,b.toString(r))}gt(e,r){return this.setLimit("min",e,!1,b.toString(r))}lte(e,r){return this.setLimit("max",e,!0,b.toString(r))}lt(e,r){return this.setLimit("max",e,!1,b.toString(r))}setLimit(e,r,n,a){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}te.create=s=>{var e;return new te({checks:[],typeName:v.ZodBigInt,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0?e:!1,...k(s)})};class Ae extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:g.boolean,received:n.parsedType}),j}return C(e.data)}}Ae.create=s=>new Ae({typeName:v.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...k(s)});class oe extends T{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_type,expected:g.date,received:i.parsedType}),j}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_date}),j}const n=new N;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):R.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new oe({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}oe.create=s=>new oe({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:v.ZodDate,...k(s)});class et extends T{_parse(e){if(this._getType(e)!==g.symbol){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:g.symbol,received:n.parsedType}),j}return C(e.data)}}et.create=s=>new et({typeName:v.ZodSymbol,...k(s)});class Oe extends T{_parse(e){if(this._getType(e)!==g.undefined){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:g.undefined,received:n.parsedType}),j}return C(e.data)}}Oe.create=s=>new Oe({typeName:v.ZodUndefined,...k(s)});class Pe extends T{_parse(e){if(this._getType(e)!==g.null){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:g.null,received:n.parsedType}),j}return C(e.data)}}Pe.create=s=>new Pe({typeName:v.ZodNull,...k(s)});class ye extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return C(e.data)}}ye.create=s=>new ye({typeName:v.ZodAny,...k(s)});class ce extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return C(e.data)}}ce.create=s=>new ce({typeName:v.ZodUnknown,...k(s)});class K extends T{_parse(e){const r=this._getOrReturnCtx(e);return f(r,{code:p.invalid_type,expected:g.never,received:r.parsedType}),j}}K.create=s=>new K({typeName:v.ZodNever,...k(s)});class tt extends T{_parse(e){if(this._getType(e)!==g.undefined){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:g.void,received:n.parsedType}),j}return C(e.data)}}tt.create=s=>new tt({typeName:v.ZodVoid,...k(s)});class B extends T{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==g.array)return f(r,{code:p.invalid_type,expected:g.array,received:r.parsedType}),j;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,c=r.data.length<a.exactLength.value;(o||c)&&(f(r,{code:o?p.too_big:p.too_small,minimum:c?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(f(r,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(f(r,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,c)=>a.type._parseAsync(new V(r,o,r.path,c)))).then(o=>N.mergeArray(n,o));const i=[...r.data].map((o,c)=>a.type._parseSync(new V(r,o,r.path,c)));return N.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new B({...this._def,minLength:{value:e,message:b.toString(r)}})}max(e,r){return new B({...this._def,maxLength:{value:e,message:b.toString(r)}})}length(e,r){return new B({...this._def,exactLength:{value:e,message:b.toString(r)}})}nonempty(e){return this.min(1,e)}}B.create=(s,e)=>new B({type:s,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...k(e)});function be(s){if(s instanceof O){const e={};for(const r in s.shape){const n=s.shape[r];e[r]=W.create(be(n))}return new O({...s._def,shape:()=>e})}else return s instanceof B?new B({...s._def,type:be(s.element)}):s instanceof W?W.create(be(s.unwrap())):s instanceof re?re.create(be(s.unwrap())):s instanceof H?H.create(s.items.map(e=>be(e))):s}class O extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=R.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==g.object){const u=this._getOrReturnCtx(e);return f(u,{code:p.invalid_type,expected:g.object,received:u.parsedType}),j}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||c.push(u);const d=[];for(const u of o){const h=i[u],m=a.data[u];d.push({key:{status:"valid",value:u},value:h._parse(new V(a,m,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof K){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(u==="strict")c.length>0&&(f(a,{code:p.unrecognized_keys,keys:c}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of c){const m=a.data[h];d.push({key:{status:"valid",value:h},value:u._parse(new V(a,m,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of d){const m=await h.key,w=await h.value;u.push({key:m,value:w,alwaysSet:h.alwaysSet})}return u}).then(u=>N.mergeObjectSync(n,u)):N.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new O({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var a,i,o,c;const d=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=b.errToObj(e).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:v.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new O({...this._def,catchall:e})}pick(e){const r={};return R.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new O({...this._def,shape:()=>r})}omit(e){const r={};return R.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new O({...this._def,shape:()=>r})}deepPartial(){return be(this)}partial(e){const r={};return R.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}),new O({...this._def,shape:()=>r})}required(e){const r={};return R.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof W;)i=i._def.innerType;r[n]=i}}),new O({...this._def,shape:()=>r})}keyof(){return Es(R.objectKeys(this.shape))}}O.create=(s,e)=>new O({shape:()=>s,unknownKeys:"strip",catchall:K.create(),typeName:v.ZodObject,...k(e)}),O.strictCreate=(s,e)=>new O({shape:()=>s,unknownKeys:"strict",catchall:K.create(),typeName:v.ZodObject,...k(e)}),O.lazycreate=(s,e)=>new O({shape:s,unknownKeys:"strip",catchall:K.create(),typeName:v.ZodObject,...k(e)});class Ne extends T{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;const o=i.map(c=>new Z(c.ctx.common.issues));return f(r,{code:p.invalid_union,unionErrors:o}),j}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const d of n){const u={...r,common:{...r.common,issues:[]},parent:null},h=d._parseSync({data:r.data,path:r.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const c=o.map(d=>new Z(d));return f(r,{code:p.invalid_union,unionErrors:c}),j}}get options(){return this._def.options}}Ne.create=(s,e)=>new Ne({options:s,typeName:v.ZodUnion,...k(e)});const G=s=>s instanceof Ie?G(s.schema):s instanceof F?G(s.innerType()):s instanceof Ue?[s.value]:s instanceof se?s.options:s instanceof Ze?R.objectValues(s.enum):s instanceof qe?G(s._def.innerType):s instanceof Oe?[void 0]:s instanceof Pe?[null]:s instanceof W?[void 0,...G(s.unwrap())]:s instanceof re?[null,...G(s.unwrap())]:s instanceof Pt||s instanceof De?G(s.unwrap()):s instanceof Me?G(s._def.innerType):[];class st extends T{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return f(r,{code:p.invalid_type,expected:g.object,received:r.parsedType}),j;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(f(r,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const i of r){const o=G(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(a.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);a.set(c,i)}}return new st({typeName:v.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...k(n)})}}function Ot(s,e){const r=Y(s),n=Y(e);if(s===e)return{valid:!0,data:s};if(r===g.object&&n===g.object){const a=R.objectKeys(e),i=R.objectKeys(s).filter(c=>a.indexOf(c)!==-1),o={...s,...e};for(const c of i){const d=Ot(s[c],e[c]);if(!d.valid)return{valid:!1};o[c]=d.data}return{valid:!0,data:o}}else if(r===g.array&&n===g.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<s.length;i++){const o=s[i],c=e[i],d=Ot(o,c);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===g.date&&n===g.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class Ce extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(Rt(i)||Rt(o))return j;const c=Ot(i.value,o.value);return c.valid?((St(i)||St(o))&&r.dirty(),{status:r.value,value:c.data}):(f(n,{code:p.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ce.create=(s,e,r)=>new Ce({left:s,right:e,typeName:v.ZodIntersection,...k(r)});class H extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.array)return f(n,{code:p.invalid_type,expected:g.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return f(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(f(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new V(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>N.mergeArray(r,o)):N.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new H({...this._def,rest:e})}}H.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new H({items:s,typeName:v.ZodTuple,rest:null,...k(e)})};class ze extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.object)return f(n,{code:p.invalid_type,expected:g.object,received:n.parsedType}),j;const a=[],i=this._def.keyType,o=this._def.valueType;for(const c in n.data)a.push({key:i._parse(new V(n,c,n.path,c)),value:o._parse(new V(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?N.mergeObjectAsync(r,a):N.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof T?new ze({keyType:e,valueType:r,typeName:v.ZodRecord,...k(n)}):new ze({keyType:D.create(),valueType:e,typeName:v.ZodRecord,...k(r)})}}class rt extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.map)return f(n,{code:p.invalid_type,expected:g.map,received:n.parsedType}),j;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([c,d],u)=>({key:a._parse(new V(n,c,n.path,[u,"key"])),value:i._parse(new V(n,d,n.path,[u,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of o){const u=await d.key,h=await d.value;if(u.status==="aborted"||h.status==="aborted")return j;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),c.set(u.value,h.value)}return{status:r.value,value:c}})}else{const c=new Map;for(const d of o){const u=d.key,h=d.value;if(u.status==="aborted"||h.status==="aborted")return j;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),c.set(u.value,h.value)}return{status:r.value,value:c}}}}rt.create=(s,e,r)=>new rt({valueType:e,keyType:s,typeName:v.ZodMap,...k(r)});class ue extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.set)return f(n,{code:p.invalid_type,expected:g.set,received:n.parsedType}),j;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(f(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(f(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(d){const u=new Set;for(const h of d){if(h.status==="aborted")return j;h.status==="dirty"&&r.dirty(),u.add(h.value)}return{status:r.value,value:u}}const c=[...n.data.values()].map((d,u)=>i._parse(new V(n,d,n.path,u)));return n.common.async?Promise.all(c).then(d=>o(d)):o(c)}min(e,r){return new ue({...this._def,minSize:{value:e,message:b.toString(r)}})}max(e,r){return new ue({...this._def,maxSize:{value:e,message:b.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}ue.create=(s,e)=>new ue({valueType:s,minSize:null,maxSize:null,typeName:v.ZodSet,...k(e)});class _e extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.function)return f(r,{code:p.invalid_type,expected:g.function,received:r.parsedType}),j;function n(c,d){return Xe({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ge(),fe].filter(u=>!!u),issueData:{code:p.invalid_arguments,argumentsError:d}})}function a(c,d){return Xe({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ge(),fe].filter(u=>!!u),issueData:{code:p.invalid_return_type,returnTypeError:d}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof ve){const c=this;return C(async function(...d){const u=new Z([]),h=await c._def.args.parseAsync(d,i).catch(A=>{throw u.addIssue(n(d,A)),u}),m=await Reflect.apply(o,this,h);return await c._def.returns._def.type.parseAsync(m,i).catch(A=>{throw u.addIssue(a(m,A)),u})})}else{const c=this;return C(function(...d){const u=c._def.args.safeParse(d,i);if(!u.success)throw new Z([n(d,u.error)]);const h=Reflect.apply(o,this,u.data),m=c._def.returns.safeParse(h,i);if(!m.success)throw new Z([a(h,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new _e({...this._def,args:H.create(e).rest(ce.create())})}returns(e){return new _e({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new _e({args:e||H.create([]).rest(ce.create()),returns:r||ce.create(),typeName:v.ZodFunction,...k(n)})}}class Ie extends T{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ie.create=(s,e)=>new Ie({getter:s,typeName:v.ZodLazy,...k(e)});class Ue extends T{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return f(r,{received:r.data,code:p.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ue.create=(s,e)=>new Ue({value:s,typeName:v.ZodLiteral,...k(e)});function Es(s,e){return new se({values:s,typeName:v.ZodEnum,...k(e)})}class se extends T{constructor(){super(...arguments),Re.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return f(r,{expected:R.joinValues(n),received:r.parsedType,code:p.invalid_type}),j}if(Ye(this,Re)||js(this,Re,new Set(this._def.values)),!Ye(this,Re).has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return f(r,{received:r.data,code:p.invalid_enum_value,options:n}),j}return C(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return se.create(e,{...this._def,...r})}exclude(e,r=this._def){return se.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Re=new WeakMap,se.create=Es;class Ze extends T{constructor(){super(...arguments),Se.set(this,void 0)}_parse(e){const r=R.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==g.string&&n.parsedType!==g.number){const a=R.objectValues(r);return f(n,{expected:R.joinValues(a),received:n.parsedType,code:p.invalid_type}),j}if(Ye(this,Se)||js(this,Se,new Set(R.getValidEnumValues(this._def.values))),!Ye(this,Se).has(e.data)){const a=R.objectValues(r);return f(n,{received:n.data,code:p.invalid_enum_value,options:a}),j}return C(e.data)}get enum(){return this._def.values}}Se=new WeakMap,Ze.create=(s,e)=>new Ze({values:s,typeName:v.ZodNativeEnum,...k(e)});class ve extends T{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.promise&&r.common.async===!1)return f(r,{code:p.invalid_type,expected:g.promise,received:r.parsedType}),j;const n=r.parsedType===g.promise?r.data:Promise.resolve(r.data);return C(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ve.create=(s,e)=>new ve({type:s,typeName:v.ZodPromise,...k(e)});class F extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{f(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async c=>{if(r.value==="aborted")return j;const d=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return d.status==="aborted"?j:d.status==="dirty"||r.value==="dirty"?ge(d.value):d});{if(r.value==="aborted")return j;const c=this._def.schema._parseSync({data:o,path:n.path,parent:n});return c.status==="aborted"?j:c.status==="dirty"||r.value==="dirty"?ge(c.value):c}}if(a.type==="refinement"){const o=c=>{const d=a.refinement(c,i);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?j:(c.status==="dirty"&&r.dirty(),o(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?j:(c.status==="dirty"&&r.dirty(),o(c.value).then(()=>({status:r.value,value:c.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Te(o))return o;const c=a.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Te(o)?Promise.resolve(a.transform(o.value,i)).then(c=>({status:r.value,value:c})):o);R.assertNever(a)}}F.create=(s,e,r)=>new F({schema:s,typeName:v.ZodEffects,effect:e,...k(r)}),F.createWithPreprocess=(s,e,r)=>new F({schema:e,effect:{type:"preprocess",transform:s},typeName:v.ZodEffects,...k(r)});class W extends T{_parse(e){return this._getType(e)===g.undefined?C(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}W.create=(s,e)=>new W({innerType:s,typeName:v.ZodOptional,...k(e)});class re extends T{_parse(e){return this._getType(e)===g.null?C(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(s,e)=>new re({innerType:s,typeName:v.ZodNullable,...k(e)});class qe extends T{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===g.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}qe.create=(s,e)=>new qe({innerType:s,typeName:v.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class Me extends T{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ee(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Me.create=(s,e)=>new Me({innerType:s,typeName:v.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class nt extends T{_parse(e){if(this._getType(e)!==g.nan){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:g.nan,received:n.parsedType}),j}return{status:"valid",value:e.data}}}nt.create=s=>new nt({typeName:v.ZodNaN,...k(s)});const On=Symbol("zod_brand");class Pt extends T{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Le extends T{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?j:i.status==="dirty"?(r.dirty(),ge(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?j:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new Le({in:e,out:r,typeName:v.ZodPipeline})}}class De extends T{_parse(e){const r=this._def.innerType._parse(e),n=a=>(Te(a)&&(a.value=Object.freeze(a.value)),a);return Ee(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}De.create=(s,e)=>new De({innerType:s,typeName:v.ZodReadonly,...k(e)});function Rs(s,e={},r){return s?ye.create().superRefine((n,a)=>{var i,o;if(!s(n)){const c=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(o=(i=c.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,u=typeof c=="string"?{message:c}:c;a.addIssue({code:"custom",...u,fatal:d})}}):ye.create()}const Pn={object:O.lazycreate};var v;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(v||(v={}));const Nn=(s,e={message:`Input not instance of ${s.name}`})=>Rs(r=>r instanceof s,e),Ss=D.create,As=ee.create,Cn=nt.create,zn=te.create,Os=Ae.create,In=oe.create,Un=et.create,Zn=Oe.create,qn=Pe.create,Mn=ye.create,Ln=ce.create,Dn=K.create,Bn=tt.create,Fn=B.create,$n=O.create,Vn=O.strictCreate,Hn=Ne.create,Wn=st.create,Qn=Ce.create,Jn=H.create,Kn=ze.create,Gn=rt.create,Xn=ue.create,Yn=_e.create,ea=Ie.create,ta=Ue.create,sa=se.create,ra=Ze.create,na=ve.create,Ps=F.create,aa=W.create,ia=re.create,oa=F.createWithPreprocess,ca=Le.create;var t=Object.freeze({__proto__:null,defaultErrorMap:fe,setErrorMap:pn,getErrorMap:Ge,makeIssue:Xe,EMPTY_PATH:mn,addIssueToContext:f,ParseStatus:N,INVALID:j,DIRTY:ge,OK:C,isAborted:Rt,isDirty:St,isValid:Te,isAsync:Ee,get util(){return R},get objectUtil(){return Et},ZodParsedType:g,getParsedType:Y,ZodType:T,datetimeRegex:Ts,ZodString:D,ZodNumber:ee,ZodBigInt:te,ZodBoolean:Ae,ZodDate:oe,ZodSymbol:et,ZodUndefined:Oe,ZodNull:Pe,ZodAny:ye,ZodUnknown:ce,ZodNever:K,ZodVoid:tt,ZodArray:B,ZodObject:O,ZodUnion:Ne,ZodDiscriminatedUnion:st,ZodIntersection:Ce,ZodTuple:H,ZodRecord:ze,ZodMap:rt,ZodSet:ue,ZodFunction:_e,ZodLazy:Ie,ZodLiteral:Ue,ZodEnum:se,ZodNativeEnum:Ze,ZodPromise:ve,ZodEffects:F,ZodTransformer:F,ZodOptional:W,ZodNullable:re,ZodDefault:qe,ZodCatch:Me,ZodNaN:nt,BRAND:On,ZodBranded:Pt,ZodPipeline:Le,ZodReadonly:De,custom:Rs,Schema:T,ZodSchema:T,late:Pn,get ZodFirstPartyTypeKind(){return v},coerce:{string:s=>D.create({...s,coerce:!0}),number:s=>ee.create({...s,coerce:!0}),boolean:s=>Ae.create({...s,coerce:!0}),bigint:s=>te.create({...s,coerce:!0}),date:s=>oe.create({...s,coerce:!0})},any:Mn,array:Fn,bigint:zn,boolean:Os,date:In,discriminatedUnion:Wn,effect:Ps,enum:sa,function:Yn,instanceof:Nn,intersection:Qn,lazy:ea,literal:ta,map:Gn,nan:Cn,nativeEnum:ra,never:Dn,null:qn,nullable:ia,number:As,object:$n,oboolean:()=>Os().optional(),onumber:()=>As().optional(),optional:aa,ostring:()=>Ss().optional(),pipeline:ca,preprocess:oa,promise:na,record:Kn,set:Xn,strictObject:Vn,string:Ss,symbol:Un,transformer:Ps,tuple:Jn,undefined:Zn,union:Hn,unknown:Ln,void:Bn,NEVER:j,ZodIssueCode:p,quotelessJson:hn,ZodError:Z});function ua(s,e){let r={...s};for(let n of e)delete r[n];return r}var da=/:([a-zA-Z_][a-zA-Z0-9_]*)/g;function la(s){let e=s.url,r=s.params;return r&&(e=e.replace(da,(n,a)=>a in r?`${r[a]}`:n)),e}function Ns(s,e,r){return s.find(n=>n.method===e&&n.path===r)}function ha(s){let e=new FormData;for(let r in s)e.append(r,s[r]);return{data:e}}var at=class extends Error{constructor(s,e,r,n){super(s),this.config=e,this.data=r,this.cause=n}},pa={name:"form-data",request:async(s,e)=>{if(typeof e.data!="object"||Array.isArray(e.data))throw new at("Zodios: multipart/form-data body must be an object",e);let r=ha(e.data);return{...e,data:r.data,headers:{...e.headers,...r.headers}}}};function ma(){return pa}var fa={name:"form-url",request:async(s,e)=>{if(typeof e.data!="object"||Array.isArray(e.data))throw new at("Zodios: application/x-www-form-urlencoded body must be an object",e);return{...e,data:new URLSearchParams(e.data).toString(),headers:{...e.headers,"Content-Type":"application/x-www-form-urlencoded"}}}};function ga(){return fa}function Cs(s,e){return{request:async(r,n)=>({...n,headers:{...n.headers,[s]:e}})}}function zs(s){return[!0,"response","all"].includes(s)}function Is(s){return[!0,"request","all"].includes(s)}function ya({validate:s,transform:e,sendDefaults:r}){return{name:"zod-validation",request:Is(s)?async(n,a)=>{let i=Ns(n,a.method,a.url);if(!i)throw new Error(`No endpoint found for ${a.method} ${a.url}`);let{parameters:o}=i;if(!o)return a;let c={...a,queries:{...a.queries},headers:{...a.headers},params:{...a.params}},d={Query:m=>{var w;return(w=c.queries)==null?void 0:w[m]},Body:m=>c.data,Header:m=>{var w;return(w=c.headers)==null?void 0:w[m]},Path:m=>{var w;return(w=c.params)==null?void 0:w[m]}},u={Query:(m,w)=>c.queries[m]=w,Body:(m,w)=>c.data=w,Header:(m,w)=>c.headers[m]=w,Path:(m,w)=>c.params[m]=w},h=Is(e);for(let m of o){let{name:w,schema:A,type:_}=m,E=d[_](w);if(r||E!==void 0){let y=await A.safeParseAsync(E);if(!y.success)throw new at(`Zodios: Invalid ${_} parameter '${w}'`,a,E,y.error);h&&u[_](w,y.data)}}return c}:void 0,response:zs(s)?async(n,a,i)=>{var o,c,d,u;let h=Ns(n,a.method,a.url);if(!h)throw new Error(`No endpoint found for ${a.method} ${a.url}`);if((c=(o=i.headers)==null?void 0:o["content-type"])!=null&&c.includes("application/json")||(u=(d=i.headers)==null?void 0:d["content-type"])!=null&&u.includes("application/vnd.api+json")){let m=await h.response.safeParseAsync(i.data);if(!m.success)throw new at(`Zodios: Invalid response from endpoint '${h.method} ${h.path}'
|
|
7
|
+
status: ${i.status} ${i.statusText}
|
|
8
|
+
cause:
|
|
9
|
+
${m.error.message}
|
|
10
|
+
received:
|
|
11
|
+
${JSON.stringify(i.data,null,2)}`,a,i.data,m.error);zs(e)&&(i.data=m.data)}return i}:void 0}}var Us=class{constructor(s,e){this.plugins=[],this.key=`${s}-${e}`}indexOf(s){return this.plugins.findIndex(e=>(e==null?void 0:e.name)===s)}use(s){if(s.name){let e=this.indexOf(s.name);if(e!==-1)return this.plugins[e]=s,{key:this.key,value:e}}return this.plugins.push(s),{key:this.key,value:this.plugins.length-1}}eject(s){if(typeof s=="string"){let e=this.indexOf(s);if(e===-1)throw new Error(`Plugin with name '${s}' not found`);this.plugins[e]=void 0}else{if(s.key!==this.key)throw new Error(`Plugin with key '${s.key}' is not registered for endpoint '${this.key}'`);this.plugins[s.value]=void 0}}async interceptRequest(s,e){let r=e;for(let n of this.plugins)n!=null&&n.request&&(r=await n.request(s,r));return r}async interceptResponse(s,e,r){let n=r;for(let a=this.plugins.length-1;a>=0;a--){let i=this.plugins[a];i&&(n=n.then(i!=null&&i.response?o=>i.response(s,e,o):void 0,i!=null&&i.error?o=>i.error(s,e,o):void 0))}return n}count(){return this.plugins.reduce((s,e)=>e?s+1:s,0)}};function Zs(s){let e=new Set;for(let n of s){let a=`${n.method} ${n.path}`;if(e.has(a))throw new Error(`Zodios: Duplicate path '${a}'`);e.add(a)}let r=new Set;for(let n of s)if(n.alias){if(r.has(n.alias))throw new Error(`Zodios: Duplicate alias '${n.alias}'`);r.add(n.alias)}for(let n of s)if(n.parameters&&n.parameters.filter(a=>a.type==="Body").length>1)throw new Error(`Zodios: Multiple body parameters in endpoint '${n.path}'`)}function ba(s){return Zs(s),s}var _a=class{constructor(s,e,r){this.endpointPlugins=new Map;let n;if(!s)throw Array.isArray(e)?new Error("Zodios: missing base url"):new Error("Zodios: missing api description");let a;if(typeof s=="string"&&Array.isArray(e))a=s,this.api=e,n=r||{};else if(Array.isArray(s)&&!Array.isArray(e))this.api=s,n=e||{};else throw new Error("Zodios: api must be an array");Zs(this.api),this.options={validate:!0,transform:!0,sendDefaults:!1,...n},this.options.axiosInstance?this.axiosInstance=this.options.axiosInstance:this.axiosInstance=P.create({...this.options.axiosConfig}),a&&(this.axiosInstance.defaults.baseURL=a),this.injectAliasEndpoints(),this.initPlugins(),[!0,"all","request","response"].includes(this.options.validate)&&this.use(ya(this.options))}initPlugins(){this.endpointPlugins.set("any-any",new Us("any","any")),this.api.forEach(s=>{let e=new Us(s.method,s.path);switch(s.requestFormat){case"binary":e.use(Cs("Content-Type","application/octet-stream"));break;case"form-data":e.use(ma());break;case"form-url":e.use(ga());break;case"text":e.use(Cs("Content-Type","text/plain"));break}this.endpointPlugins.set(`${s.method}-${s.path}`,e)})}getAnyEndpointPlugins(){return this.endpointPlugins.get("any-any")}findAliasEndpointPlugins(s){let e=this.api.find(r=>r.alias===s);if(e)return this.endpointPlugins.get(`${e.method}-${e.path}`)}findEnpointPlugins(s,e){return this.endpointPlugins.get(`${s}-${e}`)}get baseURL(){return this.axiosInstance.defaults.baseURL}get axios(){return this.axiosInstance}use(...s){if(typeof s[0]=="object")return this.getAnyEndpointPlugins().use(s[0]);if(typeof s[0]=="string"&&typeof s[1]=="object"){let e=this.findAliasEndpointPlugins(s[0]);if(!e)throw new Error(`Zodios: no alias '${s[0]}' found to register plugin`);return e.use(s[1])}else if(typeof s[0]=="string"&&typeof s[1]=="string"&&typeof s[2]=="object"){let e=this.findEnpointPlugins(s[0],s[1]);if(!e)throw new Error(`Zodios: no endpoint '${s[0]} ${s[1]}' found to register plugin`);return e.use(s[2])}throw new Error("Zodios: invalid plugin registration")}eject(s){var e;if(typeof s=="string"){this.getAnyEndpointPlugins().eject(s);return}(e=this.endpointPlugins.get(s.key))==null||e.eject(s)}injectAliasEndpoints(){this.api.forEach(s=>{s.alias&&(["post","put","patch","delete"].includes(s.method)?this[s.alias]=(e,r)=>this.request({...r,method:s.method,url:s.path,data:e}):this[s.alias]=e=>this.request({...e,method:s.method,url:s.path}))})}async request(s){let e=s,r=this.getAnyEndpointPlugins(),n=this.findEnpointPlugins(e.method,e.url);e=await r.interceptRequest(this.api,e),n&&(e=await n.interceptRequest(this.api,e));let a=this.axiosInstance.request({...ua(e,["params","queries"]),url:la(e),params:e.queries});return n&&(a=n.interceptResponse(this.api,e,a)),a=r.interceptResponse(this.api,e,a),(await a).data}async get(s,...[e]){return this.request({...e,method:"get",url:s})}async post(s,e,...[r]){return this.request({...r,method:"post",url:s,data:e})}async put(s,e,...[r]){return this.request({...r,method:"put",url:s,data:e})}async patch(s,e,...[r]){return this.request({...r,method:"patch",url:s,data:e})}async delete(s,e,...[r]){return this.request({...r,method:"delete",url:s,data:e})}},qs=_a;const Nt=t.object({id:t.string(),name:t.string(),is_archived:t.boolean(),created_at:t.string(),updated_at:t.string()}).passthrough(),va=t.array(Nt);t.object({name:t.string().min(1).max(255)}).passthrough();const ja=t.object({name:t.string().min(1).max(255),is_archived:t.boolean().optional()}).passthrough(),wa=t.object({type:t.string(),data:t.string()}).passthrough(),xa=t.object({id:t.string(),email:t.string(),role:t.string()}).passthrough(),Ms=t.enum(["owner","admin","manager","employee","placeholder"]),ka=t.object({email:t.string().email(),role:Ms}).passthrough(),Ls=t.object({id:t.string(),user_id:t.string(),name:t.string(),email:t.string(),role:t.string(),is_placeholder:t.boolean(),billable_rate:t.union([t.number(),t.null()])}).passthrough(),Ta=t.object({role:Ms,billable_rate:t.union([t.number(),t.null()])}).partial().passthrough(),Ds=t.object({id:t.string(),name:t.string(),is_personal:t.boolean(),billable_rate:t.union([t.number(),t.null()])}).passthrough(),Ea=t.object({name:t.string().max(255),billable_rate:t.union([t.number(),t.null()]).optional()}).passthrough(),it=t.object({id:t.string(),name:t.string(),color:t.string(),client_id:t.union([t.string(),t.null()]),is_archived:t.boolean(),billable_rate:t.union([t.number(),t.null()]),is_billable:t.boolean()}).passthrough(),Ra=t.object({name:t.string().min(1).max(255),color:t.string().max(255),is_billable:t.boolean(),billable_rate:t.union([t.number(),t.null()]).optional(),client_id:t.union([t.string(),t.null()]).optional()}).passthrough(),Sa=t.object({name:t.string().max(255),color:t.string().max(255),is_billable:t.boolean(),is_archived:t.boolean().optional(),client_id:t.union([t.string(),t.null()]).optional(),billable_rate:t.union([t.number(),t.null()]).optional()}).passthrough(),Ct=t.object({id:t.string(),billable_rate:t.union([t.number(),t.null()]),member_id:t.string(),project_id:t.string()}).passthrough(),Aa=t.object({member_id:t.string().uuid(),billable_rate:t.union([t.number(),t.null()]).optional()}).passthrough(),Oa=t.object({billable_rate:t.union([t.number(),t.null()])}).partial().passthrough(),zt=t.object({id:t.string(),name:t.string(),created_at:t.string(),updated_at:t.string()}).passthrough(),Pa=t.array(zt);t.object({name:t.string().min(1).max(255)}).passthrough(),t.object({name:t.string().min(1).max(255)}).passthrough();const It=t.object({id:t.string(),name:t.string(),is_done:t.boolean(),project_id:t.string(),created_at:t.string(),updated_at:t.string()}).passthrough(),Na=t.object({name:t.string().min(1).max(255),project_id:t.string()}).passthrough(),Ca=t.object({name:t.string().min(1).max(255),is_done:t.boolean().optional()}).passthrough(),ot=t.union([t.string(),t.null()]).optional(),ct=t.object({id:t.string(),start:t.string(),end:t.union([t.string(),t.null()]),duration:t.union([t.number(),t.null()]),description:t.union([t.string(),t.null()]),task_id:t.union([t.string(),t.null()]),project_id:t.union([t.string(),t.null()]),organization_id:t.string(),user_id:t.string(),tags:t.array(t.string()),billable:t.boolean()}).passthrough(),za=t.array(ct),Ia=t.object({member_id:t.string().uuid(),project_id:t.union([t.string(),t.null()]).optional(),task_id:t.union([t.string(),t.null()]).optional(),start:t.string(),end:t.union([t.string(),t.null()]).optional(),billable:t.boolean(),description:t.union([t.string(),t.null()]).optional(),tags:t.union([t.array(t.string().uuid()),t.null()]).optional()}).passthrough(),Ua=t.object({ids:t.array(t.string().uuid()),changes:t.object({member_id:t.string().uuid(),project_id:t.union([t.string(),t.null()]),task_id:t.union([t.string(),t.null()]),billable:t.boolean(),description:t.union([t.string(),t.null()]),tags:t.union([t.array(t.string().uuid()),t.null()])}).partial().passthrough()}).passthrough(),Za=t.object({member_id:t.string().uuid(),project_id:t.union([t.string(),t.null()]),task_id:t.union([t.string(),t.null()]),start:t.string(),end:t.union([t.string(),t.null()]),billable:t.boolean(),description:t.union([t.string(),t.null()]),tags:t.union([t.array(t.string().uuid()),t.null()])}).partial().passthrough(),qa=t.enum(["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]),Ma=t.object({id:t.string(),name:t.string(),email:t.string(),profile_photo_url:t.string(),timezone:t.string(),week_start:qa}).passthrough(),La=t.object({id:t.string(),organization:t.object({id:t.string(),name:t.string()}).passthrough(),role:t.string()}).passthrough(),Da=t.array(La),Bs=ba([{method:"get",path:"/v1/organizations/:organization",alias:"getOrganization",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:Ds}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization",alias:"updateOrganization",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Ea},{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:Ds}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/clients",alias:"getClients",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"page",type:"Query",schema:t.number().int().gte(1).optional()},{name:"archived",type:"Query",schema:t.enum(["true","false","all"]).optional()}],response:t.object({data:va}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/clients",alias:"createClient",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:t.object({name:t.string().min(1).max(255)}).passthrough()},{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:Nt}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization/clients/:client",alias:"updateClient",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:ja},{name:"organization",type:"Path",schema:t.string()},{name:"client",type:"Path",schema:t.string()}],response:t.object({data:Nt}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/clients/:client",alias:"deleteClient",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"client",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/import",alias:"importData",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:wa},{name:"organization",type:"Path",schema:t.string()}],response:t.object({report:t.object({clients:t.object({created:t.number().int()}).passthrough(),projects:t.object({created:t.number().int()}).passthrough(),tasks:t.object({created:t.number().int()}).passthrough(),time_entries:t.object({created:t.number().int()}).passthrough(),tags:t.object({created:t.number().int()}).passthrough(),users:t.object({created:t.number().int()}).passthrough()}).passthrough()}).passthrough(),errors:[{status:400,schema:t.union([t.object({message:t.string()}).passthrough(),t.object({message:t.string()}).passthrough()])},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/importers",alias:"getImporters",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:t.array(t.object({key:t.string(),name:t.string(),description:t.string()}).passthrough())}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/invitations",alias:"getInvitations",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:t.array(xa),links:t.object({first:t.union([t.string(),t.null()]),last:t.union([t.string(),t.null()]),prev:t.union([t.string(),t.null()]),next:t.union([t.string(),t.null()])}).passthrough(),meta:t.object({current_page:t.number().int(),from:t.union([t.number(),t.null()]),last_page:t.number().int(),links:t.array(t.object({url:t.union([t.string(),t.null()]),label:t.string(),active:t.boolean()}).passthrough()),path:t.union([t.string(),t.null()]),per_page:t.number().int(),to:t.union([t.number(),t.null()]),total:t.number().int()}).passthrough()}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/invitations",alias:"invite",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:ka},{name:"organization",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/invitations/:invitation",alias:"removeInvitation",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"invitation",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/invitations/:invitation/resend",alias:"resendInvitationEmail",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:t.object({}).partial().passthrough()},{name:"organization",type:"Path",schema:t.string()},{name:"invitation",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/members",alias:"getMembers",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:t.array(Ls),links:t.object({first:t.union([t.string(),t.null()]),last:t.union([t.string(),t.null()]),prev:t.union([t.string(),t.null()]),next:t.union([t.string(),t.null()])}).passthrough(),meta:t.object({current_page:t.number().int(),from:t.union([t.number(),t.null()]),last_page:t.number().int(),links:t.array(t.object({url:t.union([t.string(),t.null()]),label:t.string(),active:t.boolean()}).passthrough()),path:t.union([t.string(),t.null()]),per_page:t.number().int(),to:t.union([t.number(),t.null()]),total:t.number().int()}).passthrough()}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization/members/:member",alias:"updateMember",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Ta},{name:"organization",type:"Path",schema:t.string()},{name:"member",type:"Path",schema:t.string()}],response:t.object({data:Ls}).passthrough(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/members/:member",alias:"removeMember",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"member",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/members/:member/invite-placeholder",alias:"invitePlaceholder",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:t.object({}).partial().passthrough()},{name:"organization",type:"Path",schema:t.string()},{name:"member",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization/project-members/:projectMember",alias:"updateProjectMember",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Oa},{name:"organization",type:"Path",schema:t.string()},{name:"projectMember",type:"Path",schema:t.string()}],response:t.object({data:Ct}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/project-members/:projectMember",alias:"deleteProjectMember",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"projectMember",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/projects",alias:"getProjects",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"page",type:"Query",schema:t.number().int().gte(1).optional()},{name:"archived",type:"Query",schema:t.enum(["true","false","all"]).optional()}],response:t.object({data:t.array(it),links:t.object({first:t.union([t.string(),t.null()]),last:t.union([t.string(),t.null()]),prev:t.union([t.string(),t.null()]),next:t.union([t.string(),t.null()])}).passthrough(),meta:t.object({current_page:t.number().int(),from:t.union([t.number(),t.null()]),last_page:t.number().int(),links:t.array(t.object({url:t.union([t.string(),t.null()]),label:t.string(),active:t.boolean()}).passthrough()),path:t.union([t.string(),t.null()]),per_page:t.number().int(),to:t.union([t.number(),t.null()]),total:t.number().int()}).passthrough()}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/projects",alias:"createProject",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Ra},{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:it}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/projects/:project",alias:"getProject",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"project",type:"Path",schema:t.string()}],response:t.object({data:it}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization/projects/:project",alias:"updateProject",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Sa},{name:"organization",type:"Path",schema:t.string()},{name:"project",type:"Path",schema:t.string()}],response:t.object({data:it}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/projects/:project",alias:"deleteProject",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"project",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/projects/:project/project-members",alias:"getProjectMembers",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"project",type:"Path",schema:t.string()}],response:t.object({data:t.array(Ct),links:t.object({first:t.union([t.string(),t.null()]),last:t.union([t.string(),t.null()]),prev:t.union([t.string(),t.null()]),next:t.union([t.string(),t.null()])}).passthrough(),meta:t.object({current_page:t.number().int(),from:t.union([t.number(),t.null()]),last_page:t.number().int(),links:t.array(t.object({url:t.union([t.string(),t.null()]),label:t.string(),active:t.boolean()}).passthrough()),path:t.union([t.string(),t.null()]),per_page:t.number().int(),to:t.union([t.number(),t.null()]),total:t.number().int()}).passthrough()}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/projects/:project/project-members",alias:"createProjectMember",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Aa},{name:"organization",type:"Path",schema:t.string()},{name:"project",type:"Path",schema:t.string()}],response:t.object({data:Ct}).passthrough(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/tags",alias:"getTags",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:Pa}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/tags",alias:"createTag",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:t.object({name:t.string().min(1).max(255)}).passthrough()},{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:zt}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization/tags/:tag",alias:"updateTag",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:t.object({name:t.string().min(1).max(255)}).passthrough()},{name:"organization",type:"Path",schema:t.string()},{name:"tag",type:"Path",schema:t.string()}],response:t.object({data:zt}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/tags/:tag",alias:"deleteTag",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"tag",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/tasks",alias:"getTasks",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"project_id",type:"Query",schema:t.string().uuid().optional()},{name:"done",type:"Query",schema:t.enum(["true","false","all"]).optional()}],response:t.object({data:t.array(It),links:t.object({first:t.union([t.string(),t.null()]),last:t.union([t.string(),t.null()]),prev:t.union([t.string(),t.null()]),next:t.union([t.string(),t.null()])}).passthrough(),meta:t.object({current_page:t.number().int(),from:t.union([t.number(),t.null()]),last_page:t.number().int(),links:t.array(t.object({url:t.union([t.string(),t.null()]),label:t.string(),active:t.boolean()}).passthrough()),path:t.union([t.string(),t.null()]),per_page:t.number().int(),to:t.union([t.number(),t.null()]),total:t.number().int()}).passthrough()}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/tasks",alias:"createTask",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Na},{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:It}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization/tasks/:task",alias:"updateTask",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Ca},{name:"organization",type:"Path",schema:t.string()},{name:"task",type:"Path",schema:t.string()}],response:t.object({data:It}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/tasks/:task",alias:"deleteTask",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"task",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/time-entries",alias:"getTimeEntries",description:`If you only need time entries for a specific user, you can filter by `user_id`.
|
|
12
|
+
Users with the permission `time-entries:view:own` can only use this endpoint with their own user ID in the user_id filter.`,requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"member_id",type:"Query",schema:t.string().uuid().optional()},{name:"start",type:"Query",schema:ot},{name:"end",type:"Query",schema:ot},{name:"active",type:"Query",schema:t.enum(["true","false"]).optional()},{name:"billable",type:"Query",schema:t.enum(["true","false"]).optional()},{name:"limit",type:"Query",schema:t.number().int().gte(1).lte(500).optional()},{name:"only_full_dates",type:"Query",schema:t.enum(["true","false"]).optional()},{name:"member_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"project_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"tag_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"task_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"client_ids",type:"Query",schema:t.string().optional()},{name:"user_id",type:"Query",schema:t.string().optional()}],response:t.object({data:za}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"post",path:"/v1/organizations/:organization/time-entries",alias:"createTimeEntry",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Ia},{name:"organization",type:"Path",schema:t.string()}],response:t.object({data:ct}).passthrough(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"patch",path:"/v1/organizations/:organization/time-entries",alias:"updateMultipleTimeEntries",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Ua},{name:"organization",type:"Path",schema:t.string()}],response:t.object({success:t.string(),error:t.string()}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"put",path:"/v1/organizations/:organization/time-entries/:timeEntry",alias:"updateTimeEntry",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Za},{name:"organization",type:"Path",schema:t.string()},{name:"timeEntry",type:"Path",schema:t.string()}],response:t.object({data:ct}).passthrough(),errors:[{status:400,description:"API exception",schema:t.object({error:t.boolean(),key:t.string(),message:t.string()}).passthrough()},{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"delete",path:"/v1/organizations/:organization/time-entries/:timeEntry",alias:"deleteTimeEntry",requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"timeEntry",type:"Path",schema:t.string()}],response:t.null(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/organizations/:organization/time-entries/aggregate",alias:"getAggregatedTimeEntries",description:`This endpoint allows you to filter time entries and aggregate them by different criteria.
|
|
13
|
+
The parameters `group` and `sub_group` allow you to group the time entries by different criteria.
|
|
14
|
+
If the group parameters are all set to `null` or are all missing, the endpoint will aggregate all filtered time entries.`,requestFormat:"json",parameters:[{name:"organization",type:"Path",schema:t.string()},{name:"group",type:"Query",schema:t.enum(["day","week","month","year","user","project","task","client","billable"]).optional()},{name:"sub_group",type:"Query",schema:t.enum(["day","week","month","year","user","project","task","client","billable"]).optional()},{name:"member_id",type:"Query",schema:t.string().uuid().optional()},{name:"user_id",type:"Query",schema:t.string().uuid().optional()},{name:"start",type:"Query",schema:ot},{name:"end",type:"Query",schema:ot},{name:"active",type:"Query",schema:t.enum(["true","false"]).optional()},{name:"billable",type:"Query",schema:t.enum(["true","false"]).optional()},{name:"fill_gaps_in_time_groups",type:"Query",schema:t.enum(["true","false"]).optional()},{name:"member_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"project_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"client_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"tag_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()},{name:"task_ids",type:"Query",schema:t.array(t.string().uuid()).min(1).optional()}],response:t.object({data:t.object({grouped_type:t.union([t.string(),t.null()]),grouped_data:t.union([t.array(t.object({key:t.union([t.string(),t.null()]),seconds:t.number().int(),cost:t.number().int(),grouped_type:t.union([t.string(),t.null()]),grouped_data:t.union([t.array(t.object({key:t.union([t.string(),t.null()]),seconds:t.number().int(),cost:t.number().int(),grouped_type:t.null(),grouped_data:t.null()}).passthrough()),t.null()])}).passthrough()),t.null()]),seconds:t.number().int(),cost:t.number().int()}).passthrough()}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()},{status:422,description:"Validation error",schema:t.object({message:t.string(),errors:t.record(t.array(t.string()))}).passthrough()}]},{method:"get",path:"/v1/users/me",alias:"getMe",description:"This endpoint is independent of organization.",requestFormat:"json",response:t.object({data:Ma}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/users/me/memberships",alias:"getMyMemberships",description:"This endpoint is independent of organization.",requestFormat:"json",response:t.object({data:Da}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:403,description:"Authorization error",schema:t.object({message:t.string()}).passthrough()}]},{method:"get",path:"/v1/users/me/time-entries/active",alias:"getMyActiveTimeEntry",description:"This endpoint is independent of organization.",requestFormat:"json",response:t.object({data:ct}).passthrough(),errors:[{status:401,description:"Unauthenticated",schema:t.object({message:t.string()}).passthrough()},{status:404,description:"Not found",schema:t.object({message:t.string()}).passthrough()}]}]);new qs("/api",Bs);function Ba(s,e){return new qs(s,Bs,e)}const Fa=Ba("/api",{validate:"none"});le.api=Fa,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidtime/api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Package containing the solidtime api client and type declarations",
|
|
5
|
-
"main": "dist/
|
|
5
|
+
"main": "./dist/solidtime-api.umd.cjs",
|
|
6
|
+
"module": "./dist/solidtime-api.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
6
8
|
"repository": {
|
|
7
9
|
"type": "git",
|
|
8
10
|
"url": "git+https://github.com/solidtime-io/solidtime.git",
|
|
9
11
|
"directory": "resources/js/packages/api"
|
|
10
12
|
},
|
|
11
13
|
"scripts": {
|
|
12
|
-
"build": "npx
|
|
14
|
+
"build": "npx vite build",
|
|
13
15
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
16
|
},
|
|
15
17
|
"files": [
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
"zod": "^3.23.8"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
|
-
"
|
|
36
|
+
"vite": "^5.4.2",
|
|
37
|
+
"vite-plugin-dts": "^4.0.3"
|
|
35
38
|
}
|
|
36
39
|
}
|