beanbagdb-components 0.1.1

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.
@@ -0,0 +1,15 @@
1
+ (function(ct,zt){typeof exports=="object"&&typeof module<"u"?zt(exports,require("svelte")):typeof define=="function"&&define.amd?define(["exports","svelte"],zt):(ct=typeof globalThis<"u"?globalThis:ct||self,zt(ct.BBDBComponents={},ct.Svelte))})(this,(function(ct,zt){"use strict";function ws(e,t){return function(){return e.apply(t,arguments)}}const{toString:To}=Object.prototype,{getPrototypeOf:On}=Object,{iterator:ur,toStringTag:bs}=Symbol,dr=(e=>t=>{const r=To.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),qe=e=>(e=e.toLowerCase(),t=>dr(t)===e),fr=e=>t=>typeof t===e,{isArray:Nt}=Array,At=fr("undefined");function Ht(e){return e!==null&&!At(e)&&e.constructor!==null&&!At(e.constructor)&&we(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $s=qe("ArrayBuffer");function No(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$s(e.buffer),t}const Ao=fr("string"),we=fr("function"),Es=fr("number"),Kt=e=>e!==null&&typeof e=="object",jo=e=>e===!0||e===!1,hr=e=>{if(dr(e)!=="object")return!1;const t=On(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(bs in e)&&!(ur in e)},Co=e=>{if(!Kt(e)||Ht(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},qo=qe("Date"),Io=qe("File"),Do=qe("Blob"),Mo=qe("FileList"),Lo=e=>Kt(e)&&we(e.pipe),xo=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||we(e.append)&&((t=dr(e))==="formdata"||t==="object"&&we(e.toString)&&e.toString()==="[object FormData]"))},Fo=qe("URLSearchParams"),[Uo,Vo,zo,Ho]=["ReadableStream","Request","Response","Headers"].map(qe),Ko=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bt(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Nt(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(Ht(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let o;for(n=0;n<a;n++)o=s[n],t.call(null,e[o],o,e)}}function Ss(e,t){if(Ht(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const mt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ps=e=>!At(e)&&e!==mt;function Tn(){const{caseless:e,skipUndefined:t}=Ps(this)&&this||{},r={},n=(i,s)=>{const a=e&&Ss(r,s)||s;hr(r[a])&&hr(i)?r[a]=Tn(r[a],i):hr(i)?r[a]=Tn({},i):Nt(i)?r[a]=i.slice():(!t||!At(i))&&(r[a]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Bt(arguments[i],n);return r}const Bo=(e,t,r,{allOwnKeys:n}={})=>(Bt(t,(i,s)=>{r&&we(i)?e[s]=ws(i,r):e[s]=i},{allOwnKeys:n}),e),Jo=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Go=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Wo=(e,t,r,n)=>{let i,s,a;const o={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)a=i[s],(!n||n(a,e,t))&&!o[a]&&(t[a]=e[a],o[a]=!0);e=r!==!1&&On(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Zo=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Xo=e=>{if(!e)return null;if(Nt(e))return e;let t=e.length;if(!Es(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Yo=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&On(Uint8Array)),Qo=(e,t)=>{const n=(e&&e[ur]).call(e);let i;for(;(i=n.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},ec=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},tc=qe("HTMLFormElement"),rc=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),ks=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),nc=qe("RegExp"),Rs=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Bt(r,(i,s)=>{let a;(a=t(i,s,e))!==!1&&(n[s]=a||i)}),Object.defineProperties(e,n)},sc=e=>{Rs(e,(t,r)=>{if(we(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(we(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ic=(e,t)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Nt(e)?n(e):n(String(e).split(t)),r},ac=()=>{},oc=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function cc(e){return!!(e&&we(e.append)&&e[bs]==="FormData"&&e[ur])}const lc=e=>{const t=new Array(10),r=(n,i)=>{if(Kt(n)){if(t.indexOf(n)>=0)return;if(Ht(n))return n;if(!("toJSON"in n)){t[i]=n;const s=Nt(n)?[]:{};return Bt(n,(a,o)=>{const c=r(a,i+1);!At(c)&&(s[o]=c)}),t[i]=void 0,s}}return n};return r(e,0)},uc=qe("AsyncFunction"),dc=e=>e&&(Kt(e)||we(e))&&we(e.then)&&we(e.catch),Os=((e,t)=>e?setImmediate:t?((r,n)=>(mt.addEventListener("message",({source:i,data:s})=>{i===mt&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),mt.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",we(mt.postMessage)),fc=typeof queueMicrotask<"u"?queueMicrotask.bind(mt):typeof process<"u"&&process.nextTick||Os,N={isArray:Nt,isArrayBuffer:$s,isBuffer:Ht,isFormData:xo,isArrayBufferView:No,isString:Ao,isNumber:Es,isBoolean:jo,isObject:Kt,isPlainObject:hr,isEmptyObject:Co,isReadableStream:Uo,isRequest:Vo,isResponse:zo,isHeaders:Ho,isUndefined:At,isDate:qo,isFile:Io,isBlob:Do,isRegExp:nc,isFunction:we,isStream:Lo,isURLSearchParams:Fo,isTypedArray:Yo,isFileList:Mo,forEach:Bt,merge:Tn,extend:Bo,trim:Ko,stripBOM:Jo,inherits:Go,toFlatObject:Wo,kindOf:dr,kindOfTest:qe,endsWith:Zo,toArray:Xo,forEachEntry:Qo,matchAll:ec,isHTMLForm:tc,hasOwnProperty:ks,hasOwnProp:ks,reduceDescriptors:Rs,freezeMethods:sc,toObjectSet:ic,toCamelCase:rc,noop:ac,toFiniteNumber:oc,findKey:Ss,global:mt,isContextDefined:Ps,isSpecCompliantForm:cc,toJSONObject:lc,isAsyncFn:uc,isThenable:dc,setImmediate:Os,asap:fc,isIterable:e=>e!=null&&we(e[ur])};function K(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}N.inherits(K,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:N.toJSONObject(this.config),code:this.code,status:this.status}}});const Ts=K.prototype,Ns={};["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(e=>{Ns[e]={value:e}}),Object.defineProperties(K,Ns),Object.defineProperty(Ts,"isAxiosError",{value:!0}),K.from=(e,t,r,n,i,s)=>{const a=Object.create(Ts);N.toFlatObject(e,a,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");const o=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return K.call(a,o,c,r,n,i),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",s&&Object.assign(a,s),a};const hc=null;function Nn(e){return N.isPlainObject(e)||N.isArray(e)}function As(e){return N.endsWith(e,"[]")?e.slice(0,-2):e}function js(e,t,r){return e?e.concat(t).map(function(i,s){return i=As(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function pc(e){return N.isArray(e)&&!e.some(Nn)}const mc=N.toFlatObject(N,{},null,function(t){return/^is[A-Z]/.test(t)});function pr(e,t,r){if(!N.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=N.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,d){return!N.isUndefined(d[w])});const n=r.metaTokens,i=r.visitor||u,s=r.dots,a=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&N.isSpecCompliantForm(t);if(!N.isFunction(i))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(N.isDate(h))return h.toISOString();if(N.isBoolean(h))return h.toString();if(!c&&N.isBlob(h))throw new K("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(h)||N.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,w,d){let _=h;if(h&&!d&&typeof h=="object"){if(N.endsWith(w,"{}"))w=n?w:w.slice(0,-2),h=JSON.stringify(h);else if(N.isArray(h)&&pc(h)||(N.isFileList(h)||N.endsWith(w,"[]"))&&(_=N.toArray(h)))return w=As(w),_.forEach(function(g,E){!(N.isUndefined(g)||g===null)&&t.append(a===!0?js([w],E,s):a===null?w:w+"[]",l(g))}),!1}return Nn(h)?!0:(t.append(js(d,w,s),l(h)),!1)}const v=[],m=Object.assign(mc,{defaultVisitor:u,convertValue:l,isVisitable:Nn});function y(h,w){if(!N.isUndefined(h)){if(v.indexOf(h)!==-1)throw Error("Circular reference detected in "+w.join("."));v.push(h),N.forEach(h,function(_,f){(!(N.isUndefined(_)||_===null)&&i.call(t,_,N.isString(f)?f.trim():f,w,m))===!0&&y(_,w?w.concat(f):[f])}),v.pop()}}if(!N.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Cs(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function An(e,t){this._pairs=[],e&&pr(e,this,t)}const qs=An.prototype;qs.append=function(t,r){this._pairs.push([t,r])},qs.toString=function(t){const r=t?function(n){return t.call(this,n,Cs)}:Cs;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function _c(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Is(e,t,r){if(!t)return e;const n=r&&r.encode||_c;N.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(i?s=i(t,r):s=N.isURLSearchParams(t)?t.toString():new An(t,r).toString(n),s){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Ds{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){N.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ms={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yc={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:An,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},jn=typeof window<"u"&&typeof document<"u",Cn=typeof navigator=="object"&&navigator||void 0,gc=jn&&(!Cn||["ReactNative","NativeScript","NS"].indexOf(Cn.product)<0),vc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wc=jn&&window.location.href||"http://localhost",fe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jn,hasStandardBrowserEnv:gc,hasStandardBrowserWebWorkerEnv:vc,navigator:Cn,origin:wc},Symbol.toStringTag,{value:"Module"})),...yc};function bc(e,t){return pr(e,new fe.classes.URLSearchParams,{visitor:function(r,n,i,s){return fe.isNode&&N.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function $c(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ec(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],t[s]=e[s];return t}function Ls(e){function t(r,n,i,s){let a=r[s++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),c=s>=r.length;return a=!a&&N.isArray(i)?i.length:a,c?(N.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!o):((!i[a]||!N.isObject(i[a]))&&(i[a]=[]),t(r,n,i[a],s)&&N.isArray(i[a])&&(i[a]=Ec(i[a])),!o)}if(N.isFormData(e)&&N.isFunction(e.entries)){const r={};return N.forEachEntry(e,(n,i)=>{t($c(n),i,r,0)}),r}return null}function Sc(e,t,r){if(N.isString(e))try{return(t||JSON.parse)(e),N.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Jt={transitional:Ms,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=N.isObject(t);if(s&&N.isHTMLForm(t)&&(t=new FormData(t)),N.isFormData(t))return i?JSON.stringify(Ls(t)):t;if(N.isArrayBuffer(t)||N.isBuffer(t)||N.isStream(t)||N.isFile(t)||N.isBlob(t)||N.isReadableStream(t))return t;if(N.isArrayBufferView(t))return t.buffer;if(N.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return bc(t,this.formSerializer).toString();if((o=N.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return pr(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),Sc(t)):t}],transformResponse:[function(t){const r=this.transitional||Jt.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(N.isResponse(t)||N.isReadableStream(t))return t;if(t&&N.isString(t)&&(n&&!this.responseType||i)){const a=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(o){if(a)throw o.name==="SyntaxError"?K.from(o,K.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fe.classes.FormData,Blob:fe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};N.forEach(["delete","get","head","post","put","patch"],e=>{Jt.headers[e]={}});const Pc=N.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"]),kc=e=>{const t={};let r,n,i;return e&&e.split(`
2
+ `).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||t[r]&&Pc[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},xs=Symbol("internals");function Gt(e){return e&&String(e).trim().toLowerCase()}function mr(e){return e===!1||e==null?e:N.isArray(e)?e.map(mr):String(e)}function Rc(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Oc=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function qn(e,t,r,n,i){if(N.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!N.isString(t)){if(N.isString(n))return t.indexOf(n)!==-1;if(N.isRegExp(n))return n.test(t)}}function Tc(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Nc(e,t){const r=N.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,a){return this[n].call(this,t,i,s,a)},configurable:!0})})}let be=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(o,c,l){const u=Gt(c);if(!u)throw new Error("header name must be a non-empty string");const v=N.findKey(i,u);(!v||i[v]===void 0||l===!0||l===void 0&&i[v]!==!1)&&(i[v||c]=mr(o))}const a=(o,c)=>N.forEach(o,(l,u)=>s(l,u,c));if(N.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(N.isString(t)&&(t=t.trim())&&!Oc(t))a(kc(t),r);else if(N.isObject(t)&&N.isIterable(t)){let o={},c,l;for(const u of t){if(!N.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(c=o[l])?N.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}a(o,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=Gt(t),t){const n=N.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return Rc(i);if(N.isFunction(r))return r.call(this,i,n);if(N.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Gt(t),t){const n=N.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||qn(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function s(a){if(a=Gt(a),a){const o=N.findKey(n,a);o&&(!r||qn(n,n[o],o,r))&&(delete n[o],i=!0)}}return N.isArray(t)?t.forEach(s):s(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!t||qn(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const r=this,n={};return N.forEach(this,(i,s)=>{const a=N.findKey(n,s);if(a){r[a]=mr(i),delete r[s];return}const o=t?Tc(s):String(s).trim();o!==s&&delete r[s],r[o]=mr(i),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return N.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&N.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[xs]=this[xs]={accessors:{}}).accessors,i=this.prototype;function s(a){const o=Gt(a);n[o]||(Nc(i,a),n[o]=!0)}return N.isArray(t)?t.forEach(s):s(t),this}};be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),N.reduceDescriptors(be.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),N.freezeMethods(be);function In(e,t){const r=this||Jt,n=t||r,i=be.from(n.headers);let s=n.data;return N.forEach(e,function(o){s=o.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Fs(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){K.call(this,e??"canceled",K.ERR_CANCELED,t,r),this.name="CanceledError"}N.inherits(jt,K,{__CANCEL__:!0});function Us(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new K("Request failed with status code "+r.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ac(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function jc(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=n[s];a||(a=l),r[i]=c,n[i]=l;let v=s,m=0;for(;v!==i;)m+=r[v++],v=v%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),l-a<t)return;const y=u&&l-u;return y?Math.round(m*1e3/y):void 0}}function Cc(e,t){let r=0,n=1e3/t,i,s;const a=(l,u=Date.now())=>{r=u,i=null,s&&(clearTimeout(s),s=null),e(...l)};return[(...l)=>{const u=Date.now(),v=u-r;v>=n?a(l,u):(i=l,s||(s=setTimeout(()=>{s=null,a(i)},n-v)))},()=>i&&a(i)]}const _r=(e,t,r=3)=>{let n=0;const i=jc(50,250);return Cc(s=>{const a=s.loaded,o=s.lengthComputable?s.total:void 0,c=a-n,l=i(c),u=a<=o;n=a;const v={loaded:a,total:o,progress:o?a/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o&&u?(o-a)/l:void 0,event:s,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(v)},r)},Vs=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},zs=e=>(...t)=>N.asap(()=>e(...t)),qc=fe.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,fe.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(fe.origin),fe.navigator&&/(msie|trident)/i.test(fe.navigator.userAgent)):()=>!0,Ic=fe.hasStandardBrowserEnv?{write(e,t,r,n,i,s,a){if(typeof document>"u")return;const o=[`${e}=${encodeURIComponent(t)}`];N.isNumber(r)&&o.push(`expires=${new Date(r).toUTCString()}`),N.isString(n)&&o.push(`path=${n}`),N.isString(i)&&o.push(`domain=${i}`),s===!0&&o.push("secure"),N.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Dc(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Mc(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Hs(e,t,r){let n=!Dc(t);return e&&(n||r==!1)?Mc(e,t):t}const Ks=e=>e instanceof be?{...e}:e;function _t(e,t){t=t||{};const r={};function n(l,u,v,m){return N.isPlainObject(l)&&N.isPlainObject(u)?N.merge.call({caseless:m},l,u):N.isPlainObject(u)?N.merge({},u):N.isArray(u)?u.slice():u}function i(l,u,v,m){if(N.isUndefined(u)){if(!N.isUndefined(l))return n(void 0,l,v,m)}else return n(l,u,v,m)}function s(l,u){if(!N.isUndefined(u))return n(void 0,u)}function a(l,u){if(N.isUndefined(u)){if(!N.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function o(l,u,v){if(v in t)return n(l,u);if(v in e)return n(void 0,l)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(l,u,v)=>i(Ks(l),Ks(u),v,!0)};return N.forEach(Object.keys({...e,...t}),function(u){const v=c[u]||i,m=v(e[u],t[u],u);N.isUndefined(m)&&v!==o||(r[u]=m)}),r}const Bs=e=>{const t=_t({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:o}=t;if(t.headers=a=be.from(a),t.url=Is(Hs(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),N.isFormData(r)){if(fe.hasStandardBrowserEnv||fe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(N.isFunction(r.getHeaders)){const c=r.getHeaders(),l=["content-type","content-length"];Object.entries(c).forEach(([u,v])=>{l.includes(u.toLowerCase())&&a.set(u,v)})}}if(fe.hasStandardBrowserEnv&&(n&&N.isFunction(n)&&(n=n(t)),n||n!==!1&&qc(t.url))){const c=i&&s&&Ic.read(s);c&&a.set(i,c)}return t},Lc=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const i=Bs(e);let s=i.data;const a=be.from(i.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:l}=i,u,v,m,y,h;function w(){y&&y(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let d=new XMLHttpRequest;d.open(i.method.toUpperCase(),i.url,!0),d.timeout=i.timeout;function _(){if(!d)return;const g=be.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),p={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:e,request:d};Us(function(S){r(S),w()},function(S){n(S),w()},p),d=null}"onloadend"in d?d.onloadend=_:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(_)},d.onabort=function(){d&&(n(new K("Request aborted",K.ECONNABORTED,e,d)),d=null)},d.onerror=function(E){const p=E&&E.message?E.message:"Network Error",$=new K(p,K.ERR_NETWORK,e,d);$.event=E||null,n($),d=null},d.ontimeout=function(){let E=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const p=i.transitional||Ms;i.timeoutErrorMessage&&(E=i.timeoutErrorMessage),n(new K(E,p.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,e,d)),d=null},s===void 0&&a.setContentType(null),"setRequestHeader"in d&&N.forEach(a.toJSON(),function(E,p){d.setRequestHeader(p,E)}),N.isUndefined(i.withCredentials)||(d.withCredentials=!!i.withCredentials),o&&o!=="json"&&(d.responseType=i.responseType),l&&([m,h]=_r(l,!0),d.addEventListener("progress",m)),c&&d.upload&&([v,y]=_r(c),d.upload.addEventListener("progress",v),d.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(u=g=>{d&&(n(!g||g.type?new jt(null,e,d):g),d.abort(),d=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const f=Ac(i.url);if(f&&fe.protocols.indexOf(f)===-1){n(new K("Unsupported protocol "+f+":",K.ERR_BAD_REQUEST,e));return}d.send(s||null)})},xc=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const s=function(l){if(!i){i=!0,o();const u=l instanceof Error?l:this.reason;n.abort(u instanceof K?u:new jt(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,s(new K(`timeout ${t} of ms exceeded`,K.ETIMEDOUT))},t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>N.asap(o),c}},Fc=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},Uc=async function*(e,t){for await(const r of Vc(e))yield*Fc(r,t)},Vc=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Js=(e,t,r,n)=>{const i=Uc(e,t);let s=0,a,o=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await i.next();if(l){o(),c.close();return}let v=u.byteLength;if(r){let m=s+=v;r(m)}c.enqueue(new Uint8Array(u))}catch(l){throw o(l),l}},cancel(c){return o(c),i.return()}},{highWaterMark:2})},Gs=64*1024,{isFunction:yr}=N,zc=(({Request:e,Response:t})=>({Request:e,Response:t}))(N.global),{ReadableStream:Ws,TextEncoder:Zs}=N.global,Xs=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Hc=e=>{e=N.merge.call({skipUndefined:!0},zc,e);const{fetch:t,Request:r,Response:n}=e,i=t?yr(t):typeof fetch=="function",s=yr(r),a=yr(n);if(!i)return!1;const o=i&&yr(Ws),c=i&&(typeof Zs=="function"?(h=>w=>h.encode(w))(new Zs):async h=>new Uint8Array(await new r(h).arrayBuffer())),l=s&&o&&Xs(()=>{let h=!1;const w=new r(fe.origin,{body:new Ws,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!w}),u=a&&o&&Xs(()=>N.isReadableStream(new n("").body)),v={stream:u&&(h=>h.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!v[h]&&(v[h]=(w,d)=>{let _=w&&w[h];if(_)return _.call(w);throw new K(`Response type '${h}' is not supported`,K.ERR_NOT_SUPPORT,d)})});const m=async h=>{if(h==null)return 0;if(N.isBlob(h))return h.size;if(N.isSpecCompliantForm(h))return(await new r(fe.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(N.isArrayBufferView(h)||N.isArrayBuffer(h))return h.byteLength;if(N.isURLSearchParams(h)&&(h=h+""),N.isString(h))return(await c(h)).byteLength},y=async(h,w)=>{const d=N.toFiniteNumber(h.getContentLength());return d??m(w)};return async h=>{let{url:w,method:d,data:_,signal:f,cancelToken:g,timeout:E,onDownloadProgress:p,onUploadProgress:$,responseType:S,headers:A,withCredentials:I="same-origin",fetchOptions:L}=Bs(h),x=t||fetch;S=S?(S+"").toLowerCase():"text";let H=xc([f,g&&g.toAbortSignal()],E),z=null;const B=H&&H.unsubscribe&&(()=>{H.unsubscribe()});let ae;try{if($&&l&&d!=="get"&&d!=="head"&&(ae=await y(A,_))!==0){let R=new r(w,{method:"POST",body:_,duplex:"half"}),C;if(N.isFormData(_)&&(C=R.headers.get("content-type"))&&A.setContentType(C),R.body){const[T,b]=Vs(ae,_r(zs($)));_=Js(R.body,Gs,T,b)}}N.isString(I)||(I=I?"include":"omit");const oe=s&&"credentials"in r.prototype,je={...L,signal:H,method:d.toUpperCase(),headers:A.normalize().toJSON(),body:_,duplex:"half",credentials:oe?I:void 0};z=s&&new r(w,je);let Z=await(s?x(z,L):x(w,je));const Ue=u&&(S==="stream"||S==="response");if(u&&(p||Ue&&B)){const R={};["status","statusText","headers"].forEach(P=>{R[P]=Z[P]});const C=N.toFiniteNumber(Z.headers.get("content-length")),[T,b]=p&&Vs(C,_r(zs(p),!0))||[];Z=new n(Js(Z.body,Gs,T,()=>{b&&b(),B&&B()}),R)}S=S||"text";let D=await v[N.findKey(v,S)||"text"](Z,h);return!Ue&&B&&B(),await new Promise((R,C)=>{Us(R,C,{data:D,headers:be.from(Z.headers),status:Z.status,statusText:Z.statusText,config:h,request:z})})}catch(oe){throw B&&B(),oe&&oe.name==="TypeError"&&/Load failed|fetch/i.test(oe.message)?Object.assign(new K("Network Error",K.ERR_NETWORK,h,z),{cause:oe.cause||oe}):K.from(oe,oe&&oe.code,h,z)}}},Kc=new Map,Ys=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,s=[n,i,r];let a=s.length,o=a,c,l,u=Kc;for(;o--;)c=s[o],l=u.get(c),l===void 0&&u.set(c,l=o?new Map:Hc(t)),u=l;return l};Ys();const Dn={http:hc,xhr:Lc,fetch:{get:Ys}};N.forEach(Dn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Qs=e=>`- ${e}`,Bc=e=>N.isFunction(e)||e===null||e===!1;function Jc(e,t){e=N.isArray(e)?e:[e];const{length:r}=e;let n,i;const s={};for(let a=0;a<r;a++){n=e[a];let o;if(i=n,!Bc(n)&&(i=Dn[(o=String(n)).toLowerCase()],i===void 0))throw new K(`Unknown adapter '${o}'`);if(i&&(N.isFunction(i)||(i=i.get(t))))break;s[o||"#"+a]=i}if(!i){const a=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=r?a.length>1?`since :
4
+ `+a.map(Qs).join(`
5
+ `):" "+Qs(a[0]):"as no adapter specified";throw new K("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i}const ei={getAdapter:Jc,adapters:Dn};function Mn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function ti(e){return Mn(e),e.headers=be.from(e.headers),e.data=In.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ei.getAdapter(e.adapter||Jt.adapter,e)(e).then(function(n){return Mn(e),n.data=In.call(e,e.transformResponse,n),n.headers=be.from(n.headers),n},function(n){return Fs(n)||(Mn(e),n&&n.response&&(n.response.data=In.call(e,e.transformResponse,n.response),n.response.headers=be.from(n.response.headers))),Promise.reject(n)})}const ri="1.13.2",gr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ni={};gr.transitional=function(t,r,n){function i(s,a){return"[Axios v"+ri+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,o)=>{if(t===!1)throw new K(i(a," has been removed"+(r?" in "+r:"")),K.ERR_DEPRECATED);return r&&!ni[a]&&(ni[a]=!0,console.warn(i(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,o):!0}},gr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Gc(e,t,r){if(typeof e!="object")throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const s=n[i],a=t[s];if(a){const o=e[s],c=o===void 0||a(o,s,e);if(c!==!0)throw new K("option "+s+" must be "+c,K.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new K("Unknown option "+s,K.ERR_BAD_OPTION)}}const vr={assertOptions:Gc,validators:gr},ze=vr.validators;let yt=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ds,response:new Ds}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
+ `+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=_t(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&vr.assertOptions(n,{silentJSONParsing:ze.transitional(ze.boolean),forcedJSONParsing:ze.transitional(ze.boolean),clarifyTimeoutError:ze.transitional(ze.boolean)},!1),i!=null&&(N.isFunction(i)?r.paramsSerializer={serialize:i}:vr.assertOptions(i,{encode:ze.function,serialize:ze.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),vr.assertOptions(r,{baseUrl:ze.spelling("baseURL"),withXsrfToken:ze.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&N.merge(s.common,s[r.method]);s&&N.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),r.headers=be.concat(a,s);const o=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(r)===!1||(c=c&&w.synchronous,o.unshift(w.fulfilled,w.rejected))});const l=[];this.interceptors.response.forEach(function(w){l.push(w.fulfilled,w.rejected)});let u,v=0,m;if(!c){const h=[ti.bind(this),void 0];for(h.unshift(...o),h.push(...l),m=h.length,u=Promise.resolve(r);v<m;)u=u.then(h[v++],h[v++]);return u}m=o.length;let y=r;for(;v<m;){const h=o[v++],w=o[v++];try{y=h(y)}catch(d){w.call(this,d);break}}try{u=ti.call(this,y)}catch(h){return Promise.reject(h)}for(v=0,m=l.length;v<m;)u=u.then(l[v++],l[v++]);return u}getUri(t){t=_t(this.defaults,t);const r=Hs(t.baseURL,t.url,t.allowAbsoluteUrls);return Is(r,t.params,t.paramsSerializer)}};N.forEach(["delete","get","head","options"],function(t){yt.prototype[t]=function(r,n){return this.request(_t(n||{},{method:t,url:r,data:(n||{}).data}))}}),N.forEach(["post","put","patch"],function(t){function r(n){return function(s,a,o){return this.request(_t(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}yt.prototype[t]=r(),yt.prototype[t+"Form"]=r(!0)});let Wc=class Oo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(o=>{n.subscribe(o),s=o}).then(i);return a.cancel=function(){n.unsubscribe(s)},a},t(function(s,a,o){n.reason||(n.reason=new jt(s,a,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Oo(function(i){t=i}),cancel:t}}};function Zc(e){return function(r){return e.apply(null,r)}}function Xc(e){return N.isObject(e)&&e.isAxiosError===!0}const Ln={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ln).forEach(([e,t])=>{Ln[t]=e});function si(e){const t=new yt(e),r=ws(yt.prototype.request,t);return N.extend(r,yt.prototype,t,{allOwnKeys:!0}),N.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return si(_t(e,i))},r}const se=si(Jt);se.Axios=yt,se.CanceledError=jt,se.CancelToken=Wc,se.isCancel=Fs,se.VERSION=ri,se.toFormData=pr,se.AxiosError=K,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=Zc,se.isAxiosError=Xc,se.mergeConfig=_t,se.AxiosHeaders=be,se.formToJSON=e=>Ls(N.isHTMLForm(e)?new FormData(e):e),se.getAdapter=ei.getAdapter,se.HttpStatusCode=Ln,se.default=se;const{Axios:yd,AxiosError:gd,CanceledError:vd,isCancel:wd,CancelToken:bd,VERSION:$d,all:Ed,Cancel:Sd,isAxiosError:Pd,spread:kd,toFormData:Rd,AxiosHeaders:Od,HttpStatusCode:Td,formToJSON:Nd,getAdapter:Ad,mergeConfig:jd}=se;function Yc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wr={exports:{}},xn={},Ze={},gt={},Fn={},Un={},Vn={},ii;function br(){return ii||(ii=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((g,E)=>`${g}${E}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((g,E)=>(E instanceof r&&(g[E.str]=(g[E.str]||0)+1),g),{})}}e._Code=n,e.nil=new n("");function i(_,...f){const g=[_[0]];let E=0;for(;E<f.length;)o(g,f[E]),g.push(_[++E]);return new n(g)}e._=i;const s=new n("+");function a(_,...f){const g=[y(_[0])];let E=0;for(;E<f.length;)g.push(s),o(g,f[E]),g.push(s,y(_[++E]));return c(g),new n(g)}e.str=a;function o(_,f){f instanceof n?_.push(...f._items):f instanceof r?_.push(f):_.push(v(f))}e.addCodeArg=o;function c(_){let f=1;for(;f<_.length-1;){if(_[f]===s){const g=l(_[f-1],_[f+1]);if(g!==void 0){_.splice(f-1,3,g);continue}_[f++]="+"}f++}}function l(_,f){if(f==='""')return _;if(_==='""')return f;if(typeof _=="string")return f instanceof r||_[_.length-1]!=='"'?void 0:typeof f!="string"?`${_.slice(0,-1)}${f}"`:f[0]==='"'?_.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(_ instanceof r))return`"${_}${f.slice(1)}`}function u(_,f){return f.emptyStr()?_:_.emptyStr()?f:a`${_}${f}`}e.strConcat=u;function v(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:y(Array.isArray(_)?_.join(","):_)}function m(_){return new n(y(_))}e.stringify=m;function y(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function h(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):i`[${_}]`}e.getProperty=h;function w(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=w;function d(_){return new n(_.toString())}e.regexpCode=d})(Vn)),Vn}var zn={},ai;function oi(){return ai||(ai=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=br();class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:l,parent:u}={}){this._names={},this._prefixes=l,this._parent=u}toName(l){return l instanceof t.Name?l:this.name(l)}name(l){return new t.Name(this._newName(l))}_newName(l){const u=this._names[l]||this._nameGroup(l);return`${l}${u.index++}`}_nameGroup(l){var u,v;if(!((v=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||v===void 0)&&v.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}e.Scope=i;class s extends t.Name{constructor(l,u){super(u),this.prefix=l}setValue(l,{property:u,itemIndex:v}){this.value=l,this.scopePath=(0,t._)`.${new t.Name(u)}[${v}]`}}e.ValueScopeName=s;const a=(0,t._)`\n`;class o extends i{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?a:t.nil}}get(){return this._scope}name(l){return new s(l,this._newName(l))}value(l,u){var v;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const m=this.toName(l),{prefix:y}=m,h=(v=u.key)!==null&&v!==void 0?v:u.ref;let w=this._values[y];if(w){const f=w.get(h);if(f)return f}else w=this._values[y]=new Map;w.set(h,m);const d=this._scope[y]||(this._scope[y]=[]),_=d.length;return d[_]=u.ref,m.setValue(u,{property:y,itemIndex:_}),m}getValue(l,u){const v=this._values[l];if(v)return v.get(u)}scopeRefs(l,u=this._values){return this._reduceValues(u,v=>{if(v.scopePath===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return(0,t._)`${l}${v.scopePath}`})}scopeCode(l=this._values,u,v){return this._reduceValues(l,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},u,v)}_reduceValues(l,u,v={},m){let y=t.nil;for(const h in l){const w=l[h];if(!w)continue;const d=v[h]=v[h]||new Map;w.forEach(_=>{if(d.has(_))return;d.set(_,n.Started);let f=u(_);if(f){const g=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${g} ${_} = ${f};${this.opts._n}`}else if(f=m?.(_))y=(0,t._)`${y}${f}${this.opts._n}`;else throw new r(_);d.set(_,n.Completed)})}return y}}e.ValueScope=o})(zn)),zn}var ci;function W(){return ci||(ci=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=br(),r=oi();var n=br();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=oi();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(b,P){return this}}class a extends s{constructor(b,P,j){super(),this.varKind=b,this.name=P,this.rhs=j}render({es5:b,_n:P}){const j=b?r.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${j} ${this.name}${F};`+P}optimizeNames(b,P){if(b[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,b,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends s{constructor(b,P,j){super(),this.lhs=b,this.rhs=P,this.sideEffects=j}render({_n:b}){return`${this.lhs} = ${this.rhs};`+b}optimizeNames(b,P){if(!(this.lhs instanceof t.Name&&!b[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,b,P),this}get names(){const b=this.lhs instanceof t.Name?{}:{...this.lhs.names};return z(b,this.rhs)}}class c extends o{constructor(b,P,j,F){super(b,j,F),this.op=P}render({_n:b}){return`${this.lhs} ${this.op}= ${this.rhs};`+b}}class l extends s{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`${this.label}:`+b}}class u extends s{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`break${this.label?` ${this.label}`:""};`+b}}class v extends s{constructor(b){super(),this.error=b}render({_n:b}){return`throw ${this.error};`+b}get names(){return this.error.names}}class m extends s{constructor(b){super(),this.code=b}render({_n:b}){return`${this.code};`+b}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(b,P){return this.code=B(this.code,b,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends s{constructor(b=[]){super(),this.nodes=b}render(b){return this.nodes.reduce((P,j)=>P+j.render(b),"")}optimizeNodes(){const{nodes:b}=this;let P=b.length;for(;P--;){const j=b[P].optimizeNodes();Array.isArray(j)?b.splice(P,1,...j):j?b[P]=j:b.splice(P,1)}return b.length>0?this:void 0}optimizeNames(b,P){const{nodes:j}=this;let F=j.length;for(;F--;){const V=j[F];V.optimizeNames(b,P)||(ae(b,V.names),j.splice(F,1))}return j.length>0?this:void 0}get names(){return this.nodes.reduce((b,P)=>H(b,P.names),{})}}class h extends y{render(b){return"{"+b._n+super.render(b)+"}"+b._n}}class w extends y{}class d extends h{}d.kind="else";class _ extends h{constructor(b,P){super(P),this.condition=b}render(b){let P=`if(${this.condition})`+super.render(b);return this.else&&(P+="else "+this.else.render(b)),P}optimizeNodes(){super.optimizeNodes();const b=this.condition;if(b===!0)return this.nodes;let P=this.else;if(P){const j=P.optimizeNodes();P=this.else=Array.isArray(j)?new d(j):j}if(P)return b===!1?P instanceof _?P:P.nodes:this.nodes.length?this:new _(oe(b),P instanceof _?[P]:P.nodes);if(!(b===!1||!this.nodes.length))return this}optimizeNames(b,P){var j;if(this.else=(j=this.else)===null||j===void 0?void 0:j.optimizeNames(b,P),!!(super.optimizeNames(b,P)||this.else))return this.condition=B(this.condition,b,P),this}get names(){const b=super.names;return z(b,this.condition),this.else&&H(b,this.else.names),b}}_.kind="if";class f extends h{}f.kind="for";class g extends f{constructor(b){super(),this.iteration=b}render(b){return`for(${this.iteration})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iteration=B(this.iteration,b,P),this}get names(){return H(super.names,this.iteration.names)}}class E extends f{constructor(b,P,j,F){super(),this.varKind=b,this.name=P,this.from=j,this.to=F}render(b){const P=b.es5?r.varKinds.var:this.varKind,{name:j,from:F,to:V}=this;return`for(${P} ${j}=${F}; ${j}<${V}; ${j}++)`+super.render(b)}get names(){const b=z(super.names,this.from);return z(b,this.to)}}class p extends f{constructor(b,P,j,F){super(),this.loop=b,this.varKind=P,this.name=j,this.iterable=F}render(b){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iterable=B(this.iterable,b,P),this}get names(){return H(super.names,this.iterable.names)}}class $ extends h{constructor(b,P,j){super(),this.name=b,this.args=P,this.async=j}render(b){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(b)}}$.kind="func";class S extends y{render(b){return"return "+super.render(b)}}S.kind="return";class A extends h{render(b){let P="try"+super.render(b);return this.catch&&(P+=this.catch.render(b)),this.finally&&(P+=this.finally.render(b)),P}optimizeNodes(){var b,P;return super.optimizeNodes(),(b=this.catch)===null||b===void 0||b.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(b,P){var j,F;return super.optimizeNames(b,P),(j=this.catch)===null||j===void 0||j.optimizeNames(b,P),(F=this.finally)===null||F===void 0||F.optimizeNames(b,P),this}get names(){const b=super.names;return this.catch&&H(b,this.catch.names),this.finally&&H(b,this.finally.names),b}}class I extends h{constructor(b){super(),this.error=b}render(b){return`catch(${this.error})`+super.render(b)}}I.kind="catch";class L extends h{render(b){return"finally"+super.render(b)}}L.kind="finally";class x{constructor(b,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
7
+ `:""},this._extScope=b,this._scope=new r.Scope({parent:b}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(b){return this._scope.name(b)}scopeName(b){return this._extScope.name(b)}scopeValue(b,P){const j=this._extScope.value(b,P);return(this._values[j.prefix]||(this._values[j.prefix]=new Set)).add(j),j}getScopeValue(b,P){return this._extScope.getValue(b,P)}scopeRefs(b){return this._extScope.scopeRefs(b,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(b,P,j,F){const V=this._scope.toName(P);return j!==void 0&&F&&(this._constants[V.str]=j),this._leafNode(new a(b,V,j)),V}const(b,P,j){return this._def(r.varKinds.const,b,P,j)}let(b,P,j){return this._def(r.varKinds.let,b,P,j)}var(b,P,j){return this._def(r.varKinds.var,b,P,j)}assign(b,P,j){return this._leafNode(new o(b,P,j))}add(b,P){return this._leafNode(new c(b,e.operators.ADD,P))}code(b){return typeof b=="function"?b():b!==t.nil&&this._leafNode(new m(b)),this}object(...b){const P=["{"];for(const[j,F]of b)P.length>1&&P.push(","),P.push(j),(j!==F||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,F));return P.push("}"),new t._Code(P)}if(b,P,j){if(this._blockNode(new _(b)),P&&j)this.code(P).else().code(j).endIf();else if(P)this.code(P).endIf();else if(j)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(b){return this._elseNode(new _(b))}else(){return this._elseNode(new d)}endIf(){return this._endBlockNode(_,d)}_for(b,P){return this._blockNode(b),P&&this.code(P).endFor(),this}for(b,P){return this._for(new g(b),P)}forRange(b,P,j,F,V=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(b);return this._for(new E(V,ee,P,j),()=>F(ee))}forOf(b,P,j,F=r.varKinds.const){const V=this._scope.toName(b);if(this.opts.es5){const ee=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${ee}.length`,X=>{this.var(V,(0,t._)`${ee}[${X}]`),j(V)})}return this._for(new p("of",F,V,P),()=>j(V))}forIn(b,P,j,F=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(b,(0,t._)`Object.keys(${P})`,j);const V=this._scope.toName(b);return this._for(new p("in",F,V,P),()=>j(V))}endFor(){return this._endBlockNode(f)}label(b){return this._leafNode(new l(b))}break(b){return this._leafNode(new u(b))}return(b){const P=new S;if(this._blockNode(P),this.code(b),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(b,P,j){if(!P&&!j)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new A;if(this._blockNode(F),this.code(b),P){const V=this.name("e");this._currNode=F.catch=new I(V),P(V)}return j&&(this._currNode=F.finally=new L,this.code(j)),this._endBlockNode(I,L)}throw(b){return this._leafNode(new v(b))}block(b,P){return this._blockStarts.push(this._nodes.length),b&&this.code(b).endBlock(P),this}endBlock(b){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const j=this._nodes.length-P;if(j<0||b!==void 0&&j!==b)throw new Error(`CodeGen: wrong number of nodes: ${j} vs ${b} expected`);return this._nodes.length=P,this}func(b,P=t.nil,j,F){return this._blockNode(new $(b,P,j)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(b=1){for(;b-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(b){return this._currNode.nodes.push(b),this}_blockNode(b){this._currNode.nodes.push(b),this._nodes.push(b)}_endBlockNode(b,P){const j=this._currNode;if(j instanceof b||P&&j instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${b.kind}/${P.kind}`:b.kind}"`)}_elseNode(b){const P=this._currNode;if(!(P instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=b,this}get _root(){return this._nodes[0]}get _currNode(){const b=this._nodes;return b[b.length-1]}set _currNode(b){const P=this._nodes;P[P.length-1]=b}}e.CodeGen=x;function H(T,b){for(const P in b)T[P]=(T[P]||0)+(b[P]||0);return T}function z(T,b){return b instanceof t._CodeOrName?H(T,b.names):T}function B(T,b,P){if(T instanceof t.Name)return j(T);if(!F(T))return T;return new t._Code(T._items.reduce((V,ee)=>(ee instanceof t.Name&&(ee=j(ee)),ee instanceof t._Code?V.push(...ee._items):V.push(ee),V),[]));function j(V){const ee=P[V.str];return ee===void 0||b[V.str]!==1?V:(delete b[V.str],ee)}function F(V){return V instanceof t._Code&&V._items.some(ee=>ee instanceof t.Name&&b[ee.str]===1&&P[ee.str]!==void 0)}}function ae(T,b){for(const P in b)T[P]=(T[P]||0)-(b[P]||0)}function oe(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,t._)`!${C(T)}`}e.not=oe;const je=R(e.operators.AND);function Z(...T){return T.reduce(je)}e.and=Z;const Ue=R(e.operators.OR);function D(...T){return T.reduce(Ue)}e.or=D;function R(T){return(b,P)=>b===t.nil?P:P===t.nil?b:(0,t._)`${C(b)} ${T} ${C(P)}`}function C(T){return T instanceof t.Name?T:(0,t._)`(${T})`}})(Un)),Un}var J={},li;function Y(){if(li)return J;li=1,Object.defineProperty(J,"__esModule",{value:!0}),J.checkStrictMode=J.getErrorPath=J.Type=J.useFunc=J.setEvaluated=J.evaluatedPropsToName=J.mergeEvaluated=J.eachItem=J.unescapeJsonPointer=J.escapeJsonPointer=J.escapeFragment=J.unescapeFragment=J.schemaRefOrVal=J.schemaHasRulesButRef=J.schemaHasRules=J.checkUnknownRules=J.alwaysValidSchema=J.toHash=void 0;const e=W(),t=br();function r(p){const $={};for(const S of p)$[S]=!0;return $}J.toHash=r;function n(p,$){return typeof $=="boolean"?$:Object.keys($).length===0?!0:(i(p,$),!s($,p.self.RULES.all))}J.alwaysValidSchema=n;function i(p,$=p.schema){const{opts:S,self:A}=p;if(!S.strictSchema||typeof $=="boolean")return;const I=A.RULES.keywords;for(const L in $)I[L]||E(p,`unknown keyword: "${L}"`)}J.checkUnknownRules=i;function s(p,$){if(typeof p=="boolean")return!p;for(const S in p)if($[S])return!0;return!1}J.schemaHasRules=s;function a(p,$){if(typeof p=="boolean")return!p;for(const S in p)if(S!=="$ref"&&$.all[S])return!0;return!1}J.schemaHasRulesButRef=a;function o({topSchemaRef:p,schemaPath:$},S,A,I){if(!I){if(typeof S=="number"||typeof S=="boolean")return S;if(typeof S=="string")return(0,e._)`${S}`}return(0,e._)`${p}${$}${(0,e.getProperty)(A)}`}J.schemaRefOrVal=o;function c(p){return v(decodeURIComponent(p))}J.unescapeFragment=c;function l(p){return encodeURIComponent(u(p))}J.escapeFragment=l;function u(p){return typeof p=="number"?`${p}`:p.replace(/~/g,"~0").replace(/\//g,"~1")}J.escapeJsonPointer=u;function v(p){return p.replace(/~1/g,"/").replace(/~0/g,"~")}J.unescapeJsonPointer=v;function m(p,$){if(Array.isArray(p))for(const S of p)$(S);else $(p)}J.eachItem=m;function y({mergeNames:p,mergeToName:$,mergeValues:S,resultToName:A}){return(I,L,x,H)=>{const z=x===void 0?L:x instanceof e.Name?(L instanceof e.Name?p(I,L,x):$(I,L,x),x):L instanceof e.Name?($(I,x,L),L):S(L,x);return H===e.Name&&!(z instanceof e.Name)?A(I,z):z}}J.mergeEvaluated={props:y({mergeNames:(p,$,S)=>p.if((0,e._)`${S} !== true && ${$} !== undefined`,()=>{p.if((0,e._)`${$} === true`,()=>p.assign(S,!0),()=>p.assign(S,(0,e._)`${S} || {}`).code((0,e._)`Object.assign(${S}, ${$})`))}),mergeToName:(p,$,S)=>p.if((0,e._)`${S} !== true`,()=>{$===!0?p.assign(S,!0):(p.assign(S,(0,e._)`${S} || {}`),w(p,S,$))}),mergeValues:(p,$)=>p===!0?!0:{...p,...$},resultToName:h}),items:y({mergeNames:(p,$,S)=>p.if((0,e._)`${S} !== true && ${$} !== undefined`,()=>p.assign(S,(0,e._)`${$} === true ? true : ${S} > ${$} ? ${S} : ${$}`)),mergeToName:(p,$,S)=>p.if((0,e._)`${S} !== true`,()=>p.assign(S,$===!0?!0:(0,e._)`${S} > ${$} ? ${S} : ${$}`)),mergeValues:(p,$)=>p===!0?!0:Math.max(p,$),resultToName:(p,$)=>p.var("items",$)})};function h(p,$){if($===!0)return p.var("props",!0);const S=p.var("props",(0,e._)`{}`);return $!==void 0&&w(p,S,$),S}J.evaluatedPropsToName=h;function w(p,$,S){Object.keys(S).forEach(A=>p.assign((0,e._)`${$}${(0,e.getProperty)(A)}`,!0))}J.setEvaluated=w;const d={};function _(p,$){return p.scopeValue("func",{ref:$,code:d[$.code]||(d[$.code]=new t._Code($.code))})}J.useFunc=_;var f;(function(p){p[p.Num=0]="Num",p[p.Str=1]="Str"})(f||(J.Type=f={}));function g(p,$,S){if(p instanceof e.Name){const A=$===f.Num;return S?A?(0,e._)`"[" + ${p} + "]"`:(0,e._)`"['" + ${p} + "']"`:A?(0,e._)`"/" + ${p}`:(0,e._)`"/" + ${p}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return S?(0,e.getProperty)(p).toString():"/"+u(p)}J.getErrorPath=g;function E(p,$,S=p.opts.strictSchema){if(S){if($=`strict mode: ${$}`,S===!0)throw new Error($);p.self.logger.warn($)}}return J.checkStrictMode=E,J}var $r={},ui;function lt(){if(ui)return $r;ui=1,Object.defineProperty($r,"__esModule",{value:!0});const e=W(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return $r.default=t,$r}var di;function Er(){return di||(di=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=W(),r=Y(),n=lt();e.keywordError={message:({keyword:d})=>(0,t.str)`must pass "${d}" keyword validation`},e.keyword$DataError={message:({keyword:d,schemaType:_})=>_?(0,t.str)`"${d}" keyword must be ${_} ($data)`:(0,t.str)`"${d}" keyword is invalid ($data)`};function i(d,_=e.keywordError,f,g){const{it:E}=d,{gen:p,compositeRule:$,allErrors:S}=E,A=v(d,_,f);g??($||S)?c(p,A):l(E,(0,t._)`[${A}]`)}e.reportError=i;function s(d,_=e.keywordError,f){const{it:g}=d,{gen:E,compositeRule:p,allErrors:$}=g,S=v(d,_,f);c(E,S),p||$||l(g,n.default.vErrors)}e.reportExtraError=s;function a(d,_){d.assign(n.default.errors,_),d.if((0,t._)`${n.default.vErrors} !== null`,()=>d.if(_,()=>d.assign((0,t._)`${n.default.vErrors}.length`,_),()=>d.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function o({gen:d,keyword:_,schemaValue:f,data:g,errsCount:E,it:p}){if(E===void 0)throw new Error("ajv implementation error");const $=d.name("err");d.forRange("i",E,n.default.errors,S=>{d.const($,(0,t._)`${n.default.vErrors}[${S}]`),d.if((0,t._)`${$}.instancePath === undefined`,()=>d.assign((0,t._)`${$}.instancePath`,(0,t.strConcat)(n.default.instancePath,p.errorPath))),d.assign((0,t._)`${$}.schemaPath`,(0,t.str)`${p.errSchemaPath}/${_}`),p.opts.verbose&&(d.assign((0,t._)`${$}.schema`,f),d.assign((0,t._)`${$}.data`,g))})}e.extendErrors=o;function c(d,_){const f=d.const("err",_);d.if((0,t._)`${n.default.vErrors} === null`,()=>d.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),d.code((0,t._)`${n.default.errors}++`)}function l(d,_){const{gen:f,validateName:g,schemaEnv:E}=d;E.$async?f.throw((0,t._)`new ${d.ValidationError}(${_})`):(f.assign((0,t._)`${g}.errors`,_),f.return(!1))}const u={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function v(d,_,f){const{createErrors:g}=d.it;return g===!1?(0,t._)`{}`:m(d,_,f)}function m(d,_,f={}){const{gen:g,it:E}=d,p=[y(E,f),h(d,f)];return w(d,_,p),g.object(...p)}function y({errorPath:d},{instancePath:_}){const f=_?(0,t.str)`${d}${(0,r.getErrorPath)(_,r.Type.Str)}`:d;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function h({keyword:d,it:{errSchemaPath:_}},{schemaPath:f,parentSchema:g}){let E=g?_:(0,t.str)`${_}/${d}`;return f&&(E=(0,t.str)`${E}${(0,r.getErrorPath)(f,r.Type.Str)}`),[u.schemaPath,E]}function w(d,{params:_,message:f},g){const{keyword:E,data:p,schemaValue:$,it:S}=d,{opts:A,propertyName:I,topSchemaRef:L,schemaPath:x}=S;g.push([u.keyword,E],[u.params,typeof _=="function"?_(d):_||(0,t._)`{}`]),A.messages&&g.push([u.message,typeof f=="function"?f(d):f]),A.verbose&&g.push([u.schema,$],[u.parentSchema,(0,t._)`${L}${x}`],[n.default.data,p]),I&&g.push([u.propertyName,I])}})(Fn)),Fn}var fi;function Qc(){if(fi)return gt;fi=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.boolOrEmptySchema=gt.topBoolOrEmptySchema=void 0;const e=Er(),t=W(),r=lt(),n={message:"boolean schema is false"};function i(o){const{gen:c,schema:l,validateName:u}=o;l===!1?a(o,!1):typeof l=="object"&&l.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${u}.errors`,null),c.return(!0))}gt.topBoolOrEmptySchema=i;function s(o,c){const{gen:l,schema:u}=o;u===!1?(l.var(c,!1),a(o)):l.var(c,!0)}gt.boolOrEmptySchema=s;function a(o,c){const{gen:l,data:u}=o,v={gen:l,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(v,n,void 0,c)}return gt}var ce={},vt={},hi;function pi(){if(hi)return vt;hi=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.getRules=vt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(i){return typeof i=="string"&&t.has(i)}vt.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return vt.getRules=n,vt}var Xe={},mi;function _i(){if(mi)return Xe;mi=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.shouldUseRule=Xe.shouldUseGroup=Xe.schemaHasRulesForType=void 0;function e({schema:n,self:i},s){const a=i.RULES.types[s];return a&&a!==!0&&t(n,a)}Xe.schemaHasRulesForType=e;function t(n,i){return i.rules.some(s=>r(n,s))}Xe.shouldUseGroup=t;function r(n,i){var s;return n[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(a=>n[a]!==void 0))}return Xe.shouldUseRule=r,Xe}var yi;function Sr(){if(yi)return ce;yi=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.reportTypeError=ce.checkDataTypes=ce.checkDataType=ce.coerceAndCheckDataType=ce.getJSONTypes=ce.getSchemaTypes=ce.DataType=void 0;const e=pi(),t=_i(),r=Er(),n=W(),i=Y();var s;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(s||(ce.DataType=s={}));function a(f){const g=o(f.type);if(g.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!g.length&&f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&g.push("null")}return g}ce.getSchemaTypes=a;function o(f){const g=Array.isArray(f)?f:f?[f]:[];if(g.every(e.isJSONType))return g;throw new Error("type must be JSONType or JSONType[]: "+g.join(","))}ce.getJSONTypes=o;function c(f,g){const{gen:E,data:p,opts:$}=f,S=u(g,$.coerceTypes),A=g.length>0&&!(S.length===0&&g.length===1&&(0,t.schemaHasRulesForType)(f,g[0]));if(A){const I=h(g,p,$.strictNumbers,s.Wrong);E.if(I,()=>{S.length?v(f,g,S):d(f)})}return A}ce.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function u(f,g){return g?f.filter(E=>l.has(E)||g==="array"&&E==="array"):[]}function v(f,g,E){const{gen:p,data:$,opts:S}=f,A=p.let("dataType",(0,n._)`typeof ${$}`),I=p.let("coerced",(0,n._)`undefined`);S.coerceTypes==="array"&&p.if((0,n._)`${A} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>p.assign($,(0,n._)`${$}[0]`).assign(A,(0,n._)`typeof ${$}`).if(h(g,$,S.strictNumbers),()=>p.assign(I,$))),p.if((0,n._)`${I} !== undefined`);for(const x of E)(l.has(x)||x==="array"&&S.coerceTypes==="array")&&L(x);p.else(),d(f),p.endIf(),p.if((0,n._)`${I} !== undefined`,()=>{p.assign($,I),m(f,I)});function L(x){switch(x){case"string":p.elseIf((0,n._)`${A} == "number" || ${A} == "boolean"`).assign(I,(0,n._)`"" + ${$}`).elseIf((0,n._)`${$} === null`).assign(I,(0,n._)`""`);return;case"number":p.elseIf((0,n._)`${A} == "boolean" || ${$} === null
8
+ || (${A} == "string" && ${$} && ${$} == +${$})`).assign(I,(0,n._)`+${$}`);return;case"integer":p.elseIf((0,n._)`${A} === "boolean" || ${$} === null
9
+ || (${A} === "string" && ${$} && ${$} == +${$} && !(${$} % 1))`).assign(I,(0,n._)`+${$}`);return;case"boolean":p.elseIf((0,n._)`${$} === "false" || ${$} === 0 || ${$} === null`).assign(I,!1).elseIf((0,n._)`${$} === "true" || ${$} === 1`).assign(I,!0);return;case"null":p.elseIf((0,n._)`${$} === "" || ${$} === 0 || ${$} === false`),p.assign(I,null);return;case"array":p.elseIf((0,n._)`${A} === "string" || ${A} === "number"
10
+ || ${A} === "boolean" || ${$} === null`).assign(I,(0,n._)`[${$}]`)}}}function m({gen:f,parentData:g,parentDataProperty:E},p){f.if((0,n._)`${g} !== undefined`,()=>f.assign((0,n._)`${g}[${E}]`,p))}function y(f,g,E,p=s.Correct){const $=p===s.Correct?n.operators.EQ:n.operators.NEQ;let S;switch(f){case"null":return(0,n._)`${g} ${$} null`;case"array":S=(0,n._)`Array.isArray(${g})`;break;case"object":S=(0,n._)`${g} && typeof ${g} == "object" && !Array.isArray(${g})`;break;case"integer":S=A((0,n._)`!(${g} % 1) && !isNaN(${g})`);break;case"number":S=A();break;default:return(0,n._)`typeof ${g} ${$} ${f}`}return p===s.Correct?S:(0,n.not)(S);function A(I=n.nil){return(0,n.and)((0,n._)`typeof ${g} == "number"`,I,E?(0,n._)`isFinite(${g})`:n.nil)}}ce.checkDataType=y;function h(f,g,E,p){if(f.length===1)return y(f[0],g,E,p);let $;const S=(0,i.toHash)(f);if(S.array&&S.object){const A=(0,n._)`typeof ${g} != "object"`;$=S.null?A:(0,n._)`!${g} || ${A}`,delete S.null,delete S.array,delete S.object}else $=n.nil;S.number&&delete S.integer;for(const A in S)$=(0,n.and)($,y(A,g,E,p));return $}ce.checkDataTypes=h;const w={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:g})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${g}}`};function d(f){const g=_(f);(0,r.reportError)(g,w)}ce.reportTypeError=d;function _(f){const{gen:g,data:E,schema:p}=f,$=(0,i.schemaRefOrVal)(f,p,"type");return{gen:g,keyword:"type",data:E,schema:p.type,schemaCode:$,schemaValue:$,parentSchema:p,params:{},it:f}}return ce}var Wt={},gi;function el(){if(gi)return Wt;gi=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.assignDefaults=void 0;const e=W(),t=Y();function r(i,s){const{properties:a,items:o}=i.schema;if(s==="object"&&a)for(const c in a)n(i,c,a[c].default);else s==="array"&&Array.isArray(o)&&o.forEach((c,l)=>n(i,l,c.default))}Wt.assignDefaults=r;function n(i,s,a){const{gen:o,compositeRule:c,data:l,opts:u}=i;if(a===void 0)return;const v=(0,e._)`${l}${(0,e.getProperty)(s)}`;if(c){(0,t.checkStrictMode)(i,`default is ignored for: ${v}`);return}let m=(0,e._)`${v} === undefined`;u.useDefaults==="empty"&&(m=(0,e._)`${m} || ${v} === null || ${v} === ""`),o.if(m,(0,e._)`${v} = ${(0,e.stringify)(a)}`)}return Wt}var Ie={},te={},vi;function De(){if(vi)return te;vi=1,Object.defineProperty(te,"__esModule",{value:!0}),te.validateUnion=te.validateArray=te.usePattern=te.callValidateCode=te.schemaProperties=te.allSchemaProperties=te.noPropertyInData=te.propertyInData=te.isOwnProperty=te.hasPropFunc=te.reportMissingProp=te.checkMissingProp=te.checkReportMissingProp=void 0;const e=W(),t=Y(),r=lt(),n=Y();function i(f,g){const{gen:E,data:p,it:$}=f;E.if(u(E,p,g,$.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${g}`},!0),f.error()})}te.checkReportMissingProp=i;function s({gen:f,data:g,it:{opts:E}},p,$){return(0,e.or)(...p.map(S=>(0,e.and)(u(f,g,S,E.ownProperties),(0,e._)`${$} = ${S}`)))}te.checkMissingProp=s;function a(f,g){f.setParams({missingProperty:g},!0),f.error()}te.reportMissingProp=a;function o(f){return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}te.hasPropFunc=o;function c(f,g,E){return(0,e._)`${o(f)}.call(${g}, ${E})`}te.isOwnProperty=c;function l(f,g,E,p){const $=(0,e._)`${g}${(0,e.getProperty)(E)} !== undefined`;return p?(0,e._)`${$} && ${c(f,g,E)}`:$}te.propertyInData=l;function u(f,g,E,p){const $=(0,e._)`${g}${(0,e.getProperty)(E)} === undefined`;return p?(0,e.or)($,(0,e.not)(c(f,g,E))):$}te.noPropertyInData=u;function v(f){return f?Object.keys(f).filter(g=>g!=="__proto__"):[]}te.allSchemaProperties=v;function m(f,g){return v(g).filter(E=>!(0,t.alwaysValidSchema)(f,g[E]))}te.schemaProperties=m;function y({schemaCode:f,data:g,it:{gen:E,topSchemaRef:p,schemaPath:$,errorPath:S},it:A},I,L,x){const H=x?(0,e._)`${f}, ${g}, ${p}${$}`:g,z=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,S)],[r.default.parentData,A.parentData],[r.default.parentDataProperty,A.parentDataProperty],[r.default.rootData,r.default.rootData]];A.opts.dynamicRef&&z.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const B=(0,e._)`${H}, ${E.object(...z)}`;return L!==e.nil?(0,e._)`${I}.call(${L}, ${B})`:(0,e._)`${I}(${B})`}te.callValidateCode=y;const h=(0,e._)`new RegExp`;function w({gen:f,it:{opts:g}},E){const p=g.unicodeRegExp?"u":"",{regExp:$}=g.code,S=$(E,p);return f.scopeValue("pattern",{key:S.toString(),ref:S,code:(0,e._)`${$.code==="new RegExp"?h:(0,n.useFunc)(f,$)}(${E}, ${p})`})}te.usePattern=w;function d(f){const{gen:g,data:E,keyword:p,it:$}=f,S=g.name("valid");if($.allErrors){const I=g.let("valid",!0);return A(()=>g.assign(I,!1)),I}return g.var(S,!0),A(()=>g.break()),S;function A(I){const L=g.const("len",(0,e._)`${E}.length`);g.forRange("i",0,L,x=>{f.subschema({keyword:p,dataProp:x,dataPropType:t.Type.Num},S),g.if((0,e.not)(S),I)})}}te.validateArray=d;function _(f){const{gen:g,schema:E,keyword:p,it:$}=f;if(!Array.isArray(E))throw new Error("ajv implementation error");if(E.some(L=>(0,t.alwaysValidSchema)($,L))&&!$.opts.unevaluated)return;const A=g.let("valid",!1),I=g.name("_valid");g.block(()=>E.forEach((L,x)=>{const H=f.subschema({keyword:p,schemaProp:x,compositeRule:!0},I);g.assign(A,(0,e._)`${A} || ${I}`),f.mergeValidEvaluated(H,I)||g.if((0,e.not)(A))})),f.result(A,()=>f.reset(),()=>f.error(!0))}return te.validateUnion=_,te}var wi;function tl(){if(wi)return Ie;wi=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateKeywordUsage=Ie.validSchemaType=Ie.funcKeywordCode=Ie.macroKeywordCode=void 0;const e=W(),t=lt(),r=De(),n=Er();function i(m,y){const{gen:h,keyword:w,schema:d,parentSchema:_,it:f}=m,g=y.macro.call(f.self,d,_,f),E=l(h,w,g);f.opts.validateSchema!==!1&&f.self.validateSchema(g,!0);const p=h.name("valid");m.subschema({schema:g,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${w}`,topSchemaRef:E,compositeRule:!0},p),m.pass(p,()=>m.error(!0))}Ie.macroKeywordCode=i;function s(m,y){var h;const{gen:w,keyword:d,schema:_,parentSchema:f,$data:g,it:E}=m;c(E,y);const p=!g&&y.compile?y.compile.call(E.self,_,f,E):y.validate,$=l(w,d,p),S=w.let("valid");m.block$data(S,A),m.ok((h=y.valid)!==null&&h!==void 0?h:S);function A(){if(y.errors===!1)x(),y.modifying&&a(m),H(()=>m.error());else{const z=y.async?I():L();y.modifying&&a(m),H(()=>o(m,z))}}function I(){const z=w.let("ruleErrs",null);return w.try(()=>x((0,e._)`await `),B=>w.assign(S,!1).if((0,e._)`${B} instanceof ${E.ValidationError}`,()=>w.assign(z,(0,e._)`${B}.errors`),()=>w.throw(B))),z}function L(){const z=(0,e._)`${$}.errors`;return w.assign(z,null),x(e.nil),z}function x(z=y.async?(0,e._)`await `:e.nil){const B=E.opts.passContext?t.default.this:t.default.self,ae=!("compile"in y&&!g||y.schema===!1);w.assign(S,(0,e._)`${z}${(0,r.callValidateCode)(m,$,B,ae)}`,y.modifying)}function H(z){var B;w.if((0,e.not)((B=y.valid)!==null&&B!==void 0?B:S),z)}}Ie.funcKeywordCode=s;function a(m){const{gen:y,data:h,it:w}=m;y.if(w.parentData,()=>y.assign(h,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function o(m,y){const{gen:h}=m;h.if((0,e._)`Array.isArray(${y})`,()=>{h.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${y} : ${t.default.vErrors}.concat(${y})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(m)},()=>m.error())}function c({schemaEnv:m},y){if(y.async&&!m.$async)throw new Error("async keyword in sync schema")}function l(m,y,h){if(h===void 0)throw new Error(`keyword "${y}" failed to compile`);return m.scopeValue("keyword",typeof h=="function"?{ref:h}:{ref:h,code:(0,e.stringify)(h)})}function u(m,y,h=!1){return!y.length||y.some(w=>w==="array"?Array.isArray(m):w==="object"?m&&typeof m=="object"&&!Array.isArray(m):typeof m==w||h&&typeof m>"u")}Ie.validSchemaType=u;function v({schema:m,opts:y,self:h,errSchemaPath:w},d,_){if(Array.isArray(d.keyword)?!d.keyword.includes(_):d.keyword!==_)throw new Error("ajv implementation error");const f=d.dependencies;if(f?.some(g=>!Object.prototype.hasOwnProperty.call(m,g)))throw new Error(`parent schema must have dependencies of ${_}: ${f.join(",")}`);if(d.validateSchema&&!d.validateSchema(m[_])){const E=`keyword "${_}" value is invalid at path "${w}": `+h.errorsText(d.validateSchema.errors);if(y.validateSchema==="log")h.logger.error(E);else throw new Error(E)}}return Ie.validateKeywordUsage=v,Ie}var Ye={},bi;function rl(){if(bi)return Ye;bi=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.extendSubschemaMode=Ye.extendSubschemaData=Ye.getSubschema=void 0;const e=W(),t=Y();function r(s,{keyword:a,schemaProp:o,schema:c,schemaPath:l,errSchemaPath:u,topSchemaRef:v}){if(a!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const m=s.schema[a];return o===void 0?{schema:m,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${a}`}:{schema:m[o],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${a}/${(0,t.escapeFragment)(o)}`}}if(c!==void 0){if(l===void 0||u===void 0||v===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:v,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}Ye.getSubschema=r;function n(s,a,{dataProp:o,dataPropType:c,data:l,dataTypes:u,propertyName:v}){if(l!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:m}=a;if(o!==void 0){const{errorPath:h,dataPathArr:w,opts:d}=a,_=m.let("data",(0,e._)`${a.data}${(0,e.getProperty)(o)}`,!0);y(_),s.errorPath=(0,e.str)`${h}${(0,t.getErrorPath)(o,c,d.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${o}`,s.dataPathArr=[...w,s.parentDataProperty]}if(l!==void 0){const h=l instanceof e.Name?l:m.let("data",l,!0);y(h),v!==void 0&&(s.propertyName=v)}u&&(s.dataTypes=u);function y(h){s.data=h,s.dataLevel=a.dataLevel+1,s.dataTypes=[],a.definedProperties=new Set,s.parentData=a.data,s.dataNames=[...a.dataNames,h]}}Ye.extendSubschemaData=n;function i(s,{jtdDiscriminator:a,jtdMetadata:o,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(s.compositeRule=c),l!==void 0&&(s.createErrors=l),u!==void 0&&(s.allErrors=u),s.jtdDiscriminator=a,s.jtdMetadata=o}return Ye.extendSubschemaMode=i,Ye}var _e={},Hn,$i;function Ei(){return $i||($i=1,Hn=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Hn}var Kn={exports:{}},Si;function nl(){if(Si)return Kn.exports;Si=1;var e=Kn.exports=function(n,i,s){typeof i=="function"&&(s=i,i={}),s=i.cb||s;var a=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};t(i,a,o,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,i,s,a,o,c,l,u,v,m){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,o,c,l,u,v,m);for(var y in a){var h=a[y];if(Array.isArray(h)){if(y in e.arrayKeywords)for(var w=0;w<h.length;w++)t(n,i,s,h[w],o+"/"+y+"/"+w,c,o,y,a,w)}else if(y in e.propsKeywords){if(h&&typeof h=="object")for(var d in h)t(n,i,s,h[d],o+"/"+y+"/"+r(d),c,o,y,a,d)}else(y in e.keywords||n.allKeys&&!(y in e.skipKeywords))&&t(n,i,s,h,o+"/"+y,c,o,y,a)}s(a,o,c,l,u,v,m)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Kn.exports}var Pi;function Pr(){if(Pi)return _e;Pi=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.getSchemaRefs=_e.resolveUrl=_e.normalizeId=_e._getFullPath=_e.getFullPath=_e.inlineRef=void 0;const e=Y(),t=Ei(),r=nl(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(w,d=!0){return typeof w=="boolean"?!0:d===!0?!a(w):d?o(w)<=d:!1}_e.inlineRef=i;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(w){for(const d in w){if(s.has(d))return!0;const _=w[d];if(Array.isArray(_)&&_.some(a)||typeof _=="object"&&a(_))return!0}return!1}function o(w){let d=0;for(const _ in w){if(_==="$ref")return 1/0;if(d++,!n.has(_)&&(typeof w[_]=="object"&&(0,e.eachItem)(w[_],f=>d+=o(f)),d===1/0))return 1/0}return d}function c(w,d="",_){_!==!1&&(d=v(d));const f=w.parse(d);return l(w,f)}_e.getFullPath=c;function l(w,d){return w.serialize(d).split("#")[0]+"#"}_e._getFullPath=l;const u=/#\/?$/;function v(w){return w?w.replace(u,""):""}_e.normalizeId=v;function m(w,d,_){return _=v(_),w.resolve(d,_)}_e.resolveUrl=m;const y=/^[a-z_][-a-z0-9._]*$/i;function h(w,d){if(typeof w=="boolean")return{};const{schemaId:_,uriResolver:f}=this.opts,g=v(w[_]||d),E={"":g},p=c(f,g,!1),$={},S=new Set;return r(w,{allKeys:!0},(L,x,H,z)=>{if(z===void 0)return;const B=p+x;let ae=E[z];typeof L[_]=="string"&&(ae=oe.call(this,L[_])),je.call(this,L.$anchor),je.call(this,L.$dynamicAnchor),E[x]=ae;function oe(Z){const Ue=this.opts.uriResolver.resolve;if(Z=v(ae?Ue(ae,Z):Z),S.has(Z))throw I(Z);S.add(Z);let D=this.refs[Z];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?A(L,D.schema,Z):Z!==v(B)&&(Z[0]==="#"?(A(L,$[Z],Z),$[Z]=L):this.refs[Z]=B),Z}function je(Z){if(typeof Z=="string"){if(!y.test(Z))throw new Error(`invalid anchor "${Z}"`);oe.call(this,`#${Z}`)}}}),$;function A(L,x,H){if(x!==void 0&&!t(L,x))throw I(H)}function I(L){return new Error(`reference "${L}" resolves to more than one schema`)}}return _e.getSchemaRefs=h,_e}var ki;function kr(){if(ki)return Ze;ki=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.getData=Ze.KeywordCxt=Ze.validateFunctionCode=void 0;const e=Qc(),t=Sr(),r=_i(),n=Sr(),i=el(),s=tl(),a=rl(),o=W(),c=lt(),l=Pr(),u=Y(),v=Er();function m(k){if(p(k)&&(S(k),E(k))){d(k);return}y(k,()=>(0,e.topBoolOrEmptySchema)(k))}Ze.validateFunctionCode=m;function y({gen:k,validateName:O,schema:q,schemaEnv:M,opts:U},G){U.code.es5?k.func(O,(0,o._)`${c.default.data}, ${c.default.valCxt}`,M.$async,()=>{k.code((0,o._)`"use strict"; ${f(q,U)}`),w(k,U),k.code(G)}):k.func(O,(0,o._)`${c.default.data}, ${h(U)}`,M.$async,()=>k.code(f(q,U)).code(G))}function h(k){return(0,o._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${k.dynamicRef?(0,o._)`, ${c.default.dynamicAnchors}={}`:o.nil}}={}`}function w(k,O){k.if(c.default.valCxt,()=>{k.var(c.default.instancePath,(0,o._)`${c.default.valCxt}.${c.default.instancePath}`),k.var(c.default.parentData,(0,o._)`${c.default.valCxt}.${c.default.parentData}`),k.var(c.default.parentDataProperty,(0,o._)`${c.default.valCxt}.${c.default.parentDataProperty}`),k.var(c.default.rootData,(0,o._)`${c.default.valCxt}.${c.default.rootData}`),O.dynamicRef&&k.var(c.default.dynamicAnchors,(0,o._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{k.var(c.default.instancePath,(0,o._)`""`),k.var(c.default.parentData,(0,o._)`undefined`),k.var(c.default.parentDataProperty,(0,o._)`undefined`),k.var(c.default.rootData,c.default.data),O.dynamicRef&&k.var(c.default.dynamicAnchors,(0,o._)`{}`)})}function d(k){const{schema:O,opts:q,gen:M}=k;y(k,()=>{q.$comment&&O.$comment&&z(k),L(k),M.let(c.default.vErrors,null),M.let(c.default.errors,0),q.unevaluated&&_(k),A(k),B(k)})}function _(k){const{gen:O,validateName:q}=k;k.evaluated=O.const("evaluated",(0,o._)`${q}.evaluated`),O.if((0,o._)`${k.evaluated}.dynamicProps`,()=>O.assign((0,o._)`${k.evaluated}.props`,(0,o._)`undefined`)),O.if((0,o._)`${k.evaluated}.dynamicItems`,()=>O.assign((0,o._)`${k.evaluated}.items`,(0,o._)`undefined`))}function f(k,O){const q=typeof k=="object"&&k[O.schemaId];return q&&(O.code.source||O.code.process)?(0,o._)`/*# sourceURL=${q} */`:o.nil}function g(k,O){if(p(k)&&(S(k),E(k))){$(k,O);return}(0,e.boolOrEmptySchema)(k,O)}function E({schema:k,self:O}){if(typeof k=="boolean")return!k;for(const q in k)if(O.RULES.all[q])return!0;return!1}function p(k){return typeof k.schema!="boolean"}function $(k,O){const{schema:q,gen:M,opts:U}=k;U.$comment&&q.$comment&&z(k),x(k),H(k);const G=M.const("_errs",c.default.errors);A(k,G),M.var(O,(0,o._)`${G} === ${c.default.errors}`)}function S(k){(0,u.checkUnknownRules)(k),I(k)}function A(k,O){if(k.opts.jtd)return oe(k,[],!1,O);const q=(0,t.getSchemaTypes)(k.schema),M=(0,t.coerceAndCheckDataType)(k,q);oe(k,q,!M,O)}function I(k){const{schema:O,errSchemaPath:q,opts:M,self:U}=k;O.$ref&&M.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(O,U.RULES)&&U.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function L(k){const{schema:O,opts:q}=k;O.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,u.checkStrictMode)(k,"default is ignored in the schema root")}function x(k){const O=k.schema[k.opts.schemaId];O&&(k.baseId=(0,l.resolveUrl)(k.opts.uriResolver,k.baseId,O))}function H(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function z({gen:k,schemaEnv:O,schema:q,errSchemaPath:M,opts:U}){const G=q.$comment;if(U.$comment===!0)k.code((0,o._)`${c.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){const ue=(0,o.str)`${M}/$comment`,Ve=k.scopeValue("root",{ref:O.root});k.code((0,o._)`${c.default.self}.opts.$comment(${G}, ${ue}, ${Ve}.schema)`)}}function B(k){const{gen:O,schemaEnv:q,validateName:M,ValidationError:U,opts:G}=k;q.$async?O.if((0,o._)`${c.default.errors} === 0`,()=>O.return(c.default.data),()=>O.throw((0,o._)`new ${U}(${c.default.vErrors})`)):(O.assign((0,o._)`${M}.errors`,c.default.vErrors),G.unevaluated&&ae(k),O.return((0,o._)`${c.default.errors} === 0`))}function ae({gen:k,evaluated:O,props:q,items:M}){q instanceof o.Name&&k.assign((0,o._)`${O}.props`,q),M instanceof o.Name&&k.assign((0,o._)`${O}.items`,M)}function oe(k,O,q,M){const{gen:U,schema:G,data:ue,allErrors:Ve,opts:Ee,self:Se}=k,{RULES:de}=Se;if(G.$ref&&(Ee.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(G,de))){U.block(()=>F(k,"$ref",de.all.$ref.definition));return}Ee.jtd||Z(k,O),U.block(()=>{for(const Ce of de.rules)Vt(Ce);Vt(de.post)});function Vt(Ce){(0,r.shouldUseGroup)(G,Ce)&&(Ce.type?(U.if((0,n.checkDataType)(Ce.type,ue,Ee.strictNumbers)),je(k,Ce),O.length===1&&O[0]===Ce.type&&q&&(U.else(),(0,n.reportTypeError)(k)),U.endIf()):je(k,Ce),Ve||U.if((0,o._)`${c.default.errors} === ${M||0}`))}}function je(k,O){const{gen:q,schema:M,opts:{useDefaults:U}}=k;U&&(0,i.assignDefaults)(k,O.type),q.block(()=>{for(const G of O.rules)(0,r.shouldUseRule)(M,G)&&F(k,G.keyword,G.definition,O.type)})}function Z(k,O){k.schemaEnv.meta||!k.opts.strictTypes||(Ue(k,O),k.opts.allowUnionTypes||D(k,O),R(k,k.dataTypes))}function Ue(k,O){if(O.length){if(!k.dataTypes.length){k.dataTypes=O;return}O.forEach(q=>{T(k.dataTypes,q)||P(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),b(k,O)}}function D(k,O){O.length>1&&!(O.length===2&&O.includes("null"))&&P(k,"use allowUnionTypes to allow union type keyword")}function R(k,O){const q=k.self.RULES.all;for(const M in q){const U=q[M];if(typeof U=="object"&&(0,r.shouldUseRule)(k.schema,U)){const{type:G}=U.definition;G.length&&!G.some(ue=>C(O,ue))&&P(k,`missing type "${G.join(",")}" for keyword "${M}"`)}}}function C(k,O){return k.includes(O)||O==="number"&&k.includes("integer")}function T(k,O){return k.includes(O)||O==="integer"&&k.includes("number")}function b(k,O){const q=[];for(const M of k.dataTypes)T(O,M)?q.push(M):O.includes("integer")&&M==="number"&&q.push("integer");k.dataTypes=q}function P(k,O){const q=k.schemaEnv.baseId+k.errSchemaPath;O+=` at "${q}" (strictTypes)`,(0,u.checkStrictMode)(k,O,k.opts.strictTypes)}class j{constructor(O,q,M){if((0,s.validateKeywordUsage)(O,q,M),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=M,this.data=O.data,this.schema=O.schema[M],this.$data=q.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(O,this.schema,M,this.$data),this.schemaType=q.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=q,this.$data)this.schemaCode=O.gen.const("vSchema",X(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=O.gen.const("_errs",c.default.errors))}result(O,q,M){this.failResult((0,o.not)(O),q,M)}failResult(O,q,M){this.gen.if(O),M?M():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(O,q){this.failResult((0,o.not)(O),void 0,q)}fail(O){if(O===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(O),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);const{schemaCode:q}=this;this.fail((0,o._)`${q} !== undefined && (${(0,o.or)(this.invalid$data(),O)})`)}error(O,q,M){if(q){this.setParams(q),this._error(O,M),this.setParams({});return}this._error(O,M)}_error(O,q){(O?v.reportExtraError:v.reportError)(this,this.def.error,q)}$dataError(){(0,v.reportError)(this,this.def.$dataError||v.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,v.resetErrorsCount)(this.gen,this.errsCount)}ok(O){this.allErrors||this.gen.if(O)}setParams(O,q){q?Object.assign(this.params,O):this.params=O}block$data(O,q,M=o.nil){this.gen.block(()=>{this.check$data(O,M),q()})}check$data(O=o.nil,q=o.nil){if(!this.$data)return;const{gen:M,schemaCode:U,schemaType:G,def:ue}=this;M.if((0,o.or)((0,o._)`${U} === undefined`,q)),O!==o.nil&&M.assign(O,!0),(G.length||ue.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),O!==o.nil&&M.assign(O,!1)),M.else()}invalid$data(){const{gen:O,schemaCode:q,schemaType:M,def:U,it:G}=this;return(0,o.or)(ue(),Ve());function ue(){if(M.length){if(!(q instanceof o.Name))throw new Error("ajv implementation error");const Ee=Array.isArray(M)?M:[M];return(0,o._)`${(0,n.checkDataTypes)(Ee,q,G.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function Ve(){if(U.validateSchema){const Ee=O.scopeValue("validate$data",{ref:U.validateSchema});return(0,o._)`!${Ee}(${q})`}return o.nil}}subschema(O,q){const M=(0,a.getSubschema)(this.it,O);(0,a.extendSubschemaData)(M,this.it,O),(0,a.extendSubschemaMode)(M,O);const U={...this.it,...M,items:void 0,props:void 0};return g(U,q),U}mergeEvaluated(O,q){const{it:M,gen:U}=this;M.opts.unevaluated&&(M.props!==!0&&O.props!==void 0&&(M.props=u.mergeEvaluated.props(U,O.props,M.props,q)),M.items!==!0&&O.items!==void 0&&(M.items=u.mergeEvaluated.items(U,O.items,M.items,q)))}mergeValidEvaluated(O,q){const{it:M,gen:U}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return U.if(q,()=>this.mergeEvaluated(O,o.Name)),!0}}Ze.KeywordCxt=j;function F(k,O,q,M){const U=new j(k,q,O);"code"in q?q.code(U,M):U.$data&&q.validate?(0,s.funcKeywordCode)(U,q):"macro"in q?(0,s.macroKeywordCode)(U,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(U,q)}const V=/^\/(?:[^~]|~0|~1)*$/,ee=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function X(k,{dataLevel:O,dataNames:q,dataPathArr:M}){let U,G;if(k==="")return c.default.rootData;if(k[0]==="/"){if(!V.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);U=k,G=c.default.rootData}else{const Se=ee.exec(k);if(!Se)throw new Error(`Invalid JSON-pointer: ${k}`);const de=+Se[1];if(U=Se[2],U==="#"){if(de>=O)throw new Error(Ee("property/index",de));return M[O-de]}if(de>O)throw new Error(Ee("data",de));if(G=q[O-de],!U)return G}let ue=G;const Ve=U.split("/");for(const Se of Ve)Se&&(G=(0,o._)`${G}${(0,o.getProperty)((0,u.unescapeJsonPointer)(Se))}`,ue=(0,o._)`${ue} && ${G}`);return ue;function Ee(Se,de){return`Cannot access ${Se} ${de} levels up, current level is ${O}`}}return Ze.getData=X,Ze}var Rr={},Ri;function Bn(){if(Ri)return Rr;Ri=1,Object.defineProperty(Rr,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Rr.default=e,Rr}var Or={},Oi;function Tr(){if(Oi)return Or;Oi=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=Pr();class t extends Error{constructor(n,i,s,a){super(a||`can't resolve reference ${s} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Or.default=t,Or}var Pe={},Ti;function Jn(){if(Ti)return Pe;Ti=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.resolveSchema=Pe.getCompilingSchema=Pe.resolveRef=Pe.compileSchema=Pe.SchemaEnv=void 0;const e=W(),t=Bn(),r=lt(),n=Pr(),i=Y(),s=kr();class a{constructor(_){var f;this.refs={},this.dynamicAnchors={};let g;typeof _.schema=="object"&&(g=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(f=_.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(g?.[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=g?.$async,this.refs={}}}Pe.SchemaEnv=a;function o(d){const _=u.call(this,d);if(_)return _;const f=(0,n.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:g,lines:E}=this.opts.code,{ownProperties:p}=this.opts,$=new e.CodeGen(this.scope,{es5:g,lines:E,ownProperties:p});let S;d.$async&&(S=$.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const A=$.scopeName("validate");d.validateName=A;const I={gen:$,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,e.stringify)(d.schema)}:{ref:d.schema}),validateName:A,ValidationError:S,schema:d.schema,schemaEnv:d,rootId:f,baseId:d.baseId||f,schemaPath:e.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let L;try{this._compilations.add(d),(0,s.validateFunctionCode)(I),$.optimize(this.opts.code.optimize);const x=$.toString();L=`${$.scopeRefs(r.default.scope)}return ${x}`,this.opts.code.process&&(L=this.opts.code.process(L,d));const z=new Function(`${r.default.self}`,`${r.default.scope}`,L)(this,this.scope.get());if(this.scope.value(A,{ref:z}),z.errors=null,z.schema=d.schema,z.schemaEnv=d,d.$async&&(z.$async=!0),this.opts.code.source===!0&&(z.source={validateName:A,validateCode:x,scopeValues:$._values}),this.opts.unevaluated){const{props:B,items:ae}=I;z.evaluated={props:B instanceof e.Name?void 0:B,items:ae instanceof e.Name?void 0:ae,dynamicProps:B instanceof e.Name,dynamicItems:ae instanceof e.Name},z.source&&(z.source.evaluated=(0,e.stringify)(z.evaluated))}return d.validate=z,d}catch(x){throw delete d.validate,delete d.validateName,L&&this.logger.error("Error compiling schema, function code:",L),x}finally{this._compilations.delete(d)}}Pe.compileSchema=o;function c(d,_,f){var g;f=(0,n.resolveUrl)(this.opts.uriResolver,_,f);const E=d.refs[f];if(E)return E;let p=m.call(this,d,f);if(p===void 0){const $=(g=d.localRefs)===null||g===void 0?void 0:g[f],{schemaId:S}=this.opts;$&&(p=new a({schema:$,schemaId:S,root:d,baseId:_}))}if(p!==void 0)return d.refs[f]=l.call(this,p)}Pe.resolveRef=c;function l(d){return(0,n.inlineRef)(d.schema,this.opts.inlineRefs)?d.schema:d.validate?d:o.call(this,d)}function u(d){for(const _ of this._compilations)if(v(_,d))return _}Pe.getCompilingSchema=u;function v(d,_){return d.schema===_.schema&&d.root===_.root&&d.baseId===_.baseId}function m(d,_){let f;for(;typeof(f=this.refs[_])=="string";)_=f;return f||this.schemas[_]||y.call(this,d,_)}function y(d,_){const f=this.opts.uriResolver.parse(_),g=(0,n._getFullPath)(this.opts.uriResolver,f);let E=(0,n.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&g===E)return w.call(this,f,d);const p=(0,n.normalizeId)(g),$=this.refs[p]||this.schemas[p];if(typeof $=="string"){const S=y.call(this,d,$);return typeof S?.schema!="object"?void 0:w.call(this,f,S)}if(typeof $?.schema=="object"){if($.validate||o.call(this,$),p===(0,n.normalizeId)(_)){const{schema:S}=$,{schemaId:A}=this.opts,I=S[A];return I&&(E=(0,n.resolveUrl)(this.opts.uriResolver,E,I)),new a({schema:S,schemaId:A,root:d,baseId:E})}return w.call(this,f,$)}}Pe.resolveSchema=y;const h=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(d,{baseId:_,schema:f,root:g}){var E;if(((E=d.fragment)===null||E===void 0?void 0:E[0])!=="/")return;for(const S of d.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const A=f[(0,i.unescapeFragment)(S)];if(A===void 0)return;f=A;const I=typeof f=="object"&&f[this.opts.schemaId];!h.has(S)&&I&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,I))}let p;if(typeof f!="boolean"&&f.$ref&&!(0,i.schemaHasRulesButRef)(f,this.RULES)){const S=(0,n.resolveUrl)(this.opts.uriResolver,_,f.$ref);p=y.call(this,g,S)}const{schemaId:$}=this.opts;if(p=p||new a({schema:f,schemaId:$,root:g,baseId:_}),p.schema!==p.root.schema)return p}return Pe}const sl={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var Nr={},Zt={exports:{}},Gn,Ni;function Ai(){if(Ni)return Gn;Ni=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r(m){let y="",h=0,w=0;for(w=0;w<m.length;w++)if(h=m[w].charCodeAt(0),h!==48){if(!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";y+=m[w];break}for(w+=1;w<m.length;w++){if(h=m[w].charCodeAt(0),!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";y+=m[w]}return y}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(m){return m.length=0,!0}function s(m,y,h){if(m.length){const w=r(m);if(w!=="")y.push(w);else return h.error=!0,!1;m.length=0}return!0}function a(m){let y=0;const h={error:!1,address:"",zone:""},w=[],d=[];let _=!1,f=!1,g=s;for(let E=0;E<m.length;E++){const p=m[E];if(!(p==="["||p==="]"))if(p===":"){if(_===!0&&(f=!0),!g(d,w,h))break;if(++y>7){h.error=!0;break}E>0&&m[E-1]===":"&&(_=!0),w.push(":");continue}else if(p==="%"){if(!g(d,w,h))break;g=i}else{d.push(p);continue}}return d.length&&(g===i?h.zone=d.join(""):f?w.push(d.join("")):w.push(r(d))),h.address=w.join(""),h}function o(m){if(c(m,":")<2)return{host:m,isIPV6:!1};const y=a(m);if(y.error)return{host:m,isIPV6:!1};{let h=y.address,w=y.address;return y.zone&&(h+="%"+y.zone,w+="%25"+y.zone),{host:h,isIPV6:!0,escapedHost:w}}}function c(m,y){let h=0;for(let w=0;w<m.length;w++)m[w]===y&&h++;return h}function l(m){let y=m;const h=[];let w=-1,d=0;for(;d=y.length;){if(d===1){if(y===".")break;if(y==="/"){h.push("/");break}else{h.push(y);break}}else if(d===2){if(y[0]==="."){if(y[1]===".")break;if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&(y[1]==="."||y[1]==="/")){h.push("/");break}}else if(d===3&&y==="/.."){h.length!==0&&h.pop(),h.push("/");break}if(y[0]==="."){if(y[1]==="."){if(y[2]==="/"){y=y.slice(3);continue}}else if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&y[1]==="."){if(y[2]==="/"){y=y.slice(2);continue}else if(y[2]==="."&&y[3]==="/"){y=y.slice(3),h.length!==0&&h.pop();continue}}if((w=y.indexOf("/",1))===-1){h.push(y);break}else h.push(y.slice(0,w)),y=y.slice(w)}return h.join("")}function u(m,y){const h=y!==!0?escape:unescape;return m.scheme!==void 0&&(m.scheme=h(m.scheme)),m.userinfo!==void 0&&(m.userinfo=h(m.userinfo)),m.host!==void 0&&(m.host=h(m.host)),m.path!==void 0&&(m.path=h(m.path)),m.query!==void 0&&(m.query=h(m.query)),m.fragment!==void 0&&(m.fragment=h(m.fragment)),m}function v(m){const y=[];if(m.userinfo!==void 0&&(y.push(m.userinfo),y.push("@")),m.host!==void 0){let h=unescape(m.host);if(!t(h)){const w=o(h);w.isIPV6===!0?h=`[${w.escapedHost}]`:h=m.host}y.push(h)}return(typeof m.port=="number"||typeof m.port=="string")&&(y.push(":"),y.push(String(m.port))),y.length?y.join(""):void 0}return Gn={nonSimpleDomain:n,recomposeAuthority:v,normalizeComponentEncoding:u,removeDotSegments:l,isIPv4:t,isUUID:e,normalizeIPv6:o,stringArrayToHexStripped:r},Gn}var Wn,ji;function il(){if(ji)return Wn;ji=1;const{isUUID:e}=Ai(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(p){return r.indexOf(p)!==-1}function i(p){return p.secure===!0?!0:p.secure===!1?!1:p.scheme?p.scheme.length===3&&(p.scheme[0]==="w"||p.scheme[0]==="W")&&(p.scheme[1]==="s"||p.scheme[1]==="S")&&(p.scheme[2]==="s"||p.scheme[2]==="S"):!1}function s(p){return p.host||(p.error=p.error||"HTTP URIs must have a host."),p}function a(p){const $=String(p.scheme).toLowerCase()==="https";return(p.port===($?443:80)||p.port==="")&&(p.port=void 0),p.path||(p.path="/"),p}function o(p){return p.secure=i(p),p.resourceName=(p.path||"/")+(p.query?"?"+p.query:""),p.path=void 0,p.query=void 0,p}function c(p){if((p.port===(i(p)?443:80)||p.port==="")&&(p.port=void 0),typeof p.secure=="boolean"&&(p.scheme=p.secure?"wss":"ws",p.secure=void 0),p.resourceName){const[$,S]=p.resourceName.split("?");p.path=$&&$!=="/"?$:void 0,p.query=S,p.resourceName=void 0}return p.fragment=void 0,p}function l(p,$){if(!p.path)return p.error="URN can not be parsed",p;const S=p.path.match(t);if(S){const A=$.scheme||p.scheme||"urn";p.nid=S[1].toLowerCase(),p.nss=S[2];const I=`${A}:${$.nid||p.nid}`,L=E(I);p.path=void 0,L&&(p=L.parse(p,$))}else p.error=p.error||"URN can not be parsed.";return p}function u(p,$){if(p.nid===void 0)throw new Error("URN without nid cannot be serialized");const S=$.scheme||p.scheme||"urn",A=p.nid.toLowerCase(),I=`${S}:${$.nid||A}`,L=E(I);L&&(p=L.serialize(p,$));const x=p,H=p.nss;return x.path=`${A||$.nid}:${H}`,$.skipEscape=!0,x}function v(p,$){const S=p;return S.uuid=S.nss,S.nss=void 0,!$.tolerant&&(!S.uuid||!e(S.uuid))&&(S.error=S.error||"UUID is not valid."),S}function m(p){const $=p;return $.nss=(p.uuid||"").toLowerCase(),$}const y={scheme:"http",domainHost:!0,parse:s,serialize:a},h={scheme:"https",domainHost:y.domainHost,parse:s,serialize:a},w={scheme:"ws",domainHost:!0,parse:o,serialize:c},d={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},g={http:y,https:h,ws:w,wss:d,urn:{scheme:"urn",parse:l,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(g,null);function E(p){return p&&(g[p]||g[p.toLowerCase()])||void 0}return Wn={wsIsSecure:i,SCHEMES:g,isValidSchemeName:n,getSchemeHandler:E},Wn}var Ci;function al(){if(Ci)return Zt.exports;Ci=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:i,nonSimpleDomain:s}=Ai(),{SCHEMES:a,getSchemeHandler:o}=il();function c(d,_){return typeof d=="string"?d=m(h(d,_),_):typeof d=="object"&&(d=h(m(d,_),_)),d}function l(d,_,f){const g=f?Object.assign({scheme:"null"},f):{scheme:"null"},E=u(h(d,g),h(_,g),g,!0);return g.skipEscape=!0,m(E,g)}function u(d,_,f,g){const E={};return g||(d=h(m(d,f),f),_=h(m(_,f),f)),f=f||{},!f.tolerant&&_.scheme?(E.scheme=_.scheme,E.userinfo=_.userinfo,E.host=_.host,E.port=_.port,E.path=t(_.path||""),E.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(E.userinfo=_.userinfo,E.host=_.host,E.port=_.port,E.path=t(_.path||""),E.query=_.query):(_.path?(_.path[0]==="/"?E.path=t(_.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?E.path="/"+_.path:d.path?E.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+_.path:E.path=_.path,E.path=t(E.path)),E.query=_.query):(E.path=d.path,_.query!==void 0?E.query=_.query:E.query=d.query),E.userinfo=d.userinfo,E.host=d.host,E.port=d.port),E.scheme=d.scheme),E.fragment=_.fragment,E}function v(d,_,f){return typeof d=="string"?(d=unescape(d),d=m(n(h(d,f),!0),{...f,skipEscape:!0})):typeof d=="object"&&(d=m(n(d,!0),{...f,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=m(n(h(_,f),!0),{...f,skipEscape:!0})):typeof _=="object"&&(_=m(n(_,!0),{...f,skipEscape:!0})),d.toLowerCase()===_.toLowerCase()}function m(d,_){const f={host:d.host,scheme:d.scheme,userinfo:d.userinfo,port:d.port,path:d.path,query:d.query,nid:d.nid,nss:d.nss,uuid:d.uuid,fragment:d.fragment,reference:d.reference,resourceName:d.resourceName,secure:d.secure,error:""},g=Object.assign({},_),E=[],p=o(g.scheme||f.scheme);p&&p.serialize&&p.serialize(f,g),f.path!==void 0&&(g.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),g.reference!=="suffix"&&f.scheme&&E.push(f.scheme,":");const $=r(f);if($!==void 0&&(g.reference!=="suffix"&&E.push("//"),E.push($),f.path&&f.path[0]!=="/"&&E.push("/")),f.path!==void 0){let S=f.path;!g.absolutePath&&(!p||!p.absolutePath)&&(S=t(S)),$===void 0&&S[0]==="/"&&S[1]==="/"&&(S="/%2F"+S.slice(2)),E.push(S)}return f.query!==void 0&&E.push("?",f.query),f.fragment!==void 0&&E.push("#",f.fragment),E.join("")}const y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(d,_){const f=Object.assign({},_),g={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let E=!1;f.reference==="suffix"&&(f.scheme?d=f.scheme+":"+d:d="//"+d);const p=d.match(y);if(p){if(g.scheme=p[1],g.userinfo=p[3],g.host=p[4],g.port=parseInt(p[5],10),g.path=p[6]||"",g.query=p[7],g.fragment=p[8],isNaN(g.port)&&(g.port=p[5]),g.host)if(i(g.host)===!1){const A=e(g.host);g.host=A.host.toLowerCase(),E=A.isIPV6}else E=!0;g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&g.query===void 0&&!g.path?g.reference="same-document":g.scheme===void 0?g.reference="relative":g.fragment===void 0?g.reference="absolute":g.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==g.reference&&(g.error=g.error||"URI is not a "+f.reference+" reference.");const $=o(f.scheme||g.scheme);if(!f.unicodeSupport&&(!$||!$.unicodeSupport)&&g.host&&(f.domainHost||$&&$.domainHost)&&E===!1&&s(g.host))try{g.host=URL.domainToASCII(g.host.toLowerCase())}catch(S){g.error=g.error||"Host's domain name can not be converted to ASCII: "+S}(!$||$&&!$.skipNormalize)&&(d.indexOf("%")!==-1&&(g.scheme!==void 0&&(g.scheme=unescape(g.scheme)),g.host!==void 0&&(g.host=unescape(g.host))),g.path&&(g.path=escape(unescape(g.path))),g.fragment&&(g.fragment=encodeURI(decodeURIComponent(g.fragment)))),$&&$.parse&&$.parse(g,f)}else g.error=g.error||"URI can not be parsed.";return g}const w={SCHEMES:a,normalize:c,resolve:l,resolveComponent:u,equal:v,serialize:m,parse:h};return Zt.exports=w,Zt.exports.default=w,Zt.exports.fastUri=w,Zt.exports}var qi;function ol(){if(qi)return Nr;qi=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=al();return e.code='require("ajv/dist/runtime/uri").default',Nr.default=e,Nr}var Ii;function cl(){return Ii||(Ii=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=kr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=W();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Bn(),i=Tr(),s=pi(),a=Jn(),o=W(),c=Pr(),l=Sr(),u=Y(),v=sl,m=ol(),y=(D,R)=>new RegExp(D,R);y.code="new RegExp";const h=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),d={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function g(D){var R,C,T,b,P,j,F,V,ee,X,k,O,q,M,U,G,ue,Ve,Ee,Se,de,Vt,Ce,ys,gs;const lr=D.strict,vs=(R=D.code)===null||R===void 0?void 0:R.optimize,ko=vs===!0||vs===void 0?1:vs||0,Ro=(T=(C=D.code)===null||C===void 0?void 0:C.regExp)!==null&&T!==void 0?T:y,ud=(b=D.uriResolver)!==null&&b!==void 0?b:m.default;return{strictSchema:(j=(P=D.strictSchema)!==null&&P!==void 0?P:lr)!==null&&j!==void 0?j:!0,strictNumbers:(V=(F=D.strictNumbers)!==null&&F!==void 0?F:lr)!==null&&V!==void 0?V:!0,strictTypes:(X=(ee=D.strictTypes)!==null&&ee!==void 0?ee:lr)!==null&&X!==void 0?X:"log",strictTuples:(O=(k=D.strictTuples)!==null&&k!==void 0?k:lr)!==null&&O!==void 0?O:"log",strictRequired:(M=(q=D.strictRequired)!==null&&q!==void 0?q:lr)!==null&&M!==void 0?M:!1,code:D.code?{...D.code,optimize:ko,regExp:Ro}:{optimize:ko,regExp:Ro},loopRequired:(U=D.loopRequired)!==null&&U!==void 0?U:f,loopEnum:(G=D.loopEnum)!==null&&G!==void 0?G:f,meta:(ue=D.meta)!==null&&ue!==void 0?ue:!0,messages:(Ve=D.messages)!==null&&Ve!==void 0?Ve:!0,inlineRefs:(Ee=D.inlineRefs)!==null&&Ee!==void 0?Ee:!0,schemaId:(Se=D.schemaId)!==null&&Se!==void 0?Se:"$id",addUsedSchema:(de=D.addUsedSchema)!==null&&de!==void 0?de:!0,validateSchema:(Vt=D.validateSchema)!==null&&Vt!==void 0?Vt:!0,validateFormats:(Ce=D.validateFormats)!==null&&Ce!==void 0?Ce:!0,unicodeRegExp:(ys=D.unicodeRegExp)!==null&&ys!==void 0?ys:!0,int32range:(gs=D.int32range)!==null&&gs!==void 0?gs:!0,uriResolver:ud}}class E{constructor(R={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,R=this.opts={...R,...g(R)};const{es5:C,lines:T}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:w,es5:C,lines:T}),this.logger=H(R.logger);const b=R.validateFormats;R.validateFormats=!1,this.RULES=(0,s.getRules)(),p.call(this,d,R,"NOT SUPPORTED"),p.call(this,_,R,"DEPRECATED","warn"),this._metaOpts=L.call(this),R.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),R.keywords&&I.call(this,R.keywords),typeof R.meta=="object"&&this.addMetaSchema(R.meta),S.call(this),R.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:R,meta:C,schemaId:T}=this.opts;let b=v;T==="id"&&(b={...v},b.id=b.$id,delete b.$id),C&&R&&this.addMetaSchema(b,b[T],!1)}defaultMeta(){const{meta:R,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof R=="object"?R[C]||R:void 0}validate(R,C){let T;if(typeof R=="string"){if(T=this.getSchema(R),!T)throw new Error(`no schema with key or ref "${R}"`)}else T=this.compile(R);const b=T(C);return"$async"in T||(this.errors=T.errors),b}compile(R,C){const T=this._addSchema(R,C);return T.validate||this._compileSchemaEnv(T)}compileAsync(R,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:T}=this.opts;return b.call(this,R,C);async function b(X,k){await P.call(this,X.$schema);const O=this._addSchema(X,k);return O.validate||j.call(this,O)}async function P(X){X&&!this.getSchema(X)&&await b.call(this,{$ref:X},!0)}async function j(X){try{return this._compileSchemaEnv(X)}catch(k){if(!(k instanceof i.default))throw k;return F.call(this,k),await V.call(this,k.missingSchema),j.call(this,X)}}function F({missingSchema:X,missingRef:k}){if(this.refs[X])throw new Error(`AnySchema ${X} is loaded but ${k} cannot be resolved`)}async function V(X){const k=await ee.call(this,X);this.refs[X]||await P.call(this,k.$schema),this.refs[X]||this.addSchema(k,X,C)}async function ee(X){const k=this._loading[X];if(k)return k;try{return await(this._loading[X]=T(X))}finally{delete this._loading[X]}}}addSchema(R,C,T,b=this.opts.validateSchema){if(Array.isArray(R)){for(const j of R)this.addSchema(j,void 0,T,b);return this}let P;if(typeof R=="object"){const{schemaId:j}=this.opts;if(P=R[j],P!==void 0&&typeof P!="string")throw new Error(`schema ${j} must be string`)}return C=(0,c.normalizeId)(C||P),this._checkUnique(C),this.schemas[C]=this._addSchema(R,T,C,b,!0),this}addMetaSchema(R,C,T=this.opts.validateSchema){return this.addSchema(R,C,!0,T),this}validateSchema(R,C){if(typeof R=="boolean")return!0;let T;if(T=R.$schema,T!==void 0&&typeof T!="string")throw new Error("$schema must be a string");if(T=T||this.opts.defaultMeta||this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const b=this.validate(T,R);if(!b&&C){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return b}getSchema(R){let C;for(;typeof(C=$.call(this,R))=="string";)R=C;if(C===void 0){const{schemaId:T}=this.opts,b=new a.SchemaEnv({schema:{},schemaId:T});if(C=a.resolveSchema.call(this,b,R),!C)return;this.refs[R]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(R){if(R instanceof RegExp)return this._removeAllSchemas(this.schemas,R),this._removeAllSchemas(this.refs,R),this;switch(typeof R){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=$.call(this,R);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[R],delete this.refs[R],this}case"object":{const C=R;this._cache.delete(C);let T=R[this.opts.schemaId];return T&&(T=(0,c.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(R){for(const C of R)this.addKeyword(C);return this}addKeyword(R,C){let T;if(typeof R=="string")T=R,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=T);else if(typeof R=="object"&&C===void 0){if(C=R,T=C.keyword,Array.isArray(T)&&!T.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,T,C),!C)return(0,u.eachItem)(T,P=>ae.call(this,P)),this;je.call(this,C);const b={...C,type:(0,l.getJSONTypes)(C.type),schemaType:(0,l.getJSONTypes)(C.schemaType)};return(0,u.eachItem)(T,b.type.length===0?P=>ae.call(this,P,b):P=>b.type.forEach(j=>ae.call(this,P,b,j))),this}getKeyword(R){const C=this.RULES.all[R];return typeof C=="object"?C.definition:!!C}removeKeyword(R){const{RULES:C}=this;delete C.keywords[R],delete C.all[R];for(const T of C.rules){const b=T.rules.findIndex(P=>P.keyword===R);b>=0&&T.rules.splice(b,1)}return this}addFormat(R,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[R]=C,this}errorsText(R=this.errors,{separator:C=", ",dataVar:T="data"}={}){return!R||R.length===0?"No errors":R.map(b=>`${T}${b.instancePath} ${b.message}`).reduce((b,P)=>b+C+P)}$dataMetaSchema(R,C){const T=this.RULES.all;R=JSON.parse(JSON.stringify(R));for(const b of C){const P=b.split("/").slice(1);let j=R;for(const F of P)j=j[F];for(const F in T){const V=T[F];if(typeof V!="object")continue;const{$data:ee}=V.definition,X=j[F];ee&&X&&(j[F]=Ue(X))}}return R}_removeAllSchemas(R,C){for(const T in R){const b=R[T];(!C||C.test(T))&&(typeof b=="string"?delete R[T]:b&&!b.meta&&(this._cache.delete(b.schema),delete R[T]))}}_addSchema(R,C,T,b=this.opts.validateSchema,P=this.opts.addUsedSchema){let j;const{schemaId:F}=this.opts;if(typeof R=="object")j=R[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof R!="boolean")throw new Error("schema must be object or boolean")}let V=this._cache.get(R);if(V!==void 0)return V;T=(0,c.normalizeId)(j||T);const ee=c.getSchemaRefs.call(this,R,T);return V=new a.SchemaEnv({schema:R,schemaId:F,meta:C,baseId:T,localRefs:ee}),this._cache.set(V.schema,V),P&&!T.startsWith("#")&&(T&&this._checkUnique(T),this.refs[T]=V),b&&this.validateSchema(R,!0),V}_checkUnique(R){if(this.schemas[R]||this.refs[R])throw new Error(`schema with key or id "${R}" already exists`)}_compileSchemaEnv(R){if(R.meta?this._compileMetaSchema(R):a.compileSchema.call(this,R),!R.validate)throw new Error("ajv implementation error");return R.validate}_compileMetaSchema(R){const C=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,R)}finally{this.opts=C}}}E.ValidationError=n.default,E.MissingRefError=i.default,e.default=E;function p(D,R,C,T="error"){for(const b in D){const P=b;P in R&&this.logger[T](`${C}: option ${b}. ${D[P]}`)}}function $(D){return D=(0,c.normalizeId)(D),this.schemas[D]||this.refs[D]}function S(){const D=this.opts.schemas;if(D)if(Array.isArray(D))this.addSchema(D);else for(const R in D)this.addSchema(D[R],R)}function A(){for(const D in this.opts.formats){const R=this.opts.formats[D];R&&this.addFormat(D,R)}}function I(D){if(Array.isArray(D)){this.addVocabulary(D);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const R in D){const C=D[R];C.keyword||(C.keyword=R),this.addKeyword(C)}}function L(){const D={...this.opts};for(const R of h)delete D[R];return D}const x={log(){},warn(){},error(){}};function H(D){if(D===!1)return x;if(D===void 0)return console;if(D.log&&D.warn&&D.error)return D;throw new Error("logger must implement log, warn and error methods")}const z=/^[a-z_$][a-z0-9_$:-]*$/i;function B(D,R){const{RULES:C}=this;if((0,u.eachItem)(D,T=>{if(C.keywords[T])throw new Error(`Keyword ${T} is already defined`);if(!z.test(T))throw new Error(`Keyword ${T} has invalid name`)}),!!R&&R.$data&&!("code"in R||"validate"in R))throw new Error('$data keyword must have "code" or "validate" function')}function ae(D,R,C){var T;const b=R?.post;if(C&&b)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let j=b?P.post:P.rules.find(({type:V})=>V===C);if(j||(j={type:C,rules:[]},P.rules.push(j)),P.keywords[D]=!0,!R)return;const F={keyword:D,definition:{...R,type:(0,l.getJSONTypes)(R.type),schemaType:(0,l.getJSONTypes)(R.schemaType)}};R.before?oe.call(this,j,F,R.before):j.rules.push(F),P.all[D]=F,(T=R.implements)===null||T===void 0||T.forEach(V=>this.addKeyword(V))}function oe(D,R,C){const T=D.rules.findIndex(b=>b.keyword===C);T>=0?D.rules.splice(T,0,R):(D.rules.push(R),this.logger.warn(`rule ${C} is not defined`))}function je(D){let{metaSchema:R}=D;R!==void 0&&(D.$data&&this.opts.$data&&(R=Ue(R)),D.validateSchema=this.compile(R,!0))}const Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ue(D){return{anyOf:[D,Z]}}})(xn)),xn}var Ar={},jr={},Cr={},Di;function ll(){if(Di)return Cr;Di=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Cr.default=e,Cr}var ut={},Mi;function ul(){if(Mi)return ut;Mi=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.callRef=ut.getValidate=void 0;const e=Tr(),t=De(),r=W(),n=lt(),i=Jn(),s=Y(),a={keyword:"$ref",schemaType:"string",code(l){const{gen:u,schema:v,it:m}=l,{baseId:y,schemaEnv:h,validateName:w,opts:d,self:_}=m,{root:f}=h;if((v==="#"||v==="#/")&&y===f.baseId)return E();const g=i.resolveRef.call(_,f,y,v);if(g===void 0)throw new e.default(m.opts.uriResolver,y,v);if(g instanceof i.SchemaEnv)return p(g);return $(g);function E(){if(h===f)return c(l,w,h,h.$async);const S=u.scopeValue("root",{ref:f});return c(l,(0,r._)`${S}.validate`,f,f.$async)}function p(S){const A=o(l,S);c(l,A,S,S.$async)}function $(S){const A=u.scopeValue("schema",d.code.source===!0?{ref:S,code:(0,r.stringify)(S)}:{ref:S}),I=u.name("valid"),L=l.subschema({schema:S,dataTypes:[],schemaPath:r.nil,topSchemaRef:A,errSchemaPath:v},I);l.mergeEvaluated(L),l.ok(I)}}};function o(l,u){const{gen:v}=l;return u.validate?v.scopeValue("validate",{ref:u.validate}):(0,r._)`${v.scopeValue("wrapper",{ref:u})}.validate`}ut.getValidate=o;function c(l,u,v,m){const{gen:y,it:h}=l,{allErrors:w,schemaEnv:d,opts:_}=h,f=_.passContext?n.default.this:r.nil;m?g():E();function g(){if(!d.$async)throw new Error("async schema referenced by sync schema");const S=y.let("valid");y.try(()=>{y.code((0,r._)`await ${(0,t.callValidateCode)(l,u,f)}`),$(u),w||y.assign(S,!0)},A=>{y.if((0,r._)`!(${A} instanceof ${h.ValidationError})`,()=>y.throw(A)),p(A),w||y.assign(S,!1)}),l.ok(S)}function E(){l.result((0,t.callValidateCode)(l,u,f),()=>$(u),()=>p(u))}function p(S){const A=(0,r._)`${S}.errors`;y.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),y.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function $(S){var A;if(!h.opts.unevaluated)return;const I=(A=v?.validate)===null||A===void 0?void 0:A.evaluated;if(h.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(h.props=s.mergeEvaluated.props(y,I.props,h.props));else{const L=y.var("props",(0,r._)`${S}.evaluated.props`);h.props=s.mergeEvaluated.props(y,L,h.props,r.Name)}if(h.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(h.items=s.mergeEvaluated.items(y,I.items,h.items));else{const L=y.var("items",(0,r._)`${S}.evaluated.items`);h.items=s.mergeEvaluated.items(y,L,h.items,r.Name)}}}return ut.callRef=c,ut.default=a,ut}var Li;function dl(){if(Li)return jr;Li=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=ll(),t=ul(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return jr.default=r,jr}var qr={},Ir={},xi;function fl(){if(xi)return Ir;xi=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=W(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:s,schemaCode:a})=>(0,e.str)`must be ${r[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${a}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:a,data:o,schemaCode:c}=s;s.fail$data((0,e._)`${o} ${r[a].fail} ${c} || isNaN(${o})`)}};return Ir.default=i,Ir}var Dr={},Fi;function hl(){if(Fi)return Dr;Fi=1,Object.defineProperty(Dr,"__esModule",{value:!0});const e=W(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:s,schemaCode:a,it:o}=n,c=o.opts.multipleOfPrecision,l=i.let("res"),u=c?(0,e._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,e._)`${l} !== parseInt(${l})`;n.fail$data((0,e._)`(${a} === 0 || (${l} = ${s}/${a}, ${u}))`)}};return Dr.default=r,Dr}var Mr={},Lr={},Ui;function pl(){if(Ui)return Lr;Ui=1,Object.defineProperty(Lr,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,s;for(;i<r;)n++,s=t.charCodeAt(i++),s>=55296&&s<=56319&&i<r&&(s=t.charCodeAt(i),(s&64512)===56320&&i++);return n}return Lr.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Lr}var Vi;function ml(){if(Vi)return Mr;Vi=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=W(),t=Y(),r=pl(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:a}){const o=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${a} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:a,data:o,schemaCode:c,it:l}=s,u=a==="maxLength"?e.operators.GT:e.operators.LT,v=l.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${o})`;s.fail$data((0,e._)`${v} ${u} ${c}`)}};return Mr.default=i,Mr}var xr={},zi;function _l(){if(zi)return xr;zi=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=De(),t=W(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:s,$data:a,schema:o,schemaCode:c,it:l}=i,u=l.opts.unicodeRegExp?"u":"",v=a?(0,t._)`(new RegExp(${c}, ${u}))`:(0,e.usePattern)(i,o);i.fail$data((0,t._)`!${v}.test(${s})`)}};return xr.default=n,xr}var Fr={},Hi;function yl(){if(Hi)return Fr;Hi=1,Object.defineProperty(Fr,"__esModule",{value:!0});const e=W(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:a}=n,o=i==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${o} ${a}`)}};return Fr.default=r,Fr}var Ur={},Ki;function gl(){if(Ki)return Ur;Ki=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=De(),t=W(),r=Y(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:a,schema:o,schemaCode:c,data:l,$data:u,it:v}=s,{opts:m}=v;if(!u&&o.length===0)return;const y=o.length>=m.loopRequired;if(v.allErrors?h():w(),m.strictRequired){const f=s.parentSchema.properties,{definedProperties:g}=s.it;for(const E of o)if(f?.[E]===void 0&&!g.has(E)){const p=v.schemaEnv.baseId+v.errSchemaPath,$=`required property "${E}" is not defined at "${p}" (strictRequired)`;(0,r.checkStrictMode)(v,$,v.opts.strictRequired)}}function h(){if(y||u)s.block$data(t.nil,d);else for(const f of o)(0,e.checkReportMissingProp)(s,f)}function w(){const f=a.let("missing");if(y||u){const g=a.let("valid",!0);s.block$data(g,()=>_(f,g)),s.ok(g)}else a.if((0,e.checkMissingProp)(s,o,f)),(0,e.reportMissingProp)(s,f),a.else()}function d(){a.forOf("prop",c,f=>{s.setParams({missingProperty:f}),a.if((0,e.noPropertyInData)(a,l,f,m.ownProperties),()=>s.error())})}function _(f,g){s.setParams({missingProperty:f}),a.forOf(f,c,()=>{a.assign(g,(0,e.propertyInData)(a,l,f,m.ownProperties)),a.if((0,t.not)(g),()=>{s.error(),a.break()})},t.nil)}}};return Ur.default=i,Ur}var Vr={},Bi;function vl(){if(Bi)return Vr;Bi=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=W(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:a}=n,o=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${s}.length ${o} ${a}`)}};return Vr.default=r,Vr}var zr={},Hr={},Ji;function Zn(){if(Ji)return Hr;Ji=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=Ei();return e.code='require("ajv/dist/runtime/equal").default',Hr.default=e,Hr}var Gi;function wl(){if(Gi)return zr;Gi=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=Sr(),t=W(),r=Y(),n=Zn(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:o}})=>(0,t.str)`must NOT have duplicate items (items ## ${o} and ${a} are identical)`,params:({params:{i:a,j:o}})=>(0,t._)`{i: ${a}, j: ${o}}`},code(a){const{gen:o,data:c,$data:l,schema:u,parentSchema:v,schemaCode:m,it:y}=a;if(!l&&!u)return;const h=o.let("valid"),w=v.items?(0,e.getSchemaTypes)(v.items):[];a.block$data(h,d,(0,t._)`${m} === false`),a.ok(h);function d(){const E=o.let("i",(0,t._)`${c}.length`),p=o.let("j");a.setParams({i:E,j:p}),o.assign(h,!0),o.if((0,t._)`${E} > 1`,()=>(_()?f:g)(E,p))}function _(){return w.length>0&&!w.some(E=>E==="object"||E==="array")}function f(E,p){const $=o.name("item"),S=(0,e.checkDataTypes)(w,$,y.opts.strictNumbers,e.DataType.Wrong),A=o.const("indices",(0,t._)`{}`);o.for((0,t._)`;${E}--;`,()=>{o.let($,(0,t._)`${c}[${E}]`),o.if(S,(0,t._)`continue`),w.length>1&&o.if((0,t._)`typeof ${$} == "string"`,(0,t._)`${$} += "_"`),o.if((0,t._)`typeof ${A}[${$}] == "number"`,()=>{o.assign(p,(0,t._)`${A}[${$}]`),a.error(),o.assign(h,!1).break()}).code((0,t._)`${A}[${$}] = ${E}`)})}function g(E,p){const $=(0,r.useFunc)(o,n.default),S=o.name("outer");o.label(S).for((0,t._)`;${E}--;`,()=>o.for((0,t._)`${p} = ${E}; ${p}--;`,()=>o.if((0,t._)`${$}(${c}[${E}], ${c}[${p}])`,()=>{a.error(),o.assign(h,!1).break(S)})))}}};return zr.default=s,zr}var Kr={},Wi;function bl(){if(Wi)return Kr;Wi=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=W(),t=Y(),r=Zn(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:a,data:o,$data:c,schemaCode:l,schema:u}=s;c||u&&typeof u=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${o}, ${l})`):s.fail((0,e._)`${u} !== ${o}`)}};return Kr.default=i,Kr}var Br={},Zi;function $l(){if(Zi)return Br;Zi=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=W(),t=Y(),r=Zn(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:v}=s;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const m=l.length>=v.opts.loopEnum;let y;const h=()=>y??(y=(0,t.useFunc)(a,r.default));let w;if(m||c)w=a.let("valid"),s.block$data(w,d);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const f=a.const("vSchema",u);w=(0,e.or)(...l.map((g,E)=>_(f,E)))}s.pass(w);function d(){a.assign(w,!1),a.forOf("v",u,f=>a.if((0,e._)`${h()}(${o}, ${f})`,()=>a.assign(w,!0).break()))}function _(f,g){const E=l[g];return typeof E=="object"&&E!==null?(0,e._)`${h()}(${o}, ${f}[${g}])`:(0,e._)`${o} === ${E}`}}};return Br.default=i,Br}var Xi;function El(){if(Xi)return qr;Xi=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=fl(),t=hl(),r=ml(),n=_l(),i=yl(),s=gl(),a=vl(),o=wl(),c=bl(),l=$l(),u=[e.default,t.default,r.default,n.default,i.default,s.default,a.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return qr.default=u,qr}var Jr={},Ct={},Yi;function Qi(){if(Yi)return Ct;Yi=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.validateAdditionalItems=void 0;const e=W(),t=Y(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:a,it:o}=s,{items:c}=a;if(!Array.isArray(c)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(s,c)}};function i(s,a){const{gen:o,schema:c,data:l,keyword:u,it:v}=s;v.items=!0;const m=o.const("len",(0,e._)`${l}.length`);if(c===!1)s.setParams({len:a.length}),s.pass((0,e._)`${m} <= ${a.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(v,c)){const h=o.var("valid",(0,e._)`${m} <= ${a.length}`);o.if((0,e.not)(h),()=>y(h)),s.ok(h)}function y(h){o.forRange("i",a.length,m,w=>{s.subschema({keyword:u,dataProp:w,dataPropType:t.Type.Num},h),v.allErrors||o.if((0,e.not)(h),()=>o.break())})}}return Ct.validateAdditionalItems=i,Ct.default=n,Ct}var Gr={},qt={},ea;function ta(){if(ea)return qt;ea=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.validateTuple=void 0;const e=W(),t=Y(),r=De(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:a,it:o}=s;if(Array.isArray(a))return i(s,"additionalItems",a);o.items=!0,!(0,t.alwaysValidSchema)(o,a)&&s.ok((0,r.validateArray)(s))}};function i(s,a,o=s.schema){const{gen:c,parentSchema:l,data:u,keyword:v,it:m}=s;w(l),m.opts.unevaluated&&o.length&&m.items!==!0&&(m.items=t.mergeEvaluated.items(c,o.length,m.items));const y=c.name("valid"),h=c.const("len",(0,e._)`${u}.length`);o.forEach((d,_)=>{(0,t.alwaysValidSchema)(m,d)||(c.if((0,e._)`${h} > ${_}`,()=>s.subschema({keyword:v,schemaProp:_,dataProp:_},y)),s.ok(y))});function w(d){const{opts:_,errSchemaPath:f}=m,g=o.length,E=g===d.minItems&&(g===d.maxItems||d[a]===!1);if(_.strictTuples&&!E){const p=`"${v}" is ${g}-tuple, but minItems or maxItems/${a} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(m,p,_.strictTuples)}}}return qt.validateTuple=i,qt.default=n,qt}var ra;function Sl(){if(ra)return Gr;ra=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=ta(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Gr.default=t,Gr}var Wr={},na;function Pl(){if(na)return Wr;na=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=W(),t=Y(),r=De(),n=Qi(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:o,parentSchema:c,it:l}=a,{prefixItems:u}=c;l.items=!0,!(0,t.alwaysValidSchema)(l,o)&&(u?(0,n.validateAdditionalItems)(a,u):a.ok((0,r.validateArray)(a)))}};return Wr.default=s,Wr}var Zr={},sa;function kl(){if(sa)return Zr;sa=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=W(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:s}})=>s===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${s}}`},code(i){const{gen:s,schema:a,parentSchema:o,data:c,it:l}=i;let u,v;const{minContains:m,maxContains:y}=o;l.opts.next?(u=m===void 0?1:m,v=y):u=1;const h=s.const("len",(0,e._)`${c}.length`);if(i.setParams({min:u,max:v}),v===void 0&&u===0){(0,t.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(v!==void 0&&u>v){(0,t.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(l,a)){let g=(0,e._)`${h} >= ${u}`;v!==void 0&&(g=(0,e._)`${g} && ${h} <= ${v}`),i.pass(g);return}l.items=!0;const w=s.name("valid");v===void 0&&u===1?_(w,()=>s.if(w,()=>s.break())):u===0?(s.let(w,!0),v!==void 0&&s.if((0,e._)`${c}.length > 0`,d)):(s.let(w,!1),d()),i.result(w,()=>i.reset());function d(){const g=s.name("_valid"),E=s.let("count",0);_(g,()=>s.if(g,()=>f(E)))}function _(g,E){s.forRange("i",0,h,p=>{i.subschema({keyword:"contains",dataProp:p,dataPropType:t.Type.Num,compositeRule:!0},g),E()})}function f(g){s.code((0,e._)`${g}++`),v===void 0?s.if((0,e._)`${g} >= ${u}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${g} > ${v}`,()=>s.assign(w,!1).break()),u===1?s.assign(w,!0):s.if((0,e._)`${g} >= ${u}`,()=>s.assign(w,!0)))}}};return Zr.default=n,Zr}var Xn={},ia;function Rl(){return ia||(ia=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=W(),r=Y(),n=De();e.error={message:({params:{property:c,depsCount:l,deps:u}})=>{const v=l===1?"property":"properties";return(0,t.str)`must have ${v} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:u,missingProperty:v}})=>(0,t._)`{property: ${c},
11
+ missingProperty: ${v},
12
+ depsCount: ${l},
13
+ deps: ${u}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[l,u]=s(c);a(c,l),o(c,u)}};function s({schema:c}){const l={},u={};for(const v in c){if(v==="__proto__")continue;const m=Array.isArray(c[v])?l:u;m[v]=c[v]}return[l,u]}function a(c,l=c.schema){const{gen:u,data:v,it:m}=c;if(Object.keys(l).length===0)return;const y=u.let("missing");for(const h in l){const w=l[h];if(w.length===0)continue;const d=(0,n.propertyInData)(u,v,h,m.opts.ownProperties);c.setParams({property:h,depsCount:w.length,deps:w.join(", ")}),m.allErrors?u.if(d,()=>{for(const _ of w)(0,n.checkReportMissingProp)(c,_)}):(u.if((0,t._)`${d} && (${(0,n.checkMissingProp)(c,w,y)})`),(0,n.reportMissingProp)(c,y),u.else())}}e.validatePropertyDeps=a;function o(c,l=c.schema){const{gen:u,data:v,keyword:m,it:y}=c,h=u.name("valid");for(const w in l)(0,r.alwaysValidSchema)(y,l[w])||(u.if((0,n.propertyInData)(u,v,w,y.opts.ownProperties),()=>{const d=c.subschema({keyword:m,schemaProp:w},h);c.mergeValidEvaluated(d,h)},()=>u.var(h,!0)),c.ok(h))}e.validateSchemaDeps=o,e.default=i})(Xn)),Xn}var Xr={},aa;function Ol(){if(aa)return Xr;aa=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=W(),t=Y(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:s,schema:a,data:o,it:c}=i;if((0,t.alwaysValidSchema)(c,a))return;const l=s.name("valid");s.forIn("key",o,u=>{i.setParams({propertyName:u}),i.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),s.if((0,e.not)(l),()=>{i.error(!0),c.allErrors||s.break()})}),i.ok(l)}};return Xr.default=n,Xr}var Yr={},oa;function ca(){if(oa)return Yr;oa=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=De(),t=W(),r=lt(),n=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:o,schema:c,parentSchema:l,data:u,errsCount:v,it:m}=a;if(!v)throw new Error("ajv implementation error");const{allErrors:y,opts:h}=m;if(m.props=!0,h.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,c))return;const w=(0,e.allSchemaProperties)(l.properties),d=(0,e.allSchemaProperties)(l.patternProperties);_(),a.ok((0,t._)`${v} === ${r.default.errors}`);function _(){o.forIn("key",u,$=>{!w.length&&!d.length?E($):o.if(f($),()=>E($))})}function f($){let S;if(w.length>8){const A=(0,n.schemaRefOrVal)(m,l.properties,"properties");S=(0,e.isOwnProperty)(o,A,$)}else w.length?S=(0,t.or)(...w.map(A=>(0,t._)`${$} === ${A}`)):S=t.nil;return d.length&&(S=(0,t.or)(S,...d.map(A=>(0,t._)`${(0,e.usePattern)(a,A)}.test(${$})`))),(0,t.not)(S)}function g($){o.code((0,t._)`delete ${u}[${$}]`)}function E($){if(h.removeAdditional==="all"||h.removeAdditional&&c===!1){g($);return}if(c===!1){a.setParams({additionalProperty:$}),a.error(),y||o.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(m,c)){const S=o.name("valid");h.removeAdditional==="failing"?(p($,S,!1),o.if((0,t.not)(S),()=>{a.reset(),g($)})):(p($,S),y||o.if((0,t.not)(S),()=>o.break()))}}function p($,S,A){const I={keyword:"additionalProperties",dataProp:$,dataPropType:n.Type.Str};A===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(I,S)}}};return Yr.default=s,Yr}var Qr={},la;function Tl(){if(la)return Qr;la=1,Object.defineProperty(Qr,"__esModule",{value:!0});const e=kr(),t=De(),r=Y(),n=ca(),i={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,parentSchema:c,data:l,it:u}=s;u.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(u,n.default,"additionalProperties"));const v=(0,t.allSchemaProperties)(o);for(const d of v)u.definedProperties.add(d);u.opts.unevaluated&&v.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(a,(0,r.toHash)(v),u.props));const m=v.filter(d=>!(0,r.alwaysValidSchema)(u,o[d]));if(m.length===0)return;const y=a.name("valid");for(const d of m)h(d)?w(d):(a.if((0,t.propertyInData)(a,l,d,u.opts.ownProperties)),w(d),u.allErrors||a.else().var(y,!0),a.endIf()),s.it.definedProperties.add(d),s.ok(y);function h(d){return u.opts.useDefaults&&!u.compositeRule&&o[d].default!==void 0}function w(d){s.subschema({keyword:"properties",schemaProp:d,dataProp:d},y)}}};return Qr.default=i,Qr}var en={},ua;function Nl(){if(ua)return en;ua=1,Object.defineProperty(en,"__esModule",{value:!0});const e=De(),t=W(),r=Y(),n=Y(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,data:c,parentSchema:l,it:u}=s,{opts:v}=u,m=(0,e.allSchemaProperties)(o),y=m.filter(E=>(0,r.alwaysValidSchema)(u,o[E]));if(m.length===0||y.length===m.length&&(!u.opts.unevaluated||u.props===!0))return;const h=v.strictSchema&&!v.allowMatchingProperties&&l.properties,w=a.name("valid");u.props!==!0&&!(u.props instanceof t.Name)&&(u.props=(0,n.evaluatedPropsToName)(a,u.props));const{props:d}=u;_();function _(){for(const E of m)h&&f(E),u.allErrors?g(E):(a.var(w,!0),g(E),a.if(w))}function f(E){for(const p in h)new RegExp(E).test(p)&&(0,r.checkStrictMode)(u,`property ${p} matches pattern ${E} (use allowMatchingProperties)`)}function g(E){a.forIn("key",c,p=>{a.if((0,t._)`${(0,e.usePattern)(s,E)}.test(${p})`,()=>{const $=y.includes(E);$||s.subschema({keyword:"patternProperties",schemaProp:E,dataProp:p,dataPropType:n.Type.Str},w),u.opts.unevaluated&&d!==!0?a.assign((0,t._)`${d}[${p}]`,!0):!$&&!u.allErrors&&a.if((0,t.not)(w),()=>a.break())})})}}};return en.default=i,en}var tn={},da;function Al(){if(da)return tn;da=1,Object.defineProperty(tn,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:s}=r;if((0,e.alwaysValidSchema)(s,i)){r.fail();return}const a=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),r.failResult(a,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return tn.default=t,tn}var rn={},fa;function jl(){if(fa)return rn;fa=1,Object.defineProperty(rn,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:De().validateUnion,error:{message:"must match a schema in anyOf"}};return rn.default=t,rn}var nn={},ha;function Cl(){if(ha)return nn;ha=1,Object.defineProperty(nn,"__esModule",{value:!0});const e=W(),t=Y(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:a,parentSchema:o,it:c}=i;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&o.discriminator)return;const l=a,u=s.let("valid",!1),v=s.let("passing",null),m=s.name("_valid");i.setParams({passing:v}),s.block(y),i.result(u,()=>i.reset(),()=>i.error(!0));function y(){l.forEach((h,w)=>{let d;(0,t.alwaysValidSchema)(c,h)?s.var(m,!0):d=i.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},m),w>0&&s.if((0,e._)`${m} && ${u}`).assign(u,!1).assign(v,(0,e._)`[${v}, ${w}]`).else(),s.if(m,()=>{s.assign(u,!0),s.assign(v,w),d&&i.mergeEvaluated(d,e.Name)})})}}};return nn.default=n,nn}var sn={},pa;function ql(){if(pa)return sn;pa=1,Object.defineProperty(sn,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const a=n.name("valid");i.forEach((o,c)=>{if((0,e.alwaysValidSchema)(s,o))return;const l=r.subschema({keyword:"allOf",schemaProp:c},a);r.ok(a),r.mergeEvaluated(l)})}};return sn.default=t,sn}var an={},ma;function Il(){if(ma)return an;ma=1,Object.defineProperty(an,"__esModule",{value:!0});const e=W(),t=Y(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:a,parentSchema:o,it:c}=s;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=i(c,"then"),u=i(c,"else");if(!l&&!u)return;const v=a.let("valid",!0),m=a.name("_valid");if(y(),s.reset(),l&&u){const w=a.let("ifClause");s.setParams({ifClause:w}),a.if(m,h("then",w),h("else",w))}else l?a.if(m,h("then")):a.if((0,e.not)(m),h("else"));s.pass(v,()=>s.error(!0));function y(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);s.mergeEvaluated(w)}function h(w,d){return()=>{const _=s.subschema({keyword:w},m);a.assign(v,m),s.mergeValidEvaluated(_,v),d?a.assign(d,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function i(s,a){const o=s.schema[a];return o!==void 0&&!(0,t.alwaysValidSchema)(s,o)}return an.default=n,an}var on={},_a;function Dl(){if(_a)return on;_a=1,Object.defineProperty(on,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return on.default=t,on}var ya;function Ml(){if(ya)return Jr;ya=1,Object.defineProperty(Jr,"__esModule",{value:!0});const e=Qi(),t=Sl(),r=ta(),n=Pl(),i=kl(),s=Rl(),a=Ol(),o=ca(),c=Tl(),l=Nl(),u=Al(),v=jl(),m=Cl(),y=ql(),h=Il(),w=Dl();function d(_=!1){const f=[u.default,v.default,m.default,y.default,h.default,w.default,a.default,o.default,s.default,c.default,l.default];return _?f.push(t.default,n.default):f.push(e.default,r.default),f.push(i.default),f}return Jr.default=d,Jr}var cn={},ln={},ga;function Ll(){if(ga)return ln;ga=1,Object.defineProperty(ln,"__esModule",{value:!0});const e=W(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,i){const{gen:s,data:a,$data:o,schema:c,schemaCode:l,it:u}=n,{opts:v,errSchemaPath:m,schemaEnv:y,self:h}=u;if(!v.validateFormats)return;o?w():d();function w(){const _=s.scopeValue("formats",{ref:h.formats,code:v.code.formats}),f=s.const("fDef",(0,e._)`${_}[${l}]`),g=s.let("fType"),E=s.let("format");s.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>s.assign(g,(0,e._)`${f}.type || "string"`).assign(E,(0,e._)`${f}.validate`),()=>s.assign(g,(0,e._)`"string"`).assign(E,f)),n.fail$data((0,e.or)(p(),$()));function p(){return v.strictSchema===!1?e.nil:(0,e._)`${l} && !${E}`}function $(){const S=y.$async?(0,e._)`(${f}.async ? await ${E}(${a}) : ${E}(${a}))`:(0,e._)`${E}(${a})`,A=(0,e._)`(typeof ${E} == "function" ? ${S} : ${E}.test(${a}))`;return(0,e._)`${E} && ${E} !== true && ${g} === ${i} && !${A}`}}function d(){const _=h.formats[c];if(!_){p();return}if(_===!0)return;const[f,g,E]=$(_);f===i&&n.pass(S());function p(){if(v.strictSchema===!1){h.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function $(A){const I=A instanceof RegExp?(0,e.regexpCode)(A):v.code.formats?(0,e._)`${v.code.formats}${(0,e.getProperty)(c)}`:void 0,L=s.scopeValue("formats",{key:c,ref:A,code:I});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,e._)`${L}.validate`]:["string",A,L]}function S(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!y.$async)throw new Error("async format in sync schema");return(0,e._)`await ${E}(${a})`}return typeof g=="function"?(0,e._)`${E}(${a})`:(0,e._)`${E}.test(${a})`}}}};return ln.default=r,ln}var va;function xl(){if(va)return cn;va=1,Object.defineProperty(cn,"__esModule",{value:!0});const t=[Ll().default];return cn.default=t,cn}var wt={},wa;function Fl(){return wa||(wa=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.contentVocabulary=wt.metadataVocabulary=void 0,wt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],wt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),wt}var ba;function Ul(){if(ba)return Ar;ba=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=dl(),t=El(),r=Ml(),n=xl(),i=Fl(),s=[e.default,t.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return Ar.default=s,Ar}var un={},Xt={},$a;function Vl(){if($a)return Xt;$a=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Xt.DiscrError=e={})),Xt}var Ea;function zl(){if(Ea)return un;Ea=1,Object.defineProperty(un,"__esModule",{value:!0});const e=W(),t=Vl(),r=Jn(),n=Tr(),i=Y(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:c}})=>o===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:o,tag:c,tagName:l}})=>(0,e._)`{error: ${o}, tag: ${l}, tagValue: ${c}}`},code(o){const{gen:c,data:l,schema:u,parentSchema:v,it:m}=o,{oneOf:y}=v;if(!m.opts.discriminator)throw new Error("discriminator: requires discriminator option");const h=u.propertyName;if(typeof h!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!y)throw new Error("discriminator: requires oneOf keyword");const w=c.let("valid",!1),d=c.const("tag",(0,e._)`${l}${(0,e.getProperty)(h)}`);c.if((0,e._)`typeof ${d} == "string"`,()=>_(),()=>o.error(!1,{discrError:t.DiscrError.Tag,tag:d,tagName:h})),o.ok(w);function _(){const E=g();c.if(!1);for(const p in E)c.elseIf((0,e._)`${d} === ${p}`),c.assign(w,f(E[p]));c.else(),o.error(!1,{discrError:t.DiscrError.Mapping,tag:d,tagName:h}),c.endIf()}function f(E){const p=c.name("valid"),$=o.subschema({keyword:"oneOf",schemaProp:E},p);return o.mergeEvaluated($,e.Name),p}function g(){var E;const p={},$=A(v);let S=!0;for(let x=0;x<y.length;x++){let H=y[x];if(H?.$ref&&!(0,i.schemaHasRulesButRef)(H,m.self.RULES)){const B=H.$ref;if(H=r.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,B),H instanceof r.SchemaEnv&&(H=H.schema),H===void 0)throw new n.default(m.opts.uriResolver,m.baseId,B)}const z=(E=H?.properties)===null||E===void 0?void 0:E[h];if(typeof z!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);S=S&&($||A(H)),I(z,x)}if(!S)throw new Error(`discriminator: "${h}" must be required`);return p;function A({required:x}){return Array.isArray(x)&&x.includes(h)}function I(x,H){if(x.const)L(x.const,H);else if(x.enum)for(const z of x.enum)L(z,H);else throw new Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}function L(x,H){if(typeof x!="string"||x in p)throw new Error(`discriminator: "${h}" values must be unique strings`);p[x]=H}}}};return un.default=a,un}const Hl={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};var Sa;function Kl(){return Sa||(Sa=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=cl(),n=Ul(),i=zl(),s=Hl,a=["/properties"],o="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const h=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(h,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=kr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=W();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var v=Bn();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return v.default}});var m=Tr();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(wr,wr.exports)),wr.exports}var Bl=Kl();const Jl=Yc(Bl),Yt={app_id:"beanbagdb_system",meta:{name:"beanbagdb_system",description:"This is the default system app required for proper functioning of the database"},schemas:[{name:"schema",active:!0,description:"Meta-schema or the schema for defining other schemas",system_generated:!0,version:1.25,title:"Schema document",schema:{type:"object",additionalProperties:!1,properties:{system_generated:{title:"System generated schema",type:"boolean",default:!1},active:{title:"Active",description:"This indicates where new documents can be created using this schema or not. Old documents can still be edited",type:"boolean",default:!1},version:{type:"number",title:"Version",minimum:0,default:1,description:"This is an optional field.To be used primarily for system schemas"},name:{type:"string",title:"Name",minLength:4,maxLength:50,pattern:"^[a-zA-Z][a-zA-Z0-9_]*$",description:"This is the name of the schema.It cannot be changed later"},title:{type:"string",title:"Title",minLength:0,maxLength:1e3,description:"A title to display with records."},description:{type:"string",title:"About",minLength:0,maxLength:1e3,description:"A small description of what data in this schema stores."},schema:{type:"object",title:"JSON Schema specification",additionalProperties:!0,minProperties:1,maxProperties:50,description:"This must be a valid JSON Schema which will be used to validate documents created with this schema.See this https://tour.json-schema.org/",default:{}},settings:{type:"object",title:"Additional Settings",additionalProperties:!0,properties:{primary_keys:{title:"Primary key",type:"array",default:[],items:{type:"string"},maxItems:10,description:"Fields that makes each document unique in the schema.Leave it blank if you do not need it. You can still be able to distinguish documents using the link field and the document id."},non_editable_fields:{type:"array",title:"Non editable fields",default:[],items:{type:"string"},maxItems:50,minItems:0,description:"The list of fields whose values are added when the document is created but cannot be edited later in future."},encrypted_fields:{type:"array",title:"List of fields encrypted",default:[],items:{type:"string"},maxItems:50,description:"Once set, all the data in this field will be encrypted before storing it in the database. Encryption key must be provided during the time of BeanBagDB initialization and must be managed by the user as it is NOT stored in the database"},display_fields:{type:"array",title:"List of fields to show in short view",default:[],items:{type:"string"},maxItems:50,description:"These fields will be used when a record is displayed in short"},install_source:{type:"string",title:"Installation source",default:"human",description:"Describes how this schema was installed in database. This is determined by the system. By default the value is human. Possible value: name of the app , where it was cloned from etc..."},svg_icon25:{type:"string",title:"SVG Icon for schema",default:"human",description:"The height and width should be 25px"}},required:["primary_keys","non_editable_fields","encrypted_fields"]}},required:["name","description","schema","settings","title"]},settings:{primary_keys:["name"],non_editable_fields:["system_generated"],encrypted_fields:[],display_fields:["name","version","description","title","active"],svg_icon25:"<svg xmlns='http://www.w3.org/2000/svg' width='25' height='16' fill='currentColor' class='bi bi-database-fill-gear' viewBox='0 0 16 16'><path d='M8 1c-1.573 0-3.022.289-4.096.777C2.875 2.245 2 2.993 2 4s.875 1.755 1.904 2.223C4.978 6.711 6.427 7 8 7s3.022-.289 4.096-.777C13.125 5.755 14 5.007 14 4s-.875-1.755-1.904-2.223C11.022 1.289 9.573 1 8 1'/><path d='M2 7v-.839c.457.432 1.004.751 1.49.972C4.722 7.693 6.318 8 8 8s3.278-.307 4.51-.867c.486-.22 1.033-.54 1.49-.972V7c0 .424-.155.802-.411 1.133a4.51 4.51 0 0 0-4.815 1.843A12 12 0 0 1 8 10c-1.573 0-3.022-.289-4.096-.777C2.875 8.755 2 8.007 2 7m6.257 3.998L8 11c-1.682 0-3.278-.307-4.51-.867-.486-.22-1.033-.54-1.49-.972V10c0 1.007.875 1.755 1.904 2.223C4.978 12.711 6.427 13 8 13h.027a4.55 4.55 0 0 1 .23-2.002m-.002 3L8 14c-1.682 0-3.278-.307-4.51-.867-.486-.22-1.033-.54-1.49-.972V13c0 1.007.875 1.755 1.904 2.223C4.978 15.711 6.427 16 8 16c.536 0 1.058-.034 1.555-.097a4.5 4.5 0 0 1-1.3-1.905m3.631-4.538c.18-.613 1.048-.613 1.229 0l.043.148a.64.64 0 0 0 .921.382l.136-.074c.561-.306 1.175.308.87.869l-.075.136a.64.64 0 0 0 .382.92l.149.045c.612.18.612 1.048 0 1.229l-.15.043a.64.64 0 0 0-.38.921l.074.136c.305.561-.309 1.175-.87.87l-.136-.075a.64.64 0 0 0-.92.382l-.045.149c-.18.612-1.048.612-1.229 0l-.043-.15a.64.64 0 0 0-.921-.38l-.136.074c-.561.305-1.175-.309-.87-.87l.075-.136a.64.64 0 0 0-.382-.92l-.148-.045c-.613-.18-.613-1.048 0-1.229l.148-.043a.64.64 0 0 0 .382-.921l-.074-.136c-.306-.561.308-1.175.869-.87l.136.075a.64.64 0 0 0 .92-.382zM14 12.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0'/></svg>"}},{system_generated:!0,version:1,description:"To store user defined key. this can include anything like API tokens etc. There is a special method to fetch this. The values are encrypted",name:"system_key",title:"System key",active:!0,schema:{type:"object",additionalProperties:!0,required:["name","value"],properties:{name:{type:"string",minLength:5,maxLength:50,pattern:"^[a-zA-Z][a-zA-Z0-9_]*$"},value:{type:"string",minLength:5,maxLength:5e3,pattern:`^[^
14
+ \r]*$`,description:"Must be a single line string"},note:{type:"string",minLength:1,maxLength:5e3}}},settings:{primary_keys:["name"],encrypted_fields:["value"],non_editable_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-key-fill" viewBox="0 0 16 16"><path d="M3.5 11.5a3.5 3.5 0 1 1 3.163-5H14L15.5 8 14 9.5l-1-1-1 1-1-1-1 1-1-1-1 1H6.663a3.5 3.5 0 0 1-3.163 2M2.5 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'}},{version:1,system_generated:!0,description:"The system relies on these settings for proper functioning or enabling optional features.",name:"system_setting",title:"System Setting",active:!0,schema:{required:["name","value"],type:"object",additionalProperties:!0,properties:{name:{type:"string",minLength:5,maxLength:1e3,pattern:"^[a-zA-Z][a-zA-Z0-9_]*$"},value:{type:["array","object"]}}},settings:{primary_keys:["name"],non_editable_fields:["name"],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16"><path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"/></svg>'}},{name:"system_edge_constraint",title:"Edge constraint",system_generated:!0,active:!0,version:1,description:"To define edge constraints for simple directed graph of records.",schema:{type:"object",additionalProperties:!0,required:["node1","node2","name"],properties:{node1:{type:"string",minLength:1,maxLength:500,pattern:"^(\\*|(\\*-[a-zA-Z0-9_-]+)(,[a-zA-Z0-9_-]+)*|[a-zA-Z0-9_-]+(,[a-zA-Z0-9_-]+)*)$"},node2:{type:"string",minLength:1,maxLength:500,pattern:"^(\\*|(\\*-[a-zA-Z0-9_-]+)(,[a-zA-Z0-9_-]+)*|[a-zA-Z0-9_-]+(,[a-zA-Z0-9_-]+)*)$"},name:{type:"string",minLength:1,maxLength:500,pattern:"^[a-zA-Z][a-zA-Z0-9_]*$"},label:{type:"string",maxLength:500},note:{type:"string",maxLength:5e3},max_from_node1:{type:"number",default:-1},max_to_node2:{type:"number",default:-1}}},settings:{primary_keys:["name"],non_editable_fields:["name"],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-node-plus-fill" viewBox="0 0 16 16"><path d="M11 13a5 5 0 1 0-4.975-5.5H4A1.5 1.5 0 0 0 2.5 6h-1A1.5 1.5 0 0 0 0 7.5v1A1.5 1.5 0 0 0 1.5 10h1A1.5 1.5 0 0 0 4 8.5h2.025A5 5 0 0 0 11 13m.5-7.5v2h2a.5.5 0 0 1 0 1h-2v2a.5.5 0 0 1-1 0v-2h-2a.5.5 0 0 1 0-1h2v-2a.5.5 0 0 1 1 0"/></svg>'}},{name:"system_edge",title:"Edge in the system graph",active:!0,system_generated:!0,version:1.5,description:"To define edges in the simple directed graph of records.",schema:{type:"object",additionalProperties:!0,required:["node1","node2","edge_name"],properties:{node1:{type:"string"},node2:{type:"string"},edge_name:{type:"string"},note:{type:"string",default:" "},level_weight:{type:"number",default:1,description:"This helps order nodes at the same level in the graph. Nodes at the same level will be ordered in ascending order"}}},settings:{primary_keys:["node1","node2","edge_name"],non_editable_fields:[],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-diagram-2-fill" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M6 3.5A1.5 1.5 0 0 1 7.5 2h1A1.5 1.5 0 0 1 10 3.5v1A1.5 1.5 0 0 1 8.5 6v1H11a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0v-1A.5.5 0 0 1 5 7h2.5V6A1.5 1.5 0 0 1 6 4.5zm-3 8A1.5 1.5 0 0 1 4.5 10h1A1.5 1.5 0 0 1 7 11.5v1A1.5 1.5 0 0 1 5.5 14h-1A1.5 1.5 0 0 1 3 12.5zm6 0a1.5 1.5 0 0 1 1.5-1.5h1a1.5 1.5 0 0 1 1.5 1.5v1a1.5 1.5 0 0 1-1.5 1.5h-1A1.5 1.5 0 0 1 9 12.5z"/></svg>'}},{name:"system_media",title:"Media content",active:!0,system_generated:!0,version:1,description:"To store images as Base64",schema:{type:"object",additionalProperties:!0,required:["imageBase64","caption","source"],properties:{imageBase64:{type:"string",media:{binaryEncoding:"base64"}},caption:{type:"string"},source:{type:"string"}}},settings:{primary_keys:["caption"],non_editable_fields:[],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-file-image" viewBox="0 0 16 16"><path d="M8.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/><path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2M3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8l-2.083-2.083a.5.5 0 0 0-.76.063L8 11 5.835 9.7a.5.5 0 0 0-.611.076L3 12z"/></svg>'}},{name:"system_log",system_generated:!0,title:"System log",active:!0,version:1.25,description:"To define edges in the simple directed graph of records.",schema:{type:"object",additionalProperties:!0,required:["text"],properties:{text:{type:"string"},app:{type:"string"}}},settings:{primary_keys:[],non_editable_fields:[],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-clock-history" viewBox="0 0 16 16"><path d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022zm2.004.45a7 7 0 0 0-.985-.299l.219-.976q.576.129 1.126.342zm1.37.71a7 7 0 0 0-.439-.27l.493-.87a8 8 0 0 1 .979.654l-.615.789a7 7 0 0 0-.418-.302zm1.834 1.79a7 7 0 0 0-.653-.796l.724-.69q.406.429.747.91zm.744 1.352a7 7 0 0 0-.214-.468l.893-.45a8 8 0 0 1 .45 1.088l-.95.313a7 7 0 0 0-.179-.483m.53 2.507a7 7 0 0 0-.1-1.025l.985-.17q.1.58.116 1.17zm-.131 1.538q.05-.254.081-.51l.993.123a8 8 0 0 1-.23 1.155l-.964-.267q.069-.247.12-.501m-.952 2.379q.276-.436.486-.908l.914.405q-.24.54-.555 1.038zm-.964 1.205q.183-.183.35-.378l.758.653a8 8 0 0 1-.401.432z"/><path d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0z"/><path d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5"/></svg>'}},{name:"system_script",system_generated:!0,title:"Executable script",active:!0,version:1,description:"To create scripts that implement some logic. Can run both on browser and client.",schema:{type:"object",additionalProperties:!0,required:["script","type","version"],properties:{type:{type:"string",default:"JS"},name:{type:"string",default:"script-name",pattern:"^[a-zA-Z0-9\\-]+$"},script:{type:"string",description:"The script",default:""},usage:{type:"string",description:"Documentation",default:" "},version:{type:"number",default:.1},log_execution:{type:"boolean",default:!1}}},settings:{primary_keys:["name"],non_editable_fields:[],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-braces-asterisk" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C2.25 2 1.49 2.759 1.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6M14.886 7.9v.164c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456v-1.3c-1.114 0-1.49-.362-1.49-1.456V4.352C14.51 2.759 13.75 2 12.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6M7.5 11.5V9.207l-1.621 1.621-.707-.707L6.792 8.5H4.5v-1h2.293L5.172 5.879l.707-.707L7.5 6.792V4.5h1v2.293l1.621-1.621.707.707L9.208 7.5H11.5v1H9.207l1.621 1.621-.707.707L8.5 9.208V11.5z"/></svg>'}},{name:"system_text",system_generated:!0,title:"Plain text",active:!0,version:1,description:"Plain text nothing more",schema:{type:"object",additionalProperties:!1,required:[],properties:{text:{type:"string",default:"Text..."}}},settings:{primary_keys:[],non_editable_fields:[],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-justify-left" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5m0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5m0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5"/></svg>'}}],records:[]},Yn={additionalProperties:!0,type:"object",properties:{tags:{type:"array",items:{type:"string"},default:[],maxItems:40},link:{type:"string",minLength:2,maxLength:2e3,pattern:"^[a-zA-Z0-9-]+$"},title:{type:"string",default:"Document",maxLength:1e4},ref:{type:"object",description:"This can be used by apps to add additional data for later user like version ",default:{}},location:{type:"object",description:"this can be used to add created_from and last_updated_from location to the doc",default:{}}}},Gl={additionalProperties:!0,type:"object",required:["app_id"],properties:{app_id:{type:"string"},meta:{type:"object",additionalProperties:!0},schemas:{type:"array",minItems:1},records:{type:"array",default:[]},default_setting:{type:"object",additionalProperties:!0,default:{primary_keys:[],non_editable_fields:[],encrypted_fields:[],svg_icon25:'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-file-earmark" viewBox="0 0 16 16"><path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z"/></svg>'}}}};class He{constructor(t){if(this.util_check_required_fields(["name","encryption_key","api","utils","db_name"],t),this.util_check_required_fields(["insert","update","delete","search","get","createIndex"],t.api),this.util_check_required_fields(["encrypt","decrypt","ping","validate_schema"],t.utils),t.encryption_key.length<20)throw new he([{message:He.error_codes.key_short}]);this.encryption_key=t.encryption_key,this.db_name=t.db_name,this.db_api=t.api,this.utils=t.utils,this.meta={database_name:t.name,backend_database:this.db_name,beanbagdb_version_db:null},this._version=this._get_current_version(),this.active=!1,this.apps={},console.log("Run ready() now")}static error_codes={key_short:"The encryption key must at least contain 20 characters",not_active:"Database is not ready. Run ready() first",schema_not_found:"Schema not found",doc_not_found:"Document with selected criteria does not exists"};static rest_enabled={ready:{use:"Makes the database ready to use"},metadata:{use:"Returns metadata related to the current BeanBagDB instance "},initialize_app:{use:"To install/initialize an external app",input:"{...app_data}"},update_indexes:{use:"Updates the indexes in the database for better searching"},create:{input:"{schema,data,meta}",use:"Creates a new doc"},read:{input:"{criteria,include_schema:false}",use:"Returns a doc. 3 ways to search for a doc : by _id, by link or by the primary key of the schema "},update:{input:"{criteria,updates}",use:"Updates a document"},delete:{input:"{criteria}",use:"Deletes a doc"},search:{input:"{criteria:{selector:{...}}}",use:"To search in the database"},get:{input:"{type,criteria}",use:"Returns special types of documents "},create_edge:{input:"{node1:{..criteria},node2:{..criteria},edge_name,edge_label}",use:"Creates a new edge in the system's simple directed graph "},util_get_now_unix_timestamp:{use:"Returns the current UNIX timestamp"},util_validate_data:{input:"{schema:{},data:{}}",use:"Validate the given data against the given schema and returns errors/validated doc"},util_validate_schema_object:{input:"{...schema_object...}",use:"Validated the schema document without inserting it in the DB"},util_generate_random_link:{use:"Returns a random link"}};metadata(){return{...this.meta,beanbagdb_version_code:this._version,ready_to_use:this.active}}async check_ready(){console.log("checking if DB is ready to be used");let t=await this.db_api.search({selector:{schema:"system_setting","data.name":"beanbagdb_system"}});if(t.docs.length>0){let r=t.docs[0];this.active=r.data.value.version==this._version,this.meta.beanbagdb_version_db=r.data.value.version}return this.active||console.log("Version mismatch.Init of default required"),this.active}async ready(t=!0){if(await this.check_ready())console.log("Ready.Set.Go");else if(t)console.log("Initializing"),await this.initialize();else throw new Error("DB cannot be used because there is a version mismatch between the DB and the script. Since automatically init flag was set to true, exiting")}async initialize(){try{let t=await this.initialize_app(Yt);return this.meta.beanbagdb_version_db=this._version,this.active=!0,t}catch(t){throw console.log("Error in initializing instance"),console.log(t),t}}async initialize_app(t){if(!t)throw new Error("app_data_input is required");let r=this.util_validate_data({schema:Gl,data:t}),n=0;r.schemas.map(u=>{n=n+u.version,u.settings.install_source=`app:${r.app_id}`}),r.records.map(u=>{n=n+u.version});let i=await this.db_api.search({selector:{schema:"system_setting","data.name":r.app_id}}),s=!0,a;if(i.docs.length>0&&(a=i.docs[0],a.data.value.version==n&&(s=!1)),!s)return a;let o=`Initializing ${r.app_id} app to v.${n}`,c=["update started"];for(let u=0;u<r.schemas.length;u++){const v=r.schemas[u].name,m=r.schemas[u];c.push(`checking.${v}`);try{let y=await this.get({type:"schema",criteria:{name:v}});if(y.data.version!=m.version){c.push(`old.${v}.v.${y.data.version}`);let h=await this.db_api.get(y._id);h.data={...m},h.meta.updated_on=this.util_get_now_unix_timestamp(),console.log(h),await this.db_api.update(h),c.push(`new.${v}.v=${m.version}`)}else c.push(`${v}.v.${y.data.version}=latest`)}catch(y){if(y instanceof Qe){if(v=="schema"&&r.app_id=="beanbagdb_system"){let h=this._get_blank_doc("schema");h.data=m,await this.db_api.insert(h)}else{let h=Yt.schemas[0].schema,w=this._get_blank_schema_doc("schema",h,m);await this.db_api.insert(w)}c.push(`init.${v}.v=${m.version}`)}else c.push(`${v}.error.message : ${y.message} `)}}for(let u=0;u<r.records.length;u++){const v=r.records[u].schema,m=r.records[u].record,y=r.records[u].title;c.push(`checking.records.${y}`);try{let h=await this.create({schema:v,data:m,meta:r.records[u].meta});c.push(`doc.${y}.created`)}catch(h){h instanceof bt||c.push(`error in doc ${y} insertion: ${h.message}, doc: ${JSON.stringify(m)}`)}}let l={...r.meta,app_id:r.app_id,version:n};try{await this.modify_setting(r.app_id,l,"update");let u=this._get_blank_doc("system_log");u.data={text:o,steps:c,app:r.app_id},u.meta.title=o,await this.db_api.insert(u),console.log("init logged")}catch(u){throw console.log(u),console.log("error in storing/updating beanbagdb_version"),u}return l}async update_indexes(){this._check_ready_to_use();let t=await this.db_api.search({selector:{schema:"schema"}}),r=[];t.docs.map(n=>{Object.keys(n.data.schema.properties).map(i=>{r.push("data."+i)})}),await this.db_api.createIndex({index:{fields:r}})}async create(t){this._check_ready_to_use();let r=[];if(t.schema||r.push("schema is required"),t.data||r.push("data is required"),r.length>0)throw new bt(`${r.join(",")}.`);if(Object.keys(t.data).length==0)throw new bt("No data provided");try{let n=await this._insert_pre_checks(t.schema,t.data,t?.meta||{},t?.app||{},t?.settings||{}),i=await this.db_api.insert(n);return{_id:i.id,_rev:i.rev,...n}}catch(n){throw n}}async read(t){this._check_ready_to_use();let r={doc:null},n=null;if(t._id)try{let i=await this.db_api.get(t._id);r.doc=i}catch{throw new Qe(He.error_codes.doc_not_found)}else if(t.link){let i=await this.db_api.search({selector:{"meta.link":t.link}});if(i.docs.length==0)throw new Qe(He.error_codes.doc_not_found);r.doc=i.docs[0]}else if(t.hasOwnProperty("schema")&t.hasOwnProperty("data")){n=await this.get({type:"schema",criteria:{name:t.schema}});let i=n.data.settings.primary_keys,s={schema:t.schema};i.forEach(o=>{if(!t.data[o])throw new he("Incomplete Primary key set. Required field(s) : "+i.join(","));s["data."+o]=t.data[o]});let a=await this.db_api.search({selector:s});if(a.docs.length==0)throw new Qe(He.error_codes.doc_not_found);r.doc=a.docs[0]}else throw new he('Invalid criteria to read a document. Valid ways : {"schema":"schema_name","data":{...primary key}} or {"_id":""} or {"link":""} ');return n||(n=await this.get({type:"schema",criteria:{name:r.doc.schema}})),t.include_schema&&(r.schema=n.data),r.doc=await this._decrypt_doc(n.data,r.doc),r}async update(t){this._check_ready_to_use();const{criteria:r,updates:n,rev_id:i="",update_source:s="api",save_conflict:a=!0}=t;if(!r)throw new Ke("Doc search criteria not provided");if(!n)throw new Ke("No updates provided. Format {'update':{'data':{...selected fields},'meta':{},'app':{... used by apps to manage app data} }}");let o=await this.read({...r,include_schema:!0}),c=o.schema,l=o.doc;if(l.schema=="schema"&&l.data.system_generated==!0)throw new Ke("System schemas cannot be updated using this API");let u=Object.keys(c.schema.properties),v=c.settings.non_editable_fields,m=u.filter(w=>!v.includes(w)),y=!1,h=this.util_filter_object(n.data||{},m);if(Object.keys(h).length>0){let w={...l.data,...h};if(l.schema=="system_edge"&&(w=await this._create_edge(w)),w=this.util_validate_data({schema:c.schema,data:w}),c.settings.primary_keys.length>0){let d=c.settings.primary_keys,_={schema:c.name};d.map(g=>{_["data."+g]=w[g]});let f=await this.search({selector:_});if(f.docs.length>0)if(f.docs.length==1){if(f.docs[0]._id!=l._id)throw new Ke("Update not allowed. Document with the same primary key already exists")}else throw new Error("There is something wrong with the schema primary keys")}l.data=w,y=!0}if(n.meta){let w=Yn;Object.keys(w.properties);let d={...l.meta,...n.meta};if(d=this.util_validate_data({schema:w,data:d}),d.link){let _=await this.search({selector:{"meta.link":d.link}});if(_.docs.length>0)if(_.docs.length==1){if(_.docs[0]._id!=l._id)throw new Ke("Update not allowed. Document with the same link already exists")}else throw new Error("There is something wrong.")}l.meta={...d},y=!0}if(n.app&&(l.app||(l.app={}),Object.entries(n.app).forEach(([w,d])=>{if(!d||typeof d!="object"||!d.mode||!d.data)throw console.warn(`Invalid update format for ${w}`),new Ke(`Invalid update format for app ${w}. Must be an object {mode:"update|replace|append|remove", data:{} }`);switch(d.mode){case"update":l.app[w]={...l.app[w],...d.data},y=!0;break;case"replace":l.app[w]=d.data,y=!0;break;case"append":Object.entries(d.data).forEach(([_,f])=>{Array.isArray(l.app[w]?.[_])||(l.app[w]=l.app[w]||{},l.app[w][_]=[]),l.app[w][_].push(f)}),y=!0;break;case"remove":delete l.app[w],y=!0;break;default:throw new Ke(`Unknown mode: ${d.mode} app ${w}. Must be an object {mode:"update|replace|append|remove", data:{} }`)}})),y)return l=await this._encrypt_doc(c,l),l.meta.updated_on=this.util_get_now_unix_timestamp(),l.meta.updated_by=s,await this.db_api.update(l);throw new Ke("Nothing to update")}async delete(t){this._check_ready_to_use();let r=await this.read(t);if(["schema","system_setting","system_log"].includes(r.schema))throw new Error(`Deletion of ${r.schema} doc is not support yet.`);await this.db_api.delete(r.doc._id)}async search(t={}){if(this._check_ready_to_use(),!t.selector)throw new he("Invalid search query.Use {selector:{...query...}}");let r=await this.db_api.search(t);return{...{decrypt_docs:!1},...t?.options||{}}.decrypt_docs&&r.docs.length>0&&(r=await this._decrypt_docs(r)),r}async _decrypt_docs(t){const r=[...new Set(t.docs.map(a=>a.schema))];let n=await this.db_api.search({selector:{schema:"schema","data.name":{$in:r}}}),i={};n.docs.map(a=>{i[a.data.name]=a.data});let s=[];for(let a=0;a<t.docs.length;a++){const o=t.docs[a];s.push(await this._decrypt_doc(i[o.schema],o))}return{docs:s}}async get(t){const r={schema:async n=>{let i=await this.db_api.search({selector:{schema:"schema","data.name":n.name}});if(i.docs.length==0)throw new Qe(He.error_codes.schema_not_found);return i.docs[0]},schema_list:async n=>{let i=await this.db_api.search({selector:{schema:"schema"}});if(i.docs.length==0)throw new Qe(He.error_codes.schema_not_found);{let s=[];return i.docs.map(a=>{s.push({name:a.data.name,version:a.data.version,system_defined:a.data.system_generated,description:a.data.description,link:a.meta.link,title:a.data.title,_id:a._id})}),s}},schema_icons:async n=>{let i=await this.db_api.search({selector:{schema:"schema"}});if(i.docs.length==0)throw new Qe(He.error_codes.schema_not_found);{let s={};return i.docs.map(a=>{s[a.data.name]=a.data.settings.svg_icon25||""}),s}},editable_meta_schema:async n=>Yn};if(!t.type)throw new he("No type provided. Must be: "+Object.keys(r).join(","));if(Object.keys(r).includes(t.type))return await r[t.type](t?.criteria||{});throw new he("Invalid name. Must be : "+Object.keys(r).join(","))}async load_scripts(t,r){if(this._check_ready_to_use(),this.apps[t]={},r)for(let n in r)typeof r[n]=="function"&&(this.apps[t][n]=r[n].bind(null,this));else console.log("app_module is blank")}async modify_setting(t,r,n){if(!t||!r||!n)throw new Ke("All 3 inputs (setting name, value and update_mode) are required");let i=await this.db_api.search({selector:{schema:"system_setting","data.name":t}});if(!["append","update"].includes(n))throw new Ke("Invalid update_mode");if(i.docs.length>0){let s={...i.docs[0]};return Array.isArray(r)?s.data.value=n==="append"?[...s.data.value,r]:r:s.data.value=n==="append"?{...s.data.value,...r}:r,s.meta.updated_on=this.util_get_now_unix_timestamp(),await this.db_api.update(s),s}else{let s=this._get_blank_doc("system_setting");s.data={value:r,name:t},await this.db_api.insert(s)}}async _create_edge(t){console.log(t);let{node1:r,node2:n,edge_name:i,note:s="",level_weight:a=1}=t;if(this._check_ready_to_use(),!i)throw new he("edge_name required");if(!r||Object.keys(r).length==0)throw new he("node1 required");if(!n||Object.keys(n).length==0)throw new he("node2 required");typeof r=="string"&&(r={_id:r}),typeof n=="string"&&(n={_id:n});let o=await this.read(r),c=await this.read(n);if(o.doc._id==c.doc._id)throw new he("Both nodes cannot be the same");if(o.doc.schema=="system_edge"||c.doc.schema=="system_edge")throw new he("A node cannot be an existing edge document");let l;try{l=(await this.read({schema:"system_edge_constraint",data:{name:i}})).doc.data;let v=[],m=o.doc._id,y=c.doc._id,h=this._check_nodes_edge(l.node1,l.node2,o.doc.schema,c.doc.schema);h.valid?h.swapped&&(m=c.doc._id,y=o.doc._id):v.push("Invalid nodes.This config of nodes not allowed");let w=await this.search({selector:{schema:"system_edge","data.edge_name":i}});if(l.max_from_node1!=-1&&w.docs.filter(_=>_.data.node1==m).length>=l.max_from_node1&&v.push("max limit reached"),l.max_to_node2!=-1){let d=w.docs.filter(_=>_.data.node2==y);filter1.length>=l.max_from_node1&&v.push("max limit reached")}if(v.length==0)return{node1:m,node2:y,edge_name:i,note:s,level_weight:a};throw new Wl(v)}catch(u){if(u instanceof Qe){let v={node1:"*",node2:"*",name:i,note:s};return await this.create({schema:"system_edge_constraint",data:v}),{node1:o.doc._id,node2:c.doc._id,edge_name:i,note:s,level_weight:a}}else throw u}}_check_node_schema_match(t,r){return t==="*"?!0:t.startsWith("*-")?!t.slice(2).split(",").includes(r):t.split(",").includes(r)}_check_nodes_edge(t,r,n,i){const s=this._check_node_schema_match(t,n),a=this._check_node_schema_match(r,i),o=this._check_node_schema_match(r,n),c=this._check_node_schema_match(t,i);return s&&a?{valid:!0,swapped:!1}:o&&c?{valid:!0,swapped:!0}:{valid:!1,swapped:!1}}async _upgrade_schema_in_bulk(t,r=!1,n="Schema Upgrade in bulk"){let i=["schema update started"],s=!1;for(let a=0;a<t.length;a++){const o=t[a].name,c=t[a];i.push(`checking.${o}`);try{let l=await this.get({type:"schema",criteria:{name:o}});if(l.data.version!=c.version){i.push(`old.${o}.v.${l.data.version}`);let u=await this.db_api.get(l._id);u.data={...c},u.meta.updated_on=this.util_get_now_unix_timestamp(),console.log(u),await this.db_api.update(u),i.push(`new.${o}.v=${c.version}`),s=s||!0}else i.push(`${o}.v.${l.data.version}=latest`)}catch(l){if(l instanceof Qe){let u=Yt.schemas[0].schema,v=this._get_blank_schema_doc("schema",u,c);await this.db_api.insert(v),i.push(`init.${o}.v=${c.version}`),s=s||!0}else i.push(`${o}.error.message : ${l.message} `)}}if(s&&r)try{let a=this._get_blank_doc("system_log");a.data={text:n,data:{steps:i},time:this.util_get_now_unix_timestamp()},await this.db_api.insert(a)}catch(a){console.log(a)}return{update_was_required:s,logs:i}}_get_current_version(){let t=0;if(Yt.schemas.map(r=>{t=t+r.version}),Yt.records.map(r=>{t=t+r.version}),t==NaN)throw Error("Error in system schema version numbers");return t}_check_ready_to_use(){if(!this.active)throw new Error(He.error_codes.not_active)}_get_blank_doc(t){if(!t)throw new Error("Schema name not provided for the blank doc");let r=this.util_get_now_unix_timestamp(),n=`${r}`;return{data:{},meta:{created_on:r,tags:[],link:this.util_generate_random_link(),title:n},app:{},schema:t}}_get_blank_schema_doc(t,r,n){let i=this.util_validate_data({schema:r,data:n}),s=this._get_blank_doc(t);return s.data=i,s}async _decrypt_doc(t,r){try{for(let n of t.settings.encrypted_fields)r.data[n]=await this.utils.decrypt(r.data[n],this.encryption_key);return{...r}}catch(n){throw console.log(n),new Pa([{message:n.message}])}}async _encrypt_doc(t,r){try{if(t.settings.encrypted_fields.length>0)for(let n of t.settings.encrypted_fields)r.data[n]=await this.utils.encrypt(r.data[n],this.encryption_key);return{...r}}catch(n){throw new Pa([{message:n.message}])}}async _insert_pre_checks(t,r,n={},i={},s={}){let a=await this.search({selector:{schema:"schema","data.name":t}});if(a.docs.length==0)throw new bt(`The schema "${t}" does not exists`);let o=a.docs[0].data;if(!o.active)throw new bt(`The schema "${t}" is not active`);let c;if(t!="system_edge"&&(c=this.util_validate_data({schema:o.schema,data:r})),Object.keys(n).length>0&&(n=this.util_validate_data({schema:Yn,data:n})),Object.keys(i).length>0){let u={type:"object",patternProperties:{".*":{type:"object"}},additionalProperties:!1};this.util_validate_data({schema:u,data:i})}if(n.link&&(await this.search({selector:{"meta.link":n.link}})).docs.length>0)throw new bt(`Document with the link "${n.link}" already exists in the Database.`);if(t=="schema"?this.util_validate_schema_object(c):t=="system_edge"&&(c=await this._create_edge(r)),o.settings.primary_keys.length>0){let u={schema:t};if(o.settings.primary_keys.map(m=>{u["data."+m]=c[m]}),(await this.search({selector:u})).docs.length>0)throw new bt(`Document with the given primary key (${o.settings.primary_keys.join(",")}) already exists in the schema "${t}"`)}if(o.settings.encrypted_fields.length>0)for(let u of o.settings.encrypted_fields)c[u]=await this.utils.encrypt(c[u],this.encryption_key);let l=this._get_blank_doc(t);return l.data=c,n&&(l.meta={...l.meta,...n}),i&&(l.app=i),l}util_get_now_unix_timestamp(){return Math.floor(Date.now()/1e3)}util_check_required_fields(t,r){for(const n of t)if(!r[n])throw new he(`The field ${n} is required.`)}util_filter_object(t,r){return r.reduce((n,i)=>(Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]),n),{})}util_validate_data(t){if(!t.schema)throw new he("schema is required");if(!t.data)throw new he("data is required");const{valid:r,validate:n,data:i}=this.utils.validate_schema(t.schema,t.data);if(r)return i;throw new he(n.errors)}util_validate_schema_object(t){let r=[{message:"Schema validation errors "}];t.schema.type?t.schema.type!="object"&&r.push({message:"The schema.'type' value is invalid.Only 'object' allowed"}):r.push({message:"Schema must have the field schema.'type' which can only be 'object' "}),t.schema.properties?(typeof t.schema.properties!="object"&&r.push({message:"Invalid schema.properties. It must be an object and must have atleast one field inside."}),Object.keys(t.schema.properties).length==0&&r.push({message:"You must define at least one property"})):r.push({message:"The schema.'properties' object does not exists"}),t.schema.hasOwnProperty("additionalProperties")?typeof t.schema.additionalProperties!="boolean"&&r.push({message:"Invalid schema.additionalProperties. It must be a boolean value"}):r.push({message:"The schema.'additionalProperties' field is required"});const n=Object.keys(t.schema.properties);if(t.settings.primary_keys.length>0&&(t.settings.primary_keys.every(s=>n.includes(s)&&t.schema.properties[s].type!="object"&&t.schema.properties[s].type!="array")||r.push({message:"Primary keys invalid. All keys must be defined in the schema and must be non object"})),t.settings.non_editable_fields.length>0&&(t.settings.non_editable_fields.every(s=>n.includes(s))||r.push({message:"Non editable fields invalid. All fields must be defined in the schema "})),t.settings.encrypted_fields.length>0&&(t.settings.encrypted_fields.every(a=>n.includes(a)&&t.schema.properties[a].type=="string")||r.push({message:"Invalid encrypted fields. All fields must be defined in the schema and must be string "}),t.settings.encrypted_fields.every(a=>!t.settings.primary_keys.includes(a))||r.push({message:"Invalid encrypted fields.Primary key fields cannot be encrypted "})),r.length>1)throw new he(r)}util_generate_random_link(t={type:1}){return{0:()=>{const n=["rain","mars","banana","earth","kiwi","mercury","fuji","hurricane","matterhorn","snow","saturn","jupiter","peach","wind","pluto","apple","k2","storm","venus","denali","cloud","sunshine","mango","drizzle","pineapple","aconcagua","gasherbrum","apricot","neptune","fog","orange","blueberry","kilimanjaro","uranus","grape","storm","montblanc","lemon","chooyu","raspberry","cherry","thunder","vinson","breeze","elbrus","everest","parbat","makalu","nanga","kangchenjunga","lightning","cyclone","comet","asteroid","pomegranate","nectarine","clementine","strawberry","tornado","avalanche","andes","rockies","himalayas","pyrenees","carpathians","cascade","etna","vesuvius","volcano","tundra","whirlwind","iceberg","eclipse","zephyr","tropic","monsoon","aurora"];return Array.from({length:3},()=>n[Math.floor(Math.random()*n.length)]).join("-")},1:()=>{const n=Math.floor(Math.random()*3)+6;return Math.floor(Math.random()*Math.pow(16,n)).toString(16).padStart(n,"0")}}[t.type]()}}class he extends Error{constructor(t=[]){let r;Array.isArray(t)?r=t.map(i=>` ${(i.instancePath||" ").replace("/","")} ${i.message} `):r=[t];let n=`Validation failed with error(s): ${r.join(",")}`;super(n),this.name="ValidationError",this.errors=t}}class Ke extends Error{constructor(t=[]){let r;Array.isArray(t)?r=t.map(i=>` ${(i.instancePath||" ").replace("/","")} ${i.message} `):r=[t];let n=`Error in document update. ${r.join(",")}`;super(n),this.name="DocUpdateError",this.errors=t}}class bt extends Error{constructor(t=[]){let r;Array.isArray(t)?r=t.map(i=>` ${(i.instancePath||" ").replace("/","")} ${i.message} `):r=[t];let n=`Error in document creation. ${r.join(",")}`;super(n),this.name="DocCreationError",this.errors=t}}class Qe extends Error{constructor(t=[]){let r;Array.isArray(t)?r=t.map(i=>` ${(i.instancePath||" ").replace("/","")} ${i.message} `):r=[t];let n=`Error in fetching document. Criteria : ${r.join(",")}`;super(n),this.name="DocNotFoundError",this.errors=t}}class Pa extends Error{constructor(t=[]){let r;Array.isArray(t)?r=t.map(i=>` ${(i.instancePath||" ").replace("/","")} ${i.message} `):r=[t];let n=`Error in encryption/decryption of data : ${r.join(",")}`;super(n),this.name="EncryptionError",this.errors=t}}class Wl extends Error{constructor(t=[]){let r;Array.isArray(t)?r=t.map(i=>` ${(i.instancePath||" ").replace("/","")} ${i.message} `):r=[t];let n=`Error in relation of the simple digraph : ${r.join(",")}`;super(n),this.name="RelationError",this.errors=t}}const Zl=DB=async e=>{if(!e.url)throw new Error("No DB URL provided");if(!e.name)throw new Error("No DB name provided");if(!e.encryption_key)throw new Error("No encryption key provided");let t=e.url,r=e.name;const n=e.url.match(/^(https?:\/\/[^\/]+(?:\/[^\/]+)*)\/([^\/]+)$/);n&&(t=n[1],r=e.name||n[2]);const i=`${t}/${r}`,s=se.create({baseURL:i,timeout:1e4,headers:{"Content-Type":"application/json",Accept:"application/json"}});try{await s.get("/")}catch(c){if(c.response?.status===404)await se.put(`${t}/${r}`);else throw c}const a={db_name:"couchdb-rest",name:r,encryption_key:e.encryption_key,api:{insert:async c=>(await s.post("/",c)).data,update:async c=>{if(!c._id||!c._rev)throw new Error("Document must have _id and _rev for update");return(await s.put(`/${c._id}`,c)).data},search:async c=>(await s.post("_find",c)).data,get:async c=>(await s.get(`/${c}`)).data,createIndex:async c=>(await s.post("_index",c)).data,delete:async c=>{const l=await s.get(`/${c}`);return(await s.delete(`/${c}?rev=${l._rev}`)).data}},utils:{encrypt:async(c,l)=>{const u=new TextEncoder,v=u.encode(c),m=u.encode(l);if(![16,24,32].includes(m.length))throw new Error("Encryption key must be 16, 24, or 32 bytes long.");const y=await crypto.subtle.importKey("raw",m,{name:"AES-GCM"},!1,["encrypt"]),h=crypto.getRandomValues(new Uint8Array(12)),w=await crypto.subtle.encrypt({name:"AES-GCM",iv:h},y,v),d=new Uint8Array(w),_=btoa(String.fromCharCode(...d));return`${btoa(String.fromCharCode(...h))}:${_}`},decrypt:async(c,l)=>{const[u,v]=c.split(":"),m=Uint8Array.from(atob(u),f=>f.charCodeAt(0)),y=Uint8Array.from(atob(v),f=>f.charCodeAt(0)),h=new TextEncoder,w=await crypto.subtle.importKey("raw",h.encode(l),{name:"AES-GCM"},!1,["decrypt"]),d=await crypto.subtle.decrypt({name:"AES-GCM",iv:m},w,y);return new TextDecoder().decode(d)},ping:async()=>{try{return await s.get("/"),!0}catch{return!1}},validate_schema:(c,l)=>{const u=new Jl({code:{esm:!0},strict:!1,useDefaults:!0}),v={...l},m=u.compile(c);return{valid:m(v),validate:m,data:v}}}},o=new He(a);return await o.ready(!1),o},Xl="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Xl);const Yl=2,ka="[",Ra="[!",Oa="]",Qt={},pe=Symbol(),Qn=!1;var Ql=Array.isArray,eu=Array.prototype.indexOf,tu=Array.from,dn=Object.keys,fn=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,ru=Object.prototype,nu=Array.prototype,su=Object.getPrototypeOf,Ta=Object.isExtensible;function iu(e){for(var t=0;t<e.length;t++)e[t]()}function Na(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}const le=2,Aa=4,es=8,au=1<<24,et=16,Et=32,dt=64,hn=128,Me=512,ye=1024,ke=2048,Be=4096,ft=8192,tt=16384,ts=32768,pn=65536,ja=1<<17,Ca=1<<18,St=1<<19,ou=1<<20,Pt=32768,rs=1<<21,ns=1<<22,ht=1<<23,mn=Symbol("$state"),qa=Symbol("legacy props"),It=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Ia=3,_n=8;function cu(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function lu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function uu(){throw new Error("https://svelte.dev/e/hydration_failed")}function du(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function fu(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function hu(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function pu(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function mu(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function ss(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function _u(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let me=!1;function yn(e){me=e}let ne;function rt(e){if(e===null)throw ss(),Qt;return ne=e}function Da(){return rt(it(ne))}function is(e){if(me){if(it(ne)!==null)throw ss(),Qt;ne=e}}function Ma(e=1){if(me){for(var t=e,r=ne;t--;)r=it(r);ne=r}}function yu(e=!0){for(var t=0,r=ne;;){if(r.nodeType===_n){var n=r.data;if(n===Oa){if(t===0)return r;t-=1}else(n===ka||n===Ra)&&(t+=1)}var i=it(r);e&&r.remove(),r=i}}function La(e){return e===this.v}function gu(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function vu(e){return!gu(e,this.v)}let wu=!1,Le=null;function Dt(e){Le=e}function xa(e,t=!1,r){Le={p:Le,i:!1,c:null,e:null,s:e,x:null,l:null}}function Fa(e){var t=Le,r=t.e;if(r!==null){t.e=null;for(var n of r)Mu(n)}return e!==void 0&&(t.x=e),t.i=!0,Le=t.p,e??{}}function Ua(){return!0}let kt=[];function Va(){var e=kt;kt=[],iu(e)}function as(e){if(kt.length===0&&!er){var t=kt;queueMicrotask(()=>{t===kt&&Va()})}kt.push(e)}function bu(){for(;kt.length>0;)Va()}function za(e){var t=re;if(t===null)return Q.f|=ht,e;if((t.f&ts)===0){if((t.f&hn)===0)throw e;t.b.error(e)}else Mt(e,t)}function Mt(e,t){for(;t!==null;){if((t.f&hn)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const gn=new Set;let ie=null,Te=null,Ne=[],vn=null,os=!1,er=!1;class xe{committed=!1;current=new Map;previous=new Map;#t=new Set;#e=new Set;#c=0;#s=0;#l=null;#a=new Set;#n=new Set;skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#s>0}process(t){Ne=[],this.apply();var r={parent:null,effect:null,effects:[],render_effects:[]};for(const n of t)this.#r(n,r);this.is_fork||this.#u(),this.is_deferred()?(this.#i(r.effects),this.#i(r.render_effects)):(ie=null,Ka(r.render_effects),Ka(r.effects),this.#l?.resolve()),Te=null}#r(t,r){t.f^=ye;for(var n=t.first;n!==null;){var i=n.f,s=(i&(Et|dt))!==0,a=s&&(i&ye)!==0,o=a||(i&ft)!==0||this.skipped_effects.has(n);if((n.f&hn)!==0&&n.b?.is_pending()&&(r={parent:r,effect:n,effects:[],render_effects:[]}),!o&&n.fn!==null){s?n.f^=ye:(i&Aa)!==0?r.effects.push(n):or(n)&&((n.f&et)!==0&&this.#a.add(n),cr(n));var c=n.first;if(c!==null){n=c;continue}}var l=n.parent;for(n=n.next;n===null&&l!==null;)l===r.effect&&(this.#i(r.effects),this.#i(r.render_effects),r=r.parent),n=l.next,l=l.parent}}#i(t){for(const r of t)(r.f&ke)!==0?this.#a.add(r):(r.f&Be)!==0&&this.#n.add(r),this.#o(r.deps),ve(r,ye)}#o(t){if(t!==null)for(const r of t)(r.f&le)===0||(r.f&Pt)===0||(r.f^=Pt,this.#o(r.deps))}capture(t,r){this.previous.has(t)||this.previous.set(t,r),(t.f&ht)===0&&(this.current.set(t,t.v),Te?.set(t,t.v))}activate(){ie=this,this.apply()}deactivate(){ie===this&&(ie=null,Te=null)}flush(){if(this.activate(),Ne.length>0){if(Ha(),ie!==null&&ie!==this)return}else this.#c===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#u(){if(this.#s===0){for(const t of this.#t)t();this.#t.clear()}this.#c===0&&this.#d()}#d(){if(gn.size>1){this.previous.clear();var t=Te,r=!0,n={parent:null,effect:null,effects:[],render_effects:[]};for(const s of gn){if(s===this){r=!1;continue}const a=[];for(const[c,l]of this.current){if(s.current.has(c))if(r&&l!==s.current.get(c))s.current.set(c,l);else continue;a.push(c)}if(a.length===0)continue;const o=[...s.current.keys()].filter(c=>!this.current.has(c));if(o.length>0){var i=Ne;Ne=[];const c=new Set,l=new Map;for(const u of a)Ba(u,o,c,l);if(Ne.length>0){ie=s,s.apply();for(const u of Ne)s.#r(u,n);s.deactivate()}Ne=i}}ie=null,Te=t}this.committed=!0,gn.delete(this)}increment(t){this.#c+=1,t&&(this.#s+=1)}decrement(t){this.#c-=1,t&&(this.#s-=1),this.revive()}revive(){for(const t of this.#a)this.#n.delete(t),ve(t,ke),Lt(t);for(const t of this.#n)ve(t,Be),Lt(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#l??=Na()).promise}static ensure(){if(ie===null){const t=ie=new xe;gn.add(ie),er||xe.enqueue(()=>{ie===t&&t.flush()})}return ie}static enqueue(t){as(t)}apply(){}}function cs(e){var t=er;er=!0;try{for(var r;;){if(bu(),Ne.length===0&&(ie?.flush(),Ne.length===0))return vn=null,r;Ha()}}finally{er=t}}function Ha(){var e=Ot;os=!0;var t=null;try{var r=0;for(En(!0);Ne.length>0;){var n=xe.ensure();if(r++>1e3){var i,s;$u()}n.process(Ne),pt.clear()}}finally{os=!1,En(e),vn=null}}function $u(){try{lu()}catch(e){Mt(e,vn)}}let nt=null;function Ka(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(tt|ft))===0&&or(n)&&(nt=new Set,cr(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?oo(n):n.fn=null),nt?.size>0)){pt.clear();for(const i of nt){if((i.f&(tt|ft))!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)nt.has(a)&&(nt.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const c=s[o];(c.f&(tt|ft))===0&&cr(c)}}nt.clear()}}nt=null}}function Ba(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&le)!==0?Ba(i,t,r,n):(s&(ns|et))!==0&&(s&ke)===0&&Ja(i,t,n)&&(ve(i,ke),Lt(i))}}function Ja(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const i of e.deps){if(t.includes(i))return!0;if((i.f&le)!==0&&Ja(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Lt(e){for(var t=vn=e;t.parent!==null;){t=t.parent;var r=t.f;if(os&&t===re&&(r&et)!==0&&(r&Ca)===0)return;if((r&(dt|Et))!==0){if((r&ye)===0)return;t.f^=ye}}Ne.push(t)}function Eu(e){let t=0,r=tr(0),n;return()=>{ir()&&(Oe(r),so(()=>(t===0&&(n=Wu(()=>e(()=>rr(r)))),t+=1,()=>{as(()=>{t-=1,t===0&&(n?.(),n=void 0,rr(r))})})))}}var Su=pn|St|hn;function Pu(e,t,r){new ku(e,t,r)}class ku{parent;#t=!1;#e;#c=me?ne:null;#s;#l;#a;#n=null;#r=null;#i=null;#o=null;#u=null;#d=0;#f=0;#p=!1;#h=null;#v=Eu(()=>(this.#h=tr(this.#d),()=>{this.#h=null}));constructor(t,r,n){this.#e=t,this.#s=r,this.#l=n,this.parent=re.b,this.#t=!!this.#s.pending,this.#a=Vu(()=>{if(re.b=this,me){const s=this.#c;Da(),s.nodeType===_n&&s.data===Ra?this.#b():this.#w()}else{var i=this.#y();try{this.#n=Rt(()=>n(i))}catch(s){this.error(s)}this.#f>0?this.#_():this.#t=!1}return()=>{this.#u?.remove()}},Su),me&&(this.#e=ne)}#w(){try{this.#n=Rt(()=>this.#l(this.#e))}catch(t){this.error(t)}this.#t=!1}#b(){const t=this.#s.pending;t&&(this.#r=Rt(()=>t(this.#e)),xe.enqueue(()=>{var r=this.#y();this.#n=this.#m(()=>(xe.ensure(),Rt(()=>this.#l(r)))),this.#f>0?this.#_():($n(this.#r,()=>{this.#r=null}),this.#t=!1)}))}#y(){var t=this.#e;return this.#t&&(this.#u=nr(),this.#e.before(this.#u),t=this.#u),t}is_pending(){return this.#t||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#s.pending}#m(t){var r=re,n=Q,i=Le;We(this.#a),$e(this.#a),Dt(this.#a.ctx);try{return t()}catch(s){return za(s),null}finally{We(r),$e(n),Dt(i)}}#_(){const t=this.#s.pending;this.#n!==null&&(this.#o=document.createDocumentFragment(),this.#o.append(this.#u),Ku(this.#n,this.#o)),this.#r===null&&(this.#r=Rt(()=>t(this.#e)))}#g(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#g(t);return}this.#f+=t,this.#f===0&&(this.#t=!1,this.#r&&$n(this.#r,()=>{this.#r=null}),this.#o&&(this.#e.before(this.#o),this.#o=null))}update_pending_count(t){this.#g(t),this.#d+=t,this.#h&&bn(this.#h,this.#d)}get_effect_pending(){return this.#v(),Oe(this.#h)}error(t){var r=this.#s.onerror;let n=this.#s.failed;if(this.#p||!r&&!n)throw t;this.#n&&(Fe(this.#n),this.#n=null),this.#r&&(Fe(this.#r),this.#r=null),this.#i&&(Fe(this.#i),this.#i=null),me&&(rt(this.#c),Ma(),rt(yu()));var i=!1,s=!1;const a=()=>{if(i){_u();return}i=!0,s&&mu(),xe.ensure(),this.#d=0,this.#i!==null&&$n(this.#i,()=>{this.#i=null}),this.#t=this.has_pending_snippet(),this.#n=this.#m(()=>(this.#p=!1,Rt(()=>this.#l(this.#e)))),this.#f>0?this.#_():this.#t=!1};var o=Q;try{$e(null),s=!0,r?.(t,a),s=!1}catch(c){Mt(c,this.#a&&this.#a.parent)}finally{$e(o)}n&&as(()=>{this.#i=this.#m(()=>{xe.ensure(),this.#p=!0;try{return Rt(()=>{n(this.#e,()=>t,()=>a)})}catch(c){return Mt(c,this.#a.parent),null}finally{this.#p=!1}})})}}function Ru(e,t,r,n){const i=Ga;if(r.length===0&&e.length===0){n(t.map(i));return}var s=ie,a=re,o=Ou();function c(){Promise.all(r.map(l=>Tu(l))).then(l=>{o();try{n([...t.map(i),...l])}catch(u){(a.f&tt)===0&&Mt(u,a)}s?.deactivate(),wn()}).catch(l=>{Mt(l,a)})}e.length>0?Promise.all(e).then(()=>{o();try{return c()}finally{s?.deactivate(),wn()}}):c()}function Ou(){var e=re,t=Q,r=Le,n=ie;return function(s=!0){We(e),$e(t),Dt(r),s&&n?.activate()}}function wn(){We(null),$e(null),Dt(null)}function Ga(e){var t=le|ke,r=Q!==null&&(Q.f&le)!==0?Q:null;return re!==null&&(re.f|=St),{ctx:Le,deps:null,effects:null,equals:La,f:t,fn:e,reactions:null,rv:0,v:pe,wv:0,parent:r??re,ac:null}}function Tu(e,t){let r=re;r===null&&cu();var n=r.b,i=void 0,s=tr(pe),a=!Q,o=new Map;return Fu(()=>{var c=Na();i=c.promise;try{Promise.resolve(e()).then(c.resolve,c.reject).then(()=>{l===ie&&l.committed&&l.deactivate(),wn()})}catch(m){c.reject(m),wn()}var l=ie;if(a){var u=!n.is_pending();n.update_pending_count(1),l.increment(u),o.get(l)?.reject(It),o.delete(l),o.set(l,c)}const v=(m,y=void 0)=>{if(l.activate(),y)y!==It&&(s.f|=ht,bn(s,y));else{(s.f&ht)!==0&&(s.f^=ht),bn(s,m);for(const[h,w]of o){if(o.delete(h),h===l)break;w.reject(It)}}a&&(n.update_pending_count(-1),l.decrement(u))};c.promise.then(v,m=>v(null,m||"unknown"))}),Du(()=>{for(const c of o.values())c.reject(It)}),new Promise(c=>{function l(u){function v(){u===i?c(s):l(i)}u.then(v,v)}l(i)})}function Wa(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Fe(t[r])}}function Nu(e){for(var t=e.parent;t!==null;){if((t.f&le)===0)return(t.f&tt)===0?t:null;t=t.parent}return null}function ls(e){var t,r=re;We(Nu(e));try{e.f&=~Pt,Wa(e),t=mo(e)}finally{We(r)}return t}function Za(e){var t=ls(e);if(e.equals(t)||(ie?.is_fork||(e.v=t),e.wv=ho()),!Ft)if(Te!==null)(ir()||ie?.is_fork)&&Te.set(e,t);else{var r=(e.f&Me)===0?Be:ye;ve(e,r)}}let us=new Set;const pt=new Map;let Xa=!1;function tr(e,t){var r={f:0,v:e,reactions:null,equals:La,rv:0,wv:0};return r}function st(e,t){const r=tr(e);return Bu(r),r}function Au(e,t=!1,r=!0){const n=tr(e);return t||(n.equals=vu),n}function Je(e,t,r=!1){Q!==null&&(!Ge||(Q.f&ja)!==0)&&Ua()&&(Q.f&(le|et|ns|ja))!==0&&!ot?.includes(e)&&pu();let n=r?xt(t):t;return bn(e,n)}function bn(e,t){if(!e.equals(t)){var r=e.v;Ft?pt.set(e,t):pt.set(e,r),e.v=t;var n=xe.ensure();n.capture(e,r),(e.f&le)!==0&&((e.f&ke)!==0&&ls(e),ve(e,(e.f&Me)!==0?ye:Be)),e.wv=ho(),Ya(e,ke),re!==null&&(re.f&ye)!==0&&(re.f&(Et|dt))===0&&(Ae===null?Ju([e]):Ae.push(e)),!n.is_fork&&us.size>0&&!Xa&&ju()}return t}function ju(){Xa=!1;var e=Ot;En(!0);const t=Array.from(us);try{for(const r of t)(r.f&ye)!==0&&ve(r,Be),or(r)&&cr(r)}finally{En(e)}us.clear()}function rr(e){Je(e,e.v+1)}function Ya(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],a=s.f,o=(a&ke)===0;if(o&&ve(s,t),(a&le)!==0){var c=s;Te?.delete(c),(a&Pt)===0&&(a&Me&&(s.f|=Pt),Ya(c,Be))}else o&&((a&et)!==0&&nt!==null&&nt.add(s),Lt(s))}}function xt(e){if(typeof e!="object"||e===null||mn in e)return e;const t=su(e);if(t!==ru&&t!==nu)return e;var r=new Map,n=Ql(e),i=st(0),s=Tt,a=o=>{if(Tt===s)return o();var c=Q,l=Tt;$e(null),fo(s);var u=o();return $e(c),fo(l),u};return n&&r.set("length",st(e.length)),new Proxy(e,{defineProperty(o,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&fu();var u=r.get(c);return u===void 0?u=a(()=>{var v=st(l.value);return r.set(c,v),v}):Je(u,l.value,!0),!0},deleteProperty(o,c){var l=r.get(c);if(l===void 0){if(c in o){const u=a(()=>st(pe));r.set(c,u),rr(i)}}else Je(l,pe),rr(i);return!0},get(o,c,l){if(c===mn)return e;var u=r.get(c),v=c in o;if(u===void 0&&(!v||$t(o,c)?.writable)&&(u=a(()=>{var y=xt(v?o[c]:pe),h=st(y);return h}),r.set(c,u)),u!==void 0){var m=Oe(u);return m===pe?void 0:m}return Reflect.get(o,c,l)},getOwnPropertyDescriptor(o,c){var l=Reflect.getOwnPropertyDescriptor(o,c);if(l&&"value"in l){var u=r.get(c);u&&(l.value=Oe(u))}else if(l===void 0){var v=r.get(c),m=v?.v;if(v!==void 0&&m!==pe)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return l},has(o,c){if(c===mn)return!0;var l=r.get(c),u=l!==void 0&&l.v!==pe||Reflect.has(o,c);if(l!==void 0||re!==null&&(!u||$t(o,c)?.writable)){l===void 0&&(l=a(()=>{var m=u?xt(o[c]):pe,y=st(m);return y}),r.set(c,l));var v=Oe(l);if(v===pe)return!1}return u},set(o,c,l,u){var v=r.get(c),m=c in o;if(n&&c==="length")for(var y=l;y<v.v;y+=1){var h=r.get(y+"");h!==void 0?Je(h,pe):y in o&&(h=a(()=>st(pe)),r.set(y+"",h))}if(v===void 0)(!m||$t(o,c)?.writable)&&(v=a(()=>st(void 0)),Je(v,xt(l)),r.set(c,v));else{m=v.v!==pe;var w=a(()=>xt(l));Je(v,w)}var d=Reflect.getOwnPropertyDescriptor(o,c);if(d?.set&&d.set.call(u,l),!m){if(n&&typeof c=="string"){var _=r.get("length"),f=Number(c);Number.isInteger(f)&&f>=_.v&&Je(_,f+1)}rr(i)}return!0},ownKeys(o){Oe(i);var c=Reflect.ownKeys(o).filter(v=>{var m=r.get(v);return m===void 0||m.v!==pe});for(var[l,u]of r)u.v!==pe&&!(l in o)&&c.push(l);return c},setPrototypeOf(){hu()}})}var Qa,eo,to,ro;function ds(){if(Qa===void 0){Qa=window,eo=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;to=$t(t,"firstChild").get,ro=$t(t,"nextSibling").get,Ta(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Ta(r)&&(r.__t=void 0)}}function nr(e=""){return document.createTextNode(e)}function sr(e){return to.call(e)}function it(e){return ro.call(e)}function fs(e,t){if(!me)return sr(e);var r=sr(ne);return r===null&&(r=ne.appendChild(nr())),rt(r),r}function Cu(e,t=!1){if(!me){var r=sr(e);return r instanceof Comment&&r.data===""?it(r):r}if(t&&ne?.nodeType!==Ia){var n=nr();return ne?.before(n),rt(n),n}return ne}function hs(e,t=1,r=!1){let n=me?ne:e;for(var i;t--;)i=n,n=it(n);if(!me)return n;if(r&&n?.nodeType!==Ia){var s=nr();return n===null?i?.after(s):n.before(s),rt(s),s}return rt(n),n}function qu(e){e.textContent=""}function no(e){var t=Q,r=re;$e(null),We(null);try{return e()}finally{$e(t),We(r)}}function Iu(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function at(e,t,r){var n=re;n!==null&&(n.f&ft)!==0&&(e|=ft);var i={ctx:Le,deps:null,nodes:null,f:e|ke|Me,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{cr(i),i.f|=ts}catch(o){throw Fe(i),o}else t!==null&&Lt(i);var s=i;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&St)===0&&(s=s.first,(e&et)!==0&&(e&pn)!==0&&s!==null&&(s.f|=pn)),s!==null&&(s.parent=n,n!==null&&Iu(s,n),Q!==null&&(Q.f&le)!==0&&(e&dt)===0)){var a=Q;(a.effects??=[]).push(s)}return i}function ir(){return Q!==null&&!Ge}function Du(e){const t=at(es,null,!1);return ve(t,ye),t.teardown=e,t}function Mu(e){return at(Aa|ou,e,!1)}function Lu(e){xe.ensure();const t=at(dt|St,e,!0);return()=>{Fe(t)}}function xu(e){xe.ensure();const t=at(dt|St,e,!0);return(r={})=>new Promise(n=>{r.outro?$n(t,()=>{Fe(t),n(void 0)}):(Fe(t),n(void 0))})}function Fu(e){return at(ns|St,e,!0)}function so(e,t=0){return at(es|t,e,!0)}function Uu(e,t=[],r=[],n=[]){Ru(n,t,r,i=>{at(es,()=>e(...i.map(Oe)),!0)})}function Vu(e,t=0){var r=at(et|t,e,!0);return r}function Rt(e){return at(Et|St,e,!0)}function io(e){var t=e.teardown;if(t!==null){const r=Ft,n=Q;lo(!0),$e(null);try{t.call(null)}finally{lo(r),$e(n)}}}function ao(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const i=r.ac;i!==null&&no(()=>{i.abort(It)});var n=r.next;(r.f&dt)!==0?r.parent=null:Fe(r,t),r=n}}function zu(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Et)===0&&Fe(t),t=r}}function Fe(e,t=!0){var r=!1;(t||(e.f&Ca)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Hu(e.nodes.start,e.nodes.end),r=!0),ao(e,t&&!r),Sn(e,0),ve(e,tt);var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)s.stop();io(e);var i=e.parent;i!==null&&i.first!==null&&oo(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Hu(e,t){for(;e!==null;){var r=e===t?null:it(e);e.remove(),e=r}}function oo(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function $n(e,t,r=!0){var n=[];co(e,n,!0);var i=()=>{r&&Fe(e),t&&t()},s=n.length;if(s>0){var a=()=>--s||i();for(var o of n)o.out(a)}else i()}function co(e,t,r){if((e.f&ft)===0){e.f^=ft;var n=e.nodes&&e.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&t.push(o);for(var i=e.first;i!==null;){var s=i.next,a=(i.f&pn)!==0||(i.f&Et)!==0&&(e.f&et)!==0;co(i,t,a?r:!1),i=s}}}function Ku(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:it(r);t.append(r),r=i}}let Ot=!1;function En(e){Ot=e}let Ft=!1;function lo(e){Ft=e}let Q=null,Ge=!1;function $e(e){Q=e}let re=null;function We(e){re=e}let ot=null;function Bu(e){Q!==null&&(ot===null?ot=[e]:ot.push(e))}let ge=null,Re=0,Ae=null;function Ju(e){Ae=e}let uo=1,ar=0,Tt=ar;function fo(e){Tt=e}function ho(){return++uo}function or(e){var t=e.f;if((t&ke)!==0)return!0;if(t&le&&(e.f&=~Pt),(t&Be)!==0){var r=e.deps;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i];if(or(s)&&Za(s),s.wv>e.wv)return!0}(t&Me)!==0&&Te===null&&ve(e,ye)}return!1}function po(e,t,r=!0){var n=e.reactions;if(n!==null&&!ot?.includes(e))for(var i=0;i<n.length;i++){var s=n[i];(s.f&le)!==0?po(s,t,!1):t===s&&(r?ve(s,ke):(s.f&ye)!==0&&ve(s,Be),Lt(s))}}function mo(e){var t=ge,r=Re,n=Ae,i=Q,s=ot,a=Le,o=Ge,c=Tt,l=e.f;ge=null,Re=0,Ae=null,Q=(l&(Et|dt))===0?e:null,ot=null,Dt(e.ctx),Ge=!1,Tt=++ar,e.ac!==null&&(no(()=>{e.ac.abort(It)}),e.ac=null);try{e.f|=rs;var u=e.fn,v=u(),m=e.deps;if(ge!==null){var y;if(Sn(e,Re),m!==null&&Re>0)for(m.length=Re+ge.length,y=0;y<ge.length;y++)m[Re+y]=ge[y];else e.deps=m=ge;if(ir()&&(e.f&Me)!==0)for(y=Re;y<m.length;y++)(m[y].reactions??=[]).push(e)}else m!==null&&Re<m.length&&(Sn(e,Re),m.length=Re);if(Ua()&&Ae!==null&&!Ge&&m!==null&&(e.f&(le|Be|ke))===0)for(y=0;y<Ae.length;y++)po(Ae[y],e);return i!==null&&i!==e&&(ar++,Ae!==null&&(n===null?n=Ae:n.push(...Ae))),(e.f&ht)!==0&&(e.f^=ht),v}catch(h){return za(h)}finally{e.f^=rs,ge=t,Re=r,Ae=n,Q=i,ot=s,Dt(a),Ge=o,Tt=c}}function Gu(e,t){let r=t.reactions;if(r!==null){var n=eu.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(t.f&le)!==0&&(ge===null||!ge.includes(t))&&(ve(t,Be),(t.f&Me)!==0&&(t.f^=Me,t.f&=~Pt),Wa(t),Sn(t,0))}function Sn(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)Gu(e,r[n])}function cr(e){var t=e.f;if((t&tt)===0){ve(e,ye);var r=re,n=Ot;re=e,Ot=!0;try{(t&(et|au))!==0?zu(e):ao(e),io(e);var i=mo(e);e.teardown=typeof i=="function"?i:null,e.wv=uo;var s;Qn&&wu&&(e.f&ke)!==0&&e.deps}finally{Ot=n,re=r}}}function Oe(e){var t=e.f,r=(t&le)!==0;if(Q!==null&&!Ge){var n=re!==null&&(re.f&tt)!==0;if(!n&&!ot?.includes(e)){var i=Q.deps;if((Q.f&rs)!==0)e.rv<ar&&(e.rv=ar,ge===null&&i!==null&&i[Re]===e?Re++:ge===null?ge=[e]:ge.includes(e)||ge.push(e));else{(Q.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[Q]:s.includes(Q)||s.push(Q)}}}if(Ft){if(pt.has(e))return pt.get(e);if(r){var a=e,o=a.v;return((a.f&ye)===0&&a.reactions!==null||yo(a))&&(o=ls(a)),pt.set(a,o),o}}else r&&(!Te?.has(e)||ie?.is_fork&&!ir())&&(a=e,or(a)&&Za(a),Ot&&ir()&&(a.f&Me)===0&&_o(a));if(Te?.has(e))return Te.get(e);if((e.f&ht)!==0)throw e.v;return e.v}function _o(e){if(e.deps!==null){e.f^=Me;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&le)!==0&&(t.f&Me)===0&&_o(t)}}function yo(e){if(e.v===pe)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(pt.has(t)||(t.f&le)!==0&&yo(t))return!0;return!1}function Wu(e){var t=Ge;try{return Ge=!0,e()}finally{Ge=t}}const Zu=-7169;function ve(e,t){e.f=e.f&Zu|t}const Xu=new Set,go=new Set;let vo=null;function Pn(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;vo=e;var a=0,o=vo===e&&e.__root;if(o){var c=i.indexOf(o);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(a=c)}if(s=i[a]||e.target,s!==t){fn(e,"currentTarget",{configurable:!0,get(){return s||r}});var u=Q,v=re;$e(null),We(null);try{for(var m,y=[];s!==null;){var h=s.assignedSlot||s.parentNode||s.host||null;try{var w=s["__"+n];w!=null&&(!s.disabled||e.target===s)&&w.call(s,e)}catch(d){m?y.push(d):m=d}if(e.cancelBubble||h===t||h===null)break;s=h}if(m){for(let d of y)queueMicrotask(()=>{throw d});throw m}}finally{e.__root=t,delete e.currentTarget,$e(u),We(v)}}}function Yu(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function ps(e,t){var r=re;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function Qu(e,t){var r=(t&Yl)!==0,n,i=!e.startsWith("<!>");return()=>{if(me)return ps(ne,null),ne;n===void 0&&(n=Yu(i?e:"<!>"+e));var s=r||eo?document.importNode(n,!0):n.cloneNode(!0);{var a=sr(s),o=s.lastChild;ps(a,o)}return s}}function wo(e,t){if(me){var r=re;((r.f&ts)===0||r.nodes.end===null)&&(r.nodes.end=ne),Da();return}e!==null&&e.before(t)}const ed=["touchstart","touchmove"];function td(e){return ed.includes(e)}function ms(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function bo(e,t){return $o(e,t)}function rd(e,t){ds(),t.intro=t.intro??!1;const r=t.target,n=me,i=ne;try{for(var s=sr(r);s&&(s.nodeType!==_n||s.data!==ka);)s=it(s);if(!s)throw Qt;yn(!0),rt(s);const a=$o(e,{...t,anchor:s});return yn(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
15
+ `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==Qt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&uu(),ds(),qu(r),yn(!1),bo(e,t)}finally{yn(n),rt(i)}}const Ut=new Map;function $o(e,{target:t,anchor:r,props:n={},events:i,context:s,intro:a=!0}){ds();var o=new Set,c=v=>{for(var m=0;m<v.length;m++){var y=v[m];if(!o.has(y)){o.add(y);var h=td(y);t.addEventListener(y,Pn,{passive:h});var w=Ut.get(y);w===void 0?(document.addEventListener(y,Pn,{passive:h}),Ut.set(y,1)):Ut.set(y,w+1)}}};c(tu(Xu)),go.add(c);var l=void 0,u=xu(()=>{var v=r??t.appendChild(nr());return Pu(v,{pending:()=>{}},m=>{if(s){xa({});var y=Le;y.c=s}if(i&&(n.$$events=i),me&&ps(m,null),l=e(m,n)||{},me&&(re.nodes.end=ne,ne===null||ne.nodeType!==_n||ne.data!==Oa))throw ss(),Qt;s&&Fa()}),()=>{for(var m of o){t.removeEventListener(m,Pn);var y=Ut.get(m);--y===0?(document.removeEventListener(m,Pn),Ut.delete(m)):Ut.set(m,y)}go.delete(c),v!==r&&v.parentNode?.removeChild(v)}});return _s.set(l,u),l}let _s=new WeakMap;function nd(e,t){const r=_s.get(e);return r?(_s.delete(e),r(t)):Promise.resolve()}let kn=!1;function sd(e){var t=kn;try{return kn=!1,[e(),kn]}finally{kn=t}}function Eo(e,t,r,n){var i=n,s=!0,a=()=>(s&&(s=!1,i=n),i),o;{var c=mn in e||qa in e;o=$t(e,t)?.set??(c&&t in e?d=>e[t]=d:void 0)}var l,u=!1;[l,u]=sd(()=>e[t]),l===void 0&&n!==void 0&&(l=a(),o&&(du(),o(l)));var v;if(v=()=>{var d=e[t];return d===void 0?a():(s=!0,d)},o){var m=e.$$legacy;return(function(d,_){return arguments.length>0?((!_||m||u)&&o(_?v():d),d):v()})}var y=!1,h=Ga(()=>(y=!1,v()));Oe(h);var w=re;return(function(d,_){if(arguments.length>0){const f=_?Oe(h):xt(d);return Je(h,f),y=!0,i!==void 0&&(i=f),d}return Ft&&y||(w.f&tt)!==0?h.v:Oe(h)})}function id(e){return new ad(e)}class ad{#t;#e;constructor(t){var r=new Map,n=(s,a)=>{var o=Au(a,!1,!1);return r.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return Oe(r.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===qa?!0:(Oe(r.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return Je(r.get(a)??n(a,o),o),Reflect.set(s,a,o)}});this.#e=(t.hydrate?rd:bo)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&cs(),this.#t=i.$$events;for(const s of Object.keys(this.#e))s==="$set"||s==="$destroy"||s==="$on"||fn(this,s,{get(){return this.#e[s]},set(a){this.#e[s]=a},enumerable:!0});this.#e.$set=s=>{Object.assign(i,s)},this.#e.$destroy=()=>{nd(this.#e)}}$set(t){this.#e.$set(t)}$on(t,r){this.#t[t]=this.#t[t]||[];const n=(...i)=>r.call(this,...i);return this.#t[t].push(n),()=>{this.#t[t]=this.#t[t].filter(i=>i!==n)}}$destroy(){this.#e.$destroy()}}let So;typeof HTMLElement=="function"&&(So=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),wo(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=od(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Rn(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=id({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Lu(()=>{so(()=>{this.$$r=!0;for(const n of dn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=Rn(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Rn(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return dn(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Rn(e,t,r,n){const i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function od(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function cd(e,t,r,n,i,s){let a=class extends So{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return dn(t).map(o=>(t[o].attribute||o).toLowerCase())}};return dn(t).forEach(o=>{fn(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(c){c=Rn(o,c,t),this.$$d[o]=c;var l=this.$$c;if(l){var u=$t(l,o)?.get;u?l[o]=c:l.$set({[o]:c})}}})}),n.forEach(o=>{fn(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}var ld=Qu("This is the test component <p> </p> <p> </p> <p> </p>",1);function Po(e,t){xa(t,!0);let r=Eo(t,"a",15,0),n=Eo(t,"b",15,0),i=st(0);zt.onMount(()=>{console.log(r(),n())});var a={getSum:()=>{Je(i,r()+n())},get a(){return r()},set a(h=0){r(h),cs()},get b(){return n()},set b(h=0){n(h),cs()}};Ma();var o=ld(),c=hs(Cu(o)),l=fs(c);is(c);var u=hs(c,2),v=fs(u);is(u);var m=hs(u,2),y=fs(m);return is(m),Uu(()=>{ms(l,`a = ${r()??""}`),ms(v,`b = ${n()??""}`),ms(y,`sum = ${Oe(i)??""}`)}),wo(e,o),Fa(a)}customElements.define("test-one",cd(Po,{a:{},b:{}},[],["getSum"],!0)),ct.DB=Zl,ct.Test=Po,Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"})}));