howtocode 0.7.62 → 0.7.64

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.
@@ -1,2 +1,2 @@
1
- import{a as T}from"./chunk-UTYFLLSM.js";import{g as R,j as P}from"./chunk-4A2IUH5P.js";import{existsSync as z,readFileSync as ye,rmSync as xe}from"node:fs";import{join as ve}from"node:path";import{createHash as q,randomBytes as J}from"node:crypto";import{createServer as ne}from"node:http";import{execFileSync as X}from"node:child_process";import{createHmac as Q}from"node:crypto";import{readFileSync as ee}from"node:fs";import{arch as F,cpus as M,hostname as N,platform as v,userInfo as O}from"node:os";var te="howtocode-cli-hwid-v1";function x(e){try{let t=ee(e,"utf8").trim();return t.length>0?t:void 0}catch{return}}function $(e,t){try{let r=X(e,t,{encoding:"utf8",timeout:3e3,stdio:["ignore","pipe","ignore"]});return r.trim().length>0?r.trim():void 0}catch{return}}function re(){let e=v();if(e==="linux"){let t=x("/etc/machine-id");if(t)return{value:t,source:"machine-id",strong:!0};let r=x("/var/lib/dbus/machine-id");if(r)return{value:r,source:"dbus-machine-id",strong:!0};let o=x("/sys/class/dmi/id/product_uuid");return o?{value:o,source:"dmi-product-uuid",strong:!0}:void 0}if(e==="win32"){let r=$("reg",["query","HKLM\\SOFTWARE\\Microsoft\\Cryptography","/v","MachineGuid"])?.match(/MachineGuid\s+REG_SZ\s+(\S+)/i);return r?.[1]?{value:r[1],source:"windows-machine-guid",strong:!0}:void 0}if(e==="darwin"){let r=$("ioreg",["-rd1","-c","IOPlatformExpertDevice"])?.match(/"IOPlatformUUID"\s*=\s*"([^"]+)"/);return r?.[1]?{value:r[1],source:"platform-uuid",strong:!0}:void 0}}function H(){let e=re(),t=e?.value??[N(),v(),F(),O().username].join("\0"),r=e?.source??"hostname";return{id:Q("sha256",te).update(t).digest("hex").slice(0,32),source:r,strong:e?.strong??!1}}function U(e){return[e.id,e.source,N(),v(),F(),O().username,String(M().length),M()[0]?.model??""]}var _="https://howtofix.id",se=300*1e3,G=3e3,K="/callback";function I(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function oe(){return I(J(32))}function ie(e){return I(q("sha256").update(e).digest())}function ae(){return I(J(16))}var ce="howtocode-cli-",ue="x-howtocode-client",le="cli";function L(e){let t=e??U(H());return ce+q("sha256").update(t.join("\0")).digest("hex").slice(0,32)}function de(){return{"content-type":"application/json",[ue]:le}}var fe=()=>new Promise((e,t)=>{let r=ne();r.once("error",t),r.listen(0,"127.0.0.1",()=>{let{port:o}=r.address();e({port:o,close:()=>r.close(),waitForCode:(n,s)=>new Promise((i,a)=>{let c=(l,f)=>{let h=new URL(l.url??"/","http://127.0.0.1");if(h.pathname!==K){f.writeHead(404).end("not found");return}let y=(V,Z)=>f.writeHead(200,{"content-type":"text/html; charset=utf-8"}).end(`<!doctype html><meta charset="utf-8"><h2>${V}</h2><p>${Z}</p>`),S=h.searchParams.get("error")??"",E=h.searchParams.get("code")??"",Y=h.searchParams.get("state")??"";if(S){y("Sign-in was refused","You can close this tab."),u(new Error(`the browser reported: ${S}`));return}if(!E||Y!==n){y("This callback did not belong to the login","You can close this tab."),u(new Error("the callback carried the wrong state"));return}y("Signed in","You can close this tab and go back to HowToCode."),u(void 0,E)},u=(l,f)=>{r.off("request",c),s?.removeEventListener("abort",g),l?a(l):i(f)},g=()=>u(new Error("cancelled"));s?.addEventListener("abort",g,{once:!0}),r.on("request",c)})})})});function k(e,t){e.onProgress?.(t)}async function p(e,t,r,o){let n=await e(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(r),signal:o}),s={};try{s=await n.json()}catch{}let i=Number(n.headers?.get?.("retry-after"));return{status:n.status,body:s,retryAfterSeconds:Number.isFinite(i)&&i>0?i:void 0}}function d(...e){for(let t of e)if(typeof t=="string"&&t.trim()!=="")return t.trim()}function j(...e){for(let t of e)if(typeof t=="number"&&Number.isFinite(t))return t;return 0}function me(e){try{let t=new URL(e).searchParams.get("code");return t&&t.trim()!==""?t.trim():void 0}catch{return}}async function ge(e,t,r){let o=await e(t,{headers:de(),signal:r}),n={};try{n=await o.json()}catch{}let s=Number(o.headers?.get?.("retry-after"));return{status:o.status,body:n,retryAfterSeconds:Number.isFinite(s)&&s>0?s:void 0}}function A(e){let t=e.data,r=[e.token,e.api_key,e.apiKey,e.key,t?.token,t?.api_key,t?.apiKey,t?.key];for(let o of r)if(typeof o=="string"&&o.trim().startsWith("sk-"))return o.trim()}function pe(e){let t=e.data,r=d(e.token,t?.token),o=d(e.refresh_token,t?.refresh_token),n=d(e.device_id,t?.device_id);if(!r||!o||!n)return;let s=j(e.access_expires_at,t?.access_expires_at),i=j(e.refresh_expires_at,t?.refresh_expires_at);return{accessToken:r,accessExpiresAt:s,refreshToken:o,deviceId:n,refreshExpiresAt:i}}function m(e,t){let r=e.message??e.error;return typeof r=="string"&&r.trim()?r.trim():t}async function He(e){let t=e.fetchImpl??fetch,r=(e.panelUrl??_).replace(/\/+$/,""),o=e.timeoutMs??se,n={...e,panel:r,fetchImpl:t,timeoutMs:o},s=await ke(n);if(s.ok||s.terminal)return s.result;let i=await he(n);if(i.ok||i.terminal)return i.result;let a=await we(n);return a.ok?a:{ok:!1,message:`${s.result.ok?"":s.result.message}; ${i.result.ok?"":i.result.message}; ${a.message}. howtofix.id does not offer a browser login a local client can complete yet \u2014 run /connect and paste a token from ${r}/keys instead.`}}async function he(e){let t=oe(),r=ae(),o;try{o=await(e.loopback??fe)();let n=`http://127.0.0.1:${o.port}${K}`,s=await p(e.fetchImpl,`${e.panel}/api/oauth/device/start`,{redirect_uri:n,code_challenge:ie(t),code_challenge_method:"S256",state:r},e.signal);if(s.status===404)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel has no loopback login endpoint"}};if(s.status>=400)return{ok:!1,terminal:!1,result:{ok:!1,message:m(s.body,`the panel refused the login (${s.status})`)}};let i=typeof s.body.authorize_url=="string"?s.body.authorize_url:"";if(!i)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel did not say where to send the browser"}};k(e,{kind:"browser",url:i});let a=await be(o.waitForCode(r,e.signal),e.timeoutMs),c=await p(e.fetchImpl,`${e.panel}/api/oauth/device/token`,{flow_token:s.body.flow_token,code:a,code_verifier:t},e.signal);if(c.status>=400)return{ok:!1,terminal:!0,result:{ok:!1,message:m(c.body,`the panel refused the exchange (${c.status})`)}};let u=A(c.body);return u?{ok:!0,result:{ok:!0,token:u}}:{ok:!1,terminal:!0,result:{ok:!1,message:"the panel did not return an API key"}}}catch(n){let s=n instanceof Error?n.message:String(n);return{ok:!1,terminal:s==="cancelled",result:{ok:!1,message:s}}}finally{o?.close()}}async function ke(e){let t=e.fingerprintId??L(),r=e.clientInfo??R(),o=P(t,r);try{let n=await p(e.fetchImpl,`${e.panel}/api/auth/cli/code`,{fingerprintId:t,clientInfo:r,...o},e.signal);if(n.status===404)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel has no CLI login endpoint"}};if(n.status===401)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel did not recognise this build as the HowToCode CLI \u2014 update it with `npm install -g howtocode@latest`"}};if(n.status===429)return{ok:!1,terminal:!0,result:{ok:!1,message:`too many sign-in attempts from this machine right now.${n.retryAfterSeconds?` Try again in ${Math.ceil(n.retryAfterSeconds/60)} minute(s).`:""}`}};if(n.status>=400)return{ok:!1,terminal:!1,result:{ok:!1,message:m(n.body,`the panel refused the login (${n.status})`)}};let s=n.body.data??{},i=d(n.body.login_url,s.login_url),a=d(n.body.code,s.code)??(i?me(i):void 0),c=d(n.body.secret,s.secret);return!i||!a?{ok:!1,terminal:!1,result:{ok:!1,message:"the panel did not return a login URL"}}:c?(k(e,{kind:"browser",url:i}),await D(e,a,c)):(k(e,{kind:"browser",url:i}),await D(e,a,void 0))}catch(n){let s=n instanceof Error?n.message:String(n);return{ok:!1,terminal:s==="cancelled",result:{ok:!1,message:s}}}}async function D(e,t,r){let o=e.pollIntervalMs??G,n=Date.now()+e.timeoutMs;for(;Date.now()<n;){await w(o,e.signal);let s=new URLSearchParams(r?{code:t,secret:r}:{code:t});s.set("capability","device-refresh");let i=await ge(e.fetchImpl,`${e.panel}/api/auth/cli/status?${s}`,e.signal);if(i.status===404)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel has no CLI login status endpoint"}};if(i.status===403)return{ok:!1,terminal:!0,result:{ok:!1,message:"the panel rejected this poll \u2014 run /connect again"}};if(i.status===429){let u=Math.min(Math.max(i.retryAfterSeconds??5,1)*1e3,3e4);await w(u,e.signal);continue}let a=A(i.body);if(a)return{ok:!0,result:{ok:!0,token:a,credential:pe(i.body)}};if(d(i.body.data?.status,i.body.status)==="expired")return{ok:!1,terminal:!0,result:{ok:!1,message:"the sign-in link expired before it was approved"}};if(i.status>=400)return{ok:!1,terminal:!0,result:{ok:!1,message:m(i.body,`the panel refused the poll (${i.status})`)}}}return{ok:!1,terminal:!0,result:{ok:!1,message:"the sign-in was not approved in time"}}}async function we(e){let t=e.pollIntervalMs??G;try{let r=await p(e.fetchImpl,`${e.panel}/api/oauth/device`,{},e.signal);if(r.status===404)return{ok:!1,message:"the panel has no device-code endpoint"};if(r.status>=400)return{ok:!1,message:m(r.body,`the panel refused the request (${r.status})`)};let o=typeof r.body.device_code=="string"?r.body.device_code:"",n=typeof r.body.user_code=="string"?r.body.user_code:"",s=typeof r.body.verification_uri=="string"?r.body.verification_uri:`${e.panel}/oauth/device`;if(!o||!n)return{ok:!1,message:"the panel did not return a code to show"};k(e,{kind:"code",code:n,url:s});let i=Date.now()+e.timeoutMs;for(;Date.now()<i;){await w(t,e.signal);let a=await p(e.fetchImpl,`${e.panel}/api/oauth/device/poll`,{device_code:o},e.signal);if(a.status===404)return{ok:!1,message:"the panel has no device-code poll endpoint"};let c=typeof a.body.status=="string"?a.body.status:"";if(c==="pending")continue;if(c==="slow_down"){await w(t,e.signal);continue}if(c==="denied")return{ok:!1,message:"the sign-in was refused in the browser"};if(c==="expired")return{ok:!1,message:"the code expired; run /connect again"};let u=A(a.body);if(u)return{ok:!0,token:u};if(a.status>=400)return{ok:!1,message:m(a.body,`the panel refused the poll (${a.status})`)}}return{ok:!1,message:"the code was not approved in time"}}catch(r){return{ok:!1,message:r instanceof Error?r.message:String(r)}}}function be(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("the sign-in was not finished in time")),t);e.then(s=>{clearTimeout(n),r(s)},s=>{clearTimeout(n),o(s)})})}function w(e,t){return new Promise((r,o)=>{let n=setTimeout(r,e);t?.addEventListener("abort",()=>{clearTimeout(n),o(new Error("cancelled"))},{once:!0})})}function b(e){return ve(e,"cli-credentials.json")}var _e=300*1e3;function Ie(e,t=Date.now()){return e.accessToken?!Number.isFinite(e.accessExpiresAt)||e.accessExpiresAt<=0?!0:e.accessExpiresAt*1e3-_e>t:!1}function Le(e,t=Date.now()){return!e.refreshToken||!e.deviceId?!1:!Number.isFinite(e.refreshExpiresAt)||e.refreshExpiresAt<=0?!0:e.refreshExpiresAt*1e3>t}function Ge(e){let t=b(e);if(!z(t))return;let r;try{r=JSON.parse(ye(t,"utf8"))}catch{return}if(!r||typeof r!="object"||Array.isArray(r))return;let o=r,n=typeof o.accessToken=="string"?o.accessToken.trim():"",s=typeof o.refreshToken=="string"?o.refreshToken.trim():"",i=typeof o.deviceId=="string"?o.deviceId.trim():"";if(!(!n||!s||!i))return{accessToken:n,accessExpiresAt:W(o.accessExpiresAt),refreshToken:s,deviceId:i,refreshExpiresAt:W(o.refreshExpiresAt)}}function Ae(e,t){try{return T(b(e),`${JSON.stringify(t,null,2)}
1
+ import{a as T}from"./chunk-UTYFLLSM.js";import{g as R,j as P}from"./chunk-O5MPUAA5.js";import{existsSync as z,readFileSync as ye,rmSync as xe}from"node:fs";import{join as ve}from"node:path";import{createHash as q,randomBytes as J}from"node:crypto";import{createServer as ne}from"node:http";import{execFileSync as X}from"node:child_process";import{createHmac as Q}from"node:crypto";import{readFileSync as ee}from"node:fs";import{arch as F,cpus as M,hostname as N,platform as v,userInfo as O}from"node:os";var te="howtocode-cli-hwid-v1";function x(e){try{let t=ee(e,"utf8").trim();return t.length>0?t:void 0}catch{return}}function $(e,t){try{let r=X(e,t,{encoding:"utf8",timeout:3e3,stdio:["ignore","pipe","ignore"]});return r.trim().length>0?r.trim():void 0}catch{return}}function re(){let e=v();if(e==="linux"){let t=x("/etc/machine-id");if(t)return{value:t,source:"machine-id",strong:!0};let r=x("/var/lib/dbus/machine-id");if(r)return{value:r,source:"dbus-machine-id",strong:!0};let o=x("/sys/class/dmi/id/product_uuid");return o?{value:o,source:"dmi-product-uuid",strong:!0}:void 0}if(e==="win32"){let r=$("reg",["query","HKLM\\SOFTWARE\\Microsoft\\Cryptography","/v","MachineGuid"])?.match(/MachineGuid\s+REG_SZ\s+(\S+)/i);return r?.[1]?{value:r[1],source:"windows-machine-guid",strong:!0}:void 0}if(e==="darwin"){let r=$("ioreg",["-rd1","-c","IOPlatformExpertDevice"])?.match(/"IOPlatformUUID"\s*=\s*"([^"]+)"/);return r?.[1]?{value:r[1],source:"platform-uuid",strong:!0}:void 0}}function H(){let e=re(),t=e?.value??[N(),v(),F(),O().username].join("\0"),r=e?.source??"hostname";return{id:Q("sha256",te).update(t).digest("hex").slice(0,32),source:r,strong:e?.strong??!1}}function U(e){return[e.id,e.source,N(),v(),F(),O().username,String(M().length),M()[0]?.model??""]}var _="https://howtofix.id",se=300*1e3,G=3e3,K="/callback";function I(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function oe(){return I(J(32))}function ie(e){return I(q("sha256").update(e).digest())}function ae(){return I(J(16))}var ce="howtocode-cli-",ue="x-howtocode-client",le="cli";function L(e){let t=e??U(H());return ce+q("sha256").update(t.join("\0")).digest("hex").slice(0,32)}function de(){return{"content-type":"application/json",[ue]:le}}var fe=()=>new Promise((e,t)=>{let r=ne();r.once("error",t),r.listen(0,"127.0.0.1",()=>{let{port:o}=r.address();e({port:o,close:()=>r.close(),waitForCode:(n,s)=>new Promise((i,a)=>{let c=(l,f)=>{let h=new URL(l.url??"/","http://127.0.0.1");if(h.pathname!==K){f.writeHead(404).end("not found");return}let y=(V,Z)=>f.writeHead(200,{"content-type":"text/html; charset=utf-8"}).end(`<!doctype html><meta charset="utf-8"><h2>${V}</h2><p>${Z}</p>`),S=h.searchParams.get("error")??"",E=h.searchParams.get("code")??"",Y=h.searchParams.get("state")??"";if(S){y("Sign-in was refused","You can close this tab."),u(new Error(`the browser reported: ${S}`));return}if(!E||Y!==n){y("This callback did not belong to the login","You can close this tab."),u(new Error("the callback carried the wrong state"));return}y("Signed in","You can close this tab and go back to HowToCode."),u(void 0,E)},u=(l,f)=>{r.off("request",c),s?.removeEventListener("abort",g),l?a(l):i(f)},g=()=>u(new Error("cancelled"));s?.addEventListener("abort",g,{once:!0}),r.on("request",c)})})})});function k(e,t){e.onProgress?.(t)}async function p(e,t,r,o){let n=await e(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(r),signal:o}),s={};try{s=await n.json()}catch{}let i=Number(n.headers?.get?.("retry-after"));return{status:n.status,body:s,retryAfterSeconds:Number.isFinite(i)&&i>0?i:void 0}}function d(...e){for(let t of e)if(typeof t=="string"&&t.trim()!=="")return t.trim()}function j(...e){for(let t of e)if(typeof t=="number"&&Number.isFinite(t))return t;return 0}function me(e){try{let t=new URL(e).searchParams.get("code");return t&&t.trim()!==""?t.trim():void 0}catch{return}}async function ge(e,t,r){let o=await e(t,{headers:de(),signal:r}),n={};try{n=await o.json()}catch{}let s=Number(o.headers?.get?.("retry-after"));return{status:o.status,body:n,retryAfterSeconds:Number.isFinite(s)&&s>0?s:void 0}}function A(e){let t=e.data,r=[e.token,e.api_key,e.apiKey,e.key,t?.token,t?.api_key,t?.apiKey,t?.key];for(let o of r)if(typeof o=="string"&&o.trim().startsWith("sk-"))return o.trim()}function pe(e){let t=e.data,r=d(e.token,t?.token),o=d(e.refresh_token,t?.refresh_token),n=d(e.device_id,t?.device_id);if(!r||!o||!n)return;let s=j(e.access_expires_at,t?.access_expires_at),i=j(e.refresh_expires_at,t?.refresh_expires_at);return{accessToken:r,accessExpiresAt:s,refreshToken:o,deviceId:n,refreshExpiresAt:i}}function m(e,t){let r=e.message??e.error;return typeof r=="string"&&r.trim()?r.trim():t}async function He(e){let t=e.fetchImpl??fetch,r=(e.panelUrl??_).replace(/\/+$/,""),o=e.timeoutMs??se,n={...e,panel:r,fetchImpl:t,timeoutMs:o},s=await ke(n);if(s.ok||s.terminal)return s.result;let i=await he(n);if(i.ok||i.terminal)return i.result;let a=await we(n);return a.ok?a:{ok:!1,message:`${s.result.ok?"":s.result.message}; ${i.result.ok?"":i.result.message}; ${a.message}. howtofix.id does not offer a browser login a local client can complete yet \u2014 run /connect and paste a token from ${r}/keys instead.`}}async function he(e){let t=oe(),r=ae(),o;try{o=await(e.loopback??fe)();let n=`http://127.0.0.1:${o.port}${K}`,s=await p(e.fetchImpl,`${e.panel}/api/oauth/device/start`,{redirect_uri:n,code_challenge:ie(t),code_challenge_method:"S256",state:r},e.signal);if(s.status===404)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel has no loopback login endpoint"}};if(s.status>=400)return{ok:!1,terminal:!1,result:{ok:!1,message:m(s.body,`the panel refused the login (${s.status})`)}};let i=typeof s.body.authorize_url=="string"?s.body.authorize_url:"";if(!i)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel did not say where to send the browser"}};k(e,{kind:"browser",url:i});let a=await be(o.waitForCode(r,e.signal),e.timeoutMs),c=await p(e.fetchImpl,`${e.panel}/api/oauth/device/token`,{flow_token:s.body.flow_token,code:a,code_verifier:t},e.signal);if(c.status>=400)return{ok:!1,terminal:!0,result:{ok:!1,message:m(c.body,`the panel refused the exchange (${c.status})`)}};let u=A(c.body);return u?{ok:!0,result:{ok:!0,token:u}}:{ok:!1,terminal:!0,result:{ok:!1,message:"the panel did not return an API key"}}}catch(n){let s=n instanceof Error?n.message:String(n);return{ok:!1,terminal:s==="cancelled",result:{ok:!1,message:s}}}finally{o?.close()}}async function ke(e){let t=e.fingerprintId??L(),r=e.clientInfo??R(),o=P(t,r);try{let n=await p(e.fetchImpl,`${e.panel}/api/auth/cli/code`,{fingerprintId:t,clientInfo:r,...o},e.signal);if(n.status===404)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel has no CLI login endpoint"}};if(n.status===401)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel did not recognise this build as the HowToCode CLI \u2014 update it with `npm install -g howtocode@latest`"}};if(n.status===429)return{ok:!1,terminal:!0,result:{ok:!1,message:`too many sign-in attempts from this machine right now.${n.retryAfterSeconds?` Try again in ${Math.ceil(n.retryAfterSeconds/60)} minute(s).`:""}`}};if(n.status>=400)return{ok:!1,terminal:!1,result:{ok:!1,message:m(n.body,`the panel refused the login (${n.status})`)}};let s=n.body.data??{},i=d(n.body.login_url,s.login_url),a=d(n.body.code,s.code)??(i?me(i):void 0),c=d(n.body.secret,s.secret);return!i||!a?{ok:!1,terminal:!1,result:{ok:!1,message:"the panel did not return a login URL"}}:c?(k(e,{kind:"browser",url:i}),await D(e,a,c)):(k(e,{kind:"browser",url:i}),await D(e,a,void 0))}catch(n){let s=n instanceof Error?n.message:String(n);return{ok:!1,terminal:s==="cancelled",result:{ok:!1,message:s}}}}async function D(e,t,r){let o=e.pollIntervalMs??G,n=Date.now()+e.timeoutMs;for(;Date.now()<n;){await w(o,e.signal);let s=new URLSearchParams(r?{code:t,secret:r}:{code:t});s.set("capability","device-refresh");let i=await ge(e.fetchImpl,`${e.panel}/api/auth/cli/status?${s}`,e.signal);if(i.status===404)return{ok:!1,terminal:!1,result:{ok:!1,message:"the panel has no CLI login status endpoint"}};if(i.status===403)return{ok:!1,terminal:!0,result:{ok:!1,message:"the panel rejected this poll \u2014 run /connect again"}};if(i.status===429){let u=Math.min(Math.max(i.retryAfterSeconds??5,1)*1e3,3e4);await w(u,e.signal);continue}let a=A(i.body);if(a)return{ok:!0,result:{ok:!0,token:a,credential:pe(i.body)}};if(d(i.body.data?.status,i.body.status)==="expired")return{ok:!1,terminal:!0,result:{ok:!1,message:"the sign-in link expired before it was approved"}};if(i.status>=400)return{ok:!1,terminal:!0,result:{ok:!1,message:m(i.body,`the panel refused the poll (${i.status})`)}}}return{ok:!1,terminal:!0,result:{ok:!1,message:"the sign-in was not approved in time"}}}async function we(e){let t=e.pollIntervalMs??G;try{let r=await p(e.fetchImpl,`${e.panel}/api/oauth/device`,{},e.signal);if(r.status===404)return{ok:!1,message:"the panel has no device-code endpoint"};if(r.status>=400)return{ok:!1,message:m(r.body,`the panel refused the request (${r.status})`)};let o=typeof r.body.device_code=="string"?r.body.device_code:"",n=typeof r.body.user_code=="string"?r.body.user_code:"",s=typeof r.body.verification_uri=="string"?r.body.verification_uri:`${e.panel}/oauth/device`;if(!o||!n)return{ok:!1,message:"the panel did not return a code to show"};k(e,{kind:"code",code:n,url:s});let i=Date.now()+e.timeoutMs;for(;Date.now()<i;){await w(t,e.signal);let a=await p(e.fetchImpl,`${e.panel}/api/oauth/device/poll`,{device_code:o},e.signal);if(a.status===404)return{ok:!1,message:"the panel has no device-code poll endpoint"};let c=typeof a.body.status=="string"?a.body.status:"";if(c==="pending")continue;if(c==="slow_down"){await w(t,e.signal);continue}if(c==="denied")return{ok:!1,message:"the sign-in was refused in the browser"};if(c==="expired")return{ok:!1,message:"the code expired; run /connect again"};let u=A(a.body);if(u)return{ok:!0,token:u};if(a.status>=400)return{ok:!1,message:m(a.body,`the panel refused the poll (${a.status})`)}}return{ok:!1,message:"the code was not approved in time"}}catch(r){return{ok:!1,message:r instanceof Error?r.message:String(r)}}}function be(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("the sign-in was not finished in time")),t);e.then(s=>{clearTimeout(n),r(s)},s=>{clearTimeout(n),o(s)})})}function w(e,t){return new Promise((r,o)=>{let n=setTimeout(r,e);t?.addEventListener("abort",()=>{clearTimeout(n),o(new Error("cancelled"))},{once:!0})})}function b(e){return ve(e,"cli-credentials.json")}var _e=300*1e3;function Ie(e,t=Date.now()){return e.accessToken?!Number.isFinite(e.accessExpiresAt)||e.accessExpiresAt<=0?!0:e.accessExpiresAt*1e3-_e>t:!1}function Le(e,t=Date.now()){return!e.refreshToken||!e.deviceId?!1:!Number.isFinite(e.refreshExpiresAt)||e.refreshExpiresAt<=0?!0:e.refreshExpiresAt*1e3>t}function Ge(e){let t=b(e);if(!z(t))return;let r;try{r=JSON.parse(ye(t,"utf8"))}catch{return}if(!r||typeof r!="object"||Array.isArray(r))return;let o=r,n=typeof o.accessToken=="string"?o.accessToken.trim():"",s=typeof o.refreshToken=="string"?o.refreshToken.trim():"",i=typeof o.deviceId=="string"?o.deviceId.trim():"";if(!(!n||!s||!i))return{accessToken:n,accessExpiresAt:W(o.accessExpiresAt),refreshToken:s,deviceId:i,refreshExpiresAt:W(o.refreshExpiresAt)}}function Ae(e,t){try{return T(b(e),`${JSON.stringify(t,null,2)}
2
2
  `,{mode:384}),!0}catch{return!1}}function Ce(e){try{let t=b(e);z(t)&&xe(t,{force:!0})}catch{}}function W(e){return typeof e=="number"&&Number.isFinite(e)?e:0}async function Se(e,t){let r=(t?.panelUrl??_).replace(/\/+$/,""),o=t?.fetchImpl??fetch,n=t?.timeoutMs??15e3,s=new AbortController,i=setTimeout(()=>s.abort(),n);try{let a=await o(`${r}/api/auth/cli/refresh`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({device_id:e.deviceId,refresh_token:e.refreshToken,fingerprint_id:L()}),signal:s.signal}),c=await a.json().catch(()=>({}));if(a.status===401||a.status===403)return{ok:!1,terminal:!0,message:"this sign-in is no longer valid; run /connect to sign in again"};if(!a.ok)return{ok:!1,terminal:!1,message:`the panel refused the renewal (${a.status})`};let u=c.data??{},g=C(c.token,u.token),l=C(c.refresh_token,u.refresh_token),f=C(c.device_id,u.device_id)??e.deviceId;return!g||!l?{ok:!1,terminal:!1,message:"the panel did not return a renewed credential"}:{ok:!0,terminal:!1,credential:{accessToken:g,accessExpiresAt:B(c.access_expires_at,u.access_expires_at),refreshToken:l,deviceId:f,refreshExpiresAt:B(c.refresh_expires_at,u.refresh_expires_at)}}}catch(a){return{ok:!1,terminal:!1,message:a instanceof Error&&a.name==="AbortError"?`the panel did not answer within ${Math.round(n/1e3)}s`:"could not reach the panel"}}finally{clearTimeout(i)}}function C(...e){for(let t of e)if(typeof t=="string"&&t.trim())return t.trim()}function B(...e){for(let t of e)if(typeof t=="number"&&Number.isFinite(t))return t;return 0}async function Ke(e,t,r){let o=r?.now??Date.now();if(Ie(t,o)||!Le(t,o))return{credential:t,renewed:!1,terminal:!1};let n=await Se(t,r);if(!n.ok||!n.credential)return n.terminal&&Ce(e),{credential:t,renewed:!1,terminal:n.terminal,message:n.message};let s=Ae(e,n.credential);return{credential:n.credential,renewed:!0,terminal:!1,message:s?void 0:`the renewed sign-in could not be saved to ${b(e)}`}}export{H as a,_ as b,He as c,b as d,_e as e,Ie as f,Le as g,Ge as h,Ae as i,Ce as j,Se as k,Ke as l};
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-7LA2AMZB.js";import{a as w}from"./chunk-UTYFLLSM.js";import{h as M,i as T}from"./chunk-4A2IUH5P.js";import{existsSync as H,mkdirSync as I,readFileSync as b}from"node:fs";import{join as k}from"node:path";var J="https://models.dev/api.json";var N=["anthropic","openai","google","deepseek","zai","xai","moonshotai","minimax","alibaba","xiaomi","meta","tencent","nvidia","venice","openrouter"];function _(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"")}function S(n){let e=n.split("/");return _(e[e.length-1]??n)}function q(n){let e=new Map,s=new Map;if(!n||typeof n!="object")return e;let t=n,r=c=>{let o=N.indexOf(c);return o===-1?N.length:o};for(let c of Object.keys(t).sort()){let o=t[c]?.models;if(!(!o||typeof o!="object"))for(let a of Object.keys(o)){let i=o[a],u=Number(i?.limit?.context);if(!Number.isFinite(u)||u<=0)continue;let l=_(a),f=r(c),d=s.get(l);if(d!==void 0&&d<=f)continue;let m=Number(i?.limit?.output);e.set(l,{contextWindow:Math.floor(u),maxTokens:Number.isFinite(m)&&m>0?Math.floor(m):void 0,reasoning:i?.reasoning===!0,vision:Array.isArray(i?.modalities?.input)&&i.modalities.input.includes("image")}),s.set(l,f)}}return e}function A(n,e){let s=_(e);if(!s)return;let t=n.get(s);if(t)return t;let r=S(e);for(let[c,o]of n)if(S(c)===r)return o;for(let[c,o]of n)if(c.endsWith(s)||s.endsWith(c))return o}function R(n){return`${n}/models-dev-cache.json`}function $(n){let e={};for(let[s,t]of n)e[s]=[t.contextWindow,t.maxTokens??0,t.reasoning?1:0,t.vision?1:0];return JSON.stringify(e)}function P(n){let e=new Map,s;try{s=JSON.parse(n)}catch{return e}if(!s||typeof s!="object")return e;for(let[t,r]of Object.entries(s)){if(!Array.isArray(r)||r.length<3)continue;let c=Number(r[0]),o=Number(r[1]);!Number.isFinite(c)||c<=0||e.set(t,{contextWindow:Math.floor(c),maxTokens:Number.isFinite(o)&&o>0?Math.floor(o):void 0,reasoning:r[2]===1||r[2]===!0,vision:r[3]===1||r[3]===!0})}return e}async function U(n){let e=n?.url??J,s=n?.fetchImpl??fetch,t=n?.timeoutMs??2e4,r=new AbortController,c=setTimeout(()=>r.abort(),t);try{let o=await s(e,{signal:r.signal,headers:{Accept:"application/json"}});if(!o.ok)return{ok:!1,message:`the model catalogue answered ${o.status}`};let a=q(await o.json());return a.size===0?{ok:!1,message:"the model catalogue was empty or in an unexpected shape"}:{ok:!0,index:a}}catch(o){return{ok:!1,message:o instanceof Error&&o.name==="AbortError"?`the model catalogue did not answer within ${Math.round(t/1e3)}s`:"could not reach the model catalogue"}}finally{clearTimeout(c)}}var x="https://api.howtofix.id/v1",ce=v,C=["howtocode","howtocode-free"];function ue(n){try{let s=JSON.parse(b(k(n,"models.json"),"utf8")).providers;return!s||typeof s!="object"?new Set:new Set(Object.keys(s))}catch{return new Set}}function le(){return{baseUrl:x,api:"openai-completions",headers:{[M]:T()}}}function de(n){let e=k(n,"models.json"),s;try{s=JSON.parse(b(e,"utf8"))}catch{return 0}let t=s.providers;if(!t||typeof t!="object")return 0;let r=0;for(let c of C){let o=t[c];if(!o||!Array.isArray(o.models))continue;let a=Y(o.models),i={...o.headers??{},[M]:T()},u=o.headers?.[M]!==i[M];a.changed===0&&!u||(o.models=a.models,o.headers=i,r+=a.changed===0?1:a.changed)}if(r===0)return 0;try{w(e,`${JSON.stringify(s,null,2)}
1
+ import{a as v}from"./chunk-7LA2AMZB.js";import{a as w}from"./chunk-UTYFLLSM.js";import{h as M,i as T}from"./chunk-O5MPUAA5.js";import{existsSync as H,mkdirSync as I,readFileSync as b}from"node:fs";import{join as k}from"node:path";var J="https://models.dev/api.json";var N=["anthropic","openai","google","deepseek","zai","xai","moonshotai","minimax","alibaba","xiaomi","meta","tencent","nvidia","venice","openrouter"];function _(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"")}function S(n){let e=n.split("/");return _(e[e.length-1]??n)}function q(n){let e=new Map,s=new Map;if(!n||typeof n!="object")return e;let t=n,r=c=>{let o=N.indexOf(c);return o===-1?N.length:o};for(let c of Object.keys(t).sort()){let o=t[c]?.models;if(!(!o||typeof o!="object"))for(let a of Object.keys(o)){let i=o[a],u=Number(i?.limit?.context);if(!Number.isFinite(u)||u<=0)continue;let l=_(a),f=r(c),d=s.get(l);if(d!==void 0&&d<=f)continue;let m=Number(i?.limit?.output);e.set(l,{contextWindow:Math.floor(u),maxTokens:Number.isFinite(m)&&m>0?Math.floor(m):void 0,reasoning:i?.reasoning===!0,vision:Array.isArray(i?.modalities?.input)&&i.modalities.input.includes("image")}),s.set(l,f)}}return e}function A(n,e){let s=_(e);if(!s)return;let t=n.get(s);if(t)return t;let r=S(e);for(let[c,o]of n)if(S(c)===r)return o;for(let[c,o]of n)if(c.endsWith(s)||s.endsWith(c))return o}function R(n){return`${n}/models-dev-cache.json`}function $(n){let e={};for(let[s,t]of n)e[s]=[t.contextWindow,t.maxTokens??0,t.reasoning?1:0,t.vision?1:0];return JSON.stringify(e)}function P(n){let e=new Map,s;try{s=JSON.parse(n)}catch{return e}if(!s||typeof s!="object")return e;for(let[t,r]of Object.entries(s)){if(!Array.isArray(r)||r.length<3)continue;let c=Number(r[0]),o=Number(r[1]);!Number.isFinite(c)||c<=0||e.set(t,{contextWindow:Math.floor(c),maxTokens:Number.isFinite(o)&&o>0?Math.floor(o):void 0,reasoning:r[2]===1||r[2]===!0,vision:r[3]===1||r[3]===!0})}return e}async function U(n){let e=n?.url??J,s=n?.fetchImpl??fetch,t=n?.timeoutMs??2e4,r=new AbortController,c=setTimeout(()=>r.abort(),t);try{let o=await s(e,{signal:r.signal,headers:{Accept:"application/json"}});if(!o.ok)return{ok:!1,message:`the model catalogue answered ${o.status}`};let a=q(await o.json());return a.size===0?{ok:!1,message:"the model catalogue was empty or in an unexpected shape"}:{ok:!0,index:a}}catch(o){return{ok:!1,message:o instanceof Error&&o.name==="AbortError"?`the model catalogue did not answer within ${Math.round(t/1e3)}s`:"could not reach the model catalogue"}}finally{clearTimeout(c)}}var x="https://api.howtofix.id/v1",ce=v,C=["howtocode","howtocode-free"];function ue(n){try{let s=JSON.parse(b(k(n,"models.json"),"utf8")).providers;return!s||typeof s!="object"?new Set:new Set(Object.keys(s))}catch{return new Set}}function le(){return{baseUrl:x,api:"openai-completions",headers:{[M]:T()}}}function de(n){let e=k(n,"models.json"),s;try{s=JSON.parse(b(e,"utf8"))}catch{return 0}let t=s.providers;if(!t||typeof t!="object")return 0;let r=0;for(let c of C){let o=t[c];if(!o||!Array.isArray(o.models))continue;let a=Y(o.models),i={...o.headers??{},[M]:T()},u=o.headers?.[M]!==i[M];a.changed===0&&!u||(o.models=a.models,o.headers=i,r+=a.changed===0?1:a.changed)}if(r===0)return 0;try{w(e,`${JSON.stringify(s,null,2)}
2
2
  `)}catch{return 0}return r}var G=10080*60*1e3;async function F(n,e){let s=R(n),t=e?.now??Date.now(),r,c=0;try{let i=JSON.parse(b(s,"utf8"));typeof i?.entries=="string"&&(r=P(i.entries),c=Number(i.at)||0)}catch{r=void 0}if(r&&r.size>0&&t-c<G&&!e?.force)return{index:r};let a=await U({fetchImpl:e?.fetchImpl});if(!a.ok)return r&&r.size>0?{index:r,message:a.message}:{index:new Map,message:a.message};try{I(n,{recursive:!0}),w(s,`${JSON.stringify({at:t,entries:$(a.index)})}
3
3
  `)}catch{}return{index:a.index}}async function fe(n,e){let s=k(n,"models.json"),t;try{t=JSON.parse(b(s,"utf8"))}catch{return{changed:0}}let r=t.providers;if(!r||typeof r!="object")return{changed:0};let{index:c,message:o}=await F(n,e);if(c.size===0&&!e?.prices&&!e?.tiers)return{changed:0,message:o};let a=0;for(let i of C){let u=r[i];if(!u||!Array.isArray(u.models))continue;let l=Z(u.models,c,e?.prices,e?.tiers);l.changed!==0&&(u.models=l.models,a+=l.changed)}if(a>0)try{w(s,`${JSON.stringify(t,null,2)}
4
4
  `)}catch{return{changed:0,message:"the models file could not be written"}}return{changed:a,message:o}}var B=3e5;function me(n){let e=k(n,"settings.json"),s={};try{let t=b(e,"utf8"),r=JSON.parse(t);r&&typeof r=="object"&&!Array.isArray(r)&&(s=r)}catch{if(H(e))return!1}if("httpIdleTimeoutMs"in s)return!1;s.httpIdleTimeoutMs=B;try{I(n,{recursive:!0}),w(e,`${JSON.stringify(s,null,2)}
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-UMFFZTFV.js";import{createPrivateKey as p,createPublicKey as f,createHash as l,randomBytes as d,sign as y}from"node:crypto";import{arch as c,cpus as m,hostname as I,platform as s}from"node:os";var a="hf-cli-1",C="MC4CAQAwBQYDK2VwBCIEIDmKoNgInS7oDpncee1d1+Mnci1R/q4aE5xxHeCKq4Dc",x="howtocode-cli-auth-v1",i;function u(){return i||(i=p({key:Buffer.from(C,"base64"),format:"der",type:"pkcs8"})),i}function g(){return f(u())}function K(t,e,n,r){return Buffer.from([x,t,e,n,r].join(`
1
+ import{b as o}from"./chunk-V262WPO6.js";import{createPrivateKey as p,createPublicKey as f,createHash as l,randomBytes as d,sign as y}from"node:crypto";import{arch as c,cpus as m,hostname as I,platform as s}from"node:os";var a="hf-cli-1",C="MC4CAQAwBQYDK2VwBCIEIDmKoNgInS7oDpncee1d1+Mnci1R/q4aE5xxHeCKq4Dc",x="howtocode-cli-auth-v1",i;function u(){return i||(i=p({key:Buffer.from(C,"base64"),format:"der",type:"pkcs8"})),i}function g(){return f(u())}function K(t,e,n,r){return Buffer.from([x,t,e,n,r].join(`
2
2
  `),"utf8")}function h(){return d(16).toString("hex")}var E="tQ91uspGl0sw5Y8x+soLYnFNX6a9vEzSzCuuvalzdKk=";function P(){let t=g().export({format:"der",type:"spki"});return t.subarray(t.length-32).toString("base64")===E}function N(){let t=g().export({format:"der",type:"spki"});return l("sha256").update(t).digest("hex").slice(0,16)}function $(){let e=(m()[0]?.model??"").replace(/\s+/g," ").trim(),n=I(),r=e?`${n} (${s()}/${c()}, ${e})`:`${n} (${s()}/${c()})`;return`CLI (${o}, ${r})`}var k="X-HowToCode-Client";function A(){return`CLI (${o})`}function B(t,e){let n=h(),r=y(null,K(a,t,e,n),u());return{keyId:a,nonce:n,signature:r.toString("base64")}}export{a,g as b,K as c,h as d,P as e,N as f,$ as g,k as h,A as i,B as j};
@@ -1,4 +1,4 @@
1
- import{b as pf}from"./chunk-27TRKD65.js";import{r as cf}from"./chunk-YNMLRZJK.js";import{H as Ye,K as uf,L as jn,a as Gi}from"./chunk-ABDZXFNM.js";import{a as sr}from"./chunk-UTYFLLSM.js";import{a as Nm,b as Dn,c as Nn,d as qm,e as Um,f as Mo,g as _m,h as Br,j as vo}from"./chunk-MVVEYKN6.js";import{a as At}from"./chunk-WOT6VMZA.js";import{spawn as k1}from"node:child_process";import{existsSync as T1,readFileSync as w1}from"node:fs";import{join as C1}from"node:path";var B={};At(B,{Match:()=>Nw});function Nw(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}var Me={};At(Me,{Get:()=>Qi,Reset:()=>FC,Set:()=>LC});var s={};At(s,{CodePointCount:()=>Zw,Counted:()=>sC,Entries:()=>uC,EntriesRegExp:()=>mC,Every:()=>rC,EveryAll:()=>nC,GraphemeCount:()=>Xw,HasPropertyKey:()=>aC,IsArray:()=>Lo,IsBigInt:()=>Fo,IsBoolean:()=>xf,IsClassInstance:()=>Qw,IsConstructor:()=>Hw,IsDeepEqual:()=>Km,IsEqual:()=>Y,IsFunction:()=>hf,IsGreaterEqualThan:()=>bf,IsGreaterThan:()=>Vw,IsInteger:()=>Bm,IsLessEqualThan:()=>If,IsLessThan:()=>Jw,IsMaxLength:()=>eC,IsMinLength:()=>tC,IsMultipleOf:()=>Yw,IsNull:()=>Wi,IsNumber:()=>Vi,IsObject:()=>jo,IsObjectNotArray:()=>zw,IsString:()=>Ji,IsSymbol:()=>Ww,IsUndefined:()=>Gm,IsUnsafePropertyKey:()=>Ef,IsValueLike:()=>$f,Keys:()=>zi,ShiftLeft:()=>Yi,Some:()=>oC,SomeAll:()=>iC,Symbols:()=>cC,Values:()=>pC});function qn(e,t,r){return e>=t&&e<=r}function qw(e){return e===8205}function ff(e){return qn(e,127462,127487)}function Uw(e){return qn(e,65024,65039)}function _w(e){return qn(e,768,879)||qn(e,6832,6911)||qn(e,7616,7679)||qn(e,65056,65071)}function Ki(e){return e>65535?2:1}function df(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(_w(r)||Uw(r))t+=Ki(r);else break}return t}function Bw(e,t){let r=e.codePointAt(t),n=t+Ki(r);for(n=df(e,n);n<e.length-1&&qw(e.codePointAt(n));){let o=e.codePointAt(n+1);n+=1+Ki(o),n=df(e,n)}return ff(r)&&n<e.length&&ff(e.codePointAt(n))&&(n+=Ki(e.codePointAt(n))),n}function lf(e){let t=0,r=0;for(;r<e.length;)r=Bw(e,r),t++;return t}function Hi(e){let t=0,r=0,n=0;for(;r<e.length;){let o=e.charCodeAt(r++)>>10;t+=+((n<<8|o)!==13879),n=o}return t}function gf(e,t){return e.length<=t||e.length<=t<<1&&Hi(e)<=t}function yf(e,t){return e.length>=t<<1||e.length>=t&&Hi(e)>=t}function Lo(e){return Array.isArray(e)}function Fo(e){return Y(typeof e,"bigint")}function xf(e){return Y(typeof e,"boolean")}function Hw(e){if(Gm(e)||!hf(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function hf(e){return Y(typeof e,"function")}function Bm(e){return Number.isInteger(e)}function Wi(e){return Y(e,null)}function Vi(e){return Number.isFinite(e)}function zw(e){return jo(e)&&!Lo(e)}function jo(e){return Y(typeof e,"object")&&!Wi(e)}function Ji(e){return Y(typeof e,"string")}function Ww(e){return Y(typeof e,"symbol")}function Gm(e){return Y(e,void 0)}function Y(e,t){return e===t}function Vw(e,t){return e>t}function Jw(e,t){return e<t}function If(e,t){return e<=t}function bf(e,t){return e>=t}function Yw(e,t){if(Fo(e)||Fo(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!Vi(e)||Bm(e)&&1/t%1===0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<r}function Qw(e){if(!jo(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return Wi(t)?!1:Y(typeof t.constructor,"function")&&!(Y(t.constructor,globalThis.Object)||Y(t.constructor.name,"Object"))}function $f(e){return Fo(e)||xf(e)||Wi(e)||Vi(e)||Ji(e)||Gm(e)}function Xw(e){return lf(e)}function Zw(e){return Hi(e)}function eC(e,t){return gf(e,t)}function tC(e,t){return yf(e,t)}function rC(e,t,r){return e.every((n,o)=>o<t||r(n,o))}function nC(e,t,r){let n=!0;return e.forEach((o,i)=>{i>=t&&!r(o,i)&&(n=!1)}),n}function oC(e,t){return e.some((r,n)=>t(r,n))}function iC(e,t){let r=!1;return e.forEach((n,o)=>{t(n,o)&&(r=!0)}),r}function sC(e,t){return e.reduce((r,n,o)=>t(n,o)?++r:r,0)}function Yi(e,t,r){return Y(e.length,0)?r():t(e[0],e.slice(1))}function Ef(e){return Y(e,"__proto__")||Y(e,"constructor")||Y(e,"prototype")}function aC(e,t){return Ef(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function mC(e){return zi(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function uC(e){return Object.entries(e)}function zi(e){return Object.getOwnPropertyNames(e)}function cC(e){return Object.getOwnPropertySymbols(e)}function pC(e){return Object.values(e)}function fC(e,t){if(!jo(t))return!1;let r=zi(e);return Y(r.length,zi(t).length)&&r.every(n=>Km(e[n],t[n]))}function dC(e,t){return Lo(t)&&Y(e.length,t.length)&&e.every((r,n)=>Km(e[n],t[n]))}function Km(e,t){return Lo(e)?dC(e,t):jo(e)?fC(e,t):Y(e,t)}var De={};At(De,{IsBigInt64Array:()=>CC,IsBigUint64Array:()=>RC,IsBoolean:()=>lC,IsDate:()=>AC,IsFloat32Array:()=>TC,IsFloat64Array:()=>wC,IsInt16Array:()=>$C,IsInt32Array:()=>SC,IsInt8Array:()=>hC,IsMap:()=>MC,IsNumber:()=>gC,IsRegExp:()=>PC,IsSet:()=>OC,IsString:()=>yC,IsTypeArray:()=>xC,IsUint16Array:()=>EC,IsUint32Array:()=>kC,IsUint8Array:()=>IC,IsUint8ClampedArray:()=>bC});function lC(e){return e instanceof Boolean}function gC(e){return e instanceof Number}function yC(e){return e instanceof String}function xC(e){return globalThis.ArrayBuffer.isView(e)}function hC(e){return e instanceof globalThis.Int8Array}function IC(e){return e instanceof globalThis.Uint8Array}function bC(e){return e instanceof globalThis.Uint8ClampedArray}function $C(e){return e instanceof globalThis.Int16Array}function EC(e){return e instanceof globalThis.Uint16Array}function SC(e){return e instanceof globalThis.Int32Array}function kC(e){return e instanceof globalThis.Uint32Array}function TC(e){return e instanceof globalThis.Float32Array}function wC(e){return e instanceof globalThis.Float64Array}function CC(e){return e instanceof globalThis.BigInt64Array}function RC(e){return e instanceof globalThis.BigUint64Array}function PC(e){return e instanceof globalThis.RegExp}function AC(e){return e instanceof globalThis.Date}function OC(e){return e instanceof globalThis.Set}function MC(e){return e instanceof globalThis.Map}var Sf=s;var Vt={immutableTypes:!1,maxErrors:8,maxParseErrors:1,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function FC(){Vt.immutableTypes=!1,Vt.maxErrors=8,Vt.maxParseErrors=1,Vt.maxInstantiationCount=128,Vt.useAcceleration=!0,Vt.exactOptionalPropertyTypes=!1,Vt.enumerableKind=!1,Vt.correctiveParse=!1,Vt.unionPrioritySort=!0}function LC(e){for(let t of s.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(Vt,t,{value:r})}}function Qi(){return Vt}function Xi(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"check")&&s.HasPropertyKey(t,"error")&&s.IsFunction(t.check)&&s.IsFunction(t.error))}function gt(e){return s.IsObject(e)&&!s.IsArray(e)}function ln(e){return s.IsBoolean(e)}function L(e){return gt(e)||ln(e)}function Zi(e){return s.HasPropertyKey(e,"additionalItems")&&L(e.additionalItems)}function _t(e){return s.HasPropertyKey(e,"additionalProperties")&&L(e.additionalProperties)}function es(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>L(t))}function kf(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function ts(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>L(t))}function Hm(e){return s.HasPropertyKey(e,"const")}function Gr(e){return s.HasPropertyKey(e,"contains")&&L(e.contains)}function bt(e){return s.HasPropertyKey(e,"default")}function zm(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>L(t)||s.IsArray(t)&&t.every(r=>s.IsString(r)))}function Wm(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(r=>s.IsString(r)))}function rs(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>L(t))}function Kr(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function ns(e){return s.HasPropertyKey(e,"$dynamicRef")&&s.IsString(e.$dynamicRef)}function os(e){return s.HasPropertyKey(e,"else")&&L(e.else)}function Vm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function Jm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function wr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Do(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function ut(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function is(e){return s.HasPropertyKey(e,"if")&&L(e.if)}function gn(e){return s.HasPropertyKey(e,"items")&&(L(e.items)||s.IsArray(e.items)&&e.items.every(t=>L(t)))}function ss(e){return gn(e)&&s.IsArray(e.items)}function Ym(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Qm(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function No(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Xm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Zm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Cr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function yn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function xn(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function qo(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function Uo(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function eu(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function as(e){return s.HasPropertyKey(e,"not")&&L(e.not)}function ms(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>L(t))}function _o(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Un(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>L(t))}function hn(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>L(t))}function _n(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>L(t))}function us(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||L(e.propertyNames))}function jC(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Bo(e){return jC(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function cs(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function ps(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function In(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function fs(e){return s.HasPropertyKey(e,"then")&&L(e.then)}function tu(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Hr(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Go(e){return s.HasPropertyKey(e,"unevaluatedItems")&&L(e.unevaluatedItems)}function Ko(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&L(e.unevaluatedProperties)}var ct=class{constructor(){let t=new Set,r=new Set;this.stack=[{indices:t,keys:r}]}Push(){let t=new Set,r=new Set;return this.stack.push({indices:t,keys:r}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(let r of t)r.GetIndices().forEach(n=>this.GetIndices().add(n)),r.GetKeys().forEach(n=>this.GetKeys().add(n));return!0}},et=class extends ct{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=Me.Get().maxErrors}AddError(t,r,n,o){return this.AddErrorObject({keyword:t,schemaPath:r,instancePath:n,params:o})}AddErrors(t){return t.forEach(r=>this.AddErrorObject(r)),!1}GetErrors(){return this.errors}AddErrorObject(t){return this.AtCapacity()||this.errors.push(t),!1}};function Tf(e,t,r,n){return s.Every(r["~refine"],0,(o,i)=>o.check(n))}function wf(e,t,r,n,o,i){return s.EveryAll(o["~refine"],0,(a,m)=>a.check(i)||t.AddError("~refine",r,n,{index:m,message:a.error(i)}))}var Ho="urn:typebox:root";function Rr(e,t){return URL.canParse(e,t)?new URL(e,t):s.IsEqual(t,Ho)?new URL(`${t}:${e}`):new URL(`${t.slice(0,t.lastIndexOf(":"))}:${e}`)}function Gn(e,t){let r=gt(t)&&ut(t)?Rr(t.$id,Ho).href:Ho;return{context:e,schema:t,lexicalSchema:t,lexicalBase:r,resourceBase:r,referenceBase:r,ids:[],useResourceBaseForReference:!0,recursiveAnchor:void 0,dynamicAnchors:[],resourceEntries:new Map,pendingResource:!0,enteredResource:!1}}function ru(e,t,r=!0){if(ln(t))return e;if(Array.isArray(t))return t.reduce((o,i)=>ru(o,i,!1),e);if(!gt(t)||!r&&ut(t))return e;let n=!r&&Kr(t)?[...e,t]:e;return Object.keys(t).reduce((o,i)=>ru(o,t[i],!1),n)}function zo(e,t){return e.resourceEntries.get(t)}function Cf(e,t){return e.enteredResource||zo(e,t)!==void 0}function DC(e){return!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)}function NC(e,t){return ut(t)?[...e.ids,t]:e.ids}function qC(e,t){return e.recursiveAnchor??(Bo(t)?t:void 0)}function UC(e,t){let r=ut(t)?ru(e.dynamicAnchors,t):e.dynamicAnchors;return Kr(t)?[...r,t]:r}function _C(e,t){return ut(t)?!1:e.pendingResource}function Rf(e,t){let r=zo(e,t);return r?r.base:ut(t)?Rr(t.$id,e.lexicalBase).href:e.lexicalBase}function Pf(e,t){let r=zo(e,t);return r?r.base:ut(t)&&e.pendingResource?Rr(t.$id,e.resourceBase).href:e.resourceBase}function Af(e,t){return ut(t)?!DC(t):e.useResourceBaseForReference}function BC(e,t){let r=Cf(e,t),n=Af(e,t);return r||n?Pf(e,t):Rf(e,t)}function GC(e,t){let r=zo(e,t);return r?r.root:ut(t)?t:e.lexicalSchema}function KC(e,t){return gt(t)&&(ut(t)||Kr(t)||s.IsUndefined(e.recursiveAnchor)&&Bo(t)||!s.IsUndefined(zo(e,t)))}function Kn(e,t){return KC(e,t)?{...e,ids:NC(e,t),dynamicAnchors:UC(e,t),recursiveAnchor:qC(e,t),pendingResource:_C(e,t),lexicalBase:Rf(e,t),resourceBase:Pf(e,t),useResourceBaseForReference:Af(e,t),referenceBase:BC(e,t),lexicalSchema:GC(e,t),enteredResource:Cf(e,t)}:e}function Of(e){return gn(e)&&s.IsArray(e.items)}function Mf(e,t,r,n){return Of(r)?s.Every(n,0,(i,a)=>s.IsLessThan(a,r.items.length)||Ot(e,t,r.additionalItems,i)&&t.AddIndex(a)):!0}function vf(e,t,r,n,o,i){return Of(o)?s.Every(i,0,(m,c)=>{let p=`${r}/additionalItems`,f=`${n}/${c}`;return s.IsLessThan(c,o.items.length)||Mt(e,t,p,f,o.additionalItems,m)&&t.AddIndex(c)}):!0}function $t(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function zr(e){return new RegExp(e,"u")}function HC(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Ff(e){let t=[];return Un(e)&&t.push(...s.Keys(e.patternProperties)),_n(e)&&t.push(...s.Keys(e.properties).map(HC)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function Lf(e,t,r,n){let o=zr(Ff(r));return s.Every(s.Keys(n),0,(a,m)=>o.test(a)||Ot(e,t,r.additionalProperties,n[a])&&t.AddKey(a))}function jf(e,t,r,n,o,i){let a=zr(Ff(o)),m=[];return s.EveryAll(s.Keys(i),0,(p,f)=>{let d=`${r}/additionalProperties`,g=`${n}/${$t(p)}`,y=a.test(p)||Mt(e,t,d,g,o.additionalProperties,i[p])&&t.AddKey(p);return y||m.push(p),y})||t.AddError("additionalProperties",r,n,{additionalProperties:m})}function Df(e,t,r,n){let o=r.allOf.reduce((i,a)=>{let m=new ct;return Q(e,m,a,n)?[...i,m]:i},[]);return s.IsEqual(o.length,r.allOf.length)&&t.Merge(o)}function Nf(e,t,r,n,o,i){let a=[],m=o.allOf.reduce((p,f,d)=>{let g=`${r}/allOf/${d}`,y=new et,I=ce(e,y,g,n,f,i);return I||a.push(y),I?[...p,y]:p},[]),c=s.IsEqual(m.length,o.allOf.length)&&t.Merge(m);return c||a.forEach(p=>t.AddErrors(p.GetErrors())),c}function qf(e,t,r,n){let o=r.anyOf.reduce((i,a)=>{let m=new ct;return Q(e,m,a,n)?[...i,m]:i},[]);return s.IsGreaterThan(o.length,0)&&t.Merge(o)}function Uf(e,t,r,n,o,i){let a=[],m=o.anyOf.reduce((p,f,d)=>{let g=new et,y=`${r}/anyOf/${d}`,I=ce(e,g,y,n,f,i);return I||a.push(g),I?[...p,g]:p},[]),c=s.IsGreaterThan(m.length,0)&&t.Merge(m);return c||a.forEach(p=>t.AddErrors(p.GetErrors())),c||t.AddError("anyOf",r,n,{})}function iu(e,t,r,n){return r}function _f(e,t,r,n,o,i){return iu(e,t,o,i)||t.AddError("boolean",r,n,{})}function su(e,t,r,n){return s.IsValueLike(r.const)?s.IsEqual(n,r.const):s.IsDeepEqual(n,r.const)}function Bf(e,t,r,n,o,i){return su(e,t,o,i)||t.AddError("const",r,n,{allowedValue:o.const})}function zC(e){return!(yn(e)&&s.IsEqual(e.minContains,0))}function au(e,t,r,n){return zC(r)?!s.IsEqual(n.length,0)&&s.SomeAll(n,(o,i)=>Q(e,t,r.contains,o)&&t.AddIndex(i)):!0}function Gf(e,t,r,n,o,i){return au(e,t,o,i)||t.AddError("contains",r,n,{minContains:1})}function Kf(e,t,r,n){let o=s.IsEqual(s.Keys(n).length,0),i=s.Every(s.Entries(r.dependencies),0,([a,m])=>!s.HasPropertyKey(n,a)||(s.IsArray(m)?m.every(c=>s.HasPropertyKey(n,c)):Q(e,t,m,n)));return o||i}function Hf(e,t,r,n,o,i){let a=s.IsEqual(s.Keys(i).length,0),m=s.EveryAll(s.Entries(o.dependencies),0,([c,p])=>{let f=`${r}/dependencies/${$t(c)}`;return!s.HasPropertyKey(i,c)||(s.IsArray(p)?p.every(d=>s.HasPropertyKey(i,d)||t.AddError("dependencies",r,n,{property:c,dependencies:p})):ce(e,t,f,n,p,i))});return a||m}function zf(e,t,r,n){let o=s.IsEqual(s.Keys(n).length,0),i=s.Every(s.Entries(r.dependentRequired),0,([a,m])=>!s.HasPropertyKey(n,a)||m.every(c=>s.HasPropertyKey(n,c)));return o||i}function Wf(e,t,r,n,o,i){let a=s.IsEqual(s.Keys(i).length,0),m=s.EveryAll(s.Entries(o.dependentRequired),0,([c,p])=>!s.HasPropertyKey(i,c)||s.EveryAll(p,0,f=>s.HasPropertyKey(i,f)||t.AddError("dependentRequired",r,n,{property:c,dependencies:p})));return a||m}function Vf(e,t,r,n){let o=s.IsEqual(s.Keys(n).length,0),i=s.Every(s.Entries(r.dependentSchemas),0,([a,m])=>!s.HasPropertyKey(n,a)||Q(e,t,m,n));return o||i}function Jf(e,t,r,n,o,i){let a=s.IsEqual(s.Keys(i).length,0),m=s.EveryAll(s.Entries(o.dependentSchemas),0,([c,p])=>{let f=`${r}/dependentSchemas/${$t(c)}`;return!s.HasPropertyKey(i,c)||ce(e,t,f,n,p,i)});return a||m}var Bt={};At(Bt,{DynamicRef:()=>SR,RecursiveRef:()=>bR,Ref:()=>hR});var mr={};At(mr,{Delete:()=>YC,Get:()=>VC,Has:()=>WC,Indices:()=>Vo,Set:()=>JC});function Qf(e){throw Error(e)}function Yf(){Qf("Pointer contains unsafe property key")}function mu(){Qf("Cannot set value")}function Vo(e){let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t[0]===""?t.slice(1):t}function WC(e,t){let r=e;for(let n of Vo(t)){if(!s.IsObject(r)||!s.HasPropertyKey(r,n))return!1;r=r[n]}return!0}function VC(e,t){let r=e;for(let n of Vo(t)){if(!s.IsObject(r)||s.IsUnsafePropertyKey(n))return;r=r[n]}return r}function Xf(e,t,r){let n=e;for(let o of t)s.IsUnsafePropertyKey(o)&&Yf(),n=s.IsObject(n)?n[o]:void 0;return s.IsUnsafePropertyKey(r)&&Yf(),s.IsObject(n)||mu(),n}function JC(e,t,r){let n=Vo(t),o=n.pop();return s.IsUndefined(o)&&mu(),Xf(e,n,o)[o]=r,e}function YC(e,t){let r=Vo(t),n=r.pop();s.IsUndefined(n)&&mu();let o=Xf(e,r,n);return s.IsArray(o)&&/^(0|[1-9]\d*)$/.test(n)?o.splice(Number(n),1):delete o[n],e}function pu(e,t){return gt(e)&&ut(e)?Rr(e.$id,t.href):t}function fu(e){return Rr(e,Ho)}function uu(e){return e.href.split("#")[0]}function QC(e,t,r){return cu(e,fu(t),r)}function XC(e,t){return t.$ref.startsWith("#")||e.enteredResource?e.lexicalSchema:e.schema}function ZC(e){return e.startsWith("#/")}function Zf(e,t){if(s.IsObject(e)&&Kr(e)&&s.IsEqual(e.$dynamicAnchor,t))return e;if(s.IsObject(e))for(let r of s.Keys(e)){let n=Zf(e[r],t);if(n)return n}}function cu(e,t,r){if(s.IsEqual(e,r))return t.href;let n=pu(e,t);if(s.IsArray(e))for(let o of e){let i=cu(o,n,r);if(!s.IsUndefined(i))return i}else if(s.IsObject(e))for(let o of s.Keys(e)){let i=cu(e[o],n,r);if(!s.IsUndefined(i))return i}}function ed(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;let r=decodeURIComponent(t.hash.slice(1));if(r.startsWith("/"))return mr.Get(e,r)}function eR(e,t,r){if(!ut(e))return;if(s.IsEqual(e.$id,r.hash))return e;let n=new URL(r.href,t.href);if(s.IsEqual(t.pathname,n.pathname))return r.hash.startsWith("#")?ed(e,r):e}function tR(e,t,r){if(!kf(e))return;let n=new URL(`#${e.$anchor}`,t.href),o=new URL(r.href,t.href);return s.IsEqual(n.href,o.href)?e:void 0}function rR(e,t,r){if(!Kr(e))return;let n=new URL(`#${e.$dynamicAnchor}`,t.href),o=new URL(r.href,t.href);return s.IsEqual(n.href,o.href)?e:void 0}function nR(e,t,r){if(gt(e))return eR(e,t,r)??tR(e,t,r)??rR(e,t,r)??ed(e,r)}function oR(e,t,r){if(s.IsArray(e))return e.reduce((n,o)=>{let i=ds(o,t,r);return s.IsUndefined(i)?n:i},void 0)}function iR(e,t,r){if(s.IsObject(e))return s.Keys(e).reduce((n,o)=>{if(s.IsEqual(o,"const")||s.IsEqual(o,"enum"))return n;let i=ds(e[o],t,r);return s.IsUndefined(i)?n:i},void 0)}function ds(e,t,r){let n=pu(e,t);return nR(e,n,r)??oR(e,n,r)??iR(e,n,r)}function sR(e,t,r,n){let o=ls(e,t,r,n);return gt(o)&&ut(o)?o:void 0}function aR(e,t,r){if(!t.$ref.startsWith("#")||!gt(e.schema)||s.HasPropertyKey(e.schema,"$schema"))return;let n=QC(e.lexicalSchema,e.referenceBase,r);if(!(s.IsUndefined(n)||s.IsEqual(n,e.referenceBase)))return{target:r,base:n,root:e.lexicalSchema}}function mR(e,t,r){let n=e.context[t];if(gt(n))return{target:r,base:t,root:n}}function uR(e,t,r,n,o){let i=o?mR(e,n,r):void 0;return s.IsUndefined(i)?aR(e,t,r):i}function cR(e,t,r){if(ut(r))return;let n=sR(e.context,e.schema,e.referenceBase,t);if(!(!n||e.ids.includes(n)))return{resource:n}}function pR(e,t){return s.HasPropertyKey(e,t)?e[t]:void 0}function fR(e,t,r){return ds(e,t,r)}function dR(e,t,r){let n=uu(r);if(!s.HasPropertyKey(e,n)||s.IsEqual(n,uu(t)))return;let o=e[n],i=pu(o,new URL(n));return s.IsEqual(r.hash,"")?o:ds(o,i,r)}function ls(e,t,r,n){let o=fu(r),i=Rr(n,o.href);return pR(e,n)??fR(t,o,i)??dR(e,o,i)}function lR(e,t){if(!t)return e;let r=new Map(e.resourceEntries);return r.set(t.target,{base:t.base,root:t.root}),{...e,resourceEntries:r}}function gR(e,t){return t?Kn(e,t.resource):e}function td(e,t,r,n){let o=lR({...e,pendingResource:t},r);return gR(o,n)}function yR(e,t,r){let n=uu(Rr(t.$ref,e.referenceBase)),o=!s.IsEqual(n,e.resourceBase),i=uR(e,t,r,n,o),a=o?cR(e,n,r):void 0;return{schema:r,stack:td(e,!0,i,a)}}function xR(e,t){return{schema:t,stack:td(e,!s.IsUndefined(t))}}function hR(e,t){let r=ls(e.context,XC(e,t),e.referenceBase,t.$ref);return gt(r)?yR(e,t,r):xR(e,r)}function IR(e){return gt(e.lexicalSchema)&&Bo(e.lexicalSchema)}function bR(e,t){let r=IR(e)?e.recursiveAnchor:e.lexicalSchema;return ls(e.context,r,e.lexicalBase,t.$recursiveRef)}function rd(e,t){return Rr(t.$dynamicRef,fu(e.lexicalBase).href).hash}function nd(e,t){return e.dynamicAnchors.find(r=>s.IsEqual(r.$dynamicAnchor,t))??Zf(e.schema,t)}function $R(e,t,r){if(!gt(r)||!Kr(r))return r;let n=rd(e,t);return ZC(n)?r:nd(e,r.$dynamicAnchor)}function ER(e,t){let r=rd(e,t);return nd(e,decodeURIComponent(r.slice(1)))}function SR(e,t){let r=t.$dynamicRef.startsWith("#")?e.lexicalSchema:e.schema,n=ls(e.context,r,e.lexicalBase,t.$dynamicRef);return s.IsUndefined(n)?ER(e,t):$R(e,t,n)}function od(e,t,r,n){let o=Bt.DynamicRef(e,r)??!1,i=o?{...e,pendingResource:!0}:e;return L(o)&&Q(i,t,o,n)}function id(e,t,r,n,o,i){let a=Bt.DynamicRef(e,o)??!1,m=a?{...e,pendingResource:!0}:e;return L(a)&&ce(m,t,r,n,a,i)}function gu(e,t,r,n){return s.Some(r.enum,o=>s.IsValueLike(o)?s.IsEqual(n,o):s.IsDeepEqual(n,o))}function sd(e,t,r,n,o,i){return gu(e,t,o,i)||t.AddError("enum",r,n,{allowedValues:o.enum})}function yu(e,t,r,n){return s.IsLessThan(n,r.exclusiveMaximum)}function ad(e,t,r,n,o,i){return yu(e,t,o,i)||t.AddError("exclusiveMaximum",r,n,{comparison:"<",limit:o.exclusiveMaximum})}function xu(e,t,r,n){return s.IsGreaterThan(n,r.exclusiveMinimum)}function md(e,t,r,n,o,i){return xu(e,t,o,i)||t.AddError("exclusiveMinimum",r,n,{comparison:">",limit:o.exclusiveMinimum})}var Xo={};At(Xo,{Clear:()=>Ld,Entries:()=>f0,Get:()=>g0,Has:()=>l0,IsDate:()=>zn,IsDateTime:()=>gs,IsDuration:()=>ys,IsEmail:()=>xs,IsHostname:()=>Ts,IsIPv4:()=>Rs,IsIPv6:()=>Ps,IsIdnEmail:()=>ws,IsIdnHostname:()=>Cs,IsIri:()=>Os,IsIriReference:()=>As,IsJsonPointer:()=>vs,IsJsonPointerUriFragment:()=>Ms,IsRegex:()=>Fs,IsRelativeJsonPointer:()=>Ls,IsTime:()=>Wn,IsUri:()=>Ns,IsUriReference:()=>js,IsUriTemplate:()=>Ds,IsUrl:()=>qs,IsUuid:()=>Us,Reset:()=>jd,Set:()=>d0,Test:()=>y0});var kR=[0,31,28,31,30,31,30,31,31,30,31,30,31],TR=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function wR(e){return e%4===0&&(e%100!==0||e%400===0)}function zn(e){let t=TR.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&wR(r)?29:kR[n])}var CR=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Wn(e,t=!0){let r=CR.exec(e);if(!r||t&&!r[4]&&!r[5])return!1;let n=+r[1],o=+r[2],i=+r[3];if(n>23||o>59||i>60)return!1;if(r[5]){let f=+r[6],d=+r[7];if(f>23||d>59)return!1}if(i<60)return!0;let a=r[5]==="-"?-1:1,m=+(r[6]||0),c=+(r[7]||0);return((n*60+o-a*(m*60+c))%1440+1440)%1440===1439}var RR=/^(?:\[!?(?:(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13}(?:\/(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13})*|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])\](?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*|(?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*)$/;function gs(e){let t=e.indexOf("["),r=t===-1?e:e.slice(0,t);if(t!==-1&&!RR.test(e.slice(t)))return!1;let n=r.split(/T/i);return n.length===2&&zn(n[0])&&Wn(n[1])}var PR=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function ys(e){return PR.test(e)}var AR=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function xs(e){return AR.test(e)}var ud=/^(?!-).*(?<!-)$/,cd=/^(?!..--)/,pd=/^[a-zA-Z0-9-]*$/,uG=new RegExp("^\\p{ASCII}*$","u"),Vn=/[^\p{ASCII}]/u;var OR=/[0-9]/,fd=/[\u{0660}-\u{0669}]/u,MR=/[\u{06f0}-\u{06f9}]/u,vR=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,FR=/[\u{002d}\u{002b}]/u,hu=new RegExp("\\p{Mn}","u"),LR=new RegExp("\\p{Mc}","u"),cG=new RegExp("\\p{Me}","u"),dd=/[\p{Mn}\p{Mc}\p{Me}]/u,Iu=new RegExp("\\p{L}","u"),jR=new RegExp("\\p{Nd}","u"),ld=new RegExp("\\p{Script=Greek}","u"),hs=new RegExp("\\p{Script=Hebrew}","u"),gd=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,yd=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,bu=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,xd=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,DR=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,NR=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,hd=new RegExp([OR,MR].map(e=>e.source).join("|"),"u"),Id=new RegExp([Iu,FR,vR,jR,hu,LR,DR,NR].map(e=>e.source).join("|"),"u");function bd(e){return ud.test(e)&&cd.test(e)&&pd.test(e)}var Yt=36,Yo=1,Qo=26,UR=38,_R=700,Ed=72,Sd=128;function $u(){throw null}function Is(e){return e.toLowerCase().startsWith("xn--")}function kd(e,t,r){e=r?Math.floor(e/_R):e>>1,e+=Math.floor(e/t);let n=0;for(;e>(Yt-Yo)*Qo>>1;)e=Math.floor(e/(Yt-Yo)),n+=Yt;return n+Math.floor((Yt-Yo+1)*e/(e+UR))}function bs(e){let t=[],r=Sd,n=0,o=Ed,i=e.lastIndexOf("-");if(i>0)for(let m=0;m<i;m++){let c=e.charCodeAt(m);c>=128&&$u(),t.push(c)}let a=i<0?0:i+1;for(;a<e.length;){let m=n,c=1,p=Yt;for(;;){a>=e.length&&$u();let d=e.charCodeAt(a++),g;d>=97&&d<=122?g=d-97:d>=48&&d<=57?g=d-48+26:$u(),n+=g*c;let y=p<=o?Yo:p>=o+Qo?Qo:p-o;if(g<y)break;c*=Yt-y,p+=Yt}let f=t.length+1;o=kd(n-m,f,m===0),r+=Math.floor(n/f),n%=f,t.splice(n,0,r),n++}return String.fromCodePoint(...t)}function $d(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var BR=new RegExp(Vn.source,"gu");function Td(e){let t=e.replace(BR,""),r=t.length,n=r>0?[t,"-"]:[],o=Array.from(e,p=>p.codePointAt(0)),i=Sd,a=0,m=Ed,c=r;for(;c<o.length;){let p=1/0;for(let f of o)f>=i&&f<p&&(p=f);a+=(p-i)*(c+1),i=p;for(let f of o)if(f<i&&a++,f===i){let d=a;for(let g=Yt;;g+=Yt){let y=g<=m?Yo:g>=m+Qo?Qo:g-m;if(d<y)break;let I=y+(d-y)%(Yt-y);n.push($d(I)),d=Math.floor((d-y)/(Yt-y))}n.push($d(d)),m=kd(a,c+1,c===r),a=0,c++}a++,i++}return n.join("")}var GR=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,wd=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,KR=/^(?:R|AL|AN)$/;function Cd(e){if(Is(e))try{return $s(bs(e.slice(4).toLowerCase()))}catch{return!1}return $s(e)}function Rd(e){let t=String.fromCodePoint(e);return hd.test(t)?"EN":fd.test(t)?"AN":hu.test(t)?"NSM":hs.test(t)?"R":yd.test(t)?"AL":Iu.test(t)?"L":"ON"}function $s(e){for(let t of e)if(KR.test(Rd(t.codePointAt(0))))return!0;return!1}function Es(e){let t=!1,r=wd,n=!1,o=!1,i=!0;for(let a of e){let m=Rd(a.codePointAt(0));if(i){if(m!=="L"&&m!=="R"&&m!=="AL")return!1;t=m==="R"||m==="AL",r=t?GR:wd,i=!1}if(!r.test(m))return!1;m==="EN"?n=!0:m==="AN"&&(o=!0)}return!(t&&n&&o)}function HR(e){return Vn.test(e)&&Td(e).length+4>63}function zR(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function Ss(e){if(HR(e)||$s(e)&&!Es(e))return!1;let t=[...e],r=t.map(i=>i.codePointAt(0)),n=r.length;if(zR(t)||dd.test(t[0]))return!1;let o=!1;for(let i=0;i<n;i++){let a=r[i],m=t[i];if(xd.test(m)||!Id.test(m))return!1;gd.test(m)&&(o=!0);let c=r[i-1],p=r[i+1];switch(a){case 183:if(c!==108||p!==108)return!1;break;case 885:if(!p||!ld.test(t[i+1]))return!1;break;case 1523:case 1524:if(!c||!hs.test(t[i-1]))return!1;break;case 8204:if(!c||c<128&&!bu.test(t[i-1]))return!1;break;case 8205:if(!c||!bu.test(t[i-1]))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!o)}function ks(e){if(!Is(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let r=bs(t);return Vn.test(r)?Ss(r):!1}catch{return!1}}function WR(e){return e.length>0&&e.length<=63}function VR(e){return WR(e)&&(ks(e)||bd(e))}function Md(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>VR(t))}function JR(e){return e.length>0&&e.length<=63}function YR(e){return JR(e)&&(ks(e)||Ss(e))}function QR(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function vd(e){if(e.length===0||e.includes(" "))return!1;let t=QR(e);if(t.length>253)return!1;let r=t.split("."),n=r.some(o=>Cd(o));return r.every(o=>YR(o)&&(!n||Es(o)))}function Ts(e){return Md(e)}var XR=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function ws(e){return XR.test(e.normalize("NFC"))}function Cs(e){return vd(e)}var ZR=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function Rs(e){return ZR.test(e)}var e0=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function Ps(e){return e0.test(e)}var t0=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,r0=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function As(e){return!t0.test(e)&&!r0.test(e)&&URL.canParse(e,"http://example.com")}var n0=/[\x00-\x20<>\^`{|}\\]/,o0=/%(?![0-9a-fA-F]{2})/;function Os(e){return n0.test(e)||o0.test(e)?!1:URL.canParse(e)}var i0=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Ms(e){return i0.test(e)}var s0=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function vs(e){return s0.test(e)}function Fs(e){try{return new RegExp(e,"u"),!0}catch{return!1}}var a0=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Ls(e){return a0.test(e)}var m0=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function js(e){return m0.test(e)}var u0=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function Ds(e){return u0.test(e)}var c0=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Ns(e){return c0.test(e)}function qs(e){return URL.canParse(e)}var p0=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Us(e){return p0.test(e)}var le=new Map;function Ld(){le.clear()}function f0(){return[...le.entries()]}function d0(e,t){le.set(e,t)}function l0(e){return le.has(e)}function g0(e){return le.get(e)}function y0(e,t){return le.get(e)?.(t)??!0}function jd(){Ld(),le.set("date-time",gs),le.set("date",zn),le.set("duration",ys),le.set("email",xs),le.set("hostname",Ts),le.set("idn-email",ws),le.set("idn-hostname",Cs),le.set("ipv4",Rs),le.set("ipv6",Ps),le.set("iri-reference",As),le.set("iri",Os),le.set("json-pointer-uri-fragment",Ms),le.set("json-pointer",vs),le.set("regex",Fs),le.set("relative-json-pointer",Ls),le.set("time",Wn),le.set("uri-reference",js),le.set("uri-template",Ds),le.set("uri",Ns),le.set("url",qs),le.set("uuid",Us)}jd();function Su(e,t,r,n){return Xo.Test(r.format,n)}function Dd(e,t,r,n,o,i){return Su(e,t,o,i)||t.AddError("format",r,n,{format:o.format})}function Nd(e,t,r,n){let o=fs(r)?r.then:!0,i=os(r)?r.else:!0;return Q(e,t,r.if,n)?Q(e,t,o,n):Q(e,t,i,n)}function qd(e,t,r,n,o,i){let a=fs(o)?o.then:!0,m=os(o)?o.else:!0,c=new et,p=ce(e,c,`${r}/if`,n,o.if,i)?ce(e,c,`${r}/then`,n,a,i)||t.AddError("if",r,n,{failingKeyword:"then"}):ce(e,t,`${r}/else`,n,m,i)||t.AddError("if",r,n,{failingKeyword:"else"});return p&&t.Merge([c]),p}function x0(e,t,r,n){return s.Every(r.items,0,(o,i)=>s.IsLessEqualThan(n.length,i)||Ot(e,t,o,n[i])&&t.AddIndex(i))}function h0(e,t,r,n,o,i){return s.EveryAll(o.items,0,(a,m)=>{let c=`${r}/items/${m}`,p=`${n}/${m}`;return s.IsLessEqualThan(i.length,m)||Mt(e,t,c,p,a,i[m])&&t.AddIndex(m)})}function I0(e,t,r,n){let o=hn(r)?r.prefixItems.length:0;return s.Every(n,o,(i,a)=>Ot(e,t,r.items,i)&&t.AddIndex(a))}function b0(e,t,r,n,o,i){let a=hn(o)?o.prefixItems.length:0;return s.EveryAll(i,a,(m,c)=>{let p=`${r}/items`,f=`${n}/${c}`;return Mt(e,t,p,f,o.items,m)&&t.AddIndex(c)})}function Ud(e,t,r,n){return ss(r)?x0(e,t,r,n):I0(e,t,r,n)}function _d(e,t,r,n,o,i){return ss(o)?h0(e,t,r,n,o,i):b0(e,t,r,n,o,i)}function $0(e){return Gr(e)}function ku(e,t,r,n){if(!$0(r))return!0;let o=s.Counted(n,i=>Q(e,t,r.contains,i));return s.IsLessEqualThan(o,r.maxContains)}function Bd(e,t,r,n,o,i){let a=yn(o)?o.minContains:1;return ku(e,t,o,i)||t.AddError("contains",r,n,{minContains:a,maxContains:o.maxContains})}function Tu(e,t,r,n){return s.IsLessEqualThan(n,r.maximum)}function Gd(e,t,r,n,o,i){return Tu(e,t,o,i)||t.AddError("maximum",r,n,{comparison:"<=",limit:o.maximum})}function wu(e,t,r,n){return s.IsLessEqualThan(n.length,r.maxItems)}function Kd(e,t,r,n,o,i){return wu(e,t,o,i)||t.AddError("maxItems",r,n,{limit:o.maxItems})}function Cu(e,t,r,n){return s.IsMaxLength(n,r.maxLength)}function Hd(e,t,r,n,o,i){return Cu(e,t,o,i)||t.AddError("maxLength",r,n,{limit:o.maxLength})}function Ru(e,t,r,n){return s.IsLessEqualThan(s.Keys(n).length,r.maxProperties)}function zd(e,t,r,n,o,i){return Ru(e,t,o,i)||t.AddError("maxProperties",r,n,{limit:o.maxProperties})}function E0(e){return Gr(e)}function Pu(e,t,r,n){if(!E0(r))return!0;let o=s.Counted(n,(i,a)=>Q(e,t,r.contains,i)&&t.AddIndex(a));return s.IsGreaterEqualThan(o,r.minContains)}function Wd(e,t,r,n,o,i){return Pu(e,t,o,i)||t.AddError("contains",r,n,{minContains:o.minContains})}function Au(e,t,r,n){return s.IsGreaterEqualThan(n,r.minimum)}function Vd(e,t,r,n,o,i){return Au(e,t,o,i)||t.AddError("minimum",r,n,{comparison:">=",limit:o.minimum})}function Ou(e,t,r,n){return s.IsGreaterEqualThan(n.length,r.minItems)}function Jd(e,t,r,n,o,i){return Ou(e,t,o,i)||t.AddError("minItems",r,n,{limit:o.minItems})}function Mu(e,t,r,n){return s.IsMinLength(n,r.minLength)}function Yd(e,t,r,n,o,i){return Mu(e,t,o,i)||t.AddError("minLength",r,n,{limit:o.minLength})}function vu(e,t,r,n){return s.IsGreaterEqualThan(s.Keys(n).length,r.minProperties)}function Qd(e,t,r,n,o,i){return vu(e,t,o,i)||t.AddError("minProperties",r,n,{limit:o.minProperties})}function Fu(e,t,r,n){return s.IsMultipleOf(n,r.multipleOf)}function Xd(e,t,r,n,o,i){return Fu(e,t,o,i)||t.AddError("multipleOf",r,n,{multipleOf:o.multipleOf})}function Lu(e,t,r,n){let o=new ct;return!Q(e,o,r.not,n)&&t.Merge([o])}function Zd(e,t,r,n,o,i){return Lu(e,t,o,i)||t.AddError("not",r,n,{})}function el(e,t,r,n){let o=r.oneOf.reduce((i,a)=>{let m=new ct;return Q(e,m,a,n)?[...i,m]:i},[]);return s.IsEqual(o.length,1)&&t.Merge(o)}function tl(e,t,r,n,o,i){let a=[],m=[],c=o.oneOf.reduce((f,d,g)=>{let y=new et,I=`${r}/oneOf/${g}`,h=ce(e,y,I,n,d,i);return h&&m.push(g),h||a.push(y),h?[...f,y]:f},[]),p=s.IsEqual(c.length,1)&&t.Merge(c);return!p&&s.IsEqual(m.length,0)&&a.forEach(f=>t.AddErrors(f.GetErrors())),p||t.AddError("oneOf",r,n,{passingSchemas:m})}function ju(e,t,r,n){return(s.IsString(r.pattern)?zr(r.pattern):r.pattern).test(n)}function rl(e,t,r,n,o,i){return ju(e,t,o,i)||t.AddError("pattern",r,n,{pattern:o.pattern})}function nl(e,t,r,n){return s.Every(s.Entries(r.patternProperties),0,([o,i])=>{let a=zr(o);return s.Every(s.Entries(n),0,([m,c])=>!a.test(m)||Ot(e,t,i,c)&&t.AddKey(m))})}function ol(e,t,r,n,o,i){return s.EveryAll(s.Entries(o.patternProperties),0,([a,m])=>{let c=`${r}/patternProperties/${$t(a)}`,p=zr(a);return s.EveryAll(s.Entries(i),0,([f,d])=>{let g=`${n}/${$t(f)}`;return!p.test(f)||Mt(e,t,c,g,m,d)&&t.AddKey(f)})})}function il(e,t,r,n){return s.IsEqual(n.length,0)||s.Every(r.prefixItems,0,(o,i)=>s.IsLessEqualThan(n.length,i)||Ot(e,t,o,n[i])&&t.AddIndex(i))}function sl(e,t,r,n,o,i){return s.IsEqual(i.length,0)||s.EveryAll(o.prefixItems,0,(a,m)=>{let c=`${r}/prefixItems/${m}`,p=`${n}/${m}`;return s.IsLessEqualThan(i.length,m)||Mt(e,t,c,p,a,i[m])&&t.AddIndex(m)})}function Du(e,t){return e.includes(t)||Me.Get().exactOptionalPropertyTypes}function Nu(e,t){return s.IsUndefined(e[t])}function al(e,t,r,n){let o=In(r)?r.required:[];return s.Every(s.Entries(r.properties),0,([a,m])=>{let c=!s.HasPropertyKey(n,a)||Ot(e,t,m,n[a])&&t.AddKey(a);return Du(o,a)?c:Nu(n,a)||c})}function ml(e,t,r,n,o,i){let a=In(o)?o.required:[];return s.EveryAll(s.Entries(o.properties),0,([c,p])=>{let f=`${r}/properties/${$t(c)}`,d=`${n}/${$t(c)}`,g=()=>!s.HasPropertyKey(i,c)||Mt(e,t,f,d,p,i[c])&&t.AddKey(c);return Du(a,c)?g():Nu(i,c)||g()})}function ul(e,t,r,n){return s.Every(s.Keys(n),0,(o,i)=>Q(e,t,r.propertyNames,o))}function cl(e,t,r,n,o,i){let a=[];return s.EveryAll(s.Keys(i),0,(c,p)=>{let f=`${n}/${$t(c)}`,d=`${r}/propertyNames`,g=ce(e,t,d,f,o.propertyNames,c);return g||a.push(c),g})||t.AddError("propertyNames",r,n,{propertyNames:a})}function pl(e,t,r,n){let o=Bt.RecursiveRef(e,r)??!1,i=o?{...e,pendingResource:!0}:e;return L(o)&&Q(i,t,o,n)}function fl(e,t,r,n,o,i){let a=Bt.RecursiveRef(e,o)??!1,m=a?{...e,pendingResource:!0}:e;return L(a)&&ce(m,t,r,n,a,i)}function dl(e,t,r,n){let o=Bt.Ref(e,r),i=o.schema??!1,a=new ct,m=L(i)&&Q(o.stack,a,i,n);return m&&t.Merge([a]),m}function ll(e,t,r,n,o,i){let a=Bt.Ref(e,o),m=a.schema??!1,c=new et,p=L(m)&&ce(a.stack,c,r,n,m,i);return p&&t.Merge([c]),p||t.AddErrors(c.GetErrors()),p}function gl(e,t,r,n){return s.Every(r.required,0,o=>s.HasPropertyKey(n,o))}function yl(e,t,r,n,o,i){let a=[];return s.EveryAll(o.required,0,c=>{let p=s.HasPropertyKey(i,c);return p||a.push(c),p})||t.AddError("required",r,n,{requiredProperties:a})}function qu(e,t,r,n,o){return s.IsEqual(r,"object")?s.IsObjectNotArray(o):s.IsEqual(r,"array")?s.IsArray(o):s.IsEqual(r,"boolean")?s.IsBoolean(o):s.IsEqual(r,"integer")?s.IsInteger(o):s.IsEqual(r,"number")?s.IsNumber(o):s.IsEqual(r,"null")?s.IsNull(o):s.IsEqual(r,"string")?s.IsString(o):s.IsEqual(r,"bigint")?s.IsBigInt(o):s.IsEqual(r,"constructor")?s.IsConstructor(o):s.IsEqual(r,"function")?s.IsFunction(o):s.IsEqual(r,"symbol")?s.IsSymbol(o):s.IsEqual(r,"undefined")?s.IsUndefined(o):s.IsEqual(r,"void")?s.IsUndefined(o):!0}function xl(e,t,r,n,o){return s.Some(r,i=>qu(e,t,i,n,o))}function hl(e,t,r,n){return s.IsArray(r.type)?xl(e,t,r.type,r,n):qu(e,t,r.type,r,n)}function Il(e,t,r,n,o,i){return(s.IsArray(o.type)?xl(e,t,o.type,o,i):qu(e,t,o.type,o,i))||t.AddError("type",r,n,{type:o.type})}function bl(e,t,r,n){let o=t.GetIndices();return s.Every(n,0,(i,a)=>(o.has(a)||Q(e,t,r.unevaluatedItems,i))&&t.AddIndex(a))}function $l(e,t,r,n,o,i){let a=t.GetIndices(),m=[];return s.EveryAll(i,0,(p,f)=>{let d=new et,g=(a.has(f)||ce(e,d,r,n,o.unevaluatedItems,p))&&t.AddIndex(f);return g||m.push(f),g})||t.AddError("unevaluatedItems",r,n,{unevaluatedItems:m})}function El(e,t,r,n){let o=t.GetKeys();return s.Every(s.Entries(n),0,([i,a])=>o.has(i)||Q(e,t,r.unevaluatedProperties,a)&&t.AddKey(i))}function Sl(e,t,r,n,o,i){let a=t.GetKeys(),m=[];return s.EveryAll(s.Entries(i),0,([p,f])=>{let d=new et,g=a.has(p)||ce(e,d,r,n,o.unevaluatedProperties,f)&&t.AddKey(p);return g||m.push(p),g})||t.AddError("unevaluatedProperties",r,n,{unevaluatedProperties:m})}var Pr={};At(Pr,{Hash:()=>Pl,HashCode:()=>D0});function $e(){throw new Error("Unreachable")}function S0(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let n of Reflect.ownKeys(r))n!=="constructor"&&typeof n!="symbol"&&t.add(n);r=Object.getPrototypeOf(r)}return[...t]}function k0(e){return typeof e=="number"}var St={Array:0,BigInt:1,Boolean:2,Date:3,Constructor:4,Function:5,Null:6,Number:7,Object:8,RegExp:9,String:10,Symbol:11,TypeArray:12,Undefined:13},Bs=8997,Zo=33826,Gs=40164,Ks=52210,wl=new Float64Array(1),Cl=new DataView(wl.buffer),Rl=new Uint8Array(wl.buffer);function Ge(e){let t=Bs^e,r=t*435,n=Zo*435+(r>>>16),o=Gs*435+(n>>>16)+(t<<8),i=Ks*435+(o>>>16)+(Zo<<8);Bs=r&65535,Zo=n&65535,Gs=o&65535,Ks=i&65535}function T0(e){Ge(St.Array);for(let t of e)Wr(t)}function w0(e){Ge(St.BigInt),Cl.setBigInt64(0,e);for(let t of Rl)Ge(t)}function kl(e){Ge(St.Boolean),Ge(e?1:0)}function C0(e){Ge(St.Constructor),Wr(e.toString())}function R0(e){Ge(St.Date),Wr(e.getTime())}function P0(e){Ge(St.Function),Wr(e.toString())}function A0(e){Ge(St.Null)}function Tl(e){Ge(St.Number),Cl.setFloat64(0,e,!0);for(let t of Rl)Ge(t)}function O0(e){Ge(St.Object);for(let t of S0(e).sort())Wr(t),Wr(e[t])}function M0(e){Ge(St.RegExp),Uu(e.toString())}var v0=new TextEncoder;function Uu(e){Ge(St.String);for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127){for(let n of v0.encode(e.slice(t)))Ge(n);return}Ge(r)}}function F0(e){Ge(St.Symbol),Wr(e.toString())}function L0(e){Ge(St.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Ge(t[r])}function j0(e){return Ge(St.Undefined)}function Wr(e){return De.IsTypeArray(e)?L0(e):De.IsDate(e)?R0(e):De.IsRegExp(e)?M0(e):De.IsBoolean(e)?kl(e.valueOf()):De.IsString(e)?Uu(e.valueOf()):De.IsNumber(e)?Tl(e.valueOf()):k0(e)?Tl(e):s.IsArray(e)?T0(e):s.IsBoolean(e)?kl(e):s.IsBigInt(e)?w0(e):s.IsConstructor(e)?C0(e):s.IsNull(e)?A0(e):s.IsObject(e)?O0(e):s.IsString(e)?Uu(e):s.IsSymbol(e)?F0(e):s.IsUndefined(e)?j0(e):s.IsFunction(e)?P0(e):$e()}function _s(e){return e.toString(16).padStart(4,"0")}function D0(e){return BigInt(`0x${Pl(e)}`)}function Pl(e){return Bs=8997,Zo=33826,Gs=40164,Ks=52210,Wr(e),`${_s(Ks)}${_s(Gs)}${_s(Zo)}${_s(Bs)}`}function Al(e){return!s.IsEqual(e.uniqueItems,!1)}function Ol(e,t,r,n){if(!Al(r))return!0;let o=new Set(n.map(Pr.Hash)).size,i=n.length;return s.IsEqual(o,i)}function Ml(e,t,r,n,o,i){if(!Al(o))return!0;let a=new Set,m=i.reduce((p,f,d)=>{let g=Pr.Hash(f);return a.has(g)?[...p,d]:(a.add(g),p)},[]);return s.IsEqual(m.length,0)||t.AddError("uniqueItems",r,n,{duplicateItems:m})}function Ot(e,t,r,n){return t.Push()&&Q(e,t,r,n)&&t.Pop()}function Q(e,t,r,n){let o=Kn(e,r);return ln(r)?iu(o,t,r,n):(!tu(r)||hl(o,t,r,n))&&(!(s.IsObject(n)&&!s.IsArray(n))||(!In(r)||gl(o,t,r,n))&&(!_t(r)||Lf(o,t,r,n))&&(!zm(r)||Kf(o,t,r,n))&&(!Wm(r)||zf(o,t,r,n))&&(!rs(r)||Vf(o,t,r,n))&&(!Un(r)||nl(o,t,r,n))&&(!_n(r)||al(o,t,r,n))&&(!us(r)||ul(o,t,r,n))&&(!Uo(r)||vu(o,t,r,n))&&(!Zm(r)||Ru(o,t,r,n)))&&(!s.IsArray(n)||(!Zi(r)||Mf(o,t,r,n))&&(!Gr(r)||au(o,t,r,n))&&(!gn(r)||Ud(o,t,r,n))&&(!yn(r)||Pu(o,t,r,n))&&(!Qm(r)||ku(o,t,r,n))&&(!xn(r)||Ou(o,t,r,n))&&(!No(r)||wu(o,t,r,n))&&(!hn(r)||il(o,t,r,n))&&(!Hr(r)||Ol(o,t,r,n)))&&(!s.IsString(n)||(!qo(r)||Mu(o,t,r,n))&&(!Xm(r)||Cu(o,t,r,n))&&(!Do(r)||Su(o,t,r,n))&&(!_o(r)||ju(o,t,r,n)))&&(!(s.IsNumber(n)||s.IsBigInt(n))||(!wr(r)||xu(o,t,r,n))&&(!Jm(r)||yu(o,t,r,n))&&(!Cr(r)||Au(o,t,r,n))&&(!Ym(r)||Tu(o,t,r,n))&&(!eu(r)||Fu(o,t,r,n)))&&(!ps(r)||dl(o,t,r,n))&&(!cs(r)||pl(o,t,r,n))&&(!ns(r)||od(o,t,r,n))&&(!Hm(r)||su(o,t,r,n))&&(!Vm(r)||gu(o,t,r,n))&&(!is(r)||Nd(o,t,r,n))&&(!as(r)||Lu(o,t,r,n))&&(!es(r)||Df(o,t,r,n))&&(!ts(r)||qf(o,t,r,n))&&(!ms(r)||el(o,t,r,n))&&(!Go(r)||!s.IsArray(n)||bl(o,t,r,n))&&(!Ko(r)||!s.IsObject(n)||El(o,t,r,n))&&(!Xi(r)||Tf(o,t,r,n))}function Mt(e,t,r,n,o,i){return t.Push()&&ce(e,t,r,n,o,i)&&t.Pop()}function ce(e,t,r,n,o,i){if(t.AtCapacity())return!1;let a=Kn(e,o);return ln(o)?_f(a,t,r,n,o,i):!!(+(!tu(o)||Il(a,t,r,n,o,i))&+(!(s.IsObject(i)&&!s.IsArray(i))||!!(+(!In(o)||yl(a,t,r,n,o,i))&+(!_t(o)||jf(a,t,r,n,o,i))&+(!zm(o)||Hf(a,t,r,n,o,i))&+(!Wm(o)||Wf(a,t,r,n,o,i))&+(!rs(o)||Jf(a,t,r,n,o,i))&+(!Un(o)||ol(a,t,r,n,o,i))&+(!_n(o)||ml(a,t,r,n,o,i))&+(!us(o)||cl(a,t,r,n,o,i))&+(!Uo(o)||Qd(a,t,r,n,o,i))&+(!Zm(o)||zd(a,t,r,n,o,i))))&+(!s.IsArray(i)||!!(+(!Zi(o)||vf(a,t,r,n,o,i))&+(!Gr(o)||Gf(a,t,r,n,o,i))&+(!gn(o)||_d(a,t,r,n,o,i))&+(!yn(o)||Wd(a,t,r,n,o,i))&+(!Qm(o)||Bd(a,t,r,n,o,i))&+(!xn(o)||Jd(a,t,r,n,o,i))&+(!No(o)||Kd(a,t,r,n,o,i))&+(!hn(o)||sl(a,t,r,n,o,i))&+(!Hr(o)||Ml(a,t,r,n,o,i))))&+(!s.IsString(i)||!!(+(!qo(o)||Yd(a,t,r,n,o,i))&+(!Xm(o)||Hd(a,t,r,n,o,i))&+(!Do(o)||Dd(a,t,r,n,o,i))&+(!_o(o)||rl(a,t,r,n,o,i))))&+(!(s.IsNumber(i)||s.IsBigInt(i))||!!(+(!wr(o)||md(a,t,r,n,o,i))&+(!Jm(o)||ad(a,t,r,n,o,i))&+(!Cr(o)||Vd(a,t,r,n,o,i))&+(!Ym(o)||Gd(a,t,r,n,o,i))&+(!eu(o)||Xd(a,t,r,n,o,i))))&+(!ps(o)||ll(a,t,r,n,o,i))&+(!cs(o)||fl(a,t,r,n,o,i))&+(!ns(o)||id(a,t,r,n,o,i))&+(!Hm(o)||Bf(a,t,r,n,o,i))&+(!Vm(o)||sd(a,t,r,n,o,i))&+(!is(o)||qd(a,t,r,n,o,i))&+(!as(o)||Zd(a,t,r,n,o,i))&+(!es(o)||Nf(a,t,r,n,o,i))&+(!ts(o)||Uf(a,t,r,n,o,i))&+(!ms(o)||tl(a,t,r,n,o,i))&+(!Go(o)||!s.IsArray(i)||$l(a,t,r,n,o,i))&+(!Ko(o)||!s.IsObject(i)||Sl(a,t,r,n,o,i)))&&(!Xi(o)||wf(a,t,r,n,o,i))}function Fl(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var N0=Fl;function Ll(){return N0}var l={};At(l,{Assign:()=>U0,Clone:()=>_0,Create:()=>G0,Discard:()=>K0,Metrics:()=>Qt,Update:()=>V0});var Qt={assign:0,create:0,clone:0,discard:0,update:0};function vt(e){return[...s.Keys(e),...s.Symbols(e)]}function jl(e,t){if(!t.has(e)){t.add(e);for(let r of vt(e)){let n=Object.getOwnPropertyDescriptor(e,r);!n||!("value"in n)||s.IsObject(n.value)&&jl(n.value,t)}Object.freeze(e)}}function Vr(e){return Me.Get().immutableTypes&&jl(e,new WeakSet),e}function U0(e,t){Qt.assign+=1;let r={},n=vt(t),o=vt(e);for(let i of o)n.includes(i)||Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(e,i));for(let i of n)Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i));return Vr(r)}function _0(e){Qt.clone+=1;let t={};for(let r of vt(e)){if(s.IsUnsafePropertyKey(r))continue;let n=Object.getOwnPropertyDescriptor(e,r);s.IsEqual(n.enumerable,!0)?t[r]=n.value:Object.defineProperty(t,r,n)}return t}function Dl(e,t){return{...e,...t}}function B0(e,t){for(let r of Object.keys(t))Object.defineProperty(e,r,{configurable:!0,writable:!0,enumerable:!1,value:t[r]});return e}function G0(e,t,r={}){Qt.create+=1;let n=Dl(t,r),o=Me.Get().enumerableKind?Dl(n,e):B0(n,e);return Vr(o)}function K0(e,t){Qt.discard+=1;let r={};for(let n of vt(e)){if(t.includes(n))continue;let o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o)}return Vr(r)}function H0(e,t,r,n){for(let o of vt(e)){if(s.IsUnsafePropertyKey(o)||t.includes(o)||r.includes(o))continue;let i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,i)}}function z0(e,t,r){let n=Me.Get().enumerableKind;for(let o of t)s.IsUnsafePropertyKey(o)||Object.defineProperty(r,o,{configurable:!0,writable:!0,enumerable:n,value:e[o]})}function W0(e,t,r){for(let n of t)s.IsUnsafePropertyKey(n)||Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:e[n]})}function V0(e,t,r){Qt.update+=1;let n={},o=vt(t),i=vt(r);return H0(e,o,i,n),z0(t,o,n),W0(r,i,n),Vr(n)}function Hs(...e){let[t,r,n]=B.Match(e,{3:(f,d,g)=>[f,d,g],2:(f,d)=>[{},f,d]}),o=Gn(t,r),i=new et,a=ce(o,i,"#","",r,n),m=i.GetErrors(),c=Ll(),p=m.map(f=>({...f,message:c(f)}));return[a,p]}var ql=0;function zs(){let e=Qi();ql=e.maxErrors,e.maxErrors=e.maxParseErrors}function Ws(){let e=Qi();e.maxErrors=ql}function Bu(...e){let[t,r,n]=B.Match(e,{3:(a,m,c)=>[a,m,c],2:(a,m)=>[{},a,m]}),o=Gn(t,r),i=new ct;return Q(o,i,r,n)}function K(...e){let[t,r,n]=B.Match(e,{3:(o,i,a)=>[o,i,a],2:(o,i)=>[{},o,i]});return Bu(t,r,n)}function Xt(...e){let[t,r,n]=B.Match(e,{3:(a,m,c)=>[a,m,c],2:(a,m)=>[{},a,m]}),[o,i]=Hs(t,r,n);return i}var Ar=class extends Error{constructor(t,r,n){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:n,value:r},writable:!1,configurable:!1,enumerable:!1})}};function Vs(...e){let[t,r,n]=B.Match(e,{3:(i,a,m)=>[i,a,m],2:(i,a)=>[{},i,a]});if(!K(t,r,n))throw new Ar("Assert",n,Xt(t,r,n))}function w(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function ye(e){return s.IsObject(e)}function R(e,t,r){return l.Create({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:r},{})}function Jr(e){return w(e,"Deferred")}function ur(e,t){return l.Update(e,{"~readonly":!0},t)}function Ul(e,t,r,n){let o=$(e,t,r);return ur(o,n)}function cr(e,t){return l.Update(e,{"~optional":!0},t)}function _l(e,t,r,n){let o=$(e,t,r);return cr(o,n)}function yt(e,t){return l.Create({"~kind":"Array"},{type:"array",items:e},t)}function W(e){return w(e,"Array")}function Jn(e){return l.Discard(e,["~kind","type","items"])}function pr(e,t,r={}){return l.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Ee(e){return w(e,"Constructor")}function Bl(e){return l.Discard(e,["~kind","type","parameters","instanceType"])}function fr(e,t,r={}){return l.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Se(e){return w(e,"Function")}function Gl(e){return l.Discard(e,["~kind","type","parameters","returnType"])}function Be(e,t){return l.Create({"~kind":"Ref"},{$ref:e},t)}function te(e){return w(e,"Ref")}function Yr(e,t){return l.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Yn(e){return w(e,"Generic")}function Qn(e){return l.Create({"~kind":"Any"},{},e)}function Ie(e){return w(e,"Any")}var Kl="(?!)";function ie(e){return l.Create({"~kind":"Never"},{not:{}},e)}function xt(e){return w(e,"Never")}function dr(e,t={}){return R("AddOptional",[e],t)}function Js(e,t={}){return cr(e,t)}function Hl(e){return Js(e)}function ve(e){return ye(e)&&s.HasPropertyKey(e,"~optional")}function zl(e){return s.Keys(e).filter(t=>!ve(e[t]))}function Ys(e){return s.Keys(e)}function Qs(e){return s.Values(e)}function M(e,t={}){let r=zl(e),n=r.length>0?{required:r}:{};return l.Create({"~kind":"Object"},{type:"object",...n,properties:e},t)}function A(e){return w(e,"Object")}function Wl(e){return l.Discard(e,["~kind","type","properties","required"])}function Ne(e){return l.Create({"~kind":"Unknown"},{},e)}function Fe(e){return w(e,"Unknown")}function lr(e,t,r){let n=s.Keys(e).reduce((o,i)=>({...o,[i]:l.Update(e[i],{},{$id:i})}),{});return l.Create({"~kind":"Cyclic"},{$defs:n,$ref:t},r)}function me(e){return w(e,"Cyclic")}function Vl(e){return l.Update(e,{"~unsafe":null},{})}function Xs(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"~unsafe")&&s.IsNull(e["~unsafe"])}function ei(...e){let[t,r]=B.Match(e,{2:(n,o)=>[n,o,o],1:n=>[n,Ne(),Ne()]});return l.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function Le(e){return w(e,"Infer")}function $n(e,t,r,n={}){return l.Create({"~kind":"Dependent"},{if:e,then:t,else:r},n)}function ke(e){return w(e,"Dependent")}function Jl(e){return l.Discard(e,["~kind","if","then","else"])}function Yl(e){return s.IsObjectNotArray(e)}function Ql(e){return s.Keys(e).filter(r=>isNaN(r)).reduce((r,n)=>[...r,e[n]],[])}function Xl(e){return s.IsString(e)||s.IsNumber(e)}function Zl(e,t){let r=Yl(e)?Ql(e):e;return l.Create({"~kind":"Enum"},{enum:r},t)}function Te(e){return w(e,"Enum")}function ot(e,t={}){return l.Create({"~kind":"Intersect"},{allOf:e},t)}function O(e){return w(e,"Intersect")}function eg(e){return l.Discard(e,["~kind","allOf"])}var ti=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,n=pt(r)?a=>this.decode(r["~codec"].decode(a)):this.decode,o=pt(r)?a=>r["~codec"].encode(t(a)):t,i={decode:n,encode:o};return l.Update(this.type,{"~codec":i},{})}},ri=class{constructor(t){this.type=t}Decode(t){return new ti(this.type,t)}};function Zs(e){return new ri(e)}function tg(e,t){return Zs(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function rg(e,t){return Zs(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function pt(e){return ye(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function ng(e){return Xn(e)}function En(e){return ye(e)&&s.HasPropertyKey(e,"~immutable")}function gr(e,t={}){return R("AddReadonly",[e],t)}function ea(e,t={}){return ur(e,t)}function og(e){return ea(e)}function Or(e){return ye(e)&&s.HasPropertyKey(e,"~readonly")}function Q0(e,t){let r=ni(e)?[...e["~refine"],t]:[t];return l.Update(e,{"~refine":r},{})}function ig(...e){let[t,r,n]=B.Match(e,{3:(o,i,a)=>[o,i,a],2:(o,i)=>[o,i,()=>"Refine Error"]});return Q0(t,{check:r,error:n})}function X0(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"error")&&s.IsFunction(e.check)&&s.IsFunction(e.error)}function ni(e){return ye(e)&&s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>X0(t))}var sg="-?(?:0|[1-9][0-9]*)n";function oi(e){return l.Create({"~kind":"BigInt"},{type:"bigint"},e)}function kt(e){return w(e,"BigInt")}function ta(e){return l.Create({"~kind":"Boolean"},{type:"boolean"},e)}function ft(e){return w(e,"Boolean")}function ii(e){return l.Create({"~kind":"Identifier"},{name:e})}function ag(e){return w(e,"Identifier")}var ra="-?(?:0|[1-9][0-9]*)";function Sn(e){return l.Create({"~kind":"Integer"},{type:"integer"},e)}function Ke(e){return w(e,"Integer")}var Gu=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function Z0(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Gu(e)})()}function G(e,t){return l.Create({"~kind":"Literal"},{type:Z0(e),const:e},t)}function na(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function mg(e){return H(e)&&s.IsBigInt(e.const)}function ug(e){return H(e)&&s.IsBoolean(e.const)}function oa(e){return H(e)&&s.IsNumber(e.const)}function ia(e){return H(e)&&s.IsString(e.const)}function H(e){return w(e,"Literal")}function Zn(e){return l.Create({"~kind":"Null"},{type:"null"},e)}function yr(e){return w(e,"Null")}var sa="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function Tt(e){return l.Create({"~kind":"Number"},{type:"number"},e)}function xe(e){return w(e,"Number")}function eo(e){return l.Create({"~kind":"Symbol"},{type:"symbol"},e)}function xr(e){return w(e,"Symbol")}function kn(...e){let[t,r,n]=B.Match(e,{3:(o,i,a)=>[o,i,a],2:(o,i)=>[o,i,i],1:o=>[o,Ne(),Ne()]});return l.Create({"~kind":"Parameter"},{name:t,extends:r,equals:n},{})}function cg(e){return w(e,"Parameter")}var aa=".*";function tt(e){return l.Create({"~kind":"String"},{type:"string"},e)}function qe(e){return w(e,"String")}function j(e,t={}){return l.Create({"~kind":"Union"},{anyOf:e},t)}function S(e){return w(e,"Union")}function pg(e){return l.Discard(e,["~kind","anyOf"])}function si(e){let t=fg(e);return s.IsEqual(t.length,2)?t[0]:[]}function eP(e){return!0}function dg(e){return s.ShiftLeft(e,(t,r)=>tP(t)?dg(r):!1,()=>!0)}function lg(e){return s.IsEqual(e.length,0)?!1:dg(e)}function tP(e){return S(e)?lg(e.anyOf):H(e)?eP(e.const):!1}function ma(e){return lg(e)}function ua(e){return l.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function gg(e,t,r=[]){return s.ShiftLeft(e,(n,o)=>gg(o,t,[...r,`${n}${t}`]),()=>r)}function rP(e,t){return s.IsEqual(e.length,0)?[`${t}`]:gg(e,t)}function yg(e,t,r=[]){return s.ShiftLeft(t,(n,o)=>yg(e,o,[...r,...xg(e,n)]),()=>r)}function xg(e,t){return S(t)?yg(e,t.anyOf):H(t)?rP(e,t.const):$e()}function hg(e,t){return s.ShiftLeft(t,(r,n)=>hg(xg(e,r),n),()=>e)}function nP(e){return e.map(t=>G(t))}function oP(e){let t=hg([],e),r=nP(t);return j(r)}function iP(e){return s.IsEqual(e.length,0)?$e():s.IsEqual(e.length,1)&&H(e[0])?e[0]:oP(e)}function Ku(e){let t=si(e);return s.IsEqual(t.length,0)?tt():ma(t)?iP(t):ua(e)}function to(e){let t=Ku(e);return ue(t)?tt():t}function ht(e,t){let r="object",n={[e]:t};return l.Create({"~kind":"Record"},{type:r,patternProperties:n})}function Ig(e){return ht(Zt,e)}function bg(e){return M({true:e,false:e})}function we(e,t={}){let[r,n,o]=[e,e.length,!1];return l.Create({"~kind":"Tuple"},{type:"array",additionalItems:o,items:r,minItems:n},t)}function q(e){return w(e,"Tuple")}function $g(e){return l.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Hu(e){return e.reduceRight((r,n,o)=>({[o]:n,...r}),{})}function Eg(e){let t=Hu(e.items);return M(t)}function sP(e){return l.Discard(e,["~optional"])}function Tn(e,t){return l.Update(sP(e),{},t)}function Sg(e,t,r,n){let o=$(e,t,r);return Tn(o,n)}function aP(e){return l.Discard(e,["~readonly"])}function ro(e,t){return l.Update(aP(e),{},t)}function kg(e,t,r,n){let o=$(e,t,r);return ro(o,n)}function ca(e,t){let r=Or(e)&&Or(t),n=ve(e)&&ve(t),o=Ce([e,t]),i=ro(Tn(o,{}),{});return r&&n?ur(cr(i,{}),{}):r?ur(i,{}):n?cr(i,{}):i}function Tg(e,t){let r=Or(e)||Or(t),n=ve(e)||ve(t),o=ro(Tn(e,{}),{}),i=ro(Tn(t,{}),{}),a=It([o,i]);return r&&n?ur(cr(a,{}),{}):r?ur(a,{}):n?cr(a,{}):a}function mP(e,t,r){return r in e?r in t?ca(e[r],t[r]):e[r]:r in t?t[r]:ie()}function uP(e,t){return[...new Set([...s.Keys(e),...s.Keys(t)])].reduce((o,i)=>({...o,[i]:mP(e,t,i)}),{})}function wg(e){return A(e)?e.properties:q(e)?Hu(e.items):{}}function Cg(e,t){let r=wg(e),n=wg(t),o=uP(r,n);return M(o)}function cP(e,t){let r=no(e,t);return s.IsEqual(r,mi)?e:s.IsEqual(r,ui)||s.IsEqual(r,ai)?t:ie()}function Rg(e){return A(e)||q(e)}function pP(e,t){let r=Rg(e),n=Rg(t);return r&&n?Cg(e,t):r&&!n?e:!r&&n?t:cP(e,t)}function Pg(e,t){return xt(e)||Ie(e)?e:Fe(e)||xt(t)||Ie(t)?t:Fe(t)?e:pP(e,t)}function fP(e,t){return S(e)||S(t)}function dP(e,t){let r=Gt(e),n=Gt(t);return fP(r,n)?Ce([r,n]):Pg(r,n)}function Ag(e,t,r=[]){return s.ShiftLeft(t,(n,o)=>Ag(e,o,[...r,dP(n,e)]),()=>s.IsEqual(r.length,0)?[e]:r)}function Og(e,t,r=[]){return s.ShiftLeft(e,(n,o)=>Og(o,t,[...r,...ci([n],t)]),()=>r)}function ci(e,t=[]){return s.ShiftLeft(e,(r,n)=>S(r)?ci(n,Og(r.anyOf,t)):ci(n,Ag(r,t)),()=>t)}function lP(e,t){let r=rt({},e,t);return F.IsExtendsTrueLike(r)?[]:[e]}function Mg(e,t,r=[]){return s.ShiftLeft(e,(n,o)=>Mg(o,t,[...r,...lP(n,t)]),()=>r)}function pa(e,t){let r=Gt(e),n=S(r)?r.anyOf:[r],o=Mg(n,t);return It(o)}function er(e,t,r){let n=Ce([e,t]),o=pa(r,e);return It([n,o])}function dt(e,t=[]){return s.ShiftLeft(e,(r,n)=>dt(n,[...t,G(r)]),()=>It(t))}function Ce(e){let t=ci(e),r=zu(t);return It(r)}function it(e){let t=to(e);return Gt(t)}function It(e){let t=zu(e);return Qr(t)}function Gt(e){return ke(e)?er(e.if,e.then,e.else):Te(e)?dt(e.enum):O(e)?Ce(e.allOf):ue(e)?it(e.pattern):S(e)?It(e.anyOf):e}function Qr(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?ie():j(e)}function vg(e,t){let r=dt(e);return Xr(r,t)}function Fg(e,t){return ht(Zr,t)}function Lg(e,t){let r=Ce(e);return Xr(r,t)}function jg(e,t){return s.IsString(e)||s.IsNumber(e)?M({[e]:t}):s.IsEqual(e,!1)?M({false:t}):s.IsEqual(e,!0)?M({true:t}):M({})}function Dg(e,t){return ht(oo,t)}function Ng(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?ht(e.pattern.toString(),t):ht(Zt,t)}function qg(e,t){let r=si(e);return ma(r)?Xr(it(e),t):ht(e,t)}function gP(e){return S(e)?en(e.anyOf):[e]}function en(e,t=[]){return s.ShiftLeft(e,(r,n)=>en(n,[...t,...gP(r)]),()=>t)}function yP(e){return e.some(t=>qe(t)||xe(t)||Ke(t))}function xP(e,t){return s.IsEqual(yP(e),!0)?ht(Zt,t):void 0}function hP(e,t){return e.reduce((r,n)=>H(n)&&(s.IsString(n.const)||s.IsNumber(n.const))?{...r,[n.const]:t}:r,{})}function IP(e,t){let r=hP(e,t);return M(r)}function Ug(e,t){let r=en(e),n=xP(r,t);return ye(n)?n:IP(r,t)}function Xr(e,t){return Ie(e)?Ig(t):ft(e)?bg(t):Te(e)?vg(e.enum,t):Ke(e)?Fg(e,t):O(e)?Lg(e.allOf,t):H(e)?jg(e.const,t):xe(e)?Dg(e,t):S(e)?Ug(e.anyOf,t):qe(e)?Ng(e,t):ue(e)?qg(e.pattern,t):M({})}function Wu(e,t,r){return U([e])?l.Update(Xr(e,t),{},r):fa(e,t,r)}function _g(e,t,r,n,o){let i=$(e,t,r),a=$(e,t,n);return Wu(i,a,o)}var Zr=`^${ra}$`,oo=`^${sa}$`,Zt=`^${aa}$`;function fa(e,t,r={}){return R("Record",[e,t],r)}function io(e,t,r={}){return Wu(e,t,r)}function Bg(e,t){return ht(e,t)}function da(e){return s.IsEqual(e,Zt)?tt():s.IsEqual(e,Zr)?Sn():s.IsEqual(e,oo)?Tt():Ku(e)}function je(e){return s.Keys(e.patternProperties)[0]}function so(e){let t=je(e);return da(t)}function pe(e){return e.patternProperties[je(e)]}function ne(e){return w(e,"Record")}function wn(e){return l.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function tn(e){return w(e,"Rest")}function la(e){return l.Create({"~kind":"This"},{$ref:"#"},e)}function ga(e){return w(e,"This")}function ao(e){return l.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Kt(e){return w(e,"Undefined")}function ya(e){return l.Create({"~kind":"Void"},{type:"void"},e)}function wt(e){return w(e,"Void")}function $P(e,t){return s.IsEqual(e,"Array")?yt(t[0]):s.IsEqual(e,"Capitalize")?ha(t[0]):s.IsEqual(e,"ConstructorParameters")?Sa(t[0]):s.IsEqual(e,"Evaluate")?Hx(t[0]):s.IsEqual(e,"Exclude")?ka(t[0],t[1]):s.IsEqual(e,"Extract")?Ta(t[0],t[1]):s.IsEqual(e,"Index")?li(t[0],t[1]):s.IsEqual(e,"InstanceType")?wa(t[0]):s.IsEqual(e,"Lowercase")?Ia(t[0]):s.IsEqual(e,"NonNullable")?Ca(t[0]):s.IsEqual(e,"Omit")?Ra(t[0],t[1]):s.IsEqual(e,"Parameters")?Pa(t[0]):s.IsEqual(e,"Partial")?Aa(t[0]):s.IsEqual(e,"Pick")?Oa(t[0],t[1]):s.IsEqual(e,"Readonly")?Ma(t[0]):s.IsEqual(e,"KeyOf")?gi(t[0]):s.IsEqual(e,"Record")?fa(t[0],t[1]):s.IsEqual(e,"Required")?va(t[0]):s.IsEqual(e,"ReturnType")?Fa(t[0]):s.IsEqual(e,"Uncapitalize")?ba(t[0]):s.IsEqual(e,"Uppercase")?$a(t[0]):di(Be(e),t)}function Cn(){throw Error("Unreachable")}function Wg(e,t=[]){return s.ShiftLeft(e,(r,n)=>Wg(n,[...t,r[1]]),()=>t)}function Mr(e){return s.IsEqual(e.length,3)?[e[0],...Wg(e[1])]:[]}function Vg(e){return kn(e[0],e[2],e[4])}function Jg(e){return kn(e[0],e[2],e[2])}function Yg(e){return kn(e[0],Ne(),e[2])}function Qg(e){return kn(e,Ne(),Ne())}function Xg(e){return Mr(e)}function Zg(e){return e[1]}function ey(e){return Mr(e)}function ty(e){return e[1]}function ry(e){return $P(e[0],e[1])}function ny(e){return null}function oy(e){return tt()}function iy(e){return Tt()}function sy(e){return ta()}function ay(e){return ao()}function my(e){return Zn()}function uy(e){return Sn()}function cy(e){return oi()}function py(e){return Ne()}function fy(e){return Qn()}function dy(e){return M({})}function ly(e){return ie()}function gy(e){return eo()}function yy(e){return ya()}function xy(e){return la()}function hy(e){return G(BigInt(e))}function Iy(e){return G(s.IsEqual(e,"true"))}function by(e){return G(parseFloat(e))}function $y(e){return G(e)}function Ey(e){return e[1]}function Sy(e){return G(e)}function ky(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Ty(e){return e[1]}function wy(e){return xa(e)}function Cy(e){return s.IsEqual(e.length,6)?$n(e[1],e[3],e[5]):$n(e[1],e[3],Ne())}function Ry(e){return e.length>0}function Py(e){return e.reduce((t,r)=>s.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function Ay(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function Oy(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}function My(e){return s.IsEqual(e.length,2)?e[1]:[]}function Gg(e,t){return t.reduce((r,n)=>{let o=n;return s.IsEqual(o.length,1)?li(r,o[0]):s.IsEqual(o.length,0)?yt(r):Cn()},e)}function Kg(e,t){return s.IsEqual(t.length,3)?Ea(e,t[0],t[1],t[2]):e}function EP(e,t){return s.IsArray(t)&&s.IsEqual(t.length,0)?e:La(e,t)}function vy(e){let[t,r,n,o,i]=e;return EP(Kg(t?gi(Gg(r,n)):Gg(r,n),o),i)}function Vu(e,t){return s.IsEqual(t.length,3)?(()=>{let[r,n,o]=t,i=Vu(n,o);if(s.IsEqual(r,"&"))return O(i)?ot([e,...i.allOf]):ot([e,i]);if(s.IsEqual(r,"|"))return S(i)?j([e,...i.anyOf]):j([e,i]);Cn()})():e}function Fy(e){let[t,r]=e;return Vu(t,r)}function Ly(e){let[t,r]=e;return Vu(t,r)}function jy(e){return Gx(e[1])}function Dy(e){return e[1]}function Ny(e){return Yr(e[0],e[2])}function qy(e){return s.IsEqual(e.length,4)?ei(e[1],e[3]):s.IsEqual(e.length,2)?ei(e[1],Ne()):Cn()}function Uy(e){return`${e}`}function _y(e){return Ke(e[3])?Zr:xe(e[3])?oo:xr(e[3])?Zt:qe(e[3])?Zt:Cn()}function By(e){return e.length>0}function Gy(e){return e.length>0}function Ky(e){let[t,r,n,o,i]=e;return{[r]:t&&n?gr(dr(i)):t&&!n?gr(i):!t&&n?dr(i):i}}function Hy(e){return Mr(e)}function zy(e){return e.reduce((t,r)=>s.HasPropertyKey(r,Zr)||s.HasPropertyKey(r,oo)||s.HasPropertyKey(r,Zt)?[t[0],l.Assign(t[1],r)]:[l.Assign(t[0],r),t[1]],[{},{}])}function Wy(e){return zy(e[1])}function Vy(e){let[t,r]=e,n=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return M(t,n)}function Jy(e){return s.IsEqual(e.length,5)?gr(dr(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?gr(e[3]):dr(e[3]):Cn()}function Yy(e){if(!s.IsArray(e)||!s.IsEqual(e.length,3))return e;let[t,r,n]=e;return t&&n?gr(dr(r)):t&&!n?gr(r):!t&&n?dr(r):r}function Qy(e){return s.IsEqual(e.length,2)?wn(e[1]):s.IsEqual(e.length,1)?e[0]:Cn()}function Xy(e){return Mr(e)}function Zy(e){return we(e[1])}function ex(e){return gr(dr(e[4]))}function tx(e){return gr(e[3])}function rx(e){return dr(e[3])}function nx(e){return e[2]}function ox(e){return s.IsEqual(e.length,2)?wn(e[1]):s.IsEqual(e.length,1)?e[0]:Cn()}function ix(e){return Mr(e)}function sx(e){return fr(e[1],e[4])}function ax(e){return pr(e[2],e[5])}function Hg(e,t){return s.IsEqual(e,"remove")?Kx(t):s.IsEqual(e,"add")?gr(t):t}function mx(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function zg(e,t){return s.IsEqual(e,"remove")?Bx(t):s.IsEqual(e,"add")?dr(t):t}function ux(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function cx(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function px(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?pi(ii(e[3]),e[5],e[6][0],Hg(e[1],zg(e[8],e[10]))):pi(ii(e[3]),e[5],Be(e[3]),Hg(e[1],zg(e[8],e[10])))}function fx(e){return Be(e)}function dx(e){return BigInt(e)}function lx(e){return parseFloat(e)}function gx(e){return s.IsEqual(e,"true")}function yx(e){return null}function xx(e){return{[e[0]]:e[2]}}function hx(e){return Mr(e)}function SP(e){return e.reduce((t,r)=>l.Assign(t,r),{})}function Ix(e){return SP(e[1])}function bx(e){return Mr(e)}function $x(e){return e[1]}function Ex(e){return oi()}function Sx(e){return tt()}function kx(e){return Tt()}function Tx(e){return Sn()}function wx(e){return ie()}function Cx(e){return G(e)}function Rx(e){return j(e[1])}function Px(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Ax(e){return[e[0],...e[1]]}function Ox(e){return e[1]}function Mx(e){return Mr(e)}function vx(e){return s.IsEqual(e.length,2)?e[1]:[]}function Fx(e){let t=e[2],r=e[3],[n,o]=e[4],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Yr(t,fi(r,n,i))}}function Lx(e){let t=e[2],[r,n]=e[3],o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return{[e[1]]:fi(t,r,o)}}function jx(e){return{[e[1]]:Yr(e[2],e[4])}}function Dx(e){return{[e[1]]:e[3]}}function Nx(e){return null}function qx(e){return Mr(e)}function Ux(e){return e[1]}function _x(e){let[t,r]=[e[0],e[1]];return zx(l.Assign(t,zy(r)[0]))}function yi(e){return Y(e.length,2)}function V(e,t,r){return yi(e)?t(e[0],e[1]):r()}function wP(e,t){return Y(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function be(e,t){for(let r=0;r<e.length;r++){let n=wP(e[r],t);if(yi(n))return n}return[]}function Ju(e,t){return Array.from({length:t-e+1},(r,n)=>String.fromCharCode(e+n))}var Wx=[...Ju(97,122),...Ju(65,90)],Yu="0",Qu=Ju(49,57),mo=[Yu,...Qu],Vx=" ",uo=`
1
+ import{b as pf}from"./chunk-27TRKD65.js";import{t as cf}from"./chunk-SVONBXW3.js";import{H as Ye,K as uf,L as jn,a as Gi}from"./chunk-ABDZXFNM.js";import{a as sr}from"./chunk-UTYFLLSM.js";import{a as Nm,b as Dn,c as Nn,d as qm,e as Um,f as Mo,g as _m,h as Br,j as vo}from"./chunk-MVVEYKN6.js";import{a as At}from"./chunk-WOT6VMZA.js";import{spawn as k1}from"node:child_process";import{existsSync as T1,readFileSync as w1}from"node:fs";import{join as C1}from"node:path";var B={};At(B,{Match:()=>Nw});function Nw(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}var Me={};At(Me,{Get:()=>Qi,Reset:()=>FC,Set:()=>LC});var s={};At(s,{CodePointCount:()=>Zw,Counted:()=>sC,Entries:()=>uC,EntriesRegExp:()=>mC,Every:()=>rC,EveryAll:()=>nC,GraphemeCount:()=>Xw,HasPropertyKey:()=>aC,IsArray:()=>Lo,IsBigInt:()=>Fo,IsBoolean:()=>xf,IsClassInstance:()=>Qw,IsConstructor:()=>Hw,IsDeepEqual:()=>Km,IsEqual:()=>Y,IsFunction:()=>hf,IsGreaterEqualThan:()=>bf,IsGreaterThan:()=>Vw,IsInteger:()=>Bm,IsLessEqualThan:()=>If,IsLessThan:()=>Jw,IsMaxLength:()=>eC,IsMinLength:()=>tC,IsMultipleOf:()=>Yw,IsNull:()=>Wi,IsNumber:()=>Vi,IsObject:()=>jo,IsObjectNotArray:()=>zw,IsString:()=>Ji,IsSymbol:()=>Ww,IsUndefined:()=>Gm,IsUnsafePropertyKey:()=>Ef,IsValueLike:()=>$f,Keys:()=>zi,ShiftLeft:()=>Yi,Some:()=>oC,SomeAll:()=>iC,Symbols:()=>cC,Values:()=>pC});function qn(e,t,r){return e>=t&&e<=r}function qw(e){return e===8205}function ff(e){return qn(e,127462,127487)}function Uw(e){return qn(e,65024,65039)}function _w(e){return qn(e,768,879)||qn(e,6832,6911)||qn(e,7616,7679)||qn(e,65056,65071)}function Ki(e){return e>65535?2:1}function df(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(_w(r)||Uw(r))t+=Ki(r);else break}return t}function Bw(e,t){let r=e.codePointAt(t),n=t+Ki(r);for(n=df(e,n);n<e.length-1&&qw(e.codePointAt(n));){let o=e.codePointAt(n+1);n+=1+Ki(o),n=df(e,n)}return ff(r)&&n<e.length&&ff(e.codePointAt(n))&&(n+=Ki(e.codePointAt(n))),n}function lf(e){let t=0,r=0;for(;r<e.length;)r=Bw(e,r),t++;return t}function Hi(e){let t=0,r=0,n=0;for(;r<e.length;){let o=e.charCodeAt(r++)>>10;t+=+((n<<8|o)!==13879),n=o}return t}function gf(e,t){return e.length<=t||e.length<=t<<1&&Hi(e)<=t}function yf(e,t){return e.length>=t<<1||e.length>=t&&Hi(e)>=t}function Lo(e){return Array.isArray(e)}function Fo(e){return Y(typeof e,"bigint")}function xf(e){return Y(typeof e,"boolean")}function Hw(e){if(Gm(e)||!hf(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function hf(e){return Y(typeof e,"function")}function Bm(e){return Number.isInteger(e)}function Wi(e){return Y(e,null)}function Vi(e){return Number.isFinite(e)}function zw(e){return jo(e)&&!Lo(e)}function jo(e){return Y(typeof e,"object")&&!Wi(e)}function Ji(e){return Y(typeof e,"string")}function Ww(e){return Y(typeof e,"symbol")}function Gm(e){return Y(e,void 0)}function Y(e,t){return e===t}function Vw(e,t){return e>t}function Jw(e,t){return e<t}function If(e,t){return e<=t}function bf(e,t){return e>=t}function Yw(e,t){if(Fo(e)||Fo(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!Vi(e)||Bm(e)&&1/t%1===0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<r}function Qw(e){if(!jo(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return Wi(t)?!1:Y(typeof t.constructor,"function")&&!(Y(t.constructor,globalThis.Object)||Y(t.constructor.name,"Object"))}function $f(e){return Fo(e)||xf(e)||Wi(e)||Vi(e)||Ji(e)||Gm(e)}function Xw(e){return lf(e)}function Zw(e){return Hi(e)}function eC(e,t){return gf(e,t)}function tC(e,t){return yf(e,t)}function rC(e,t,r){return e.every((n,o)=>o<t||r(n,o))}function nC(e,t,r){let n=!0;return e.forEach((o,i)=>{i>=t&&!r(o,i)&&(n=!1)}),n}function oC(e,t){return e.some((r,n)=>t(r,n))}function iC(e,t){let r=!1;return e.forEach((n,o)=>{t(n,o)&&(r=!0)}),r}function sC(e,t){return e.reduce((r,n,o)=>t(n,o)?++r:r,0)}function Yi(e,t,r){return Y(e.length,0)?r():t(e[0],e.slice(1))}function Ef(e){return Y(e,"__proto__")||Y(e,"constructor")||Y(e,"prototype")}function aC(e,t){return Ef(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function mC(e){return zi(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function uC(e){return Object.entries(e)}function zi(e){return Object.getOwnPropertyNames(e)}function cC(e){return Object.getOwnPropertySymbols(e)}function pC(e){return Object.values(e)}function fC(e,t){if(!jo(t))return!1;let r=zi(e);return Y(r.length,zi(t).length)&&r.every(n=>Km(e[n],t[n]))}function dC(e,t){return Lo(t)&&Y(e.length,t.length)&&e.every((r,n)=>Km(e[n],t[n]))}function Km(e,t){return Lo(e)?dC(e,t):jo(e)?fC(e,t):Y(e,t)}var De={};At(De,{IsBigInt64Array:()=>CC,IsBigUint64Array:()=>RC,IsBoolean:()=>lC,IsDate:()=>AC,IsFloat32Array:()=>TC,IsFloat64Array:()=>wC,IsInt16Array:()=>$C,IsInt32Array:()=>SC,IsInt8Array:()=>hC,IsMap:()=>MC,IsNumber:()=>gC,IsRegExp:()=>PC,IsSet:()=>OC,IsString:()=>yC,IsTypeArray:()=>xC,IsUint16Array:()=>EC,IsUint32Array:()=>kC,IsUint8Array:()=>IC,IsUint8ClampedArray:()=>bC});function lC(e){return e instanceof Boolean}function gC(e){return e instanceof Number}function yC(e){return e instanceof String}function xC(e){return globalThis.ArrayBuffer.isView(e)}function hC(e){return e instanceof globalThis.Int8Array}function IC(e){return e instanceof globalThis.Uint8Array}function bC(e){return e instanceof globalThis.Uint8ClampedArray}function $C(e){return e instanceof globalThis.Int16Array}function EC(e){return e instanceof globalThis.Uint16Array}function SC(e){return e instanceof globalThis.Int32Array}function kC(e){return e instanceof globalThis.Uint32Array}function TC(e){return e instanceof globalThis.Float32Array}function wC(e){return e instanceof globalThis.Float64Array}function CC(e){return e instanceof globalThis.BigInt64Array}function RC(e){return e instanceof globalThis.BigUint64Array}function PC(e){return e instanceof globalThis.RegExp}function AC(e){return e instanceof globalThis.Date}function OC(e){return e instanceof globalThis.Set}function MC(e){return e instanceof globalThis.Map}var Sf=s;var Vt={immutableTypes:!1,maxErrors:8,maxParseErrors:1,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function FC(){Vt.immutableTypes=!1,Vt.maxErrors=8,Vt.maxParseErrors=1,Vt.maxInstantiationCount=128,Vt.useAcceleration=!0,Vt.exactOptionalPropertyTypes=!1,Vt.enumerableKind=!1,Vt.correctiveParse=!1,Vt.unionPrioritySort=!0}function LC(e){for(let t of s.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(Vt,t,{value:r})}}function Qi(){return Vt}function Xi(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"check")&&s.HasPropertyKey(t,"error")&&s.IsFunction(t.check)&&s.IsFunction(t.error))}function gt(e){return s.IsObject(e)&&!s.IsArray(e)}function ln(e){return s.IsBoolean(e)}function L(e){return gt(e)||ln(e)}function Zi(e){return s.HasPropertyKey(e,"additionalItems")&&L(e.additionalItems)}function _t(e){return s.HasPropertyKey(e,"additionalProperties")&&L(e.additionalProperties)}function es(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>L(t))}function kf(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function ts(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>L(t))}function Hm(e){return s.HasPropertyKey(e,"const")}function Gr(e){return s.HasPropertyKey(e,"contains")&&L(e.contains)}function bt(e){return s.HasPropertyKey(e,"default")}function zm(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>L(t)||s.IsArray(t)&&t.every(r=>s.IsString(r)))}function Wm(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(r=>s.IsString(r)))}function rs(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>L(t))}function Kr(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function ns(e){return s.HasPropertyKey(e,"$dynamicRef")&&s.IsString(e.$dynamicRef)}function os(e){return s.HasPropertyKey(e,"else")&&L(e.else)}function Vm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function Jm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function wr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Do(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function ut(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function is(e){return s.HasPropertyKey(e,"if")&&L(e.if)}function gn(e){return s.HasPropertyKey(e,"items")&&(L(e.items)||s.IsArray(e.items)&&e.items.every(t=>L(t)))}function ss(e){return gn(e)&&s.IsArray(e.items)}function Ym(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Qm(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function No(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Xm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Zm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Cr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function yn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function xn(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function qo(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function Uo(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function eu(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function as(e){return s.HasPropertyKey(e,"not")&&L(e.not)}function ms(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>L(t))}function _o(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Un(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>L(t))}function hn(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>L(t))}function _n(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>L(t))}function us(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||L(e.propertyNames))}function jC(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Bo(e){return jC(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function cs(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function ps(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function In(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function fs(e){return s.HasPropertyKey(e,"then")&&L(e.then)}function tu(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Hr(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Go(e){return s.HasPropertyKey(e,"unevaluatedItems")&&L(e.unevaluatedItems)}function Ko(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&L(e.unevaluatedProperties)}var ct=class{constructor(){let t=new Set,r=new Set;this.stack=[{indices:t,keys:r}]}Push(){let t=new Set,r=new Set;return this.stack.push({indices:t,keys:r}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(let r of t)r.GetIndices().forEach(n=>this.GetIndices().add(n)),r.GetKeys().forEach(n=>this.GetKeys().add(n));return!0}},et=class extends ct{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=Me.Get().maxErrors}AddError(t,r,n,o){return this.AddErrorObject({keyword:t,schemaPath:r,instancePath:n,params:o})}AddErrors(t){return t.forEach(r=>this.AddErrorObject(r)),!1}GetErrors(){return this.errors}AddErrorObject(t){return this.AtCapacity()||this.errors.push(t),!1}};function Tf(e,t,r,n){return s.Every(r["~refine"],0,(o,i)=>o.check(n))}function wf(e,t,r,n,o,i){return s.EveryAll(o["~refine"],0,(a,m)=>a.check(i)||t.AddError("~refine",r,n,{index:m,message:a.error(i)}))}var Ho="urn:typebox:root";function Rr(e,t){return URL.canParse(e,t)?new URL(e,t):s.IsEqual(t,Ho)?new URL(`${t}:${e}`):new URL(`${t.slice(0,t.lastIndexOf(":"))}:${e}`)}function Gn(e,t){let r=gt(t)&&ut(t)?Rr(t.$id,Ho).href:Ho;return{context:e,schema:t,lexicalSchema:t,lexicalBase:r,resourceBase:r,referenceBase:r,ids:[],useResourceBaseForReference:!0,recursiveAnchor:void 0,dynamicAnchors:[],resourceEntries:new Map,pendingResource:!0,enteredResource:!1}}function ru(e,t,r=!0){if(ln(t))return e;if(Array.isArray(t))return t.reduce((o,i)=>ru(o,i,!1),e);if(!gt(t)||!r&&ut(t))return e;let n=!r&&Kr(t)?[...e,t]:e;return Object.keys(t).reduce((o,i)=>ru(o,t[i],!1),n)}function zo(e,t){return e.resourceEntries.get(t)}function Cf(e,t){return e.enteredResource||zo(e,t)!==void 0}function DC(e){return!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)}function NC(e,t){return ut(t)?[...e.ids,t]:e.ids}function qC(e,t){return e.recursiveAnchor??(Bo(t)?t:void 0)}function UC(e,t){let r=ut(t)?ru(e.dynamicAnchors,t):e.dynamicAnchors;return Kr(t)?[...r,t]:r}function _C(e,t){return ut(t)?!1:e.pendingResource}function Rf(e,t){let r=zo(e,t);return r?r.base:ut(t)?Rr(t.$id,e.lexicalBase).href:e.lexicalBase}function Pf(e,t){let r=zo(e,t);return r?r.base:ut(t)&&e.pendingResource?Rr(t.$id,e.resourceBase).href:e.resourceBase}function Af(e,t){return ut(t)?!DC(t):e.useResourceBaseForReference}function BC(e,t){let r=Cf(e,t),n=Af(e,t);return r||n?Pf(e,t):Rf(e,t)}function GC(e,t){let r=zo(e,t);return r?r.root:ut(t)?t:e.lexicalSchema}function KC(e,t){return gt(t)&&(ut(t)||Kr(t)||s.IsUndefined(e.recursiveAnchor)&&Bo(t)||!s.IsUndefined(zo(e,t)))}function Kn(e,t){return KC(e,t)?{...e,ids:NC(e,t),dynamicAnchors:UC(e,t),recursiveAnchor:qC(e,t),pendingResource:_C(e,t),lexicalBase:Rf(e,t),resourceBase:Pf(e,t),useResourceBaseForReference:Af(e,t),referenceBase:BC(e,t),lexicalSchema:GC(e,t),enteredResource:Cf(e,t)}:e}function Of(e){return gn(e)&&s.IsArray(e.items)}function Mf(e,t,r,n){return Of(r)?s.Every(n,0,(i,a)=>s.IsLessThan(a,r.items.length)||Ot(e,t,r.additionalItems,i)&&t.AddIndex(a)):!0}function vf(e,t,r,n,o,i){return Of(o)?s.Every(i,0,(m,c)=>{let p=`${r}/additionalItems`,f=`${n}/${c}`;return s.IsLessThan(c,o.items.length)||Mt(e,t,p,f,o.additionalItems,m)&&t.AddIndex(c)}):!0}function $t(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function zr(e){return new RegExp(e,"u")}function HC(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Ff(e){let t=[];return Un(e)&&t.push(...s.Keys(e.patternProperties)),_n(e)&&t.push(...s.Keys(e.properties).map(HC)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function Lf(e,t,r,n){let o=zr(Ff(r));return s.Every(s.Keys(n),0,(a,m)=>o.test(a)||Ot(e,t,r.additionalProperties,n[a])&&t.AddKey(a))}function jf(e,t,r,n,o,i){let a=zr(Ff(o)),m=[];return s.EveryAll(s.Keys(i),0,(p,f)=>{let d=`${r}/additionalProperties`,g=`${n}/${$t(p)}`,y=a.test(p)||Mt(e,t,d,g,o.additionalProperties,i[p])&&t.AddKey(p);return y||m.push(p),y})||t.AddError("additionalProperties",r,n,{additionalProperties:m})}function Df(e,t,r,n){let o=r.allOf.reduce((i,a)=>{let m=new ct;return Q(e,m,a,n)?[...i,m]:i},[]);return s.IsEqual(o.length,r.allOf.length)&&t.Merge(o)}function Nf(e,t,r,n,o,i){let a=[],m=o.allOf.reduce((p,f,d)=>{let g=`${r}/allOf/${d}`,y=new et,I=ce(e,y,g,n,f,i);return I||a.push(y),I?[...p,y]:p},[]),c=s.IsEqual(m.length,o.allOf.length)&&t.Merge(m);return c||a.forEach(p=>t.AddErrors(p.GetErrors())),c}function qf(e,t,r,n){let o=r.anyOf.reduce((i,a)=>{let m=new ct;return Q(e,m,a,n)?[...i,m]:i},[]);return s.IsGreaterThan(o.length,0)&&t.Merge(o)}function Uf(e,t,r,n,o,i){let a=[],m=o.anyOf.reduce((p,f,d)=>{let g=new et,y=`${r}/anyOf/${d}`,I=ce(e,g,y,n,f,i);return I||a.push(g),I?[...p,g]:p},[]),c=s.IsGreaterThan(m.length,0)&&t.Merge(m);return c||a.forEach(p=>t.AddErrors(p.GetErrors())),c||t.AddError("anyOf",r,n,{})}function iu(e,t,r,n){return r}function _f(e,t,r,n,o,i){return iu(e,t,o,i)||t.AddError("boolean",r,n,{})}function su(e,t,r,n){return s.IsValueLike(r.const)?s.IsEqual(n,r.const):s.IsDeepEqual(n,r.const)}function Bf(e,t,r,n,o,i){return su(e,t,o,i)||t.AddError("const",r,n,{allowedValue:o.const})}function zC(e){return!(yn(e)&&s.IsEqual(e.minContains,0))}function au(e,t,r,n){return zC(r)?!s.IsEqual(n.length,0)&&s.SomeAll(n,(o,i)=>Q(e,t,r.contains,o)&&t.AddIndex(i)):!0}function Gf(e,t,r,n,o,i){return au(e,t,o,i)||t.AddError("contains",r,n,{minContains:1})}function Kf(e,t,r,n){let o=s.IsEqual(s.Keys(n).length,0),i=s.Every(s.Entries(r.dependencies),0,([a,m])=>!s.HasPropertyKey(n,a)||(s.IsArray(m)?m.every(c=>s.HasPropertyKey(n,c)):Q(e,t,m,n)));return o||i}function Hf(e,t,r,n,o,i){let a=s.IsEqual(s.Keys(i).length,0),m=s.EveryAll(s.Entries(o.dependencies),0,([c,p])=>{let f=`${r}/dependencies/${$t(c)}`;return!s.HasPropertyKey(i,c)||(s.IsArray(p)?p.every(d=>s.HasPropertyKey(i,d)||t.AddError("dependencies",r,n,{property:c,dependencies:p})):ce(e,t,f,n,p,i))});return a||m}function zf(e,t,r,n){let o=s.IsEqual(s.Keys(n).length,0),i=s.Every(s.Entries(r.dependentRequired),0,([a,m])=>!s.HasPropertyKey(n,a)||m.every(c=>s.HasPropertyKey(n,c)));return o||i}function Wf(e,t,r,n,o,i){let a=s.IsEqual(s.Keys(i).length,0),m=s.EveryAll(s.Entries(o.dependentRequired),0,([c,p])=>!s.HasPropertyKey(i,c)||s.EveryAll(p,0,f=>s.HasPropertyKey(i,f)||t.AddError("dependentRequired",r,n,{property:c,dependencies:p})));return a||m}function Vf(e,t,r,n){let o=s.IsEqual(s.Keys(n).length,0),i=s.Every(s.Entries(r.dependentSchemas),0,([a,m])=>!s.HasPropertyKey(n,a)||Q(e,t,m,n));return o||i}function Jf(e,t,r,n,o,i){let a=s.IsEqual(s.Keys(i).length,0),m=s.EveryAll(s.Entries(o.dependentSchemas),0,([c,p])=>{let f=`${r}/dependentSchemas/${$t(c)}`;return!s.HasPropertyKey(i,c)||ce(e,t,f,n,p,i)});return a||m}var Bt={};At(Bt,{DynamicRef:()=>SR,RecursiveRef:()=>bR,Ref:()=>hR});var mr={};At(mr,{Delete:()=>YC,Get:()=>VC,Has:()=>WC,Indices:()=>Vo,Set:()=>JC});function Qf(e){throw Error(e)}function Yf(){Qf("Pointer contains unsafe property key")}function mu(){Qf("Cannot set value")}function Vo(e){let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t[0]===""?t.slice(1):t}function WC(e,t){let r=e;for(let n of Vo(t)){if(!s.IsObject(r)||!s.HasPropertyKey(r,n))return!1;r=r[n]}return!0}function VC(e,t){let r=e;for(let n of Vo(t)){if(!s.IsObject(r)||s.IsUnsafePropertyKey(n))return;r=r[n]}return r}function Xf(e,t,r){let n=e;for(let o of t)s.IsUnsafePropertyKey(o)&&Yf(),n=s.IsObject(n)?n[o]:void 0;return s.IsUnsafePropertyKey(r)&&Yf(),s.IsObject(n)||mu(),n}function JC(e,t,r){let n=Vo(t),o=n.pop();return s.IsUndefined(o)&&mu(),Xf(e,n,o)[o]=r,e}function YC(e,t){let r=Vo(t),n=r.pop();s.IsUndefined(n)&&mu();let o=Xf(e,r,n);return s.IsArray(o)&&/^(0|[1-9]\d*)$/.test(n)?o.splice(Number(n),1):delete o[n],e}function pu(e,t){return gt(e)&&ut(e)?Rr(e.$id,t.href):t}function fu(e){return Rr(e,Ho)}function uu(e){return e.href.split("#")[0]}function QC(e,t,r){return cu(e,fu(t),r)}function XC(e,t){return t.$ref.startsWith("#")||e.enteredResource?e.lexicalSchema:e.schema}function ZC(e){return e.startsWith("#/")}function Zf(e,t){if(s.IsObject(e)&&Kr(e)&&s.IsEqual(e.$dynamicAnchor,t))return e;if(s.IsObject(e))for(let r of s.Keys(e)){let n=Zf(e[r],t);if(n)return n}}function cu(e,t,r){if(s.IsEqual(e,r))return t.href;let n=pu(e,t);if(s.IsArray(e))for(let o of e){let i=cu(o,n,r);if(!s.IsUndefined(i))return i}else if(s.IsObject(e))for(let o of s.Keys(e)){let i=cu(e[o],n,r);if(!s.IsUndefined(i))return i}}function ed(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;let r=decodeURIComponent(t.hash.slice(1));if(r.startsWith("/"))return mr.Get(e,r)}function eR(e,t,r){if(!ut(e))return;if(s.IsEqual(e.$id,r.hash))return e;let n=new URL(r.href,t.href);if(s.IsEqual(t.pathname,n.pathname))return r.hash.startsWith("#")?ed(e,r):e}function tR(e,t,r){if(!kf(e))return;let n=new URL(`#${e.$anchor}`,t.href),o=new URL(r.href,t.href);return s.IsEqual(n.href,o.href)?e:void 0}function rR(e,t,r){if(!Kr(e))return;let n=new URL(`#${e.$dynamicAnchor}`,t.href),o=new URL(r.href,t.href);return s.IsEqual(n.href,o.href)?e:void 0}function nR(e,t,r){if(gt(e))return eR(e,t,r)??tR(e,t,r)??rR(e,t,r)??ed(e,r)}function oR(e,t,r){if(s.IsArray(e))return e.reduce((n,o)=>{let i=ds(o,t,r);return s.IsUndefined(i)?n:i},void 0)}function iR(e,t,r){if(s.IsObject(e))return s.Keys(e).reduce((n,o)=>{if(s.IsEqual(o,"const")||s.IsEqual(o,"enum"))return n;let i=ds(e[o],t,r);return s.IsUndefined(i)?n:i},void 0)}function ds(e,t,r){let n=pu(e,t);return nR(e,n,r)??oR(e,n,r)??iR(e,n,r)}function sR(e,t,r,n){let o=ls(e,t,r,n);return gt(o)&&ut(o)?o:void 0}function aR(e,t,r){if(!t.$ref.startsWith("#")||!gt(e.schema)||s.HasPropertyKey(e.schema,"$schema"))return;let n=QC(e.lexicalSchema,e.referenceBase,r);if(!(s.IsUndefined(n)||s.IsEqual(n,e.referenceBase)))return{target:r,base:n,root:e.lexicalSchema}}function mR(e,t,r){let n=e.context[t];if(gt(n))return{target:r,base:t,root:n}}function uR(e,t,r,n,o){let i=o?mR(e,n,r):void 0;return s.IsUndefined(i)?aR(e,t,r):i}function cR(e,t,r){if(ut(r))return;let n=sR(e.context,e.schema,e.referenceBase,t);if(!(!n||e.ids.includes(n)))return{resource:n}}function pR(e,t){return s.HasPropertyKey(e,t)?e[t]:void 0}function fR(e,t,r){return ds(e,t,r)}function dR(e,t,r){let n=uu(r);if(!s.HasPropertyKey(e,n)||s.IsEqual(n,uu(t)))return;let o=e[n],i=pu(o,new URL(n));return s.IsEqual(r.hash,"")?o:ds(o,i,r)}function ls(e,t,r,n){let o=fu(r),i=Rr(n,o.href);return pR(e,n)??fR(t,o,i)??dR(e,o,i)}function lR(e,t){if(!t)return e;let r=new Map(e.resourceEntries);return r.set(t.target,{base:t.base,root:t.root}),{...e,resourceEntries:r}}function gR(e,t){return t?Kn(e,t.resource):e}function td(e,t,r,n){let o=lR({...e,pendingResource:t},r);return gR(o,n)}function yR(e,t,r){let n=uu(Rr(t.$ref,e.referenceBase)),o=!s.IsEqual(n,e.resourceBase),i=uR(e,t,r,n,o),a=o?cR(e,n,r):void 0;return{schema:r,stack:td(e,!0,i,a)}}function xR(e,t){return{schema:t,stack:td(e,!s.IsUndefined(t))}}function hR(e,t){let r=ls(e.context,XC(e,t),e.referenceBase,t.$ref);return gt(r)?yR(e,t,r):xR(e,r)}function IR(e){return gt(e.lexicalSchema)&&Bo(e.lexicalSchema)}function bR(e,t){let r=IR(e)?e.recursiveAnchor:e.lexicalSchema;return ls(e.context,r,e.lexicalBase,t.$recursiveRef)}function rd(e,t){return Rr(t.$dynamicRef,fu(e.lexicalBase).href).hash}function nd(e,t){return e.dynamicAnchors.find(r=>s.IsEqual(r.$dynamicAnchor,t))??Zf(e.schema,t)}function $R(e,t,r){if(!gt(r)||!Kr(r))return r;let n=rd(e,t);return ZC(n)?r:nd(e,r.$dynamicAnchor)}function ER(e,t){let r=rd(e,t);return nd(e,decodeURIComponent(r.slice(1)))}function SR(e,t){let r=t.$dynamicRef.startsWith("#")?e.lexicalSchema:e.schema,n=ls(e.context,r,e.lexicalBase,t.$dynamicRef);return s.IsUndefined(n)?ER(e,t):$R(e,t,n)}function od(e,t,r,n){let o=Bt.DynamicRef(e,r)??!1,i=o?{...e,pendingResource:!0}:e;return L(o)&&Q(i,t,o,n)}function id(e,t,r,n,o,i){let a=Bt.DynamicRef(e,o)??!1,m=a?{...e,pendingResource:!0}:e;return L(a)&&ce(m,t,r,n,a,i)}function gu(e,t,r,n){return s.Some(r.enum,o=>s.IsValueLike(o)?s.IsEqual(n,o):s.IsDeepEqual(n,o))}function sd(e,t,r,n,o,i){return gu(e,t,o,i)||t.AddError("enum",r,n,{allowedValues:o.enum})}function yu(e,t,r,n){return s.IsLessThan(n,r.exclusiveMaximum)}function ad(e,t,r,n,o,i){return yu(e,t,o,i)||t.AddError("exclusiveMaximum",r,n,{comparison:"<",limit:o.exclusiveMaximum})}function xu(e,t,r,n){return s.IsGreaterThan(n,r.exclusiveMinimum)}function md(e,t,r,n,o,i){return xu(e,t,o,i)||t.AddError("exclusiveMinimum",r,n,{comparison:">",limit:o.exclusiveMinimum})}var Xo={};At(Xo,{Clear:()=>Ld,Entries:()=>f0,Get:()=>g0,Has:()=>l0,IsDate:()=>zn,IsDateTime:()=>gs,IsDuration:()=>ys,IsEmail:()=>xs,IsHostname:()=>Ts,IsIPv4:()=>Rs,IsIPv6:()=>Ps,IsIdnEmail:()=>ws,IsIdnHostname:()=>Cs,IsIri:()=>Os,IsIriReference:()=>As,IsJsonPointer:()=>vs,IsJsonPointerUriFragment:()=>Ms,IsRegex:()=>Fs,IsRelativeJsonPointer:()=>Ls,IsTime:()=>Wn,IsUri:()=>Ns,IsUriReference:()=>js,IsUriTemplate:()=>Ds,IsUrl:()=>qs,IsUuid:()=>Us,Reset:()=>jd,Set:()=>d0,Test:()=>y0});var kR=[0,31,28,31,30,31,30,31,31,30,31,30,31],TR=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function wR(e){return e%4===0&&(e%100!==0||e%400===0)}function zn(e){let t=TR.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&wR(r)?29:kR[n])}var CR=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Wn(e,t=!0){let r=CR.exec(e);if(!r||t&&!r[4]&&!r[5])return!1;let n=+r[1],o=+r[2],i=+r[3];if(n>23||o>59||i>60)return!1;if(r[5]){let f=+r[6],d=+r[7];if(f>23||d>59)return!1}if(i<60)return!0;let a=r[5]==="-"?-1:1,m=+(r[6]||0),c=+(r[7]||0);return((n*60+o-a*(m*60+c))%1440+1440)%1440===1439}var RR=/^(?:\[!?(?:(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13}(?:\/(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13})*|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])\](?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*|(?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*)$/;function gs(e){let t=e.indexOf("["),r=t===-1?e:e.slice(0,t);if(t!==-1&&!RR.test(e.slice(t)))return!1;let n=r.split(/T/i);return n.length===2&&zn(n[0])&&Wn(n[1])}var PR=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function ys(e){return PR.test(e)}var AR=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function xs(e){return AR.test(e)}var ud=/^(?!-).*(?<!-)$/,cd=/^(?!..--)/,pd=/^[a-zA-Z0-9-]*$/,uG=new RegExp("^\\p{ASCII}*$","u"),Vn=/[^\p{ASCII}]/u;var OR=/[0-9]/,fd=/[\u{0660}-\u{0669}]/u,MR=/[\u{06f0}-\u{06f9}]/u,vR=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,FR=/[\u{002d}\u{002b}]/u,hu=new RegExp("\\p{Mn}","u"),LR=new RegExp("\\p{Mc}","u"),cG=new RegExp("\\p{Me}","u"),dd=/[\p{Mn}\p{Mc}\p{Me}]/u,Iu=new RegExp("\\p{L}","u"),jR=new RegExp("\\p{Nd}","u"),ld=new RegExp("\\p{Script=Greek}","u"),hs=new RegExp("\\p{Script=Hebrew}","u"),gd=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,yd=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,bu=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,xd=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,DR=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,NR=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,hd=new RegExp([OR,MR].map(e=>e.source).join("|"),"u"),Id=new RegExp([Iu,FR,vR,jR,hu,LR,DR,NR].map(e=>e.source).join("|"),"u");function bd(e){return ud.test(e)&&cd.test(e)&&pd.test(e)}var Yt=36,Yo=1,Qo=26,UR=38,_R=700,Ed=72,Sd=128;function $u(){throw null}function Is(e){return e.toLowerCase().startsWith("xn--")}function kd(e,t,r){e=r?Math.floor(e/_R):e>>1,e+=Math.floor(e/t);let n=0;for(;e>(Yt-Yo)*Qo>>1;)e=Math.floor(e/(Yt-Yo)),n+=Yt;return n+Math.floor((Yt-Yo+1)*e/(e+UR))}function bs(e){let t=[],r=Sd,n=0,o=Ed,i=e.lastIndexOf("-");if(i>0)for(let m=0;m<i;m++){let c=e.charCodeAt(m);c>=128&&$u(),t.push(c)}let a=i<0?0:i+1;for(;a<e.length;){let m=n,c=1,p=Yt;for(;;){a>=e.length&&$u();let d=e.charCodeAt(a++),g;d>=97&&d<=122?g=d-97:d>=48&&d<=57?g=d-48+26:$u(),n+=g*c;let y=p<=o?Yo:p>=o+Qo?Qo:p-o;if(g<y)break;c*=Yt-y,p+=Yt}let f=t.length+1;o=kd(n-m,f,m===0),r+=Math.floor(n/f),n%=f,t.splice(n,0,r),n++}return String.fromCodePoint(...t)}function $d(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var BR=new RegExp(Vn.source,"gu");function Td(e){let t=e.replace(BR,""),r=t.length,n=r>0?[t,"-"]:[],o=Array.from(e,p=>p.codePointAt(0)),i=Sd,a=0,m=Ed,c=r;for(;c<o.length;){let p=1/0;for(let f of o)f>=i&&f<p&&(p=f);a+=(p-i)*(c+1),i=p;for(let f of o)if(f<i&&a++,f===i){let d=a;for(let g=Yt;;g+=Yt){let y=g<=m?Yo:g>=m+Qo?Qo:g-m;if(d<y)break;let I=y+(d-y)%(Yt-y);n.push($d(I)),d=Math.floor((d-y)/(Yt-y))}n.push($d(d)),m=kd(a,c+1,c===r),a=0,c++}a++,i++}return n.join("")}var GR=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,wd=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,KR=/^(?:R|AL|AN)$/;function Cd(e){if(Is(e))try{return $s(bs(e.slice(4).toLowerCase()))}catch{return!1}return $s(e)}function Rd(e){let t=String.fromCodePoint(e);return hd.test(t)?"EN":fd.test(t)?"AN":hu.test(t)?"NSM":hs.test(t)?"R":yd.test(t)?"AL":Iu.test(t)?"L":"ON"}function $s(e){for(let t of e)if(KR.test(Rd(t.codePointAt(0))))return!0;return!1}function Es(e){let t=!1,r=wd,n=!1,o=!1,i=!0;for(let a of e){let m=Rd(a.codePointAt(0));if(i){if(m!=="L"&&m!=="R"&&m!=="AL")return!1;t=m==="R"||m==="AL",r=t?GR:wd,i=!1}if(!r.test(m))return!1;m==="EN"?n=!0:m==="AN"&&(o=!0)}return!(t&&n&&o)}function HR(e){return Vn.test(e)&&Td(e).length+4>63}function zR(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function Ss(e){if(HR(e)||$s(e)&&!Es(e))return!1;let t=[...e],r=t.map(i=>i.codePointAt(0)),n=r.length;if(zR(t)||dd.test(t[0]))return!1;let o=!1;for(let i=0;i<n;i++){let a=r[i],m=t[i];if(xd.test(m)||!Id.test(m))return!1;gd.test(m)&&(o=!0);let c=r[i-1],p=r[i+1];switch(a){case 183:if(c!==108||p!==108)return!1;break;case 885:if(!p||!ld.test(t[i+1]))return!1;break;case 1523:case 1524:if(!c||!hs.test(t[i-1]))return!1;break;case 8204:if(!c||c<128&&!bu.test(t[i-1]))return!1;break;case 8205:if(!c||!bu.test(t[i-1]))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!o)}function ks(e){if(!Is(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let r=bs(t);return Vn.test(r)?Ss(r):!1}catch{return!1}}function WR(e){return e.length>0&&e.length<=63}function VR(e){return WR(e)&&(ks(e)||bd(e))}function Md(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>VR(t))}function JR(e){return e.length>0&&e.length<=63}function YR(e){return JR(e)&&(ks(e)||Ss(e))}function QR(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function vd(e){if(e.length===0||e.includes(" "))return!1;let t=QR(e);if(t.length>253)return!1;let r=t.split("."),n=r.some(o=>Cd(o));return r.every(o=>YR(o)&&(!n||Es(o)))}function Ts(e){return Md(e)}var XR=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function ws(e){return XR.test(e.normalize("NFC"))}function Cs(e){return vd(e)}var ZR=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function Rs(e){return ZR.test(e)}var e0=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function Ps(e){return e0.test(e)}var t0=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,r0=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function As(e){return!t0.test(e)&&!r0.test(e)&&URL.canParse(e,"http://example.com")}var n0=/[\x00-\x20<>\^`{|}\\]/,o0=/%(?![0-9a-fA-F]{2})/;function Os(e){return n0.test(e)||o0.test(e)?!1:URL.canParse(e)}var i0=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Ms(e){return i0.test(e)}var s0=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function vs(e){return s0.test(e)}function Fs(e){try{return new RegExp(e,"u"),!0}catch{return!1}}var a0=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Ls(e){return a0.test(e)}var m0=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function js(e){return m0.test(e)}var u0=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function Ds(e){return u0.test(e)}var c0=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Ns(e){return c0.test(e)}function qs(e){return URL.canParse(e)}var p0=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Us(e){return p0.test(e)}var le=new Map;function Ld(){le.clear()}function f0(){return[...le.entries()]}function d0(e,t){le.set(e,t)}function l0(e){return le.has(e)}function g0(e){return le.get(e)}function y0(e,t){return le.get(e)?.(t)??!0}function jd(){Ld(),le.set("date-time",gs),le.set("date",zn),le.set("duration",ys),le.set("email",xs),le.set("hostname",Ts),le.set("idn-email",ws),le.set("idn-hostname",Cs),le.set("ipv4",Rs),le.set("ipv6",Ps),le.set("iri-reference",As),le.set("iri",Os),le.set("json-pointer-uri-fragment",Ms),le.set("json-pointer",vs),le.set("regex",Fs),le.set("relative-json-pointer",Ls),le.set("time",Wn),le.set("uri-reference",js),le.set("uri-template",Ds),le.set("uri",Ns),le.set("url",qs),le.set("uuid",Us)}jd();function Su(e,t,r,n){return Xo.Test(r.format,n)}function Dd(e,t,r,n,o,i){return Su(e,t,o,i)||t.AddError("format",r,n,{format:o.format})}function Nd(e,t,r,n){let o=fs(r)?r.then:!0,i=os(r)?r.else:!0;return Q(e,t,r.if,n)?Q(e,t,o,n):Q(e,t,i,n)}function qd(e,t,r,n,o,i){let a=fs(o)?o.then:!0,m=os(o)?o.else:!0,c=new et,p=ce(e,c,`${r}/if`,n,o.if,i)?ce(e,c,`${r}/then`,n,a,i)||t.AddError("if",r,n,{failingKeyword:"then"}):ce(e,t,`${r}/else`,n,m,i)||t.AddError("if",r,n,{failingKeyword:"else"});return p&&t.Merge([c]),p}function x0(e,t,r,n){return s.Every(r.items,0,(o,i)=>s.IsLessEqualThan(n.length,i)||Ot(e,t,o,n[i])&&t.AddIndex(i))}function h0(e,t,r,n,o,i){return s.EveryAll(o.items,0,(a,m)=>{let c=`${r}/items/${m}`,p=`${n}/${m}`;return s.IsLessEqualThan(i.length,m)||Mt(e,t,c,p,a,i[m])&&t.AddIndex(m)})}function I0(e,t,r,n){let o=hn(r)?r.prefixItems.length:0;return s.Every(n,o,(i,a)=>Ot(e,t,r.items,i)&&t.AddIndex(a))}function b0(e,t,r,n,o,i){let a=hn(o)?o.prefixItems.length:0;return s.EveryAll(i,a,(m,c)=>{let p=`${r}/items`,f=`${n}/${c}`;return Mt(e,t,p,f,o.items,m)&&t.AddIndex(c)})}function Ud(e,t,r,n){return ss(r)?x0(e,t,r,n):I0(e,t,r,n)}function _d(e,t,r,n,o,i){return ss(o)?h0(e,t,r,n,o,i):b0(e,t,r,n,o,i)}function $0(e){return Gr(e)}function ku(e,t,r,n){if(!$0(r))return!0;let o=s.Counted(n,i=>Q(e,t,r.contains,i));return s.IsLessEqualThan(o,r.maxContains)}function Bd(e,t,r,n,o,i){let a=yn(o)?o.minContains:1;return ku(e,t,o,i)||t.AddError("contains",r,n,{minContains:a,maxContains:o.maxContains})}function Tu(e,t,r,n){return s.IsLessEqualThan(n,r.maximum)}function Gd(e,t,r,n,o,i){return Tu(e,t,o,i)||t.AddError("maximum",r,n,{comparison:"<=",limit:o.maximum})}function wu(e,t,r,n){return s.IsLessEqualThan(n.length,r.maxItems)}function Kd(e,t,r,n,o,i){return wu(e,t,o,i)||t.AddError("maxItems",r,n,{limit:o.maxItems})}function Cu(e,t,r,n){return s.IsMaxLength(n,r.maxLength)}function Hd(e,t,r,n,o,i){return Cu(e,t,o,i)||t.AddError("maxLength",r,n,{limit:o.maxLength})}function Ru(e,t,r,n){return s.IsLessEqualThan(s.Keys(n).length,r.maxProperties)}function zd(e,t,r,n,o,i){return Ru(e,t,o,i)||t.AddError("maxProperties",r,n,{limit:o.maxProperties})}function E0(e){return Gr(e)}function Pu(e,t,r,n){if(!E0(r))return!0;let o=s.Counted(n,(i,a)=>Q(e,t,r.contains,i)&&t.AddIndex(a));return s.IsGreaterEqualThan(o,r.minContains)}function Wd(e,t,r,n,o,i){return Pu(e,t,o,i)||t.AddError("contains",r,n,{minContains:o.minContains})}function Au(e,t,r,n){return s.IsGreaterEqualThan(n,r.minimum)}function Vd(e,t,r,n,o,i){return Au(e,t,o,i)||t.AddError("minimum",r,n,{comparison:">=",limit:o.minimum})}function Ou(e,t,r,n){return s.IsGreaterEqualThan(n.length,r.minItems)}function Jd(e,t,r,n,o,i){return Ou(e,t,o,i)||t.AddError("minItems",r,n,{limit:o.minItems})}function Mu(e,t,r,n){return s.IsMinLength(n,r.minLength)}function Yd(e,t,r,n,o,i){return Mu(e,t,o,i)||t.AddError("minLength",r,n,{limit:o.minLength})}function vu(e,t,r,n){return s.IsGreaterEqualThan(s.Keys(n).length,r.minProperties)}function Qd(e,t,r,n,o,i){return vu(e,t,o,i)||t.AddError("minProperties",r,n,{limit:o.minProperties})}function Fu(e,t,r,n){return s.IsMultipleOf(n,r.multipleOf)}function Xd(e,t,r,n,o,i){return Fu(e,t,o,i)||t.AddError("multipleOf",r,n,{multipleOf:o.multipleOf})}function Lu(e,t,r,n){let o=new ct;return!Q(e,o,r.not,n)&&t.Merge([o])}function Zd(e,t,r,n,o,i){return Lu(e,t,o,i)||t.AddError("not",r,n,{})}function el(e,t,r,n){let o=r.oneOf.reduce((i,a)=>{let m=new ct;return Q(e,m,a,n)?[...i,m]:i},[]);return s.IsEqual(o.length,1)&&t.Merge(o)}function tl(e,t,r,n,o,i){let a=[],m=[],c=o.oneOf.reduce((f,d,g)=>{let y=new et,I=`${r}/oneOf/${g}`,h=ce(e,y,I,n,d,i);return h&&m.push(g),h||a.push(y),h?[...f,y]:f},[]),p=s.IsEqual(c.length,1)&&t.Merge(c);return!p&&s.IsEqual(m.length,0)&&a.forEach(f=>t.AddErrors(f.GetErrors())),p||t.AddError("oneOf",r,n,{passingSchemas:m})}function ju(e,t,r,n){return(s.IsString(r.pattern)?zr(r.pattern):r.pattern).test(n)}function rl(e,t,r,n,o,i){return ju(e,t,o,i)||t.AddError("pattern",r,n,{pattern:o.pattern})}function nl(e,t,r,n){return s.Every(s.Entries(r.patternProperties),0,([o,i])=>{let a=zr(o);return s.Every(s.Entries(n),0,([m,c])=>!a.test(m)||Ot(e,t,i,c)&&t.AddKey(m))})}function ol(e,t,r,n,o,i){return s.EveryAll(s.Entries(o.patternProperties),0,([a,m])=>{let c=`${r}/patternProperties/${$t(a)}`,p=zr(a);return s.EveryAll(s.Entries(i),0,([f,d])=>{let g=`${n}/${$t(f)}`;return!p.test(f)||Mt(e,t,c,g,m,d)&&t.AddKey(f)})})}function il(e,t,r,n){return s.IsEqual(n.length,0)||s.Every(r.prefixItems,0,(o,i)=>s.IsLessEqualThan(n.length,i)||Ot(e,t,o,n[i])&&t.AddIndex(i))}function sl(e,t,r,n,o,i){return s.IsEqual(i.length,0)||s.EveryAll(o.prefixItems,0,(a,m)=>{let c=`${r}/prefixItems/${m}`,p=`${n}/${m}`;return s.IsLessEqualThan(i.length,m)||Mt(e,t,c,p,a,i[m])&&t.AddIndex(m)})}function Du(e,t){return e.includes(t)||Me.Get().exactOptionalPropertyTypes}function Nu(e,t){return s.IsUndefined(e[t])}function al(e,t,r,n){let o=In(r)?r.required:[];return s.Every(s.Entries(r.properties),0,([a,m])=>{let c=!s.HasPropertyKey(n,a)||Ot(e,t,m,n[a])&&t.AddKey(a);return Du(o,a)?c:Nu(n,a)||c})}function ml(e,t,r,n,o,i){let a=In(o)?o.required:[];return s.EveryAll(s.Entries(o.properties),0,([c,p])=>{let f=`${r}/properties/${$t(c)}`,d=`${n}/${$t(c)}`,g=()=>!s.HasPropertyKey(i,c)||Mt(e,t,f,d,p,i[c])&&t.AddKey(c);return Du(a,c)?g():Nu(i,c)||g()})}function ul(e,t,r,n){return s.Every(s.Keys(n),0,(o,i)=>Q(e,t,r.propertyNames,o))}function cl(e,t,r,n,o,i){let a=[];return s.EveryAll(s.Keys(i),0,(c,p)=>{let f=`${n}/${$t(c)}`,d=`${r}/propertyNames`,g=ce(e,t,d,f,o.propertyNames,c);return g||a.push(c),g})||t.AddError("propertyNames",r,n,{propertyNames:a})}function pl(e,t,r,n){let o=Bt.RecursiveRef(e,r)??!1,i=o?{...e,pendingResource:!0}:e;return L(o)&&Q(i,t,o,n)}function fl(e,t,r,n,o,i){let a=Bt.RecursiveRef(e,o)??!1,m=a?{...e,pendingResource:!0}:e;return L(a)&&ce(m,t,r,n,a,i)}function dl(e,t,r,n){let o=Bt.Ref(e,r),i=o.schema??!1,a=new ct,m=L(i)&&Q(o.stack,a,i,n);return m&&t.Merge([a]),m}function ll(e,t,r,n,o,i){let a=Bt.Ref(e,o),m=a.schema??!1,c=new et,p=L(m)&&ce(a.stack,c,r,n,m,i);return p&&t.Merge([c]),p||t.AddErrors(c.GetErrors()),p}function gl(e,t,r,n){return s.Every(r.required,0,o=>s.HasPropertyKey(n,o))}function yl(e,t,r,n,o,i){let a=[];return s.EveryAll(o.required,0,c=>{let p=s.HasPropertyKey(i,c);return p||a.push(c),p})||t.AddError("required",r,n,{requiredProperties:a})}function qu(e,t,r,n,o){return s.IsEqual(r,"object")?s.IsObjectNotArray(o):s.IsEqual(r,"array")?s.IsArray(o):s.IsEqual(r,"boolean")?s.IsBoolean(o):s.IsEqual(r,"integer")?s.IsInteger(o):s.IsEqual(r,"number")?s.IsNumber(o):s.IsEqual(r,"null")?s.IsNull(o):s.IsEqual(r,"string")?s.IsString(o):s.IsEqual(r,"bigint")?s.IsBigInt(o):s.IsEqual(r,"constructor")?s.IsConstructor(o):s.IsEqual(r,"function")?s.IsFunction(o):s.IsEqual(r,"symbol")?s.IsSymbol(o):s.IsEqual(r,"undefined")?s.IsUndefined(o):s.IsEqual(r,"void")?s.IsUndefined(o):!0}function xl(e,t,r,n,o){return s.Some(r,i=>qu(e,t,i,n,o))}function hl(e,t,r,n){return s.IsArray(r.type)?xl(e,t,r.type,r,n):qu(e,t,r.type,r,n)}function Il(e,t,r,n,o,i){return(s.IsArray(o.type)?xl(e,t,o.type,o,i):qu(e,t,o.type,o,i))||t.AddError("type",r,n,{type:o.type})}function bl(e,t,r,n){let o=t.GetIndices();return s.Every(n,0,(i,a)=>(o.has(a)||Q(e,t,r.unevaluatedItems,i))&&t.AddIndex(a))}function $l(e,t,r,n,o,i){let a=t.GetIndices(),m=[];return s.EveryAll(i,0,(p,f)=>{let d=new et,g=(a.has(f)||ce(e,d,r,n,o.unevaluatedItems,p))&&t.AddIndex(f);return g||m.push(f),g})||t.AddError("unevaluatedItems",r,n,{unevaluatedItems:m})}function El(e,t,r,n){let o=t.GetKeys();return s.Every(s.Entries(n),0,([i,a])=>o.has(i)||Q(e,t,r.unevaluatedProperties,a)&&t.AddKey(i))}function Sl(e,t,r,n,o,i){let a=t.GetKeys(),m=[];return s.EveryAll(s.Entries(i),0,([p,f])=>{let d=new et,g=a.has(p)||ce(e,d,r,n,o.unevaluatedProperties,f)&&t.AddKey(p);return g||m.push(p),g})||t.AddError("unevaluatedProperties",r,n,{unevaluatedProperties:m})}var Pr={};At(Pr,{Hash:()=>Pl,HashCode:()=>D0});function $e(){throw new Error("Unreachable")}function S0(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let n of Reflect.ownKeys(r))n!=="constructor"&&typeof n!="symbol"&&t.add(n);r=Object.getPrototypeOf(r)}return[...t]}function k0(e){return typeof e=="number"}var St={Array:0,BigInt:1,Boolean:2,Date:3,Constructor:4,Function:5,Null:6,Number:7,Object:8,RegExp:9,String:10,Symbol:11,TypeArray:12,Undefined:13},Bs=8997,Zo=33826,Gs=40164,Ks=52210,wl=new Float64Array(1),Cl=new DataView(wl.buffer),Rl=new Uint8Array(wl.buffer);function Ge(e){let t=Bs^e,r=t*435,n=Zo*435+(r>>>16),o=Gs*435+(n>>>16)+(t<<8),i=Ks*435+(o>>>16)+(Zo<<8);Bs=r&65535,Zo=n&65535,Gs=o&65535,Ks=i&65535}function T0(e){Ge(St.Array);for(let t of e)Wr(t)}function w0(e){Ge(St.BigInt),Cl.setBigInt64(0,e);for(let t of Rl)Ge(t)}function kl(e){Ge(St.Boolean),Ge(e?1:0)}function C0(e){Ge(St.Constructor),Wr(e.toString())}function R0(e){Ge(St.Date),Wr(e.getTime())}function P0(e){Ge(St.Function),Wr(e.toString())}function A0(e){Ge(St.Null)}function Tl(e){Ge(St.Number),Cl.setFloat64(0,e,!0);for(let t of Rl)Ge(t)}function O0(e){Ge(St.Object);for(let t of S0(e).sort())Wr(t),Wr(e[t])}function M0(e){Ge(St.RegExp),Uu(e.toString())}var v0=new TextEncoder;function Uu(e){Ge(St.String);for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127){for(let n of v0.encode(e.slice(t)))Ge(n);return}Ge(r)}}function F0(e){Ge(St.Symbol),Wr(e.toString())}function L0(e){Ge(St.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Ge(t[r])}function j0(e){return Ge(St.Undefined)}function Wr(e){return De.IsTypeArray(e)?L0(e):De.IsDate(e)?R0(e):De.IsRegExp(e)?M0(e):De.IsBoolean(e)?kl(e.valueOf()):De.IsString(e)?Uu(e.valueOf()):De.IsNumber(e)?Tl(e.valueOf()):k0(e)?Tl(e):s.IsArray(e)?T0(e):s.IsBoolean(e)?kl(e):s.IsBigInt(e)?w0(e):s.IsConstructor(e)?C0(e):s.IsNull(e)?A0(e):s.IsObject(e)?O0(e):s.IsString(e)?Uu(e):s.IsSymbol(e)?F0(e):s.IsUndefined(e)?j0(e):s.IsFunction(e)?P0(e):$e()}function _s(e){return e.toString(16).padStart(4,"0")}function D0(e){return BigInt(`0x${Pl(e)}`)}function Pl(e){return Bs=8997,Zo=33826,Gs=40164,Ks=52210,Wr(e),`${_s(Ks)}${_s(Gs)}${_s(Zo)}${_s(Bs)}`}function Al(e){return!s.IsEqual(e.uniqueItems,!1)}function Ol(e,t,r,n){if(!Al(r))return!0;let o=new Set(n.map(Pr.Hash)).size,i=n.length;return s.IsEqual(o,i)}function Ml(e,t,r,n,o,i){if(!Al(o))return!0;let a=new Set,m=i.reduce((p,f,d)=>{let g=Pr.Hash(f);return a.has(g)?[...p,d]:(a.add(g),p)},[]);return s.IsEqual(m.length,0)||t.AddError("uniqueItems",r,n,{duplicateItems:m})}function Ot(e,t,r,n){return t.Push()&&Q(e,t,r,n)&&t.Pop()}function Q(e,t,r,n){let o=Kn(e,r);return ln(r)?iu(o,t,r,n):(!tu(r)||hl(o,t,r,n))&&(!(s.IsObject(n)&&!s.IsArray(n))||(!In(r)||gl(o,t,r,n))&&(!_t(r)||Lf(o,t,r,n))&&(!zm(r)||Kf(o,t,r,n))&&(!Wm(r)||zf(o,t,r,n))&&(!rs(r)||Vf(o,t,r,n))&&(!Un(r)||nl(o,t,r,n))&&(!_n(r)||al(o,t,r,n))&&(!us(r)||ul(o,t,r,n))&&(!Uo(r)||vu(o,t,r,n))&&(!Zm(r)||Ru(o,t,r,n)))&&(!s.IsArray(n)||(!Zi(r)||Mf(o,t,r,n))&&(!Gr(r)||au(o,t,r,n))&&(!gn(r)||Ud(o,t,r,n))&&(!yn(r)||Pu(o,t,r,n))&&(!Qm(r)||ku(o,t,r,n))&&(!xn(r)||Ou(o,t,r,n))&&(!No(r)||wu(o,t,r,n))&&(!hn(r)||il(o,t,r,n))&&(!Hr(r)||Ol(o,t,r,n)))&&(!s.IsString(n)||(!qo(r)||Mu(o,t,r,n))&&(!Xm(r)||Cu(o,t,r,n))&&(!Do(r)||Su(o,t,r,n))&&(!_o(r)||ju(o,t,r,n)))&&(!(s.IsNumber(n)||s.IsBigInt(n))||(!wr(r)||xu(o,t,r,n))&&(!Jm(r)||yu(o,t,r,n))&&(!Cr(r)||Au(o,t,r,n))&&(!Ym(r)||Tu(o,t,r,n))&&(!eu(r)||Fu(o,t,r,n)))&&(!ps(r)||dl(o,t,r,n))&&(!cs(r)||pl(o,t,r,n))&&(!ns(r)||od(o,t,r,n))&&(!Hm(r)||su(o,t,r,n))&&(!Vm(r)||gu(o,t,r,n))&&(!is(r)||Nd(o,t,r,n))&&(!as(r)||Lu(o,t,r,n))&&(!es(r)||Df(o,t,r,n))&&(!ts(r)||qf(o,t,r,n))&&(!ms(r)||el(o,t,r,n))&&(!Go(r)||!s.IsArray(n)||bl(o,t,r,n))&&(!Ko(r)||!s.IsObject(n)||El(o,t,r,n))&&(!Xi(r)||Tf(o,t,r,n))}function Mt(e,t,r,n,o,i){return t.Push()&&ce(e,t,r,n,o,i)&&t.Pop()}function ce(e,t,r,n,o,i){if(t.AtCapacity())return!1;let a=Kn(e,o);return ln(o)?_f(a,t,r,n,o,i):!!(+(!tu(o)||Il(a,t,r,n,o,i))&+(!(s.IsObject(i)&&!s.IsArray(i))||!!(+(!In(o)||yl(a,t,r,n,o,i))&+(!_t(o)||jf(a,t,r,n,o,i))&+(!zm(o)||Hf(a,t,r,n,o,i))&+(!Wm(o)||Wf(a,t,r,n,o,i))&+(!rs(o)||Jf(a,t,r,n,o,i))&+(!Un(o)||ol(a,t,r,n,o,i))&+(!_n(o)||ml(a,t,r,n,o,i))&+(!us(o)||cl(a,t,r,n,o,i))&+(!Uo(o)||Qd(a,t,r,n,o,i))&+(!Zm(o)||zd(a,t,r,n,o,i))))&+(!s.IsArray(i)||!!(+(!Zi(o)||vf(a,t,r,n,o,i))&+(!Gr(o)||Gf(a,t,r,n,o,i))&+(!gn(o)||_d(a,t,r,n,o,i))&+(!yn(o)||Wd(a,t,r,n,o,i))&+(!Qm(o)||Bd(a,t,r,n,o,i))&+(!xn(o)||Jd(a,t,r,n,o,i))&+(!No(o)||Kd(a,t,r,n,o,i))&+(!hn(o)||sl(a,t,r,n,o,i))&+(!Hr(o)||Ml(a,t,r,n,o,i))))&+(!s.IsString(i)||!!(+(!qo(o)||Yd(a,t,r,n,o,i))&+(!Xm(o)||Hd(a,t,r,n,o,i))&+(!Do(o)||Dd(a,t,r,n,o,i))&+(!_o(o)||rl(a,t,r,n,o,i))))&+(!(s.IsNumber(i)||s.IsBigInt(i))||!!(+(!wr(o)||md(a,t,r,n,o,i))&+(!Jm(o)||ad(a,t,r,n,o,i))&+(!Cr(o)||Vd(a,t,r,n,o,i))&+(!Ym(o)||Gd(a,t,r,n,o,i))&+(!eu(o)||Xd(a,t,r,n,o,i))))&+(!ps(o)||ll(a,t,r,n,o,i))&+(!cs(o)||fl(a,t,r,n,o,i))&+(!ns(o)||id(a,t,r,n,o,i))&+(!Hm(o)||Bf(a,t,r,n,o,i))&+(!Vm(o)||sd(a,t,r,n,o,i))&+(!is(o)||qd(a,t,r,n,o,i))&+(!as(o)||Zd(a,t,r,n,o,i))&+(!es(o)||Nf(a,t,r,n,o,i))&+(!ts(o)||Uf(a,t,r,n,o,i))&+(!ms(o)||tl(a,t,r,n,o,i))&+(!Go(o)||!s.IsArray(i)||$l(a,t,r,n,o,i))&+(!Ko(o)||!s.IsObject(i)||Sl(a,t,r,n,o,i)))&&(!Xi(o)||wf(a,t,r,n,o,i))}function Fl(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var N0=Fl;function Ll(){return N0}var l={};At(l,{Assign:()=>U0,Clone:()=>_0,Create:()=>G0,Discard:()=>K0,Metrics:()=>Qt,Update:()=>V0});var Qt={assign:0,create:0,clone:0,discard:0,update:0};function vt(e){return[...s.Keys(e),...s.Symbols(e)]}function jl(e,t){if(!t.has(e)){t.add(e);for(let r of vt(e)){let n=Object.getOwnPropertyDescriptor(e,r);!n||!("value"in n)||s.IsObject(n.value)&&jl(n.value,t)}Object.freeze(e)}}function Vr(e){return Me.Get().immutableTypes&&jl(e,new WeakSet),e}function U0(e,t){Qt.assign+=1;let r={},n=vt(t),o=vt(e);for(let i of o)n.includes(i)||Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(e,i));for(let i of n)Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i));return Vr(r)}function _0(e){Qt.clone+=1;let t={};for(let r of vt(e)){if(s.IsUnsafePropertyKey(r))continue;let n=Object.getOwnPropertyDescriptor(e,r);s.IsEqual(n.enumerable,!0)?t[r]=n.value:Object.defineProperty(t,r,n)}return t}function Dl(e,t){return{...e,...t}}function B0(e,t){for(let r of Object.keys(t))Object.defineProperty(e,r,{configurable:!0,writable:!0,enumerable:!1,value:t[r]});return e}function G0(e,t,r={}){Qt.create+=1;let n=Dl(t,r),o=Me.Get().enumerableKind?Dl(n,e):B0(n,e);return Vr(o)}function K0(e,t){Qt.discard+=1;let r={};for(let n of vt(e)){if(t.includes(n))continue;let o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o)}return Vr(r)}function H0(e,t,r,n){for(let o of vt(e)){if(s.IsUnsafePropertyKey(o)||t.includes(o)||r.includes(o))continue;let i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,i)}}function z0(e,t,r){let n=Me.Get().enumerableKind;for(let o of t)s.IsUnsafePropertyKey(o)||Object.defineProperty(r,o,{configurable:!0,writable:!0,enumerable:n,value:e[o]})}function W0(e,t,r){for(let n of t)s.IsUnsafePropertyKey(n)||Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:e[n]})}function V0(e,t,r){Qt.update+=1;let n={},o=vt(t),i=vt(r);return H0(e,o,i,n),z0(t,o,n),W0(r,i,n),Vr(n)}function Hs(...e){let[t,r,n]=B.Match(e,{3:(f,d,g)=>[f,d,g],2:(f,d)=>[{},f,d]}),o=Gn(t,r),i=new et,a=ce(o,i,"#","",r,n),m=i.GetErrors(),c=Ll(),p=m.map(f=>({...f,message:c(f)}));return[a,p]}var ql=0;function zs(){let e=Qi();ql=e.maxErrors,e.maxErrors=e.maxParseErrors}function Ws(){let e=Qi();e.maxErrors=ql}function Bu(...e){let[t,r,n]=B.Match(e,{3:(a,m,c)=>[a,m,c],2:(a,m)=>[{},a,m]}),o=Gn(t,r),i=new ct;return Q(o,i,r,n)}function K(...e){let[t,r,n]=B.Match(e,{3:(o,i,a)=>[o,i,a],2:(o,i)=>[{},o,i]});return Bu(t,r,n)}function Xt(...e){let[t,r,n]=B.Match(e,{3:(a,m,c)=>[a,m,c],2:(a,m)=>[{},a,m]}),[o,i]=Hs(t,r,n);return i}var Ar=class extends Error{constructor(t,r,n){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:n,value:r},writable:!1,configurable:!1,enumerable:!1})}};function Vs(...e){let[t,r,n]=B.Match(e,{3:(i,a,m)=>[i,a,m],2:(i,a)=>[{},i,a]});if(!K(t,r,n))throw new Ar("Assert",n,Xt(t,r,n))}function w(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function ye(e){return s.IsObject(e)}function R(e,t,r){return l.Create({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:r},{})}function Jr(e){return w(e,"Deferred")}function ur(e,t){return l.Update(e,{"~readonly":!0},t)}function Ul(e,t,r,n){let o=$(e,t,r);return ur(o,n)}function cr(e,t){return l.Update(e,{"~optional":!0},t)}function _l(e,t,r,n){let o=$(e,t,r);return cr(o,n)}function yt(e,t){return l.Create({"~kind":"Array"},{type:"array",items:e},t)}function W(e){return w(e,"Array")}function Jn(e){return l.Discard(e,["~kind","type","items"])}function pr(e,t,r={}){return l.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Ee(e){return w(e,"Constructor")}function Bl(e){return l.Discard(e,["~kind","type","parameters","instanceType"])}function fr(e,t,r={}){return l.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Se(e){return w(e,"Function")}function Gl(e){return l.Discard(e,["~kind","type","parameters","returnType"])}function Be(e,t){return l.Create({"~kind":"Ref"},{$ref:e},t)}function te(e){return w(e,"Ref")}function Yr(e,t){return l.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Yn(e){return w(e,"Generic")}function Qn(e){return l.Create({"~kind":"Any"},{},e)}function Ie(e){return w(e,"Any")}var Kl="(?!)";function ie(e){return l.Create({"~kind":"Never"},{not:{}},e)}function xt(e){return w(e,"Never")}function dr(e,t={}){return R("AddOptional",[e],t)}function Js(e,t={}){return cr(e,t)}function Hl(e){return Js(e)}function ve(e){return ye(e)&&s.HasPropertyKey(e,"~optional")}function zl(e){return s.Keys(e).filter(t=>!ve(e[t]))}function Ys(e){return s.Keys(e)}function Qs(e){return s.Values(e)}function M(e,t={}){let r=zl(e),n=r.length>0?{required:r}:{};return l.Create({"~kind":"Object"},{type:"object",...n,properties:e},t)}function A(e){return w(e,"Object")}function Wl(e){return l.Discard(e,["~kind","type","properties","required"])}function Ne(e){return l.Create({"~kind":"Unknown"},{},e)}function Fe(e){return w(e,"Unknown")}function lr(e,t,r){let n=s.Keys(e).reduce((o,i)=>({...o,[i]:l.Update(e[i],{},{$id:i})}),{});return l.Create({"~kind":"Cyclic"},{$defs:n,$ref:t},r)}function me(e){return w(e,"Cyclic")}function Vl(e){return l.Update(e,{"~unsafe":null},{})}function Xs(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"~unsafe")&&s.IsNull(e["~unsafe"])}function ei(...e){let[t,r]=B.Match(e,{2:(n,o)=>[n,o,o],1:n=>[n,Ne(),Ne()]});return l.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function Le(e){return w(e,"Infer")}function $n(e,t,r,n={}){return l.Create({"~kind":"Dependent"},{if:e,then:t,else:r},n)}function ke(e){return w(e,"Dependent")}function Jl(e){return l.Discard(e,["~kind","if","then","else"])}function Yl(e){return s.IsObjectNotArray(e)}function Ql(e){return s.Keys(e).filter(r=>isNaN(r)).reduce((r,n)=>[...r,e[n]],[])}function Xl(e){return s.IsString(e)||s.IsNumber(e)}function Zl(e,t){let r=Yl(e)?Ql(e):e;return l.Create({"~kind":"Enum"},{enum:r},t)}function Te(e){return w(e,"Enum")}function ot(e,t={}){return l.Create({"~kind":"Intersect"},{allOf:e},t)}function O(e){return w(e,"Intersect")}function eg(e){return l.Discard(e,["~kind","allOf"])}var ti=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,n=pt(r)?a=>this.decode(r["~codec"].decode(a)):this.decode,o=pt(r)?a=>r["~codec"].encode(t(a)):t,i={decode:n,encode:o};return l.Update(this.type,{"~codec":i},{})}},ri=class{constructor(t){this.type=t}Decode(t){return new ti(this.type,t)}};function Zs(e){return new ri(e)}function tg(e,t){return Zs(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function rg(e,t){return Zs(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function pt(e){return ye(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function ng(e){return Xn(e)}function En(e){return ye(e)&&s.HasPropertyKey(e,"~immutable")}function gr(e,t={}){return R("AddReadonly",[e],t)}function ea(e,t={}){return ur(e,t)}function og(e){return ea(e)}function Or(e){return ye(e)&&s.HasPropertyKey(e,"~readonly")}function Q0(e,t){let r=ni(e)?[...e["~refine"],t]:[t];return l.Update(e,{"~refine":r},{})}function ig(...e){let[t,r,n]=B.Match(e,{3:(o,i,a)=>[o,i,a],2:(o,i)=>[o,i,()=>"Refine Error"]});return Q0(t,{check:r,error:n})}function X0(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"error")&&s.IsFunction(e.check)&&s.IsFunction(e.error)}function ni(e){return ye(e)&&s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>X0(t))}var sg="-?(?:0|[1-9][0-9]*)n";function oi(e){return l.Create({"~kind":"BigInt"},{type:"bigint"},e)}function kt(e){return w(e,"BigInt")}function ta(e){return l.Create({"~kind":"Boolean"},{type:"boolean"},e)}function ft(e){return w(e,"Boolean")}function ii(e){return l.Create({"~kind":"Identifier"},{name:e})}function ag(e){return w(e,"Identifier")}var ra="-?(?:0|[1-9][0-9]*)";function Sn(e){return l.Create({"~kind":"Integer"},{type:"integer"},e)}function Ke(e){return w(e,"Integer")}var Gu=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function Z0(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Gu(e)})()}function G(e,t){return l.Create({"~kind":"Literal"},{type:Z0(e),const:e},t)}function na(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function mg(e){return H(e)&&s.IsBigInt(e.const)}function ug(e){return H(e)&&s.IsBoolean(e.const)}function oa(e){return H(e)&&s.IsNumber(e.const)}function ia(e){return H(e)&&s.IsString(e.const)}function H(e){return w(e,"Literal")}function Zn(e){return l.Create({"~kind":"Null"},{type:"null"},e)}function yr(e){return w(e,"Null")}var sa="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function Tt(e){return l.Create({"~kind":"Number"},{type:"number"},e)}function xe(e){return w(e,"Number")}function eo(e){return l.Create({"~kind":"Symbol"},{type:"symbol"},e)}function xr(e){return w(e,"Symbol")}function kn(...e){let[t,r,n]=B.Match(e,{3:(o,i,a)=>[o,i,a],2:(o,i)=>[o,i,i],1:o=>[o,Ne(),Ne()]});return l.Create({"~kind":"Parameter"},{name:t,extends:r,equals:n},{})}function cg(e){return w(e,"Parameter")}var aa=".*";function tt(e){return l.Create({"~kind":"String"},{type:"string"},e)}function qe(e){return w(e,"String")}function j(e,t={}){return l.Create({"~kind":"Union"},{anyOf:e},t)}function S(e){return w(e,"Union")}function pg(e){return l.Discard(e,["~kind","anyOf"])}function si(e){let t=fg(e);return s.IsEqual(t.length,2)?t[0]:[]}function eP(e){return!0}function dg(e){return s.ShiftLeft(e,(t,r)=>tP(t)?dg(r):!1,()=>!0)}function lg(e){return s.IsEqual(e.length,0)?!1:dg(e)}function tP(e){return S(e)?lg(e.anyOf):H(e)?eP(e.const):!1}function ma(e){return lg(e)}function ua(e){return l.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function gg(e,t,r=[]){return s.ShiftLeft(e,(n,o)=>gg(o,t,[...r,`${n}${t}`]),()=>r)}function rP(e,t){return s.IsEqual(e.length,0)?[`${t}`]:gg(e,t)}function yg(e,t,r=[]){return s.ShiftLeft(t,(n,o)=>yg(e,o,[...r,...xg(e,n)]),()=>r)}function xg(e,t){return S(t)?yg(e,t.anyOf):H(t)?rP(e,t.const):$e()}function hg(e,t){return s.ShiftLeft(t,(r,n)=>hg(xg(e,r),n),()=>e)}function nP(e){return e.map(t=>G(t))}function oP(e){let t=hg([],e),r=nP(t);return j(r)}function iP(e){return s.IsEqual(e.length,0)?$e():s.IsEqual(e.length,1)&&H(e[0])?e[0]:oP(e)}function Ku(e){let t=si(e);return s.IsEqual(t.length,0)?tt():ma(t)?iP(t):ua(e)}function to(e){let t=Ku(e);return ue(t)?tt():t}function ht(e,t){let r="object",n={[e]:t};return l.Create({"~kind":"Record"},{type:r,patternProperties:n})}function Ig(e){return ht(Zt,e)}function bg(e){return M({true:e,false:e})}function we(e,t={}){let[r,n,o]=[e,e.length,!1];return l.Create({"~kind":"Tuple"},{type:"array",additionalItems:o,items:r,minItems:n},t)}function q(e){return w(e,"Tuple")}function $g(e){return l.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Hu(e){return e.reduceRight((r,n,o)=>({[o]:n,...r}),{})}function Eg(e){let t=Hu(e.items);return M(t)}function sP(e){return l.Discard(e,["~optional"])}function Tn(e,t){return l.Update(sP(e),{},t)}function Sg(e,t,r,n){let o=$(e,t,r);return Tn(o,n)}function aP(e){return l.Discard(e,["~readonly"])}function ro(e,t){return l.Update(aP(e),{},t)}function kg(e,t,r,n){let o=$(e,t,r);return ro(o,n)}function ca(e,t){let r=Or(e)&&Or(t),n=ve(e)&&ve(t),o=Ce([e,t]),i=ro(Tn(o,{}),{});return r&&n?ur(cr(i,{}),{}):r?ur(i,{}):n?cr(i,{}):i}function Tg(e,t){let r=Or(e)||Or(t),n=ve(e)||ve(t),o=ro(Tn(e,{}),{}),i=ro(Tn(t,{}),{}),a=It([o,i]);return r&&n?ur(cr(a,{}),{}):r?ur(a,{}):n?cr(a,{}):a}function mP(e,t,r){return r in e?r in t?ca(e[r],t[r]):e[r]:r in t?t[r]:ie()}function uP(e,t){return[...new Set([...s.Keys(e),...s.Keys(t)])].reduce((o,i)=>({...o,[i]:mP(e,t,i)}),{})}function wg(e){return A(e)?e.properties:q(e)?Hu(e.items):{}}function Cg(e,t){let r=wg(e),n=wg(t),o=uP(r,n);return M(o)}function cP(e,t){let r=no(e,t);return s.IsEqual(r,mi)?e:s.IsEqual(r,ui)||s.IsEqual(r,ai)?t:ie()}function Rg(e){return A(e)||q(e)}function pP(e,t){let r=Rg(e),n=Rg(t);return r&&n?Cg(e,t):r&&!n?e:!r&&n?t:cP(e,t)}function Pg(e,t){return xt(e)||Ie(e)?e:Fe(e)||xt(t)||Ie(t)?t:Fe(t)?e:pP(e,t)}function fP(e,t){return S(e)||S(t)}function dP(e,t){let r=Gt(e),n=Gt(t);return fP(r,n)?Ce([r,n]):Pg(r,n)}function Ag(e,t,r=[]){return s.ShiftLeft(t,(n,o)=>Ag(e,o,[...r,dP(n,e)]),()=>s.IsEqual(r.length,0)?[e]:r)}function Og(e,t,r=[]){return s.ShiftLeft(e,(n,o)=>Og(o,t,[...r,...ci([n],t)]),()=>r)}function ci(e,t=[]){return s.ShiftLeft(e,(r,n)=>S(r)?ci(n,Og(r.anyOf,t)):ci(n,Ag(r,t)),()=>t)}function lP(e,t){let r=rt({},e,t);return F.IsExtendsTrueLike(r)?[]:[e]}function Mg(e,t,r=[]){return s.ShiftLeft(e,(n,o)=>Mg(o,t,[...r,...lP(n,t)]),()=>r)}function pa(e,t){let r=Gt(e),n=S(r)?r.anyOf:[r],o=Mg(n,t);return It(o)}function er(e,t,r){let n=Ce([e,t]),o=pa(r,e);return It([n,o])}function dt(e,t=[]){return s.ShiftLeft(e,(r,n)=>dt(n,[...t,G(r)]),()=>It(t))}function Ce(e){let t=ci(e),r=zu(t);return It(r)}function it(e){let t=to(e);return Gt(t)}function It(e){let t=zu(e);return Qr(t)}function Gt(e){return ke(e)?er(e.if,e.then,e.else):Te(e)?dt(e.enum):O(e)?Ce(e.allOf):ue(e)?it(e.pattern):S(e)?It(e.anyOf):e}function Qr(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?ie():j(e)}function vg(e,t){let r=dt(e);return Xr(r,t)}function Fg(e,t){return ht(Zr,t)}function Lg(e,t){let r=Ce(e);return Xr(r,t)}function jg(e,t){return s.IsString(e)||s.IsNumber(e)?M({[e]:t}):s.IsEqual(e,!1)?M({false:t}):s.IsEqual(e,!0)?M({true:t}):M({})}function Dg(e,t){return ht(oo,t)}function Ng(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?ht(e.pattern.toString(),t):ht(Zt,t)}function qg(e,t){let r=si(e);return ma(r)?Xr(it(e),t):ht(e,t)}function gP(e){return S(e)?en(e.anyOf):[e]}function en(e,t=[]){return s.ShiftLeft(e,(r,n)=>en(n,[...t,...gP(r)]),()=>t)}function yP(e){return e.some(t=>qe(t)||xe(t)||Ke(t))}function xP(e,t){return s.IsEqual(yP(e),!0)?ht(Zt,t):void 0}function hP(e,t){return e.reduce((r,n)=>H(n)&&(s.IsString(n.const)||s.IsNumber(n.const))?{...r,[n.const]:t}:r,{})}function IP(e,t){let r=hP(e,t);return M(r)}function Ug(e,t){let r=en(e),n=xP(r,t);return ye(n)?n:IP(r,t)}function Xr(e,t){return Ie(e)?Ig(t):ft(e)?bg(t):Te(e)?vg(e.enum,t):Ke(e)?Fg(e,t):O(e)?Lg(e.allOf,t):H(e)?jg(e.const,t):xe(e)?Dg(e,t):S(e)?Ug(e.anyOf,t):qe(e)?Ng(e,t):ue(e)?qg(e.pattern,t):M({})}function Wu(e,t,r){return U([e])?l.Update(Xr(e,t),{},r):fa(e,t,r)}function _g(e,t,r,n,o){let i=$(e,t,r),a=$(e,t,n);return Wu(i,a,o)}var Zr=`^${ra}$`,oo=`^${sa}$`,Zt=`^${aa}$`;function fa(e,t,r={}){return R("Record",[e,t],r)}function io(e,t,r={}){return Wu(e,t,r)}function Bg(e,t){return ht(e,t)}function da(e){return s.IsEqual(e,Zt)?tt():s.IsEqual(e,Zr)?Sn():s.IsEqual(e,oo)?Tt():Ku(e)}function je(e){return s.Keys(e.patternProperties)[0]}function so(e){let t=je(e);return da(t)}function pe(e){return e.patternProperties[je(e)]}function ne(e){return w(e,"Record")}function wn(e){return l.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function tn(e){return w(e,"Rest")}function la(e){return l.Create({"~kind":"This"},{$ref:"#"},e)}function ga(e){return w(e,"This")}function ao(e){return l.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Kt(e){return w(e,"Undefined")}function ya(e){return l.Create({"~kind":"Void"},{type:"void"},e)}function wt(e){return w(e,"Void")}function $P(e,t){return s.IsEqual(e,"Array")?yt(t[0]):s.IsEqual(e,"Capitalize")?ha(t[0]):s.IsEqual(e,"ConstructorParameters")?Sa(t[0]):s.IsEqual(e,"Evaluate")?Hx(t[0]):s.IsEqual(e,"Exclude")?ka(t[0],t[1]):s.IsEqual(e,"Extract")?Ta(t[0],t[1]):s.IsEqual(e,"Index")?li(t[0],t[1]):s.IsEqual(e,"InstanceType")?wa(t[0]):s.IsEqual(e,"Lowercase")?Ia(t[0]):s.IsEqual(e,"NonNullable")?Ca(t[0]):s.IsEqual(e,"Omit")?Ra(t[0],t[1]):s.IsEqual(e,"Parameters")?Pa(t[0]):s.IsEqual(e,"Partial")?Aa(t[0]):s.IsEqual(e,"Pick")?Oa(t[0],t[1]):s.IsEqual(e,"Readonly")?Ma(t[0]):s.IsEqual(e,"KeyOf")?gi(t[0]):s.IsEqual(e,"Record")?fa(t[0],t[1]):s.IsEqual(e,"Required")?va(t[0]):s.IsEqual(e,"ReturnType")?Fa(t[0]):s.IsEqual(e,"Uncapitalize")?ba(t[0]):s.IsEqual(e,"Uppercase")?$a(t[0]):di(Be(e),t)}function Cn(){throw Error("Unreachable")}function Wg(e,t=[]){return s.ShiftLeft(e,(r,n)=>Wg(n,[...t,r[1]]),()=>t)}function Mr(e){return s.IsEqual(e.length,3)?[e[0],...Wg(e[1])]:[]}function Vg(e){return kn(e[0],e[2],e[4])}function Jg(e){return kn(e[0],e[2],e[2])}function Yg(e){return kn(e[0],Ne(),e[2])}function Qg(e){return kn(e,Ne(),Ne())}function Xg(e){return Mr(e)}function Zg(e){return e[1]}function ey(e){return Mr(e)}function ty(e){return e[1]}function ry(e){return $P(e[0],e[1])}function ny(e){return null}function oy(e){return tt()}function iy(e){return Tt()}function sy(e){return ta()}function ay(e){return ao()}function my(e){return Zn()}function uy(e){return Sn()}function cy(e){return oi()}function py(e){return Ne()}function fy(e){return Qn()}function dy(e){return M({})}function ly(e){return ie()}function gy(e){return eo()}function yy(e){return ya()}function xy(e){return la()}function hy(e){return G(BigInt(e))}function Iy(e){return G(s.IsEqual(e,"true"))}function by(e){return G(parseFloat(e))}function $y(e){return G(e)}function Ey(e){return e[1]}function Sy(e){return G(e)}function ky(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Ty(e){return e[1]}function wy(e){return xa(e)}function Cy(e){return s.IsEqual(e.length,6)?$n(e[1],e[3],e[5]):$n(e[1],e[3],Ne())}function Ry(e){return e.length>0}function Py(e){return e.reduce((t,r)=>s.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function Ay(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function Oy(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}function My(e){return s.IsEqual(e.length,2)?e[1]:[]}function Gg(e,t){return t.reduce((r,n)=>{let o=n;return s.IsEqual(o.length,1)?li(r,o[0]):s.IsEqual(o.length,0)?yt(r):Cn()},e)}function Kg(e,t){return s.IsEqual(t.length,3)?Ea(e,t[0],t[1],t[2]):e}function EP(e,t){return s.IsArray(t)&&s.IsEqual(t.length,0)?e:La(e,t)}function vy(e){let[t,r,n,o,i]=e;return EP(Kg(t?gi(Gg(r,n)):Gg(r,n),o),i)}function Vu(e,t){return s.IsEqual(t.length,3)?(()=>{let[r,n,o]=t,i=Vu(n,o);if(s.IsEqual(r,"&"))return O(i)?ot([e,...i.allOf]):ot([e,i]);if(s.IsEqual(r,"|"))return S(i)?j([e,...i.anyOf]):j([e,i]);Cn()})():e}function Fy(e){let[t,r]=e;return Vu(t,r)}function Ly(e){let[t,r]=e;return Vu(t,r)}function jy(e){return Gx(e[1])}function Dy(e){return e[1]}function Ny(e){return Yr(e[0],e[2])}function qy(e){return s.IsEqual(e.length,4)?ei(e[1],e[3]):s.IsEqual(e.length,2)?ei(e[1],Ne()):Cn()}function Uy(e){return`${e}`}function _y(e){return Ke(e[3])?Zr:xe(e[3])?oo:xr(e[3])?Zt:qe(e[3])?Zt:Cn()}function By(e){return e.length>0}function Gy(e){return e.length>0}function Ky(e){let[t,r,n,o,i]=e;return{[r]:t&&n?gr(dr(i)):t&&!n?gr(i):!t&&n?dr(i):i}}function Hy(e){return Mr(e)}function zy(e){return e.reduce((t,r)=>s.HasPropertyKey(r,Zr)||s.HasPropertyKey(r,oo)||s.HasPropertyKey(r,Zt)?[t[0],l.Assign(t[1],r)]:[l.Assign(t[0],r),t[1]],[{},{}])}function Wy(e){return zy(e[1])}function Vy(e){let[t,r]=e,n=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return M(t,n)}function Jy(e){return s.IsEqual(e.length,5)?gr(dr(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?gr(e[3]):dr(e[3]):Cn()}function Yy(e){if(!s.IsArray(e)||!s.IsEqual(e.length,3))return e;let[t,r,n]=e;return t&&n?gr(dr(r)):t&&!n?gr(r):!t&&n?dr(r):r}function Qy(e){return s.IsEqual(e.length,2)?wn(e[1]):s.IsEqual(e.length,1)?e[0]:Cn()}function Xy(e){return Mr(e)}function Zy(e){return we(e[1])}function ex(e){return gr(dr(e[4]))}function tx(e){return gr(e[3])}function rx(e){return dr(e[3])}function nx(e){return e[2]}function ox(e){return s.IsEqual(e.length,2)?wn(e[1]):s.IsEqual(e.length,1)?e[0]:Cn()}function ix(e){return Mr(e)}function sx(e){return fr(e[1],e[4])}function ax(e){return pr(e[2],e[5])}function Hg(e,t){return s.IsEqual(e,"remove")?Kx(t):s.IsEqual(e,"add")?gr(t):t}function mx(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function zg(e,t){return s.IsEqual(e,"remove")?Bx(t):s.IsEqual(e,"add")?dr(t):t}function ux(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function cx(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function px(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?pi(ii(e[3]),e[5],e[6][0],Hg(e[1],zg(e[8],e[10]))):pi(ii(e[3]),e[5],Be(e[3]),Hg(e[1],zg(e[8],e[10])))}function fx(e){return Be(e)}function dx(e){return BigInt(e)}function lx(e){return parseFloat(e)}function gx(e){return s.IsEqual(e,"true")}function yx(e){return null}function xx(e){return{[e[0]]:e[2]}}function hx(e){return Mr(e)}function SP(e){return e.reduce((t,r)=>l.Assign(t,r),{})}function Ix(e){return SP(e[1])}function bx(e){return Mr(e)}function $x(e){return e[1]}function Ex(e){return oi()}function Sx(e){return tt()}function kx(e){return Tt()}function Tx(e){return Sn()}function wx(e){return ie()}function Cx(e){return G(e)}function Rx(e){return j(e[1])}function Px(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Ax(e){return[e[0],...e[1]]}function Ox(e){return e[1]}function Mx(e){return Mr(e)}function vx(e){return s.IsEqual(e.length,2)?e[1]:[]}function Fx(e){let t=e[2],r=e[3],[n,o]=e[4],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Yr(t,fi(r,n,i))}}function Lx(e){let t=e[2],[r,n]=e[3],o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return{[e[1]]:fi(t,r,o)}}function jx(e){return{[e[1]]:Yr(e[2],e[4])}}function Dx(e){return{[e[1]]:e[3]}}function Nx(e){return null}function qx(e){return Mr(e)}function Ux(e){return e[1]}function _x(e){let[t,r]=[e[0],e[1]];return zx(l.Assign(t,zy(r)[0]))}function yi(e){return Y(e.length,2)}function V(e,t,r){return yi(e)?t(e[0],e[1]):r()}function wP(e,t){return Y(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function be(e,t){for(let r=0;r<e.length;r++){let n=wP(e[r],t);if(yi(n))return n}return[]}function Ju(e,t){return Array.from({length:t-e+1},(r,n)=>String.fromCharCode(e+n))}var Wx=[...Ju(97,122),...Ju(65,90)],Yu="0",Qu=Ju(49,57),mo=[Yu,...Qu],Vx=" ",uo=`
2
2
  `;var rn="_",ja=".",Jx="$",Da="-";var Yx="//",Qx="/*",RP="*/";function Xx(e){let t=e.indexOf(RP);return Y(t,-1)?"":e.slice(t+2)}function Zx(e){let t=e.indexOf(uo);return Y(t,-1)?"":e.slice(t)}function PP(e){return e.replace(/^[ \t\r\f\v]+/,"")}function Na(e){let t=PP(e);return t.startsWith(Qx)?Na(Xx(t.slice(2))):t.startsWith(Yx)?Na(Zx(t.slice(2))):t}function Qe(e){let t=e.trimStart();return t.startsWith(Qx)?Qe(Xx(t.slice(2))):t.startsWith(Yx)?Qe(Zx(t.slice(2))):t}function qa(e,t){return V(be([e],t),(r,n)=>[r,n],()=>["",t])}function AP(e,t){return e.includes(t)}function co(e,t,r,n=""){return V(be(e,r),(o,i)=>AP(t,o)?co(e,t,i,n):co(e,t,i,`${n}${o}`),()=>[n,r])}function OP(e){return be(Qu,e)}var MP=[...mo,rn];function vP(e){return co(MP,[rn],e)}function FP(e){return V(be([Yu],e),(t,r)=>[t,r],()=>V(OP(e),(t,r)=>V(vP(r),(n,o)=>[`${t}${n}`,o],()=>[]),()=>[]))}function Ua(e){return FP(Qe(e))}function LP(e){return qa(Da,e)}function jP(e){return V(LP(e),(t,r)=>V(Ua(r),(n,o)=>[`${t}${n}`,o],()=>[]),()=>[])}function eh(e){return jP(Qe(e))}function DP(e){return V(eh(e),(t,r)=>V(be(["n"],r),(n,o)=>[`${t}`,o],()=>[]),()=>[])}function Xu(e){return DP(e)}function Zu(e,t){return be([e],t)}function x(e,t){return Y(e,"")?["",t]:e.startsWith(uo)?Zu(e,Na(t)):e.startsWith(Vx)?Zu(e,t):Zu(e,Qe(t))}var th=[...Wx,rn,Jx];function NP(e){return be(th,e)}var qP=[...th,...mo];function rh(e,t=""){return V(be(qP,e),(r,n)=>rh(n,`${t}${r}`),()=>[t,e])}function UP(e){return V(NP(e),(t,r)=>V(rh(r),(n,o)=>[`${t}${n}`,o],()=>[]),()=>[])}function Re(e){return UP(Qe(e))}var _P=[...mo,rn];function BP(e){return yi(be([ja],e))}function nh(e){return V(co(_P,[rn],e),(t,r)=>Y(t,"")?[]:[t,r],()=>[])}function GP(e){return V(be([ja],e),(t,r)=>V(nh(r),(n,o)=>[`0${t}${n}`,o],()=>[]),()=>[])}function KP(e){return V(Ua(e),(t,r)=>V(be([ja],r),(n,o)=>V(nh(o),(i,a)=>[`${t}${n}${i}`,a],()=>[`${t}`,o]),()=>[`${t}`,r]),()=>[])}function HP(e){return BP(e)?GP(e):KP(e)}function oh(e){return HP(Qe(e))}function zP(e){return qa(Da,e)}function WP(e){return V(zP(e),(t,r)=>V(oh(r),(n,o)=>[`${t}${n}`,o],()=>[]),()=>[])}function _a(e){return WP(Qe(e))}function VP(e){return Y(e,"")?[]:[e.slice(0,1),e.slice(1)]}function ih(e,t){return Yi(e,(r,n)=>t.startsWith(r)?!0:ih(n,t),()=>!1)}function nn(e,t,r=""){return V(VP(t),(n,o)=>ih(e,t)?[r,t]:nn(e,o,`${r}${n}`),()=>[])}function JP(e,t,r){return V(be([e],r),(n,o)=>V(nn([t],o),(i,a)=>V(be([t],a),(m,c)=>[`${i}`,c],()=>[]),()=>[]),()=>[])}function YP(e,t,r){return V(be([e],r),(n,o)=>V(nn([uo,t],o),(i,a)=>V(be([t],a),(m,c)=>[`${i}`,c],()=>[]),()=>[]),()=>[])}function sh(e,t,r,n){return r?JP(e,t,Qe(n)):YP(e,t,Qe(n))}function QP(e,t){return be(e,t)}function XP(e,t){return sh(e,e,!1,t)}function ZP(e,t){return V(QP(e,t),(r,n)=>XP(r,`${r}${n}`),()=>[])}function Ba(e,t){return ZP(e,Qe(t))}function ah(e,t){return V(nn(e,t),(r,n)=>Y(r,"")?[]:[r,n],()=>[])}var u=(e,t,r=()=>[])=>e.length===2?t(e):r(),tA=e=>u(u(Re(e),([t,r])=>u(x("extends",r),([n,o])=>u(X(o),([i,a])=>u(x("=",a),([m,c])=>u(X(c),([p,f])=>[[t,n,i,m,p],f]))))),([t,r])=>[Vg(t),r]),rA=e=>u(u(Re(e),([t,r])=>u(x("extends",r),([n,o])=>u(X(o),([i,a])=>[[t,n,i],a]))),([t,r])=>[Jg(t),r]),nA=e=>u(u(Re(e),([t,r])=>u(x("=",r),([n,o])=>u(X(o),([i,a])=>[[t,n,i],a]))),([t,r])=>[Yg(t),r]),oA=e=>u(Re(e),([t,r])=>[Qg(t),r]),ch=e=>u(u(tA(e),([t,r])=>[t,r],()=>u(rA(e),([t,r])=>[t,r],()=>u(nA(e),([t,r])=>[t,r],()=>u(oA(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),ph=(e,t=[])=>u(u(x(",",e),([r,n])=>u(ch(n),([o,i])=>[[r,o],i])),([r,n])=>ph(n,[...t,r]),()=>[t,e]),iA=e=>u(u(u(ch(e),([t,r])=>u(ph(r),([n,o])=>u(u(x(",",o),([i,a])=>[[i],a],()=>[[],o]),([i,a])=>[[t,n,i],a]))),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Xg(t),r]),rc=e=>u(u(x("<",e),([t,r])=>u(iA(r),([n,o])=>u(x(">",o),([i,a])=>[[t,n,i],a]))),([t,r])=>[Zg(t),r]),fh=(e,t=[])=>u(u(x(",",e),([r,n])=>u(X(n),([o,i])=>[[r,o],i])),([r,n])=>fh(n,[...t,r]),()=>[t,e]),sA=e=>u(u(u(X(e),([t,r])=>u(fh(r),([n,o])=>u(u(x(",",o),([i,a])=>[[i],a],()=>[[],o]),([i,a])=>[[t,n,i],a]))),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[ey(t),r]),aA=e=>u(u(x("<",e),([t,r])=>u(sA(r),([n,o])=>u(x(">",o),([i,a])=>[[t,n,i],a]))),([t,r])=>[ty(t),r]),mA=e=>u(u(Re(e),([t,r])=>u(aA(r),([n,o])=>[[t,n],o])),([t,r])=>[ry(t),r]),dh=e=>u(u(u(x(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[ny(t),r]),lh=e=>u(x("string",e),([t,r])=>[oy(t),r]),gh=e=>u(x("number",e),([t,r])=>[iy(t),r]),uA=e=>u(x("boolean",e),([t,r])=>[sy(t),r]),cA=e=>u(x("undefined",e),([t,r])=>[ay(t),r]),pA=e=>u(x("null",e),([t,r])=>[my(t),r]),yh=e=>u(x("integer",e),([t,r])=>[uy(t),r]),fA=e=>u(x("bigint",e),([t,r])=>[cy(t),r]),dA=e=>u(x("unknown",e),([t,r])=>[py(t),r]),lA=e=>u(x("any",e),([t,r])=>[fy(t),r]),gA=e=>u(x("object",e),([t,r])=>[dy(t),r]),yA=e=>u(x("never",e),([t,r])=>[ly(t),r]),xh=e=>u(x("symbol",e),([t,r])=>[gy(t),r]),xA=e=>u(x("void",e),([t,r])=>[yy(t),r]),hA=e=>u(x("this",e),([t,r])=>[xy(t),r]),IA=e=>u(u(x("${",e),([t,r])=>u(X(r),([n,o])=>u(x("}",o),([i,a])=>[[t,n,i],a]))),([t,r])=>[Ey(t),r]),ec=e=>u(nn(["${","`"],e),([t,r])=>[Sy(t),r]),hh=e=>u(u(u(ec(e),([t,r])=>u(IA(r),([n,o])=>u(hh(o),([i,a])=>[[t,n,i],a]))),([t,r])=>[t,r],()=>u(u(ec(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>u(u(ec(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[ky(t),r]),nc=e=>u(u(x("`",e),([t,r])=>u(hh(r),([n,o])=>u(x("`",o),([i,a])=>[[t,n,i],a]))),([t,r])=>[Ty(t),r]),bA=e=>u(nc(e),([t,r])=>[wy(t),r]),$A=e=>u(u(u(x("if",e),([t,r])=>u(X(r),([n,o])=>u(x("then",o),([i,a])=>u(X(a),([m,c])=>u(x("else",c),([p,f])=>u(X(f),([d,g])=>[[t,n,i,m,p,d],g])))))),([t,r])=>[t,r],()=>u(u(x("if",e),([t,r])=>u(X(r),([n,o])=>u(x("then",o),([i,a])=>u(X(a),([m,c])=>[[t,n,i,m],c])))),([t,r])=>[t,r],()=>[])),([t,r])=>[Cy(t),r]),EA=e=>u(Xu(e),([t,r])=>[hy(t),r]),SA=e=>u(u(x("true",e),([t,r])=>[t,r],()=>u(x("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Iy(t),r]),kA=e=>u(_a(e),([t,r])=>[by(t),r]),TA=e=>u(Ba(["'",'"'],e),([t,r])=>[$y(t),r]),wA=e=>u(u(u(x("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Ry(t),r]),Ih=(e,t=[])=>u(u(u(x("[",e),([r,n])=>u(X(n),([o,i])=>u(x("]",i),([a,m])=>[[r,o,a],m]))),([r,n])=>[r,n],()=>u(u(x("[",e),([r,n])=>u(x("]",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>[])),([r,n])=>Ih(n,[...t,r]),()=>[t,e]),CA=e=>u(Ih(e),([t,r])=>[Py(t),r]),RA=e=>u(u(u(x("extends",e),([t,r])=>u(X(r),([n,o])=>u(x("?",o),([i,a])=>u(X(a),([m,c])=>u(x(":",c),([p,f])=>u(X(f),([d,g])=>[[t,n,i,m,p,d],g])))))),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Ay(t),r]),PA=e=>u(u(u(x("(",e),([t,r])=>u(X(r),([n,o])=>u(x(")",o),([i,a])=>[[t,n,i],a]))),([t,r])=>[t,r],()=>u(lh(e),([t,r])=>[t,r],()=>u(gh(e),([t,r])=>[t,r],()=>u(uA(e),([t,r])=>[t,r],()=>u(cA(e),([t,r])=>[t,r],()=>u(pA(e),([t,r])=>[t,r],()=>u(yh(e),([t,r])=>[t,r],()=>u(fA(e),([t,r])=>[t,r],()=>u(dA(e),([t,r])=>[t,r],()=>u(lA(e),([t,r])=>[t,r],()=>u(gA(e),([t,r])=>[t,r],()=>u(yA(e),([t,r])=>[t,r],()=>u(xh(e),([t,r])=>[t,r],()=>u(xA(e),([t,r])=>[t,r],()=>u(hA(e),([t,r])=>[t,r],()=>u(EA(e),([t,r])=>[t,r],()=>u(SA(e),([t,r])=>[t,r],()=>u(kA(e),([t,r])=>[t,r],()=>u(TA(e),([t,r])=>[t,r],()=>u(bA(e),([t,r])=>[t,r],()=>u($A(e),([t,r])=>[t,r],()=>u(UA(e),([t,r])=>[t,r],()=>u(GA(e),([t,r])=>[t,r],()=>u(JA(e),([t,r])=>[t,r],()=>u(VA(e),([t,r])=>[t,r],()=>u(ZA(e),([t,r])=>[t,r],()=>u(mA(e),([t,r])=>[t,r],()=>u(eO(e),([t,r])=>[t,r],()=>[])))))))))))))))))))))))))))),([t,r])=>[Oy(t),r]),AA=e=>u(u(u(x("with",e),([t,r])=>u(jh(r),([n,o])=>[[t,n],o])),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[My(t),r]),bh=e=>u(u(wA(e),([t,r])=>u(PA(r),([n,o])=>u(CA(o),([i,a])=>u(RA(a),([m,c])=>u(AA(c),([p,f])=>[[t,n,i,m,p],f]))))),([t,r])=>[vy(t),r]),$h=e=>u(u(u(x("&",e),([t,r])=>u(bh(r),([n,o])=>u($h(o),([i,a])=>[[t,n,i],a]))),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Eh=e=>u(u(bh(e),([t,r])=>u($h(r),([n,o])=>[[t,n],o])),([t,r])=>[Fy(t),r]),Sh=e=>u(u(u(x("|",e),([t,r])=>u(Eh(r),([n,o])=>u(Sh(o),([i,a])=>[[t,n,i],a]))),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Ga=e=>u(u(Eh(e),([t,r])=>u(Sh(r),([n,o])=>[[t,n],o])),([t,r])=>[Ly(t),r]),OA=e=>u(u(x("readonly",e),([t,r])=>u(Ga(r),([n,o])=>[[t,n],o])),([t,r])=>[jy(t),r]),MA=e=>u(u(x("|",e),([t,r])=>u(Ga(r),([n,o])=>[[t,n],o])),([t,r])=>[Dy(t),r]),vA=e=>u(u(rc(e),([t,r])=>u(x("=",r),([n,o])=>u(X(o),([i,a])=>[[t,n,i],a]))),([t,r])=>[Ny(t),r]),FA=e=>u(u(u(x("infer",e),([t,r])=>u(Re(r),([n,o])=>u(x("extends",o),([i,a])=>u(Ga(a),([m,c])=>[[t,n,i,m],c])))),([t,r])=>[t,r],()=>u(u(x("infer",e),([t,r])=>u(Re(r),([n,o])=>[[t,n],o])),([t,r])=>[t,r],()=>[])),([t,r])=>[qy(t),r]),X=e=>u(u(FA(e),([t,r])=>[t,r],()=>u(MA(e),([t,r])=>[t,r],()=>u(OA(e),([t,r])=>[t,r],()=>u(Ga(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),LA=e=>u(_a(e),([t,r])=>[Uy(t),r]),jA=e=>u(Re(e),([t,r])=>[t,r]),DA=e=>u(Ba(["'",'"'],e),([t,r])=>[t,r]),NA=e=>u(u(x("[",e),([t,r])=>u(Re(r),([n,o])=>u(x(":",o),([i,a])=>u(u(yh(a),([m,c])=>[m,c],()=>u(gh(a),([m,c])=>[m,c],()=>u(lh(a),([m,c])=>[m,c],()=>u(xh(a),([m,c])=>[m,c],()=>[])))),([m,c])=>u(x("]",c),([p,f])=>[[t,n,i,m,p],f]))))),([t,r])=>[_y(t),r]),kh=e=>u(u(LA(e),([t,r])=>[t,r],()=>u(jA(e),([t,r])=>[t,r],()=>u(DA(e),([t,r])=>[t,r],()=>u(NA(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),Th=e=>u(u(u(x("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[By(t),r]),wh=e=>u(u(u(x("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>u([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Gy(t),r]),Ch=e=>u(u(Th(e),([t,r])=>u(kh(r),([n,o])=>u(wh(o),([i,a])=>u(x(":",a),([m,c])=>u(X(c),([p,f])=>[[t,n,i,m,p],f]))))),([t,r])=>[Ky(t),r]),Ka=e=>u(u(u(x(",",e),([t,r])=>u(x(`
3
3
  `,r),([n,o])=>[[t,n],o])),([t,r])=>[t,r],()=>u(u(x(";",e),([t,r])=>u(x(`
4
4
  `,r),([n,o])=>[[t,n],o])),([t,r])=>[t,r],()=>u(u(x(",",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>u(u(x(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>u(u(x(`
@@ -186,10 +186,11 @@ ${cN(ee)}`}],details:{...h(!0),endedAt:_}}}catch(ee){let _=ee instanceof Error?e
186
186
  \r
187
187
  `),C.destroy();return}}else{C.write(`HTTP/1.1 404 Not Found\r
188
188
  \r
189
- `),C.destroy();return}h.handleUpgrade(b,C,k,_=>{oe==="/ext"&&(i?.close(),i=_,_.on("message",qt=>y(_,qt.toString())),_.on("close",()=>{i===_&&(i=null)}))})}),await new Promise((b,C)=>{I.once("error",C),I.listen(t,"127.0.0.1",()=>{I.off("error",C);let k=I.address();k&&typeof k=="object"&&(t=k.port),b()})});let E=setInterval(()=>{for(let b of h.clients)b.readyState===b.OPEN&&b.ping()},yN);return E.unref?.(),n(`relay listening on 127.0.0.1:${t}`),{port:t,token:r,state:()=>({extensionConnected:i!==null&&i.readyState===i.OPEN,extensionSeen:a,browserVersion:m,userAgent:c,tabs:p,uptimeMs:Date.now()-o,port:t}),rpc:g,ready:()=>i!==null&&i.readyState===i.OPEN,stop:async()=>{clearInterval(E);for(let b of d.values())clearTimeout(b.timer),b.reject(new Error("Browser relay stopped"));d.clear();for(let b of h.clients)b.terminate();await new Promise(b=>h.close(()=>b())),await new Promise(b=>I.close(()=>b()))}}}import{existsSync as Cw,readFileSync as Rw}from"node:fs";import{randomBytes as xN}from"node:crypto";import{existsSync as Ew,mkdirSync as Sw,readFileSync as Zp,renameSync as hN,writeFileSync as IN,chmodSync as bN}from"node:fs";import{dirname as Tw,join as Ao}from"node:path";import{fileURLToPath as $N}from"node:url";function bw(e,t){return`const OMP_INSTALL_VERSION = ${JSON.stringify(t)};
190
- ${e}`}function $w(e,t){let r=JSON.parse(e);return`${JSON.stringify({...r,name:"HowToCode Browser Relay",description:"Lets HowToCode CLI drive your existing tabs through a local CDP relay.",homepage_url:"https://howtofix.id",version_name:t,action:{default_title:"HowToCode Browser Relay (click for settings)"}},null," ")}
191
- `}function Om(e){return e.replaceAll("OMP Browser Relay","HowToCode Browser Relay").replaceAll("omp-browser-relay","howtocode-browser-relay").replaceAll("omp-relay-keepalive","howtocode-relay-keepalive")}var EN=Ao(Tw($N(import.meta.url)),"assets");function Mm(e){let t=Ao(e,"browser-relay");return{extensionDir:Ao(t,"extension"),tokenPath:Ao(t,"token")}}function Ui(e){return Zp(Ao(EN,`${e}.txt`),"utf8")}function kw(e,t){let r=`${e}.${process.pid}.tmp`;IN(r,t),hN(r,e)}function ww(e,t){let{extensionDir:r,tokenPath:n}=Mm(e);Sw(r,{recursive:!0});let o={"manifest.json":$w(Ui("manifest.json"),t),"options.html":Om(Ui("options.html")),"options.js":Om(Ui("options.js")),LICENSE:Ui("LICENSE"),"background.js":Om(bw(Ui("background.js"),t))},i=[];for(let[m,c]of Object.entries(o)){let p=Ao(r,m);(Ew(p)?Zp(p,"utf8"):null)!==c&&(kw(p,c),i.push(m))}let a="";return Ew(n)?a=Zp(n,"utf8").trim():(a=xN(24).toString("hex"),Sw(Tw(n),{recursive:!0}),kw(n,`${a}
192
- `),bN(n,384)),{extensionDir:r,tokenPath:n,token:a,wrote:i}}var Bi=null,_i=null;function Pw(){try{return JSON.parse(Rw(new URL("../../package.json",import.meta.url),"utf8")).version??"0.0.0"}catch{return"0.0.0"}}function aLe(){let e=ww(Ye,Pw());return{token:e.token,extensionDir:e.extensionDir,tokenPath:e.tokenPath,wrote:e.wrote}}async function mLe(){if(Bi)return Bi;if(_i)return _i;_i=(async()=>{let{tokenPath:e}=Mm(Ye);if(!Cw(e))throw new Error("Browser relay is not installed. Run /browser-relay install and load the extension in Chrome first.");let t=Rw(e,"utf8").trim();if(!t)throw new Error("Browser relay token file is empty. Run /browser-relay install again.");let r=process.env.HOWTOCODE_BROWSER_RELAY_PORT?.trim(),n=r&&/^\d+$/.test(r)?Number(r):void 0,o=await Iw({token:t,port:n,productVersion:Pw()});return Bi=o,o})();try{return await _i}finally{_i=null}}async function uLe(){let{extensionDir:e,tokenPath:t}=Mm(Ye);return{running:Bi!==null,state:Bi?.state()??null,tokenConfigured:Cw(t),extensionDir:e}}import{execFile as SN,execFileSync as kN}from"node:child_process";import{promisify as TN}from"node:util";import{createHash as Mw}from"node:crypto";import{copyFileSync as wN,existsSync as vm,mkdirSync as Fm,readFileSync as rf,readdirSync as CN,rmSync as RN,statSync as ef}from"node:fs";import{dirname as vw,join as Pt,resolve as Lm}from"node:path";var tf=Pt(Ye,"rewind"),jm="refs/howtocode",Aw=100,Fw=30,Lw="project.json",jw="checkpoints.json",Ow=!1;function PN(e){let t=Lm(e);for(;;){if(vm(Pt(t,".git")))return!0;let r=vw(t);if(r===t)return!1;t=r}}var AN=TN(SN);async function Nt(e,t){let r={...process.env};for(let o of["GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_NAMESPACE","GIT_COMMON_DIR"])delete r[o];r.GIT_DIR=e.gitDir,r.GIT_WORK_TREE=e.root,r.GIT_AUTHOR_NAME=r.GIT_COMMITTER_NAME="howtocode",r.GIT_AUTHOR_EMAIL=r.GIT_COMMITTER_EMAIL="howtocode@local";let{stdout:n}=await AN("git",t,{cwd:e.root,env:r,encoding:"utf8",maxBuffer:8*1024*1024});return n.trim()}function ON(e){return Mw("sha1").update(e).digest("hex").slice(0,16)}function hLe(e){let t=Lm(e).replace(/\/+$/,"")||"/",r=Pt(tf,ON(t)),n=Pt(r,"git"),o={root:t,gitDir:n,metaFile:Pt(r,jw),disabled:!1};return!vm(Pt(n,"HEAD"))&&!PN(t)?(o.disabled=!0,o):(Fm(r,{recursive:!0}),vm(Pt(n,"HEAD"))||(Fm(n,{recursive:!0}),kN("git",["init","--quiet","--initial-branch=howtocode"],{env:{...process.env,GIT_DIR:n},stdio:["ignore","ignore","pipe"]})),MN(t,n),vN(r,t),Ow||(Ow=!0,LN({keep:r})),o)}function MN(e,t){let r=Pt(e,".git","info","exclude");try{if(!ef(r).isFile())return;Fm(Pt(t,"info"),{recursive:!0}),wN(r,Pt(t,"info","exclude"))}catch{}}function vN(e,t){let r=Pt(e,Lw),n=`${JSON.stringify({version:1,root:t})}
189
+ `),C.destroy();return}h.handleUpgrade(b,C,k,_=>{oe==="/ext"&&(i?.close(),i=_,_.on("message",qt=>y(_,qt.toString())),_.on("close",()=>{i===_&&(i=null)}))})}),await new Promise((b,C)=>{I.once("error",C),I.listen(t,"127.0.0.1",()=>{I.off("error",C);let k=I.address();k&&typeof k=="object"&&(t=k.port),b()})});let E=setInterval(()=>{for(let b of h.clients)b.readyState===b.OPEN&&b.ping()},yN);return E.unref?.(),n(`relay listening on 127.0.0.1:${t}`),{port:t,token:r,state:()=>({extensionConnected:i!==null&&i.readyState===i.OPEN,extensionSeen:a,browserVersion:m,userAgent:c,tabs:p,uptimeMs:Date.now()-o,port:t}),rpc:g,ready:()=>i!==null&&i.readyState===i.OPEN,stop:async()=>{clearInterval(E);for(let b of d.values())clearTimeout(b.timer),b.reject(new Error("Browser relay stopped"));d.clear();for(let b of h.clients)b.terminate();await new Promise(b=>h.close(()=>b())),await new Promise(b=>I.close(()=>b()))}}}import{existsSync as Cw,readFileSync as Rw}from"node:fs";import{randomBytes as xN}from"node:crypto";import{existsSync as Ew,mkdirSync as Sw,readFileSync as Zp,renameSync as hN,writeFileSync as IN,chmodSync as bN}from"node:fs";import{dirname as Tw,join as Ao}from"node:path";import{fileURLToPath as $N}from"node:url";function bw(e,t,r){let n=r?`void chrome.storage.local.get({ token: "" }).then((stored) => { if (!stored.token) return chrome.storage.local.set({ token: ${JSON.stringify(r)} }); });
190
+ `:"";return`const OMP_INSTALL_VERSION = ${JSON.stringify(t)};
191
+ ${n}${e}`}function $w(e,t){let r=JSON.parse(e);return`${JSON.stringify({...r,name:"HowToCode Browser Relay",description:"Lets HowToCode CLI drive your existing tabs through a local CDP relay.",homepage_url:"https://howtofix.id",version_name:t,action:{default_title:"HowToCode Browser Relay (click for settings)"}},null," ")}
192
+ `}function Om(e){return e.replaceAll("OMP Browser Relay","HowToCode Browser Relay").replaceAll("omp-browser-relay","howtocode-browser-relay").replaceAll("omp-relay-keepalive","howtocode-relay-keepalive")}var EN=Ao(Tw($N(import.meta.url)),"assets");function Mm(e){let t=Ao(e,"browser-relay");return{extensionDir:Ao(t,"extension"),tokenPath:Ao(t,"token")}}function Ui(e){return Zp(Ao(EN,`${e}.txt`),"utf8")}function kw(e,t){let r=`${e}.${process.pid}.tmp`;IN(r,t),hN(r,e)}function ww(e,t){let{extensionDir:r,tokenPath:n}=Mm(e);Sw(r,{recursive:!0});let o="";Ew(n)?o=Zp(n,"utf8").trim():(o=xN(24).toString("hex"),Sw(Tw(n),{recursive:!0}),kw(n,`${o}
193
+ `),bN(n,384));let i={"manifest.json":$w(Ui("manifest.json"),t),"options.html":Om(Ui("options.html")),"options.js":Om(Ui("options.js")),LICENSE:Ui("LICENSE"),"background.js":Om(bw(Ui("background.js"),t,o))},a=[];for(let[m,c]of Object.entries(i)){let p=Ao(r,m);(Ew(p)?Zp(p,"utf8"):null)!==c&&(kw(p,c),a.push(m))}return{extensionDir:r,tokenPath:n,token:o,wrote:a}}var Bi=null,_i=null;function Pw(){try{return JSON.parse(Rw(new URL("../../package.json",import.meta.url),"utf8")).version??"0.0.0"}catch{return"0.0.0"}}function aLe(){let e=ww(Ye,Pw());return{token:e.token,extensionDir:e.extensionDir,tokenPath:e.tokenPath,wrote:e.wrote}}async function mLe(){if(Bi)return Bi;if(_i)return _i;_i=(async()=>{let{tokenPath:e}=Mm(Ye);if(!Cw(e))throw new Error("Browser relay is not installed. Run /browser-relay install and load the extension in Chrome first.");let t=Rw(e,"utf8").trim();if(!t)throw new Error("Browser relay token file is empty. Run /browser-relay install again.");let r=process.env.HOWTOCODE_BROWSER_RELAY_PORT?.trim(),n=r&&/^\d+$/.test(r)?Number(r):void 0,o=await Iw({token:t,port:n,productVersion:Pw()});return Bi=o,o})();try{return await _i}finally{_i=null}}async function uLe(){let{extensionDir:e,tokenPath:t}=Mm(Ye);return{running:Bi!==null,state:Bi?.state()??null,tokenConfigured:Cw(t),extensionDir:e}}import{execFile as SN,execFileSync as kN}from"node:child_process";import{promisify as TN}from"node:util";import{createHash as Mw}from"node:crypto";import{copyFileSync as wN,existsSync as vm,mkdirSync as Fm,readFileSync as rf,readdirSync as CN,rmSync as RN,statSync as ef}from"node:fs";import{dirname as vw,join as Pt,resolve as Lm}from"node:path";var tf=Pt(Ye,"rewind"),jm="refs/howtocode",Aw=100,Fw=30,Lw="project.json",jw="checkpoints.json",Ow=!1;function PN(e){let t=Lm(e);for(;;){if(vm(Pt(t,".git")))return!0;let r=vw(t);if(r===t)return!1;t=r}}var AN=TN(SN);async function Nt(e,t){let r={...process.env};for(let o of["GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_NAMESPACE","GIT_COMMON_DIR"])delete r[o];r.GIT_DIR=e.gitDir,r.GIT_WORK_TREE=e.root,r.GIT_AUTHOR_NAME=r.GIT_COMMITTER_NAME="howtocode",r.GIT_AUTHOR_EMAIL=r.GIT_COMMITTER_EMAIL="howtocode@local";let{stdout:n}=await AN("git",t,{cwd:e.root,env:r,encoding:"utf8",maxBuffer:8*1024*1024});return n.trim()}function ON(e){return Mw("sha1").update(e).digest("hex").slice(0,16)}function hLe(e){let t=Lm(e).replace(/\/+$/,"")||"/",r=Pt(tf,ON(t)),n=Pt(r,"git"),o={root:t,gitDir:n,metaFile:Pt(r,jw),disabled:!1};return!vm(Pt(n,"HEAD"))&&!PN(t)?(o.disabled=!0,o):(Fm(r,{recursive:!0}),vm(Pt(n,"HEAD"))||(Fm(n,{recursive:!0}),kN("git",["init","--quiet","--initial-branch=howtocode"],{env:{...process.env,GIT_DIR:n},stdio:["ignore","ignore","pipe"]})),MN(t,n),vN(r,t),Ow||(Ow=!0,LN({keep:r})),o)}function MN(e,t){let r=Pt(e,".git","info","exclude");try{if(!ef(r).isFile())return;Fm(Pt(t,"info"),{recursive:!0}),wN(r,Pt(t,"info","exclude"))}catch{}}function vN(e,t){let r=Pt(e,Lw),n=`${JSON.stringify({version:1,root:t})}
193
194
  `;try{if(rf(r,"utf8")===n)return}catch{}try{sr(r,n)}catch{}}function Dm(e){try{let t=JSON.parse(rf(e.metaFile,"utf8"));if(t?.version===1&&t.sessions)return t}catch{}return{version:1,sessions:{}}}function nf(e,t){Fm(vw(e.metaFile),{recursive:!0}),sr(e.metaFile,`${JSON.stringify(t,null,1)}
194
195
  `)}function FN(e,t){return e.disabled?[]:[...Dm(e).sessions[t]??[]].sort((r,n)=>r.at-n.at)}async function ILe(e,t,r){if(e.disabled)return null;let n;try{await Nt(e,["add","-A","--ignore-errors","--"]),n=await Nt(e,["write-tree"])}catch{return null}let i=FN(e,t).find(g=>g.tree===n),a=Date.now(),m=`${a.toString(36)}-${Mw("sha1").update(`${n}:${a}`).digest("hex").slice(0,6)}`,c=i?.commit;if(!c){let g=["howtocode checkpoint",`session ${t}`,`created ${new Date(a).toISOString()}`,`prompt ${r.slice(0,200)}`].join(`
195
196
  `);c=await Nt(e,["commit-tree",n,"-m",g]),await Nt(e,["update-ref",`${jm}/${m}`,c])}let p={id:m,tree:n,commit:c,prompt:r,at:a},f=Dm(e),d=[...f.sessions[t]??[],p];for(let g of d.slice(0,Math.max(0,d.length-Aw)))try{await Nt(e,["update-ref","-d",`${jm}/${g.id}`])}catch{}return f.sessions[t]=d.slice(-Aw),nf(e,f),p}async function bLe(e,t){let r=[];if(e.disabled)return{ok:!1,output:"checkpoints are off: this directory is not a git repository",removed:r};try{await Nt(e,["read-tree","--reset","-u",t.tree])}catch(n){return{ok:!1,output:n instanceof Error?n.message:String(n),removed:r}}try{let n=await Nt(e,["clean","-fd"]);for(let o of n.split(`