UNPKG

code-server

Version:

Run VS Code on a remote server.

84 lines • 198 kB
import{a as pi}from"./chunk-AUJBCLOB.js";import{a as fi}from"./chunk-DG5HJNUS.js";import{a as Pr}from"./chunk-FNK4WUGV.js";import{a as ri}from"./chunk-XQK6T7GN.js";import{a as ui,b as di}from"./chunk-2OIKMCXU.js";import{a as li}from"./chunk-QYK4EZTH.js";import"./chunk-ORE2T4WP.js";import"./chunk-XRA5PP2P.js";import"./chunk-24O22KEQ.js";import"./chunk-SND6Q57N.js";import"./chunk-U7N72GQD.js";import"./chunk-B6VOIJOC.js";import"./chunk-KANRR4GQ.js";import"./chunk-TBI42J5D.js";import{a as ci}from"./chunk-KAMM3ZVW.js";import{b as ni}from"./chunk-2K2L2JEZ.js";import{b as Ir,d as ii,m as Er,o as oi,p as Ue,q as si,r as ai}from"./chunk-DSAPFASR.js";import"./chunk-5TVAF4SJ.js";import{B as Yn,C as zt,D as Sr,E as St,F as Qn,O as ei,Q as $r,R as ti,da as st,ea as $t,g as Un,h as Fn,j as kt,m as Kn,n as kr,o as Bn,p as Hn,q as qn,r as Vn,s as zr,t as Wn,u as je,v as Jn,w as ot,y as Gn,z as Xn}from"./chunk-L7V4HMD4.js";import{b as R,c as xr}from"./chunk-SNB7PWCV.js";import{e as pe}from"./chunk-CU3WNRKO.js";import{a as h}from"./chunk-5ZAMBDF5.js";import"./chunk-3RNHDNP5.js";var hi;function E(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,d=Object.keys(u);for(let l=0;l<d.length;l++){let p=d[l];p in a||(a[p]=u[p].bind(a))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var c;let u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var fe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(hi=globalThis).__zod_globalConfig??(hi.__zod_globalConfig={});var Ar=globalThis.__zod_globalConfig;function he(e){return e&&Object.assign(Ar,e),Ar}function Pt(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function gi(e,t){return typeof t=="bigint"?t.toString():t}function _i(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Mr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}var mi=Symbol("evaluating");function ue(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==mi)return n===void 0&&(n=mi,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}var Cr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function yi(e){if(Et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}var vi=new Set(["string","number","symbol"]);function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Or(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function B(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bi(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var wi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Fe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function xi(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function $e(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function It(e){return typeof e=="string"?e:e?.message}function me(e,t,r){let n=e.message?e.message:It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input",{inst:i,continue:o,input:s,...a}=e;return a.path??(a.path=[]),a.message=n,t?.reportInput&&(a.input=s),a}var ki=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zi=E("$ZodError",ki),ct=E("$ZodError",ki,{Parent:Error});var qc=e=>(t,r,n,i)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new fe;if(s.issues.length){let a=new(i?.Err??e)(s.issues.map(c=>me(c,o,he())));throw Cr(a,i?.callee),a}return s.value},At=qc(ct),Vc=e=>async(t,r,n,i)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??e)(s.issues.map(c=>me(c,o,he())));throw Cr(a,i?.callee),a}return s.value},Tt=Vc(ct),Wc=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new fe;return o.issues.length?{success:!1,error:new(e??zi)(o.issues.map(s=>me(s,i,he())))}:{success:!0,data:o.value}},W=Wc(ct),Jc=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>me(s,i,he())))}:{success:!0,data:o.value}},ut=Jc(ct);var Gc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Xc=new RegExp(`^${Gc}$`);var Si=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var $i=/^-?\d+$/,Zr=/^-?\d+(?:\.\d+)?$/,Ii=/^(?:true|false)$/i;var dt=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Yc={number:"number",bigint:"bigint",object:"date"};var Rr=E("$ZodCheckGreaterThan",(e,t)=>{dt.init(e,t);let r=Yc[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Ei=E("$ZodCheckNumberFormat",(e,t)=>{dt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=wi[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=i,a.maximum=o,r&&(a.pattern=$i)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}});var Ai={major:4,minor:4,patch:3};var J=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ai;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let o of i._zod.onattach)o(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,a,c)=>{let u=Fe(s),d;for(let l of a){if(l._zod.def.when){if(xi(s)||!l._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,f=l._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new fe;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(u||(u=Fe(s,p)))});else{if(s.issues.length===p)continue;u||(u=Fe(s,p))}}return d?d.then(()=>s):s},o=(s,a,c)=>{if(Fe(s))return s.aborted=!0,s;let u=i(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new fe;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>o(d,s,a)):o(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new fe;return c.then(u=>i(u,n,a))}return i(c,n,a)}}ue(e,"~standard",()=>({validate:i=>{try{let o=W(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return ut(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Oi=E("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Si(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}});var Nr=E("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??Zr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),Zi=E("$ZodNumberFormat",(e,t)=>{Ei.init(e,t),Nr.init(e,t)}),Ri=E("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=Ii,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}});var Ni=E("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r});var Di=E("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}});function Ti(e,t,r){e.issues.length&&t.issues.push(...$e(r,e.issues)),t.value[r]=e.value}var Li=E("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?o.push(c.then(u=>Ti(u,r,s))):Ti(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Ct(e,t,r,n,i,o){let s=r in n;if(e.issues.length){if(i&&o&&!s)return;t.issues.push(...$e(r,e.issues))}if(!s&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function eu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function tu(e,t,r,n,i,o){let s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type,d=c.optin==="optional",l=c.optout==="optional";for(let p in t){if(p==="__proto__"||a.has(p))continue;if(u==="never"){s.push(p);continue}let f=c.run({value:t[p],issues:[]},n);f instanceof Promise?e.push(f.then(m=>Ct(m,r,p,t,d,l))):Ct(f,r,p,t,d,l)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}var ji=E("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let n=_i(()=>eu(t));ue(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let d=a[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let l of d.values)c[u].add(l)}}return c});let i=Et,o=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=n.value);let u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let d=[],l=s.shape;for(let p of s.keys){let f=l[p],m=f._zod.optin==="optional",_=f._zod.optout==="optional",b=f._zod.run({value:u[p],issues:[]},c);b instanceof Promise?d.push(b.then(S=>Ct(S,a,p,u,m,_))):Ct(b,a,p,u,m,_)}return o?tu(d,u,a,c,n.value,e):d.length?Promise.all(d).then(()=>a):a}});function Mi(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!Fe(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>me(s,n,he())))}),t)}var Ui=E("$ZodUnion",(e,t)=>{J.init(e,t),ue(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ue(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ue(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),ue(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Mr(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>Mi(a,n,e,i)):Mi(s,n,e,i)}});var Fi=E("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!yi(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>me(f,n,he())),input:u,path:[u],inst:e});continue}let l=d.value,p=t.valueType._zod.run({value:i[u],issues:[]},n);p instanceof Promise?o.push(p.then(f=>{f.issues.length&&r.issues.push(...$e(u,f.issues)),r.value[l]=f.value})):(p.issues.length&&r.issues.push(...$e(u,p.issues)),r.value[l]=p.value)}let c;for(let u in i)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Zr.test(a)&&c.issues.length){let l=t.keyType._zod.run({value:Number(a),issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");l.issues.length===0&&(c=l)}if(c.issues.length){t.mode==="loose"?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(l=>me(l,n,he())),input:a,path:[a],inst:e});continue}let d=t.valueType._zod.run({value:i[a],issues:[]},n);d instanceof Promise?o.push(d.then(l=>{l.issues.length&&r.issues.push(...$e(a,l.issues)),r.value[c.value]=l.value})):(d.issues.length&&r.issues.push(...$e(a,d.issues)),r.value[c.value]=d.value)}}return o.length?Promise.all(o).then(()=>r):r}});var Ki=E("$ZodEnum",(e,t)=>{J.init(e,t);let r=Pt(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>vi.has(typeof i)).map(i=>typeof i=="string"?at(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),Bi=E("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?at(n):n?at(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}});function Ci(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Hi=E("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ue(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ue(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mr(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=r.value,o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Ci(s,i)):Ci(o,i)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var qi;var Dr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ru(){return new Dr}(qi=globalThis).__zod_globalRegistry??(qi.__zod_globalRegistry=ru());var Vi=globalThis.__zod_globalRegistry;function Wi(e,t){return new e({type:"string",...B(t)})}function Ji(e,t){return new e({type:"number",checks:[],...B(t)})}function Gi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...B(t)})}function Xi(e,t){return new e({type:"boolean",...B(t)})}function Yi(e){return new e({type:"unknown"})}function Qi(e,t){return new e({type:"void",...B(t)})}function eo(e,t){return new Rr({check:"greater_than",...B(t),value:e,inclusive:!1})}function Lr(e,t){return new Rr({check:"greater_than",...B(t),value:e,inclusive:!0})}function jr(e){return eo(0,e)}function Te(e){return Lr(0,e)}function Ot(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vi,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function C(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let p=s.schema,f=t.processors[i.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);f(e,t,p,d)}let l=e._zod.parent;l&&(s.ref||(s.ref=l),C(l,t,d),t.seen.get(l).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&H(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Zt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let i=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let l=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(l)return{ref:p(l)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let u=`#/${a}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=i(s);a.def={...a.schema},u&&(a.defId=u);let d=a.schema;for(let l in d)delete d[l];d.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&e.reused==="ref"){o(s);continue}}}function Rt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,d={...u},l=c.ref;if(c.ref=null,l){n(l);let f=e.seen.get(l),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,d),a._zod.parent===l)for(let b in u)b==="$ref"||b==="allOf"||b in d||delete u[b];if(m.$ref&&f.def)for(let b in u)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(u[b])===JSON.stringify(f.def[b])&&delete u[b]}let p=a._zod.parent;if(p&&p!==l){n(p);let f=e.seen.get(p);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let m in u)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(u[m])===JSON.stringify(f.def[m])&&delete u[m]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())n(a[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}Object.assign(i,r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&i.id===o&&delete i.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:to(t,"input",e.processors),output:to(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function H(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return H(n.element,r);if(n.type==="set")return H(n.valueType,r);if(n.type==="lazy")return H(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return H(n.innerType,r);if(n.type==="intersection")return H(n.left,r)||H(n.right,r);if(n.type==="record"||n.type==="map")return H(n.keyType,r)||H(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:H(n.in,r)||H(n.out,r);if(n.type==="object"){for(let i in n.shape)if(H(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(H(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(H(i,r))return!0;return!!(n.rest&&H(n.rest,r))}return!1}var to=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=Ot({...i??{},target:o,io:t,processors:r});return C(e,s),Zt(s,e),Rt(s,e)};var iu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ou=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=iu[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let d=[...c];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(l=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:l.source}))])}},su=(e,t,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let l=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";l?f?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d:typeof o=="number"&&(i.minimum=o),p?f?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof s=="number"&&(i.maximum=s),typeof c=="number"&&(i.multipleOf=c)},au=(e,t,r,n)=>{r.type="boolean"},cu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},uu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},du=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},lu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},pu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},fu=(e,t,r,n)=>{r.not={}},hu=(e,t,r,n)=>{},mu=(e,t,r,n)=>{},gu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},_u=(e,t,r,n)=>{let i=e._zod.def,o=Pt(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},yu=(e,t,r,n)=>{let i=e._zod.def,o=[];for(let s of i.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},vu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},bu=(e,t,r,n)=>{let i=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},wu=(e,t,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=e._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(i,o)},xu=(e,t,r,n)=>{r.type="boolean"},ku=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Su=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$u=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Iu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Eu=(e,t,r,n)=>{let i=r,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=C(o.element,t,{...n,path:[...n.path,"items"]})},Pu=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object",i.properties={};let s=o.shape;for(let u in s)i.properties[u]=C(s[u],t,{...n,path:[...n.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{let d=o.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=C(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Au=(e,t,r,n)=>{let i=e._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>C(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},Tu=(e,t,r,n)=>{let i=e._zod.def,o=C(i.left,t,{...n,path:[...n.path,"allOf",0]}),s=C(i.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},Mu=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((p,f)=>C(p,t,{...n,path:[...n.path,s,f]})),u=o.rest?C(o.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,u&&(i.items=u)):t.target==="openapi-3.0"?(i.items={anyOf:c},u&&i.items.anyOf.push(u),i.minItems=c.length,u||(i.maxItems=c.length)):(i.items=c,u&&(i.additionalItems=u));let{minimum:d,maximum:l}=e._zod.bag;typeof d=="number"&&(i.minItems=d),typeof l=="number"&&(i.maxItems=l)},Cu=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let d=C(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let l of c)i.patternProperties[l.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=C(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=C(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let u=s._zod.values;if(u){let d=[...u].filter(l=>typeof l=="string"||typeof l=="number");d.length>0&&(i.required=d)}},Ou=(e,t,r,n)=>{let i=e._zod.def,o=C(i.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Zu=(e,t,r,n)=>{let i=e._zod.def;C(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Ru=(e,t,r,n)=>{let i=e._zod.def;C(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Nu=(e,t,r,n)=>{let i=e._zod.def;C(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Du=(e,t,r,n)=>{let i=e._zod.def;C(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Lu=(e,t,r,n)=>{let i=e._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?i.out:i.in:i.out;C(s,t,n);let a=t.seen.get(e);a.ref=s},ju=(e,t,r,n)=>{let i=e._zod.def;C(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.readOnly=!0},Uu=(e,t,r,n)=>{let i=e._zod.def;C(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Fu=(e,t,r,n)=>{let i=e._zod.def;C(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Ku=(e,t,r,n)=>{let i=e._zod.innerType;C(i,t,n);let o=t.seen.get(e);o.ref=i},ro={string:ou,number:su,boolean:au,bigint:cu,symbol:uu,null:du,undefined:lu,void:pu,never:fu,any:hu,unknown:mu,date:gu,enum:_u,literal:yu,nan:vu,template_literal:bu,file:wu,success:xu,custom:ku,function:zu,transform:Su,map:$u,set:Iu,array:Eu,object:Pu,union:Au,intersection:Tu,tuple:Mu,record:Cu,nullable:Ou,nonoptional:Zu,default:Ru,prefault:Nu,catch:Du,pipe:Lu,readonly:ju,promise:Uu,optional:Fu,lazy:Ku};function Ur(e,t){if("_idmap"in e){let n=e,i=Ot({...t,processors:ro}),o={};for(let c of n._idmap.entries()){let[u,d]=c;C(d,i)}let s={},a={registry:n,uri:t?.uri,defs:o};i.external=a;for(let c of n._idmap.entries()){let[u,d]=c;Zt(i,d),s[u]=Rt(i,d)}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Ot({...t,processors:ro});return C(e,r),Zt(r,e),Rt(r,e)}var ne=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>W(e,r,n),e.parseAsync=async(r,n)=>Tt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ut(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Or(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),qu=E("ZodMiniString",(e,t)=>{Oi.init(e,t),ne.init(e,t)});function v(e){return Wi(qu,e)}var io=E("ZodMiniNumber",(e,t)=>{Nr.init(e,t),ne.init(e,t)});function te(e){return Ji(io,e)}var Vu=E("ZodMiniNumberFormat",(e,t)=>{Zi.init(e,t),io.init(e,t)});function Me(e){return Gi(Vu,e)}var Wu=E("ZodMiniBoolean",(e,t)=>{Ri.init(e,t),ne.init(e,t)});function lt(e){return Xi(Wu,e)}var Ju=E("ZodMiniUnknown",(e,t)=>{Ni.init(e,t),ne.init(e,t)});function Ie(){return Yi(Ju)}var Gu=E("ZodMiniVoid",(e,t)=>{Di.init(e,t),ne.init(e,t)});function Fr(e){return Qi(Gu,e)}var Xu=E("ZodMiniArray",(e,t)=>{Li.init(e,t),ne.init(e,t)});function G(e,t){return new Xu({type:"array",element:e,...B(t)})}var Yu=E("ZodMiniObject",(e,t)=>{ji.init(e,t),ne.init(e,t),ue(e,"shape",()=>t.shape)});function k(e,t){let r={type:"object",shape:e??{},...B(t)};return new Yu(r)}var Qu=E("ZodMiniUnion",(e,t)=>{Ui.init(e,t),ne.init(e,t)});function Ke(e,t){return new Qu({type:"union",options:e,...B(t)})}var no=E("ZodMiniRecord",(e,t)=>{Fi.init(e,t),ne.init(e,t)});function oo(e,t,r){return!t||!t._zod?new no({type:"record",keyType:v(),valueType:e,...B(t)}):new no({type:"record",keyType:e,valueType:t,...B(r)})}var ed=E("ZodMiniEnum",(e,t)=>{Ki.init(e,t),ne.init(e,t),e.options=Object.values(t.entries)});function ge(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ed({type:"enum",entries:r,...B(t)})}var td=E("ZodMiniLiteral",(e,t)=>{Bi.init(e,t),ne.init(e,t)});function Kr(e,t){return new td({type:"literal",values:Array.isArray(e)?e:[e],...B(t)})}var rd=E("ZodMiniOptional",(e,t)=>{Hi.init(e,t),ne.init(e,t)});function z(e){return new rd({type:"optional",innerType:e})}var id=new Set(["type","format","properties","required","additionalProperties","items","prefixItems","const","enum","anyOf","oneOf","discriminator","$ref","title","description"]);function ye(e){if(e===!0||e===!1)return e;if(e===null||typeof e!="object")throw new Error(`normalizeJsonSchema: expected object, got ${typeof e}`);if(Array.isArray(e))throw new Error("normalizeJsonSchema: expected object, got array");let t=e;if("not"in t&&sd(t.not))return!1;let r={};for(let[n,i]of Object.entries(t)){if(!id.has(n))continue;let o=od(n,i);o!==void 0&&(r[n]=o)}if(r.type==="object"&&!("additionalProperties"in r)&&(r.additionalProperties=!1),Array.isArray(r.oneOf)&&!("discriminator"in r)){let n=ad(r.oneOf);n!==void 0&&(r.discriminator=n)}return"discriminator"in r&&!Array.isArray(r.oneOf)&&delete r.discriminator,Object.keys(r).length===0?!0:r}function od(e,t){switch(e){case"properties":{if(!Gr(t))return{};let r={};for(let[n,i]of Object.entries(t))r[n]=ye(i);return r}case"items":case"additionalProperties":return t===!1?!1:ye(t);case"prefixItems":case"anyOf":case"oneOf":return Array.isArray(t)?t.map(r=>ye(r)):[];case"discriminator":{if(!Gr(t))return;let r=t.propertyName;return typeof r!="string"||r.length===0?void 0:{propertyName:r}}case"enum":return Array.isArray(t)?t.slice():[];case"required":return Array.isArray(t)?t.slice().sort():[];default:return t}}function sd(e){return Gr(e)&&Object.keys(e).length===0}function Gr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ad(e){if(e.length<2)return;let t=[];for(let n of e){if(n===!0||n===!1||n.type!=="object")return;let i=n.properties;if(!i)return;t.push(i)}let r=so(t[0]);for(let n=1;n<t.length;n++)if(r=r.filter(i=>so(t[n]).includes(i)),r.length===0)return;for(let n of r){let i=new Set,o=!0;for(let s of t){let a=s[n],c=JSON.stringify(a.const);if(i.has(c)){o=!1;break}i.add(c)}if(o)return{propertyName:n}}}function so(e){let t=[];for(let[r,n]of Object.entries(e))n===!0||n===!1||"const"in n&&t.push(r);return t}var un=class po{paramsSchema;resultSchema;errorSchema;docs;clientStreamSchema;serverStreamSchema;kind="request";constructor(t,r,n,i={},o,s){this.paramsSchema=t,this.resultSchema=r,this.errorSchema=n,this.docs=i,this.clientStreamSchema=o,this.serverStreamSchema=s}withStream(t){return new po(this.paramsSchema,this.resultSchema,this.errorSchema,this.docs,t.client,t.server)}},dn=class{paramsSchema;docs;kind="notification";constructor(e,t={}){this.paramsSchema=e,this.docs=t}};function M(e,t,r,n){let i=a=>typeof a=="object"&&a!==null&&"_zod"in a,o=i(r)?r:void 0,s=(i(r)?n:r)??{};return new un(e,t??Fr(),o??Fr(),s)}function ie(e,t={}){return new dn(e,t)}function fo(e,t){let r=e._zod?.def?.type;return r==="void"||r==="undefined"?!0:cd(Ur(e),t)}function cd(e,t){if(!Lt(e))return ye(e);let r=Lt(e.$defs)?e.$defs:{},n=Xr(e);if(Object.keys(r).length===0&&n.size===0)return ye(e);if(t===void 0)throw new Error("zodToSvcJsonSchema: local references require a component destination");let i=`method=${Br(t.methodName)}&schema=${Br(t.schemaPosition)}`,o=new Map;for(let u of Object.keys(r))o.set(u,`${i}&def=${Br(u)}`);let s=n.has("#")?`${i}&root`:void 0,a=u=>Yr(u,o,s);for(let[u,d]of Object.entries(r)){let l=o.get(u);if(l===void 0)throw new Error(`zodToSvcJsonSchema: missing component for "${u}"`);ao(t.components,l,ye(a(d)))}let c=a(e);return s!==void 0?(ao(t.components,s,ye(c)),{$ref:Qr(s)}):ye(c)}function Xr(e,t=new Set){if(Array.isArray(e)){for(let r of e)Xr(r,t);return t}if(!Lt(e))return t;typeof e.$ref=="string"&&e.$ref.startsWith("#")&&t.add(e.$ref);for(let r of Object.values(e))Xr(r,t);return t}function Yr(e,t,r){if(Array.isArray(e))return e.map(i=>Yr(i,t,r));if(!Lt(e))return e;let n={};for(let[i,o]of Object.entries(e))i!=="$defs"&&(i==="$ref"&&typeof o=="string"?n[i]=ud(o,t,r):n[i]=Yr(o,t,r));return n}function ud(e,t,r){if(e==="#"){if(r===void 0)throw new Error("zodToSvcJsonSchema: root reference has no component destination");return Qr(r)}if(e.startsWith("#/$defs/")){let n=e.slice(8),i=[...t.keys()].find(s=>ho(s)===n),o=i===void 0?void 0:t.get(i);if(o===void 0)throw new Error(`zodToSvcJsonSchema: dangling local reference "${e}"`);return Qr(o)}if(e.startsWith("#")&&!e.startsWith("#/components/schemas/"))throw new Error(`zodToSvcJsonSchema: unsupported local reference "${e}"`);return e}function ao(e,t,r){if(Object.hasOwn(e,t))throw new Error(`zodToSvcJsonSchema: duplicate component name "${t}"`);e[t]=r}function Qr(e){return`#/components/schemas/${ho(e)}`}function ho(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Br(e){return encodeURIComponent(e).replace(/~/g,"%7E")}function Lt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function mo(e){let t=Dt(e);if(t===void 0)throw new Error("jcsCanonicalize: value is not JSON-representable");return t}var Lx=new TextEncoder;function Dt(e,t=new Set){if(typeof e=="number"&&Number.isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("Infinity is not allowed");if(e===null||typeof e!="object")return JSON.stringify(e);let r=e;if(typeof r.toJSON=="function"){if(t.has(r))throw new Error("Circular reference detected");t.add(r);let i=Dt(r.toJSON(),t);return t.delete(r),i}if(t.has(r))throw new Error("Circular reference detected");t.add(r);let n;if(Array.isArray(r))n=`[${r.map(i=>Dt(i===void 0||typeof i=="symbol"?null:i,t)).join(",")}]`;else{let i=[];for(let o of Object.keys(r).sort()){let s=r[o];s===void 0||typeof s=="symbol"||i.push(`${JSON.stringify(o)}:${Dt(s,t)}`)}n=`{${i.join(",")}}`}return t.delete(r),n}var dd=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function de(e,t){return e>>>t|e<<32-t}function ld(e){let t=e.length,r=t*8,n=t+9+63&-64,i=new Uint8Array(n);i.set(e),i[t]=128;let o=new DataView(i.buffer);o.setUint32(n-8,Math.floor(r/4294967296),!1),o.setUint32(n-4,r>>>0,!1);let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);for(let d=0;d<n;d+=64){for(let y=0;y<16;y++)a[y]=o.getUint32(d+y*4,!1);for(let y=16;y<64;y++){let w=a[y-15],T=a[y-2],L=de(w,7)^de(w,18)^w>>>3,I=de(T,17)^de(T,19)^T>>>10;a[y]=a[y-16]+L+a[y-7]+I>>>0}let l=s[0],p=s[1],f=s[2],m=s[3],_=s[4],b=s[5],S=s[6],$=s[7];for(let y=0;y<64;y++){let w=de(_,6)^de(_,11)^de(_,25),T=_&b^~_&S,L=$+w+T+dd[y]+a[y]>>>0,I=(de(l,2)^de(l,13)^de(l,22))+(l&p^l&f^p&f)>>>0;$=S,S=b,b=_,_=m+L>>>0,m=f,f=p,p=l,l=L+I>>>0}s[0]=s[0]+l>>>0,s[1]=s[1]+p>>>0,s[2]=s[2]+f>>>0,s[3]=s[3]+m>>>0,s[4]=s[4]+_>>>0,s[5]=s[5]+b>>>0,s[6]=s[6]+S>>>0,s[7]=s[7]+$>>>0}let c=new Uint8Array(32),u=new DataView(c.buffer);for(let d=0;d<8;d++)u.setUint32(d*4,s[d],!1);return c}function go(e){let t=mo(en(e,!0)),r=ld(new TextEncoder().encode(t));return Array.from(r.subarray(0,8),n=>n.toString(16).padStart(2,"0")).join("")}function en(e,t=!1){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>en(n));let r={};for(let n of Object.keys(e)){if(n==="comment"||t&&n==="hash")continue;let i=e[n];i!==void 0&&(r[n]=en(i))}return r}var Hr=new WeakMap,_o=class{info;members;constructor(e,t,r={}){if(this.info=e,this.members=t,Hr.set(this,{frozenSchema:r.frozenSchema,schemaCache:void 0,hashCache:void 0}),e.hash!==void 0&&this.schemaHash!==e.hash)throw new Error(`Interface hash mismatch for "${e.id}": expected "${e.hash}", got "${this.schemaHash}". The interface's wire contract changed \u2014 update the pinned hash to "${this.schemaHash}" after reviewing the change.`)}get schemaHash(){let e=Hr.get(this);return e.hashCache===void 0&&(e.hashCache=go(e.frozenSchema??co(this.info,this.members,""))),e.hashCache}toSchema(){let e=Hr.get(this);return e.schemaCache===void 0&&(e.schemaCache=e.frozenSchema!==void 0?{...e.frozenSchema,hash:this.schemaHash}:co(this.info,this.members,this.schemaHash)),e.schemaCache}};function co(e,t,r){let n={},i={};for(let[s,a]of Object.entries(t))n[s]=pd(s,a,i);let o={id:e.id,hash:r,methods:n};return Object.keys(i).length>0&&(o.components={schemas:i}),e.description!==void 0&&(o.description=e.description),e.comment!==void 0&&(o.comment=e.comment),o}function pd(e,t,r){let n=t.docs;if(t.kind==="request"){let o={params:pt(e,"params",t.paramsSchema,r),result:pt(e,"result",t.resultSchema,r)};return t.clientStreamSchema!==void 0&&(o.clientStream=pt(e,"clientStream",t.clientStreamSchema,r)),t.serverStreamSchema!==void 0&&(o.serverStream=pt(e,"serverStream",t.serverStreamSchema,r)),n.description!==void 0&&(o.description=n.description),n.comment!==void 0&&(o.comment=n.comment),n.annotations!==void 0&&(o.annotations=n.annotations),o}let i={params:pt(e,"params",t.paramsSchema,r)};return n.description!==void 0&&(i.description=n.description),n.comment!==void 0&&(i.comment=n.comment),n.annotations!==void 0&&(i.annotations=n.annotations),i}function pt(e,t,r,n){return fo(r,{methodName:e,schemaPosition:t,components:n})}function F(e,t){return new _o(e,t)}var tn=F({id:"hubrpc.defaults",description:"Reflection: preset default service / interface on this connection."},{get:M(k({}),k({serviceId:z(v()),interfaceId:z(v()),interfaceHash:z(v())}))}),fd=G(k({principal:v(),transitive:z(lt())})),jt=Ke([k({exact:v()}),k({prefix:v()})]),hd=k({serviceId:v(),interfaceId:v(),interfaceHash:v(),serviceDescription:z(v()),rootPrincipalSets:z(G(fd)),reachableServiceIds:z(G(jt))}),rn=F({id:"hubrpc.directory",description:"Reflection: list services exposed by this endpoint. Can also list other directory services that can be explored."},{list:M(k({interfaceId:z(v()),interfaceIdPrefix:z(v()),serviceId:z(v()),serviceIdScopes:z(G(jt)),cursor:z(v()),limit:z(te().check(Me(),jr())),timeoutMs:z(te().check(Me(),Te()))}),k({items:G(hd),nextCursor:z(v()),truncated:z(lt())})),watch:M(k({interfaceId:z(v()),interfaceIdPrefix:z(v()),serviceId:z(v()),serviceIdScopes:z(G(jt))}),k({})).withStream({server:k({})})});var nn=F({id:"hubrpc.schemas",description:"Reflection: fetch interface schemas by id (+ optional hash). Must serve the interfaces advertised in this endpoint's directory."},{get:M(k({interfaceId:v(),hash:z(v())}),k({schema:Ie()}))}),yo=k({portId:v(),label:z(v())}),vo=k({type:z(v()),label:z(v()),processId:z(te()),processType:z(v()),nodeStatusServiceId:z(v()),metadata:z(oo(v(),Ke([v(),te(),lt()])))}),ln=k({source:ge(["self","attacher"]),descriptor:vo}),bo=k({nodeId:v(),kind:z(ge(["endpoint","hub"])),label:z(v()),descriptors:z(G(ln)),ports:G(yo)}),on=k({nodeId:v(),portId:v()}),wo=k({from:on,to:on,label:z(v()),peerState:z(ge(["identified","pending","unsupported","error"]))}),xo=k({serviceId:v(),nodeId:v(),portId:v(),match:ge(["exact","prefix"])}),ko=k({observerServiceId:v(),entryNodeId:v(),nodes:G(bo),links:G(wo),routes:G(xo)}),pn=F({id:"hubrpc.topology",description:"Inspect the transport graph visible from a service. A watch emits invalidation ticks; consumers re-fetch getGraph after each tick."},{getGraph:M(k({}),ko),watchGraph:M(k({}),k({})).withStream({server:k({})})}),sn=k({edgeId:v(),portId:v(),requestId:z(Ke([te(),v()]))}),zo=k({type:Kr("transit"),ts:te(),nodeId:v(),in:z(sn),out:z(sn),disposition:ge(["forwarded","consumed","dropped","unroutable"]),kind:ge(["request","notification","response","stream"]),method:z(v()),params:z(Ie()),result:z(Ie()),error:z(k({code:te(),message:v(),data:z(Ie())}))}),So=k({type:Kr("overflow"),dropped:te().check(Me(),Te())}),an=Ke([zo,So]),cn=k({delivered:te().check(Me(),Te()),dropped:te().check(Me(),Te())}),md=k({methodPrefix:z(v())}),gd=k({methodPrefix:z(v()),maxPayloadBytes:te().check(Me(),Te())}),fn=F({id:"hubrpc.traffic",description:"Stream raw message transits for the entire node hosting the addressed service. Payload-free and explicitly payload-bearing variants keep disclosure opt-in."},{watch:M(md,cn).withStream({server:an}),watchWithPayloads:M(gd,cn).withStream({server:an})}),_d=k({nodeId:v(),portId:v(),descriptors:z(G(ln))}),Ut=F({id:"hubrpc.node",description:"Topology bootstrap: identify the node and port at this end of the direct connection."},{getNodeId:M(k({}),_d)}),Oe={toCaller:"toCaller",toCallee:"toCallee"},_e={cancel:"cancel",ping:"ping",pong:"pong"};var $o=F({id:"$stream",description:"Reserved sub-protocol for in-flight stream messages correlated to a request by `requestId`."},{send:ie(k({requestId:Ke([te(),v()]),dir:ge(["toCaller","toCallee"]),control:z(k({type:ge(["cancel","ping","pong"]),reason:z(v()),nonce:z(v())})),payload:z(Ie())}),{description:"Emit a stream message tied to the request `requestId`."})}),Ze=`${$o.info.id}::send`,X={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,permissionRequired:-32401,peerDisconnected:-32402,requestTimeout:-32403,cancelled:-32800};function Be(e){return typeof e.method=="string"&&e.id!==void 0}function hn(e){return typeof e.method=="string"&&e.id===void 0}function ft(e){return typeof e.method!="string"}var le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",jx=(()=>{let e={};for(let t=0;t<64;t++)e[le[t]]=t;return e})();function Io(e){let t="",r=0;for(;r+3<=e.length;r+=3){let i=e[r]<<16|e[r+1]<<8|e[r+2];t+=le[i>>18&63]+le[i>>12&63]+le[i>>6&63]+le[i&63]}let n=e.length-r;if(n===1){let i=e[r]<<16;t+=le[i>>18&63]+le[i>>12&63]}else if(n===2){let i=e[r]<<16|e[r+1]<<8;t+=le[i>>18&63]+le[i>>12&63]+le[i>>6&63]}return t}function Eo(e){let t=e.split("::");if(t.length===3&&t[0].length===0&&t[1].length>0&&t[2].length>0)return{kind:"interface",interfaceId:t[1],member:t[2]};if(!t.some(r=>r.length===0)){if(t.length===1)return{kind:"bare",member:t[0]};if(t.length===2)return{kind:"interface",interfaceId:t[0],member:t[1]};if(t.length===3)return{kind:"full",serviceId:t[0],interfaceId:t[1],member:t[2]}}}var Po=Symbol.for("@vscode/hubrpc.localMessageContext");function Ao(e,t){return Object.defineProperties(e,{context:{configurable:!0,enumerable:!1,value:t},[Po]:{configurable:!0,enumerable:!1,value:!0}}),e}function To(e){let t=e;return e[Po]===!0?t.context:void 0}var Mo=class Co{sender;_setHandler;_setWireObserver;constructor(t,r,n){this.sender=t,this._setHandler=r,this._setWireObserver=n}setRequestHandler(t){this._setHandler(t)}setWireMessageObserver(t,r){this._setWireObserver?.(t,r)}withSender(t){return new Co(t(this.sender),this._setHandler,this._setWireObserver)}},Oo=Symbol("hubrpc.inspectionCall");function qr(e){return Object.defineProperty(e,Oo,{value:!0}),e}function Vr(e){return e?.[Oo]===!0}var ve=class extends Error{code;data;constructor(e,t,r){super(e),this.code=t,this.data=r,this.name="RpcError"}};function yd(e,t){return"exact"in t?e===t.exact:t.prefix===""||e===t.prefix||e.startsWith(`${t.prefix}/`)}function Zo(e,t){return t===void 0||t.some(r=>yd(e,r))}var vd=10*6e4,Ft=class Ro{_transport;static create(t){return this.createWithClose(t).channel}static createWithClose(t){let r=new Ro(t);return{channel:new Mo(r,n=>r.setRequestHandler(n),(n,i)=>r.setWireMessageObserver(n,i)),close:()=>r.close()}}_nextId=1;_pending=new Map;_streamListeners=new Map;_streamControl=new Map;_incomingAborts=new Map;_handler;_wireObserver;_isInspectionMethod;_outboundInspectionRequests=new Set;_inboundInspectionRequests=new Set;_closeError;setRequestHandler(t){this._handler=t}setWireMessageObserver(t,r){this._wireObserver=t,this._isInspectionMethod=t===void 0?void 0:r,t===void 0&&(this._outboundInspectionRequests.clear(),this._inboundInspectionRequests.clear())}constructor(t){this._transport=t,this._transport.setListener(r=>this._onMessage(r))}async sendRequest(t,r,n){this._throwIfClosed();let i=this._nextId++,o={jsonrpc:"2.0",id:i,method:t};r!==void 0&&(o.params=r);let s=new Promise((a,c)=>{this._pending.set(String(i),{resolve:a,reject:c})});this._observeOutbound(o,n);try{await this._transport.send(o)}catch(a){throw this._pending.delete(String(i)),this._observeSendFailure(i,a),a}return s}async sendNotification(t,r,n){this._throwIfClosed();let i={jsonrpc:"2.0",method:t};r!==void 0&&(i.params=r),this._observeOutbound(i,n),await this._transport.send(i)}sendRequestWithStream(t,r,n){this._throwIfClosed();let i=this._nextId++,o=String(i),s,a,c=new Promise((p,f)=>{s=p,a=f});this._pending.set(o,{resolve:s,reject:a}),n?.onStreamMessage&&this._streamListeners.set(o,n.onStreamMessage);let u=this._makePinger(i,Oe.toCallee);this._streamControl.set(o,u.onControl);let d=setInterval(()=>{this._sendStream(i,Oe.toCallee,{control:{type:_e.ping}})},vd);d.unref?.();let l=()=>{clearInterval(d),u.dispose(),this._streamControl.delete(o)};return c.then(l,l),(async()=>{let p={jsonrpc:"2.0",id:i,method:t};r!==void 0&&(p.params=r),this._observeOutbound(p,n),await this._transport.send(p)})().catch(p=>{this._pending.delete(o),this._streamListeners.delete(o),this._observeSendFailure(i,p),l(),a(p instanceof Error?p:new Error(String(p)))}),{result:c,send:p=>this._sendStream(i,Oe.toCallee,{payload:p}),cancel:p=>this._sendStream(i,Oe.toCallee,{control:p!==void 0?{type:_e.cancel,reason:p}:{type:_e.cancel}}),ping:u.ping}}_makePinger(t,r){let n=new Map,i=1;return{ping:()=>{let c=`${t}:${i++}`,u=new Promise((d,l)=>n.set(c,{resolve:d,reject:l}));return this._sendStream(t,r,{control:{type:_e.ping,nonce:c}}),u},onControl:c=>{if(c.type===_e.ping)this._sendStream(t,r,{control:{type:_e.pong,nonce:c.nonce}});else if(c.type===_e.pong&&c.nonce!==void 0){let u=n.get(c.nonce);u&&(n.delete(c.nonce),u.resolve())}},dispose:()=>{let c=new ve("Request settled before pong",X.cancelled);for(let u of n.values())u.reject(c);n.clear()}}}async _sendStream(t,r,n){this._throwIfClosed();let i={jsonrpc:"2.0",method:Ze,params:{requestId:t,dir:r,...n}};this._observeOutbound(i),await this._transport.send(i)}close(){if(this._closeError)return;let t=new ve("Connection closed",X.peerDisconnected);this._closeError=t;for(let r of this._incomingAborts.values())r.abort(t);this._incomingAborts.clear(),this._transport.dispose();for(let r of this._pending.values())r.reject(t);this._pending.clear(),this._streamListeners.clear(),this._streamControl.clear()}_throwIfClosed(){if(this._closeError)throw this._closeError}_onMessage(t){let r=t.context;if(this._observeInbound(t),ft(t)){if(t.id===null)return;let n=String(t.id),i=this._pending.get(n);if(!i)return;if(this._pending.delete(n),this._streamListeners.delete(n),"error"in t){let o=t.error,s=new ve(o.message,o.code,o.data);i.reject(s)}else i.resolve(t.result);return}if(Be(t)){this._handleRequest(t,r).catch(()=>{});return}if(hn(t)){if(t.method===Ze){this._handleStreamNotification(t);return}this._handleNotification(t,r);return}}_handleStreamNotification(t){let r=t.params;if(!r)return;let n=r.requestId;if(n===void 0)return;let i=String(n);if(r.control){this._streamControl.get(i)?.(r.control);return}let o=this._streamListeners.get(i);o&&o(r.payload)}async _handleRequest(t,r){let n=String(t.id),i=this._makePinger(t.id,Oe.toCaller),o={send:c=>this._sendStream(t.id,Oe.toCaller,{payload:c}),onMessage:c=>{c?this._streamListeners.set(n,c):this._streamListeners.delete(n)},ping:i.ping,markInspectionLifecycle:()=>{this._wireObserver!==void 0&&this._inboundInspectionRequests.add(n)}},s=new AbortController;this._incomingAborts.set(n,s),this._streamControl.set(n,c=>{c.type===_e.cancel?s.abort(new ve(c.reason??"cancelled",X.cancelled)):i.onControl(c)});let a;try{if(!this._handler)a={error:{code:X.methodNotFound,message:`No handler registered on this endpoint (method: ${t.method}).`}};else try{a=await this._handler.handleRequest({method:t.method,params:t.params,context:r,stream:o,signal:s.signal})}catch(c){a={error:{code:X.internalError,message:c instanceof Error?c.message:String(c)}}}}finally{this._streamListeners.delete(n),this._streamControl.delete(n),this._incomingAborts.delete(n),i.dispose()}if("result"in a){let c={jsonrpc:"2.0",id:t.id,result:a.result};this._observeOutbound(c),await this._transport.send(c)}else{let c={jsonrpc:"2.0",id:t.id,error:a.error};this._observeOutbound(c),await this._transport.send(c)}}_handleNotification(t,r){if(this._handler)try{this._handler.handleNotification({method:t.method,params:t.params,context:r,stream:bd,signal:wd})}catch{}}_observeInbound(t){let r=this._wireObserver;if(r===void 0)return;let n=!1;if(Be(t))n=this._isInspectionMethod?.(t.method)===!0,n&&this._inboundInspectionRequests.add(String(t.id));else if(ft(t)){if(t.id!==null){let i=String(t.id);n=this._outboundInspectionRequests.delete(i)}}else t.method===Ze?n=this._isInspectionStream(t):n=this._isInspectionMethod?.(t.method)===!0;n||r("inbound",t)}_observeOutbound(t,r){Be(t)&&Vr(r)&&Ao(t,{...To(t),inspection:!0});let n=this._wireObserver;if(n===void 0)return;let i=!1;if(Be(t))i=Vr(r),i&&this._outboundInspectionRequests.add(String(t.id));else if(ft(t)){if(t.id!==null){let o=String(t.id);i=this._inboundInspectionRequests.delete(o)}}else t.method===Ze?i=this._isInspectionStream(t):i=Vr(r);i||n("outbound",t)}_observeSendFailure(t,r){if(this._wireObserver===void 0){this._outboundInspectionRequests.delete(String(t));return}this._observeInbound({jsonrpc:"2.0",id:t,error:{code:X.peerDisconnected,message:r instanceof Error?r.message:String(r)}})}_isInspectionStream(t){let r=t.params;if(r?.requestId===void 0)return!1;let n=String(r.requestId);return this._outboundInspectionRequests.has(n)||this._inboundInspectionRequests.has(n)}},bd={send:()=>Promise.resolve(),onMessage:()=>{},ping:()=>Promise.resolve(),markInspectionLifecycle:()=>{}},wd=new AbortController().signal,xd=256,kd=class{_options;_send;_onDispose;_queueLimit;_queue=[];_active=!0;_pumping=!1;_overflowPending=0;_delivered=0;_dropped=0;_resolveClosed;closed;constructor(e,t,r,n=xd){this._options=e,this._send=t,this._onDispose=r,this._queueLimit=n;let i;this.closed=new Promise(o=>i=o),this._resolveClosed=i}enqueue(e){if(!this._active||this._options.methodPrefix!==void 0&&!e.method?.startsWith(this._options.methodPrefix))return;let t=this._options.maxPayloadBytes===void 0?zd(e):Sd(e,this._options.maxPayloadBytes);this._queue.length>=this._queueLimit&&(this._queue.shift(),this._dropped++,this._overflowPending++),this._queue.push(t),this._pumping||(this._pumping=!0,queueMicrotask(()=>{this._pump()}))}dispose(){this._active&&(this._active=!1,this._dropped+=this._queue.length,this._queue.length=0,this._overflowPending=0,this._onDispose(),this._pumping||this._complete())}async _pump(){try{for(;this._active;){if(this._overflowPending>0){let t=this._overflowPending;this._overflowPending=0,await this._send({type:"overflow",dropped:t});continue}let e=this._queue.shift();if(e===void 0)break;await this._send(e),this._delivered++}}catch{this.dispose()}finally{this._pumping=!1,this._active?(this._queue.length>0||this._overflowPending>0)&&(this._pumping=!0,queueMicrotask(()=>{this._pump()})):this._complete()}}_complete(){this._resolveClosed({delivered:this._delivered,dropped:this._dropped})}};function zd(e){let{params:t,result:r,error:n,...i}=e;return n===void 0?i:{...i,error:{code:n.code,message:n.message}}}function Sd(e,t){return{...e,params:Wr(e.params,t),result:Wr(e.result,t),error:e.error===void 0?void 0:{...e.error,data:Wr(e.error.data,t)}}}function Wr(e,t){if(e===void 0)return;if(t===Number.POSITIVE_INFINITY)return e;let r=JSON.stringify(e);if(r===void 0)return;let n=new TextEncoder().encode(r);if(n.byteLength<=t)return e;let i=new TextEncoder,o=new TextDecoder().decode(n.slice(0,t));for(;i.encode(o).byteLength>t;)o=o.slice(0,-1);return o}var $d=class{_nodeId;_portId;_setActive;_subscribers=new Set;_observers=new Set;_outboundRequests=new Map;_inboundRequests=new Map;observe=(e,t)=>{this._onMessage(e,t)};constructor(e,t,r){this._nodeId=e,this._portId=t,this._setActive=r}get observerCount(){return this._subscribers.size+this._observers.size}subscribe(e,t){let r=new kd(e,t,()=>{this._subscribers.delete(r),this._deactivateIfUnused()});return this._activateIfUnused(),this._subscribers.add(r),r}observeTransits(e){this._activateIfUnused(),this._observers.add(e);let t=!1;return{dispose:()=>{t||(t=!0,this._observers.delete(e),this._deactivateIfUnused())}}}dispose(){for(let e of[...this._subscribers])e.dispose();this._subscribers.clear(),this._observers.clear(),this._outboundRequests.clear(),this._inboundRequests.clear(),this._setActive(!1)}_onMessage(e,t){if(this._subscribers.size===0&&this._observers.size===0)return;let r=Date.now(),n,i=this._endpoint("id"in t?t.id??void 0:void 0),o={type:"transit",ts:r,nodeId:this._nodeId,...e==="inbound"?{in:i}:{out:i},disposition:e==="inbound"?"consumed":"forwarded"};if(Be(t)){let s={method:t.method};this._requestMap(e).set(String(t.id),s),n={...o,kind:"request",method:t.method,params:t.params}}else if(ft(t)){let s=e==="inbound"?this._outboundRequests:this._inboundRequests,a=String(t.id),c=s.get(a);s.delete(a),n={...o,kind:"response",method:c?.method,result:"result"in t?t.result:void 0,error:"error"in t?t.error:void 0}}else if(hn(t)&&t.method===Ze){let s=t.params,a=this._endpoint(s?.requestId);n={...o,...e==="inbound"?{in:a}:{out:a},kind:"stream",method:Ze,params:t.params}}else n={...o,kind:"notification",method:t.method,params:t.params};for(let s of[...this._observers])try{s(n)}catch{}for(let s of this._subscribers)s.enqueue(n)}_requestMap(e){return e==="outbound"?this._outboundRequests:this._inboundRequests}_endpoint(e){return{edgeId:this._portId,portId:this._portId,...e!==void 0?{requestId:e}:{}}}_activateIfUnused(){this._subscribers.size===0&&this._observers.size===0&&this._setActive(!0)}_deactivateIfUnused(){this._subscribers.size!==0||this._observers.size!==0||(this._outboundRequests.clear(),this._inboundRequests.clear(),this._setActive(!1))}},mn=class No{static fromTransport(t){return new No(Ft.create(t))}channel;_registry=new Map;_serviceDescriptions=new Map;_serviceRootPrincipalSets=new Map;_directoryWatchers=new Set;_directoryListeners=new Set;_inspection;_trafficInspector;_serviceInspectionRegistrations=new Map;_wireChannel;_preset;constructor(t){"sender"in t?(this._wireChannel=t,this.channel=t.sender,t.setRequestHandler({handleRequest:r=>this._handleRequest(r),handleNotification:r=>this._handleNotification(r)})):(this._wireChannel=void 0,this.channel=t)}get(t,r={}){return this._buildClient(t,r)}service(t){return new Do(this,t)}register(t,r,n={}){return this._register(t,r,n,!1)}_register(t,r,n,i){let o=n.serviceId,s=`${o??""}::${t.info.id}`;if(this._registry.has(s))throw new Error(`Interface "${t.info.id}" already registered${o?` under service "${o}"`:""}.`);let a=!1;if(n.serviceDescription!==void 0){if(o===void 0)throw new Error("register: `serviceDescription` requires `serviceId`.");let d=this._serviceDescriptions.get(o);if(d!==void 0&&d!==n.serviceDescription)throw new Error(`register: conflicting descriptions for service "${o}".`);this._serviceDescriptions.set(o,n.serviceDescription),a=d===void 0}if(n.rootPrincipalSets!==void 0){if(o===void 0)throw new Error("register: `rootPrincipalSets` requires `serviceId`.");let d=this._serviceRootPrincipalSets.get(o);if(d!==void 0&&!Id(d,n.rootPrincipalSets))throw new Error(`register: conflicting rootPrincipalSets for service "${o}".`);this._serviceRootPrincipalSets.set(o,n.rootPrincipalSets),a||=d===void 0}let c={iface:t,handlers:r,serviceId:o,internalInspection:i};if(this._registry.set(s,c),this._notifyDirectoryWatchers(c,a),!i&&o!==void 0&&this._inspection!==void 0&&!this._serviceInspectionRegistrations.has(o))try{this._installServiceInspection(o)}catch(d){throw this._registry.delete(s),this._notifyDirectoryWatchers(c),d}let u=!1;return{dispose:()=>{u||(u=!0,this._registry.get(s)===c&&(this._registry.delete(s),this._notifyDirectoryWatchers(c),o===void 0&&this._preset?.interfaceId===t.info.id&&(this._preset=void 0),o!==void 0&&!this._hasBusinessServiceRegistration(o)&&(this._removeServiceInspection(o),this._serviceDescriptions.delete(o),this._serviceRootPrincipalSets.delete(o))))}}}setPreset(t){let r=`::${t.info.id}`;if(!this._registry.has(r))throw new Error(`setPreset: interface "${t.info.id}" is not registered under the root service.`);this._preset={serviceId:void 0,interfaceId:t.info.id,hash:t.schemaHash}}listRegisteredInterfaces(){return Array.from(this._registry.values()).map(t=>{let r=t.serviceId??"",n={serviceId:r,interfaceId:t.iface.info.id,interfaceHash:t.iface.schemaHash},i=r===""?void 0:this._serviceDescriptions.get(r);i!==void 0&&(n.serviceDescription=i);let o=r===""?void 0:this._serviceRootPrincipalSets.get(r);return o!==void 0&&(n.rootPrincipalSets=o),n})}onDidChangeDirectory(t){return this._directoryListeners.add(t),()=>this._directoryListeners.delete(t)}findRegisteredInterface(t,r){for(let n of this._registry.values())if(n.iface.info.id===t&&!(r!==void 0&&n.iface.schemaHash!==r))return n.iface}enableReflection(t={}){let r=`${t.serviceId??""}::${tn.info.id}`;if(this._registry.has(r))return{dispose(){}};let n=`${t.serviceId??""}::`;for(let a of[rn,nn])if(this._registry.has(`${n}${a.info.id}`))throw new Error(`enableReflection: partial reflection registration for service "${t.serviceId??""}".`);let i=t.serviceId!==void 0?{serviceId:t.serviceId}:{},o=[];if(o.push(this.register(tn,{get:()=>this._preset?{serviceId:this._preset.serviceId,interfaceId:this._preset.interfaceId,interfaceHash:this._preset.hash}:{}},i)),o.push(this.register(rn,{list:({interfaceId:a,interfaceIdPrefix:c,serviceId:u,serviceIdScopes:d,cursor:l,limit:p})=>{let f=this.listRegisteredInterfaces().filter(S=>t.serviceId===void 0||S.serviceId===t.serviceId).filter(S=>a===void 0||S.interfaceId===a).filter(S=>c===void 0||S.interfaceId.startsWith(c)).filter(S=>u===void 0||S.serviceId===u).filter(S=>Zo(S.serviceId,d)),m=l===void 0?0:Number.parseInt(l,10)||0,_=p===void 0?f.length:Math.min(f.length,m+p),b=f.slice(m,_).map(S=>({serviceId:S.serviceId,interfaceId:S.interfaceId,interfaceHash:S.interfaceHash,serviceDescription:S.serviceDescription,rootPrincipalSets:S.rootPrincipalSets?.map($=>$.map(y=>({...y})))}));return _<f.length?{items:b,nextCursor:String(_)}:{items:b}},watch:(a,c,u)=>new Promise(d=>{let l={interfaceId:a.interfaceId,interfaceIdPrefix:a.interfaceIdPrefix,serviceId:a.serviceId,serviceIdScopes:a.serviceIdScopes,send:()=>u.send({})};this._directoryWatchers.add(l);let p=()=>{this._directoryWatchers.delete(l),d({})};if(u.signal.aborted){p();return}u.signal.addEventListener("abort",p,{once:!0})})},i)),o.push(this.register(nn,{get:({interfaceId:a,hash:c})=>{let u=this.findRegisteredInterface(a,c);if(!u)throw new ve("Interface not found",X.methodNotFound,{reason:"unknown-interface",interfaceId:a,hash:c});return{schema:u.toSchema()}}},i)),t.serviceId!==void 0)try{this.enableReflection()}catch(a){for(let c of o.reverse())c.dispose();throw a}let s=!1;return{dispose:()=>{if(!s){s=!0;for(let a of o.reverse())a.dispose()}}}}_notifyDirectoryWatchers(t,r=!1){for(let n of this._directoryListeners)try{n()}catch{}for(let n of this._directoryWatchers){if(n.pending)continue;let i=lo(n,t),o=r&&t.serviceId!==void 0&&[...this._registry.values()].some(s=>s.serviceId===t.serviceId&&lo(n,s));!i&&!o||(n.pending=!0,queueMicrotask(()=>{n.pending=!1,this._directoryWatchers.has(n)&&n.send()}))}}enableInspection(t){if(this._inspection!==void 0)return this._inspection;let r={nodeId:uo("node"),portId:uo("port"),...t!==void 0?{descriptors:[...t]}:{}},n=this._register(Ut,{getNodeId:()=>r},{},!0),i=new $d(r.nodeId,r.portId,a=>this._wireChannel?.setWireMessageObserver(a?i.observe:void 0,a?c=>this._isInspectionMethod(c):void 0));this._trafficInspector=i;let o=!1,s={...r,observeTraffic:a=>i.observeTransits(a),dispose:()=>{if(!o){o=!0;for(let a of[...this._serviceInspectionRegistrations.keys()])this._removeServiceInspection(a);i.dispose(),this._trafficInspector===i&&(this._trafficInspector=void 0),n.dispose(),this._inspection===s&&(this._inspection=void 0)}}};this._inspection=s;try{let a=new Set(Array.from(this._registry.values()).filter(c=>c.serviceId!==void 0&&!c.internalInspection).map(c=>c.serviceId));for(let c of a)this._installServiceInspection(c)}catch(a){throw s.dispose(),a}return s}get trafficObserverCount(){return this._trafficInspector?.observerCount??0}close(){this.channel.close()}_buildClient(t,r){let{serviceId:n,...i}=r,o=i,s=t.schemaHash,a=Jr(t),c={};for(let[u,d]of Object.entries(t.members)){let l=n?`${n}::${t.info.id}::${u}`:`${t.info.id}::${u}`;if(d.kind==="request")if(d.clientStreamSchema!==void 0||d.serverStreamSchema!==void 0){let p=d.serverStreamSchema;c[u]=(f,m)=>{let _=m?.onMessage,b=_!==void 0?w=>{if(p!==void 0){let T=W(p,w);if(!T.success)return;_(T.data);return}_(w)}:void 0,S=b!==void 0?{ctx:o,interfaceHash:s,onStreamMessage:b}:{ctx:o,interfaceHash:s};a&&qr(S);let $=this.channel.sendRequestWithStream(l,f,S),y=$.result.then(w=>{let T=W(d.resultSchema,w===null?void 0:w);if(!T.success)throw new ve(X.internalError,`Invalid result for ${l}`,{issues:T.error.issues});return w});return Object.assign(y,{send:w=>$.send(w),cancel:w=>$.cancel(w),ping:()=>$.ping()})}}else{let p=d.resultSchema;c[u]=async f=>{let m={ctx:o,interfaceHash:s};a&&qr(m);let _=await this.channel.sendRequest(l,f,m),b=W(p,_===null?void 0:_);if(!b.success)throw new ve(X.internalError,`Invalid result for ${l}`,{issues:b.error.issues});return _}}else c[u]=async p=>{let f={ctx:o,interfaceHash:s};a&&qr(f),this.channel.sendNotification(l,p,f)}}return c}async _handleRequest(t){let r=this._parseRouted(t.method);if(!r.ok)return Nt(r.reason,t.method);let{entry:n,memberName:i}=r,o=n.iface.members[i];if(!o)return Nt("unknown-method",t.method);let s=n.handlers[i];if(!s)return Nt("unknown-method",t.method);let a=W(o.paramsSchema,t.params);if(!a.success)return{error:{code:X.invalidParams,message:"Invalid params",data:{issues:a.error.issues}}};if(!(o instanceof un))return Nt("unknown-method",t.method);let c=this._buildStreamApi(t.stream,t.signal,o);try{let u=s(a.data,t.context,c);Jr(n.iface)&&t.stream.markInspectionLifecycle();let d=await u,l=W(o.resultSchema,d);return l.success?{result:d===void 0?null:d}:{error:{code:X.internalError,message:`Invalid result for ${t.method}`,data:{issues:l.error.issues}}}}catch(u){return u instanceof ve?{error:{code:u.code,message:u.message,data:u.data}}:{error:{code:X.internalError,message:u instanceof Error?u.message:String(u)}}}}_buildStreamApi(t,r,n){return{send:i=>{if(n.serverStreamSchema){let o=W(n.serverStreamSchema,i);if(!o.success)throw new Error(`Server stream payload failed schema validation: ${o.error.message}`)}return t.send(i)},onMessage:i=>{t.onMessage(o=>{if(n.clientStreamSchema){let s=W(n.clientStreamSchema,o);if(!s.success)return;i(s.data);return}})},ping:()=>t.ping(),signal:r}}_handleNotification(t){let r=this._parseRouted(t.method);if(!r.ok)return;let{entry:n,memberName:i}=r,o=n.iface.members[i];if(!(o instanceof dn))return;let s=n.handlers[i];if(!s)return;let a=W(o.paramsSchema,t.params);a.success&&s(a.data,t.context)}_parseRouted(t){let r=Eo(t);if(!r)return{ok:!1,reason:"bad-method-grammar"};if(r.kind==="bare"){if(!this._preset)return{ok:!1,reason:"no-preset"};let s=this._registry.get(`::${this._preset.interfaceId}`);return s?{ok:!0,entry:s,memberName:r.member}:{ok:!1,reason:"no-preset"}}let n=r.kind==="full"?r.serviceId:void 0,i=`${n??""}::${r.interfaceId}`,o=this._registry.get(i);return o?{ok:!0,entry:o,memberName:r.member}:{ok:!1,reason:n?"unknown-service":"unknown-interface"}}_installServiceInspection(t){if(this._serviceInspectionRegistrations.has(t))return;let r=this._inspection,n=this._trafficInspector;if(r===void 0||n===void 0)return;let i=[],o={serviceId:t};try{i.push(this._register(Ut,{getNodeId:()=>({nodeId:r.nodeId,portId:r.portId})},o,!0)),i.push(this._register(pn,{getGraph:()=>this._endpointGraph(t,r),watchGraph:async(s,a,c)=>(await Ed(c.signal),{})},o,!0)),i.push(this._register(fn,{watch:({methodPrefix:s},a,c)=>this._watchTraffic(n,{methodPrefix:s},c),watchWithPayloads:({methodPrefix:s,maxPayloadBytes:a},c,u)=>this._watchTraffic(n,{methodPrefix:s,maxPayloadBytes:a},u)},o,!0))}catch(s){for(let a of i.reverse())a.dispose();throw s}this._serviceInspectionRegistrations.set(t,i)}_removeServiceInspection(t){let r=this._serviceInspectionRegistrations.get(t);if(r!==void 0){this._serviceInspectionRegistrations.delete(t);for(let n of r.reverse())n.dispose()}}_hasBusinessServiceRegistration(t){return Array.from(this._registry.values()).some(r=>r.serviceId===t&&!r.internalInspection)}_isInspectionMethod(t){let r=this._parseRouted(t);return r.ok&&Jr(r.entry.iface)}_endpointGraph(t,r){return{observerServiceId:t,entryNodeId:r.nodeId,nodes:[{nodeId:r.nodeId,kind:"endpoint",...r.descriptors!==void 0?{descriptors:r.descriptors}:{},ports:[{portId:r.portId}]}],links:[],routes:[{serviceId:t,nodeId:r.nodeId,portId:r.portId,match:"exact"}]}}async _watchTraffic(t,r,n){let i=t.subscribe(r,s=>n.send(s)),o=()=>i.dispose();n.signal.aborted?o():n.signal.addEventListener("abort",o,{once:!0});try{return await i.closed}finally{n.signal.removeEventListener("abort",o),i.dispose()}}};function uo(e){let t=new Uint8Array(16);return globalThis.crypto.getRandomValues(t),`${e}:${Io(t)}`}function Id(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++)if(n[o].principal!==i[o].principal||n[o].transitive===!0!=(i[o].transitive===!0))return!1}return!0}function lo(e,t){let r=t.serviceId??"";return(e.interfaceId===void 0||e.interfaceId===t.iface.info.id)&&(e.interfaceIdPrefix===void 0||t.iface.info.id.startsWith(e.interfaceIdPrefix))&&(e.serviceId===void 0||e.serviceId===r)&&Zo(r,e.serviceIdScopes)}var Do=class{_connection;_serviceId;constructor(e,t){this._connection=e,this._serviceId=t}get(e,t={}){return this._connection.get(e,{...t,serviceId:this._serviceId})}register(e,t,r={}){return this._connection.register(e,t,{...r,serviceId:this._serviceId})}};function Nt(e,t){return{error:{code:X.methodNotFound,message:`Method not found: ${t}`,data:{reason:e,method:t}}}}function Jr(e){return e===Ut||e===pn||e===fn}function Ed(e){return e.aborted?Promise.resolve():new Promise(t=>{e.addEventListener("abort",()=>t(),{once:!0})})}var Ux=Pd(globalThis,{});function Pd(e,t){return new Proxy(e,{get(r,n,i){return n in t?t[n]:e[n]},set(r,n,i){return n in t&&delete t[n],e[n]=i,!0},deleteProperty(r,n){let i=!1;return n in t&&(delete t[n],i=!0),n in e&&(delete e[n],i=!0),i},ownKeys(r){let n=Reflect.ownKeys(e),i=Reflect.ownKeys(t),o=new Set(i);return[...n.filter(s=>!o.has(s)),...i]},defineProperty(r,n,i){return n in t&&delete t[n],Reflect.defineProperty(e,n,i),!0},getOwnPropertyDescriptor(r,n){return n in t?Reflect.getOwnPropertyDescriptor(t,n):Reflect.getOwnPropertyDescriptor(e,n)},has(r,n){return n in t||n in e}})}var Fx=new Uint8Array([115,101,99]);var Ad;Ad=new WeakMap;var Td;Td=new WeakMap;var Md;Md=new WeakMap;var Kx=new Uint8Array([98,97,115,101,95,110,111,110,99,101]),Bx=new Uint8Array([101,120,112]),Hx=new Uint8Array([105,110,102,111,95,104,97,115,104]),qx=new Uint8Array([107,101,121]),Vx=new Uint8Array([112,115,107,95,105,100,95,104,97,115,104]),Wx=new Uint8Array([115,101,99,114,101,116]),Jx=new Uint8Array([72,80,75,69,0,0,0,0,0,0]);var Gx=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]);var Xx=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32]),Yx=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]);var Ce=v(),Cd=F({id:"identity",description:"Per-participant key oracle: exposes signing and HPKE-based wrap/unwrap for the identity the executor has attached to this participant's root overlay. Private keys never leave the executor."},{getPrincipal:M(k({}),k({principal:v()})),getWrapPublicKey:M(k({}),k({wrapPublicKey:Ce})),sign:M(k({bytes:Ce}),k({signature:Ce})),wrap:M(k({domain:v(),bytes:Ce}),k({blob:Ce})),unwrap:M(k({domain:v(),blob:Ce}),k({bytes:Ce}))}),Od=F({id:"identity.storage",description:"Per-identity persistent key/value store. Scope is the executor's managed-identity slot; lifecycle is tied to the identity itself. Backed by an at-rest-encrypted file in the executor."},{get:M(k({key:v()}),k({value:z(Ie())})),set:M(k({key:v(),value:Ie()}),k({})),delete:M(k({key:v()}),k({existed:lt()})),list:M(k({prefix:z(v())}),k({keys:G(v())}))});var gn=class{_our;_their;_filterSource;_listener;_buffer=[];_closed=!1;_handler=e=>{if(this._filterSource&&e.source!==this._their)return;let t=e.data;Zd(t)&&(this._listener?this._listener(t):this._buffer.push(t))};constructor(e,t,r=!0){if(this._our=e,this._their=t,this._filterSource=r,e===t)throw new Error("WindowMessageTransport: cannot connect to self");e.addEventListener("message",this._handler)}send(e){this._closed||this._their.postMessage(e,"*")}setListener(e){if(this._listener=e,e)for(;this._buffer.length>0&&this._listener;)e(this._buffer.shift())}dispose(){this._closed||(this._closed=!0,this._our.removeEventListener("message",this._handler))}};function Zd(e){return typeof e=="object"&&e!==null&&e.jsonrpc==="2.0"}var Lo;function g(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,d=Object.keys(u);for(let l=0;l<d.length;l++){let p=d[l];p in a||(a[p]=u[p].bind(a))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var c;let u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ds=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Lo=globalThis).__zod_globalConfig??(Lo.__zod_globalConfig={});var Vt=globalThis.__zod_globalConfig;function Re(e){return e&&Object.assign(Vt,e),Vt}function ls(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function vn(e,t){return typeof t=="bigint"?t.toString():t}function Yt(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function kn(e){return e==null}function zn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Rd(e,t){let r=e/t,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}var jo=Symbol("evaluating");function A(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==jo)return n===void 0&&(n=jo,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function De(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ee(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Uo(e){return JSON.stringify(e)}function Nd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ps="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Dd=Yt(()=>{if(Vt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});function _t(e){if(gt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(gt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function fs(e){return _t(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Ld=new Set(["string","number","symbol"]);function We(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jd(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Ud={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Fd(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Pe(e,Ee(e._zod.def,{get shape(){let i={};for(let o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(i[o]=r.shape[o])}return De(this,"shape",i),i},checks:[]}))}function Kd(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");return Pe(e,Ee(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete i[o]}return De(this,"shape",i),i},checks:[]}))}function Bd(e,t){if(!_t(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Pe(e,Ee(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return De(this,"shape",n),n}}))}function Hd(e,t){if(!_t(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Pe(e,Ee(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return De(this,"shape",r),r}}))}function qd(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");return Pe(e,Ee(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return De(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Vd(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");return Pe(t,Ee(t._zod.def,{get shape(){let i=t._zod.def.shape,o={...i};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(let s in i)o[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return De(this,"shape",o),o},checks:[]}))}function Wd(e,t,r){return Pe(t,Ee(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let o in r){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(i[o]=new e({type:"nonoptional",innerType:n[o]}))}else for(let o in n)i[o]=new e({type:"nonoptional",innerType:n[o]});return De(this,"shape",i),i}}))}function He(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Jd(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function hs(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Kt(e){return typeof e=="string"?e:e?.message}function Ne(e,t,r){let n=e.message?e.message:Kt(e.inst?._zod.def?.error?.(e))??Kt(t?.error?.(e))??Kt(r.customError?.(e))??Kt(r.localeError?.(e))??"Invalid input",{inst:i,continue:o,input:s,...a}=e;return a.path??(a.path=[]),a.message=n,t?.reportInput&&(a.input=s),a}function Sn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yt(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}var ms=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gs=g("$ZodError",ms),_s=g("$ZodError",ms,{Parent:Error});function Gd(e,t=r=>r.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function Xd(e,t=r=>r.message){let r={_errors:[]},n=(i,o=[])=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;for(;u<a.length;){let d=a[u];u!==a.length-1?c[d]=c[d]||{_errors:[]}:(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(s))),c=c[d],u++}}}};return n(e),r}var $n=e=>(t,r,n,i)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new qe;if(s.issues.length){let a=new(i?.Err??e)(s.issues.map(c=>Ne(c,o,Re())));throw ps(a,i?.callee),a}return s.value},In=e=>async(t,r,n,i)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??e)(s.issues.map(c=>Ne(c,o,Re())));throw ps(a,i?.callee),a}return s.value},Qt=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new qe;return o.issues.length?{success:!1,error:new(e??gs)(o.issues.map(s=>Ne(s,i,Re())))}:{success:!0,data:o.value}},Yd=Qt(_s),er=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>Ne(s,i,Re())))}:{success:!0,data:o.value}},Qd=er(_s),el=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return $n(e)(t,r,i)},tl=e=>(t,r,n)=>$n(e)(t,r,n),rl=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return In(e)(t,r,i)},nl=e=>async(t,r,n)=>In(e)(t,r,n),il=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return Qt(e)(t,r,i)},ol=e=>(t,r,n)=>Qt(e)(t,r,n),sl=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return er(e)(t,r,i)},al=e=>async(t,r,n)=>er(e)(t,r,n),cl=/^[cC][0-9a-z]{6,}$/,ul=/^[0-9a-z]+$/,dl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ll=/^[0-9a-vA-V]{20}$/,pl=/^[A-Za-z0-9]{27}$/,fl=/^[a-zA-Z0-9_-]{21}$/,hl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ml=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fo=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_l="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yl(){return new RegExp(_l,"u")}var vl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,wl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,xl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ys=/^[A-Za-z0-9_-]*$/,zl=/^https?$/,Sl=/^\+[1-9]\d{6,14}$/,vs="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",$l=new RegExp(`^${vs}$`);function bs(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Il(e){return new RegExp(`^${bs(e)}$`)}function El(e){let t=bs({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${vs}T(?:${n})$`)}var Pl=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Al=/^-?\d+$/,Tl=/^-?\d+(?:\.\d+)?$/,Ml=/^(?:true|false)$/i,Cl=/^[^A-Z]*$/,Ol=/^[^a-z]*$/,Q=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ws={number:"number",bigint:"bigint",object:"date"},xs=g("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=ws[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ks=g("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=ws[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zl=g("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Rd(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Rl=g("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=Ud[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=i,a.maximum=o,r&&(a.pattern=Al)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Nl=g("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!kn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;if(i.length<=t.maximum)return;let o=Sn(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Dl=g("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!kn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let o=Sn(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ll=g("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!kn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{let i=n.value,o=i.length;if(o===t.length)return;let s=Sn(i),a=o>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),tr=g("$ZodCheckStringFormat",(e,t)=>{var r,n;Q.init(e,t),e._zod.onattach.push(i=>{let o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),jl=g("$ZodCheckRegex",(e,t)=>{tr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ul=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Cl),tr.init(e,t)}),Fl=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ol),tr.init(e,t)}),Kl=g("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=We(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Bl=g("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${We(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Hl=g("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${We(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ql=g("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),Vl=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(`
`).filter(i=>i),r=Math.min(...t.map(i=>i.length-i.trimStart().length)),n=t.map(i=>i.slice(r)).map(i=>" ".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map(n=>`  ${n}`)];return new e(...t,r.join(`
`))}},Wl={major:4,minor:4,patch:3},N=g("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wl;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let o of i._zod.onattach)o(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,a,c)=>{let u=He(s),d;for(let l of a){if(l._zod.def.when){if(Jd(s)||!l._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,f=l._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new qe;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(u||(u=He(s,p)))});else{if(s.issues.length===p)continue;u||(u=He(s,p))}}return d?d.then(()=>s):s},o=(s,a,c)=>{if(He(s))return s.aborted=!0,s;let u=i(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new qe;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>o(d,s,a)):o(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new qe;return c.then(u=>i(u,n,a))}return i(c,n,a)}}A(e,"~standard",()=>({validate:i=>{try{let o=Yd(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Qd(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),En=g("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Pl(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),O=g("$ZodStringFormat",(e,t)=>{tr.init(e,t),En.init(e,t)}),Jl=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ml),O.init(e,t)}),Gl=g("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fo(r))}else t.pattern??(t.pattern=Fo());O.init(e,t)}),Xl=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gl),O.init(e,t)}),Yl=g("$ZodURL",(e,t)=>{O.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===zl.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ql=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=yl()),O.init(e,t)}),ep=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=fl),O.init(e,t)}),tp=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=cl),O.init(e,t)}),rp=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ul),O.init(e,t)}),np=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dl),O.init(e,t)}),ip=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ll),O.init(e,t)}),op=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=pl),O.init(e,t)}),sp=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=El(t)),O.init(e,t)}),ap=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=$l),O.init(e,t)}),cp=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Il(t)),O.init(e,t)}),up=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hl),O.init(e,t)}),dp=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=vl),O.init(e,t),e._zod.bag.format="ipv4"}),lp=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=bl),O.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),pp=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wl),O.init(e,t)}),fp=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=xl),O.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function zs(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var hp=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kl),O.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{zs(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function mp(e){if(!ys.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/");return zs(t.padEnd(Math.ceil(t.length/4)*4,"="))}var gp=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ys),O.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{mp(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),_p=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Sl),O.init(e,t)});function yp(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}var vp=g("$ZodJWT",(e,t)=>{O.init(e,t),e._zod.check=r=>{yp(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Ss=g("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Tl,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),bp=g("$ZodNumberFormat",(e,t)=>{Rl.init(e,t),Ss.init(e,t)}),wp=g("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=Ml,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),xp=g("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=r=>r}),kp=g("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Ko(e,t,r){e.issues.length&&t.issues.push(...hs(r,e.issues)),t.value[r]=e.value}var zp=g("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?o.push(c.then(u=>Ko(u,r,s))):Ko(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Wt(e,t,r,n,i,o){let s=r in n;if(e.issues.length){if(i&&o&&!s)return;t.issues.push(...hs(r,e.issues))}if(!s&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function $s(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=jd(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Is(e,t,r,n,i,o){let s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type,d=c.optin==="optional",l=c.optout==="optional";for(let p in t){if(p==="__proto__"||a.has(p))continue;if(u==="never"){s.push(p);continue}let f=c.run({value:t[p],issues:[]},n);f instanceof Promise?e.push(f.then(m=>Wt(m,r,p,t,d,l))):Wt(f,r,p,t,d,l)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}var Sp=g("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let a={...s};return Object.defineProperty(t,"shape",{value:a}),a}})}let r=Yt(()=>$s(t));A(e._zod,"propValues",()=>{let s=t.shape,a={};for(let c in s){let u=s[c]._zod;if(u.values){a[c]??(a[c]=new Set);for(let d of u.values)a[c].add(d)}}return a});let n=gt,i=t.catchall,o;e._zod.parse=(s,a)=>{o??(o=r.value);let c=s.value;if(!n(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;s.value={};let u=[],d=o.shape;for(let l of o.keys){let p=d[l],f=p._zod.optin==="optional",m=p._zod.optout==="optional",_=p._zod.run({value:c[l],issues:[]},a);_ instanceof Promise?u.push(_.then(b=>Wt(b,s,l,c,f,m))):Wt(_,s,l,c,f,m)}return i?Is(u,c,s,a,r.value,e):u.length?Promise.all(u).then(()=>s):s}}),$p=g("$ZodObjectJIT",(e,t)=>{Sp.init(e,t);let r=e._zod.parse,n=Yt(()=>$s(t)),i=l=>{let p=new Vl(["shape","payload","ctx"]),f=n.value,m=$=>{let y=Uo($);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};p.write("const input = payload.value;");let _=Object.create(null),b=0;for(let $ of f.keys)_[$]=`key_${b++}`;p.write("const newResult = {};");for(let $ of f.keys){let y=_[$],w=Uo($),T=l[$],L=T?._zod?.optin==="optional",I=T?._zod?.optout==="optional";p.write(`const ${y} = ${m($)};`),L&&I?p.write(`
        if (${y}.issues.length) {
          if (${w} in input) {
            payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
              ...iss,
              path: iss.path ? [${w}, ...iss.path] : [${w}]
            })));
          }
        }
        
        if (${y}.value === undefined) {
          if (${w} in input) {
            newResult[${w}] = undefined;
          }
        } else {
          newResult[${w}] = ${y}.value;
        }
        
      `):L?p.write(`
        if (${y}.issues.length) {
          payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${w}, ...iss.path] : [${w}]
          })));
        }
        
        if (${y}.value === undefined) {
          if (${w} in input) {
            newResult[${w}] = undefined;
          }
        } else {
          newResult[${w}] = ${y}.value;
        }
        
      `):p.write(`
        const ${y}_present = ${w} in input;
        if (${y}.issues.length) {
          payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${w}, ...iss.path] : [${w}]
          })));
        }
        if (!${y}_present && !${y}.issues.length) {
          payload.issues.push({
            code: "invalid_type",
            expected: "nonoptional",
            input: undefined,
            path: [${w}]
          });
        }

        if (${y}_present) {
          if (${y}.value === undefined) {
            newResult[${w}] = undefined;
          } else {
            newResult[${w}] = ${y}.value;
          }
        }

      `)}p.write("payload.value = newResult;"),p.write("return payload;");let S=p.compile();return($,y)=>S(l,$,y)},o,s=gt,a=!Vt.jitless,c=a&&Dd.value,u=t.catchall,d;e._zod.parse=(l,p)=>{d??(d=n.value);let f=l.value;return s(f)?a&&c&&p?.async===!1&&p.jitless!==!0?(o||(o=i(t.shape)),l=o(l,p),u?Is([],f,l,p,d,e):l):r(l,p):(l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l)}});function Bo(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!He(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>Ne(s,n,Re())))}),t)}var Es=g("$ZodUnion",(e,t)=>{N.init(e,t),A(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),A(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),A(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),A(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>zn(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>Bo(a,n,e,i)):Bo(s,n,e,i)}}),Ip=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Es.init(e,t);let r=e._zod.parse;A(e._zod,"propValues",()=>{let i={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){i[a]||(i[a]=new Set);for(let u of c)i[a].add(u)}}return i});let n=Yt(()=>{let i=t.options,o=new Map;for(let s of i){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});e._zod.parse=(i,o)=>{let s=i.value;if(!gt(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback||o.direction==="backward"?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:s,path:[t.discriminator],inst:e}),i)}}),Ep=g("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,o=t.left._zod.run({value:i,issues:[]},n),s=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([a,c])=>Ho(r,a,c)):Ho(r,o,s)}});function bn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_t(e)&&_t(t)){let r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),i={...e,...t};for(let o of n){let s=bn(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=t[n],s=bn(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ho(e,t,r){let n=new Map,i;for(let a of t.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(a);let o=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&i&&e.issues.push({...i,keys:o}),He(e))return e;let s=bn(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Pp=g("$ZodEnum",(e,t)=>{N.init(e,t);let r=ls(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Ld.has(typeof i)).map(i=>typeof i=="string"?We(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),Ap=g("$ZodLiteral",(e,t)=>{if(N.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?We(n):n?We(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),Tp=g("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ds(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(r.value=o,r.fallback=!0,r));if(i instanceof Promise)throw new qe;return r.value=i,r.fallback=!0,r}});function qo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ps=g("$ZodOptional",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.optout="optional",A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),A(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=r.value,o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>qo(s,i)):qo(o,i)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Mp=g("$ZodExactOptional",(e,t)=>{Ps.init(e,t),A(e._zod,"values",()=>t.innerType._zod.values),A(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Cp=g("$ZodNullable",(e,t)=>{N.init(e,t),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zn(r.source)}|null)$`):void 0}),A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Op=g("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Vo(o,t)):Vo(i,t)}});function Vo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Zp=g("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Rp=g("$ZodNonOptional",(e,t)=>{N.init(e,t),A(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Wo(o,e)):Wo(i,e)}});function Wo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Np=g("$ZodCatch",(e,t)=>{N.init(e,t),e._zod.optin="optional",A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>Ne(s,n,Re()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(o=>Ne(o,n,Re()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Dp=g("$ZodPipe",(e,t)=>{N.init(e,t),A(e._zod,"values",()=>t.in._zod.values),A(e._zod,"optin",()=>t.in._zod.optin),A(e._zod,"optout",()=>t.out._zod.optout),A(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=t.out._zod.run(r,n);return o instanceof Promise?o.then(s=>Bt(s,t.in,n)):Bt(o,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(o=>Bt(o,t.out,n)):Bt(i,t.out,n)}});function Bt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var Lp=g("$ZodReadonly",(e,t)=>{N.init(e,t),A(e._zod,"propValues",()=>t.innerType._zod.propValues),A(e._zod,"values",()=>t.innerType._zod.values),A(e._zod,"optin",()=>t.innerType?._zod?.optin),A(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(Jo):Jo(i)}});function Jo(e){return e.value=Object.freeze(e.value),e}var jp=g("$ZodCustom",(e,t)=>{Q.init(e,t),N.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(o=>Go(o,r,n,e));Go(i,r,n,e)}});function Go(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(yt(i))}}var Xo,Up=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Fp(){return new Up}(Xo=globalThis).__zod_globalRegistry??(Xo.__zod_globalRegistry=Fp());var mt=globalThis.__zod_globalRegistry;function Kp(e,t){return new e({type:"string",...x(t)})}function Bp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...x(t)})}function Yo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...x(t)})}function Hp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...x(t)})}function qp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(t)})}function Vp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(t)})}function Wp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(t)})}function Jp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...x(t)})}function Gp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...x(t)})}function Xp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(t)})}function Yp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...x(t)})}function Qp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(t)})}function ef(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...x(t)})}function tf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...x(t)})}function rf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(t)})}function nf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(t)})}function of(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(t)})}function sf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(t)})}function af(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(t)})}function cf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...x(t)})}function uf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...x(t)})}function df(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...x(t)})}function lf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...x(t)})}function pf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(t)})}function ff(e,t){return new e({type:"string",format:"date",check:"string_format",...x(t)})}function hf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...x(t)})}function mf(e,t){return new e({type:"string",format:"duration",check:"string_format",...x(t)})}function gf(e,t){return new e({type:"number",checks:[],...x(t)})}function _f(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...x(t)})}function yf(e,t){return new e({type:"boolean",...x(t)})}function vf(e){return new e({type:"unknown"})}function bf(e,t){return new e({type:"never",...x(t)})}function Qo(e,t){return new xs({check:"less_than",...x(t),value:e,inclusive:!1})}function _n(e,t){return new xs({check:"less_than",...x(t),value:e,inclusive:!0})}function es(e,t){return new ks({check:"greater_than",...x(t),value:e,inclusive:!1})}function yn(e,t){return new ks({check:"greater_than",...x(t),value:e,inclusive:!0})}function ts(e,t){return new Zl({check:"multiple_of",...x(t),value:e})}function As(e,t){return new Nl({check:"max_length",...x(t),maximum:e})}function Jt(e,t){return new Dl({check:"min_length",...x(t),minimum:e})}function Ts(e,t){return new Ll({check:"length_equals",...x(t),length:e})}function wf(e,t){return new jl({check:"string_format",format:"regex",...x(t),pattern:e})}function xf(e){return new Ul({check:"string_format",format:"lowercase",...x(e)})}function kf(e){return new Fl({check:"string_format",format:"uppercase",...x(e)})}function zf(e,t){return new Kl({check:"string_format",format:"includes",...x(t),includes:e})}function Sf(e,t){return new Bl({check:"string_format",format:"starts_with",...x(t),prefix:e})}function $f(e,t){return new Hl({check:"string_format",format:"ends_with",...x(t),suffix:e})}function Ge(e){return new ql({check:"overwrite",tx:e})}function If(e){return Ge(t=>t.normalize(e))}function Ef(){return Ge(e=>e.trim())}function Pf(){return Ge(e=>e.toLowerCase())}function Af(){return Ge(e=>e.toUpperCase())}function Tf(){return Ge(e=>Nd(e))}function Mf(e,t,r){return new e({type:"array",element:t,...x(r)})}function Cf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...x(r)})}function Of(e,t){let r=Zf(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(yt(i,n.value,r._zod.def));else{let o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),n.issues.push(yt(o))}},e(n.value,n)),t);return r}function Zf(e,t){let r=new Q({check:"custom",...x(t)});return r._zod.check=e,r}function Ms(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??mt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function K(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let l=s.schema,p=t.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(e,t,l,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),K(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&q(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Cs(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let i=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,l=e.external.uri??(f=>f);if(d)return{ref:l(d)};let p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${l("__shared")}#/${a}/${p}`}}if(s[1]===r)return{ref:"#"};let c=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=i(s);a.def={...a.schema},u&&(a.defId=u);let d=a.schema;for(let l in d)delete d[l];d.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&e.reused==="ref"){o(s);continue}}}function Os(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,d={...u},l=c.ref;if(c.ref=null,l){n(l);let f=e.seen.get(l),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,d),a._zod.parent===l)for(let _ in u)_==="$ref"||_==="allOf"||_ in d||delete u[_];if(m.$ref&&f.def)for(let _ in u)_==="$ref"||_==="allOf"||_ in f.def&&JSON.stringify(u[_])===JSON.stringify(f.def[_])&&delete u[_]}let p=a._zod.parent;if(p&&p!==l){n(p);let f=e.seen.get(p);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let m in u)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(u[m])===JSON.stringify(f.def[m])&&delete u[m]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())n(a[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}Object.assign(i,r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&i.id===o&&delete i.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Gt(t,"input",e.processors),output:Gt(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function q(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return q(n.element,r);if(n.type==="set")return q(n.valueType,r);if(n.type==="lazy")return q(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return q(n.innerType,r);if(n.type==="intersection")return q(n.left,r)||q(n.right,r);if(n.type==="record"||n.type==="map")return q(n.keyType,r)||q(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:q(n.in,r)||q(n.out,r);if(n.type==="object"){for(let i in n.shape)if(q(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(q(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(q(i,r))return!0;return!!(n.rest&&q(n.rest,r))}return!1}var Rf=(e,t={})=>r=>{let n=Ms({...r,processors:t});return K(e,n),Cs(n,e),Os(n,e)},Gt=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=Ms({...i??{},target:o,io:t,processors:r});return K(e,s),Cs(s,e),Os(s,e)},Nf={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Df=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=Nf[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let d=[...c];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(l=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:l.source}))])}},Lf=(e,t,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let l=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";l?f?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d:typeof o=="number"&&(i.minimum=o),p?f?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof s=="number"&&(i.maximum=s),typeof c=="number"&&(i.multipleOf=c)},jf=(e,t,r,n)=>{r.type="boolean"},Uf=(e,t,r,n)=>{r.not={}},Ff=(e,t,r,n)=>{let i=e._zod.def,o=ls(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},Kf=(e,t,r,n)=>{let i=e._zod.def,o=[];for(let s of i.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},Bf=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Hf=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},qf=(e,t,r,n)=>{let i=r,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=K(o.element,t,{...n,path:[...n.path,"items"]})},Vf=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object",i.properties={};let s=o.shape;for(let u in s)i.properties[u]=K(s[u],t,{...n,path:[...n.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{let d=o.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=K(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Wf=(e,t,r,n)=>{let i=e._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>K(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},Jf=(e,t,r,n)=>{let i=e._zod.def,o=K(i.left,t,{...n,path:[...n.path,"allOf",0]}),s=K(i.right,t,{...n,path:[...n.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1;r.allOf=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]]},Gf=(e,t,r,n)=>{let i=e._zod.def,o=K(i.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Xf=(e,t,r,n)=>{let i=e._zod.def;K(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Yf=(e,t,r,n)=>{let i=e._zod.def;K(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Qf=(e,t,r,n)=>{let i=e._zod.def;K(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},eh=(e,t,r,n)=>{let i=e._zod.def;K(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},th=(e,t,r,n)=>{let i=e._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?i.out:i.in:i.out;K(s,t,n);let a=t.seen.get(e);a.ref=s},rh=(e,t,r,n)=>{let i=e._zod.def;K(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.readOnly=!0},Zs=(e,t,r,n)=>{let i=e._zod.def;K(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},nh=g("ZodISODateTime",(e,t)=>{sp.init(e,t),Z.init(e,t)});function ih(e){return pf(nh,e)}var oh=g("ZodISODate",(e,t)=>{ap.init(e,t),Z.init(e,t)});function sh(e){return ff(oh,e)}var ah=g("ZodISOTime",(e,t)=>{cp.init(e,t),Z.init(e,t)});function ch(e){return hf(ah,e)}var uh=g("ZodISODuration",(e,t)=>{up.init(e,t),Z.init(e,t)});function dh(e){return mf(uh,e)}var lh=(e,t)=>{gs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Xd(e,r)},flatten:{value:r=>Gd(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,vn,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,vn,2)}},isEmpty:{get(){return e.issues.length===0}}})},oe=g("ZodError",lh,{Parent:Error}),ph=$n(oe),fh=In(oe),hh=Qt(oe),mh=er(oe),gh=el(oe),_h=tl(oe),yh=rl(oe),vh=nl(oe),bh=il(oe),wh=ol(oe),xh=sl(oe),kh=al(oe),rs=new WeakMap;function vt(e,t,r){let n=Object.getPrototypeOf(e),i=rs.get(n);if(i||(i=new Set,rs.set(n,i)),!i.has(t)){i.add(t);for(let o in r){let s=r[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var D=g("ZodType",(e,t)=>(N.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Gt(e,"input"),output:Gt(e,"output")}}),e.toJSONSchema=Rf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>ph(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>hh(e,r,n),e.parseAsync=async(r,n)=>fh(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>mh(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>gh(e,r,n),e.decode=(r,n)=>_h(e,r,n),e.encodeAsync=async(r,n)=>yh(e,r,n),e.decodeAsync=async(r,n)=>vh(e,r,n),e.safeEncode=(r,n)=>bh(e,r,n),e.safeDecode=(r,n)=>wh(e,r,n),e.safeEncodeAsync=async(r,n)=>xh(e,r,n),e.safeDecodeAsync=async(r,n)=>kh(e,r,n),vt(e,"ZodType",{check(...r){let n=this.def;return this.clone(Ee(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Pe(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(_m(r,n))},superRefine(r,n){return this.check(ym(r,n))},overwrite(r){return this.check(Ge(r))},optional(){return os(this)},exactOptional(){return im(this)},nullable(){return ss(this)},nullish(){return os(ss(this))},nonoptional(r){return dm(this,r)},array(){return Ve(this)},or(r){return Jh([this,r])},and(r){return Qh(this,r)},transform(r){return as(this,rm(r))},default(r){return am(this,r)},prefault(r){return um(this,r)},catch(r){return pm(this,r)},pipe(r){return as(this,r)},readonly(){return mm(this)},describe(r){let n=this.clone();return mt.add(n,{description:r}),n},meta(...r){if(r.length===0)return mt.get(this);let n=this.clone();return mt.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return mt.get(e)?.description},configurable:!0}),e)),Rs=g("_ZodString",(e,t)=>{En.init(e,t),D.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Df(e,n,i,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,vt(e,"_ZodString",{regex(...n){return this.check(wf(...n))},includes(...n){return this.check(zf(...n))},startsWith(...n){return this.check(Sf(...n))},endsWith(...n){return this.check($f(...n))},min(...n){return this.check(Jt(...n))},max(...n){return this.check(As(...n))},length(...n){return this.check(Ts(...n))},nonempty(...n){return this.check(Jt(1,...n))},lowercase(n){return this.check(xf(n))},uppercase(n){return this.check(kf(n))},trim(){return this.check(Ef())},normalize(...n){return this.check(If(...n))},toLowerCase(){return this.check(Pf())},toUpperCase(){return this.check(Af())},slugify(){return this.check(Tf())}})}),zh=g("ZodString",(e,t)=>{En.init(e,t),Rs.init(e,t),e.email=r=>e.check(Bp(Sh,r)),e.url=r=>e.check(Jp($h,r)),e.jwt=r=>e.check(lf(Uh,r)),e.emoji=r=>e.check(Gp(Ih,r)),e.guid=r=>e.check(Yo(ns,r)),e.uuid=r=>e.check(Hp(Ht,r)),e.uuidv4=r=>e.check(qp(Ht,r)),e.uuidv6=r=>e.check(Vp(Ht,r)),e.uuidv7=r=>e.check(Wp(Ht,r)),e.nanoid=r=>e.check(Xp(Eh,r)),e.guid=r=>e.check(Yo(ns,r)),e.cuid=r=>e.check(Yp(Ph,r)),e.cuid2=r=>e.check(Qp(Ah,r)),e.ulid=r=>e.check(ef(Th,r)),e.base64=r=>e.check(cf(Dh,r)),e.base64url=r=>e.check(uf(Lh,r)),e.xid=r=>e.check(tf(Mh,r)),e.ksuid=r=>e.check(rf(Ch,r)),e.ipv4=r=>e.check(nf(Oh,r)),e.ipv6=r=>e.check(of(Zh,r)),e.cidrv4=r=>e.check(sf(Rh,r)),e.cidrv6=r=>e.check(af(Nh,r)),e.e164=r=>e.check(df(jh,r)),e.datetime=r=>e.check(ih(r)),e.date=r=>e.check(sh(r)),e.time=r=>e.check(ch(r)),e.duration=r=>e.check(dh(r))});function Y(e){return Kp(zh,e)}var Z=g("ZodStringFormat",(e,t)=>{O.init(e,t),Rs.init(e,t)}),Sh=g("ZodEmail",(e,t)=>{Xl.init(e,t),Z.init(e,t)}),ns=g("ZodGUID",(e,t)=>{Jl.init(e,t),Z.init(e,t)}),Ht=g("ZodUUID",(e,t)=>{Gl.init(e,t),Z.init(e,t)}),$h=g("ZodURL",(e,t)=>{Yl.init(e,t),Z.init(e,t)}),Ih=g("ZodEmoji",(e,t)=>{Ql.init(e,t),Z.init(e,t)}),Eh=g("ZodNanoID",(e,t)=>{ep.init(e,t),Z.init(e,t)}),Ph=g("ZodCUID",(e,t)=>{tp.init(e,t),Z.init(e,t)}),Ah=g("ZodCUID2",(e,t)=>{rp.init(e,t),Z.init(e,t)}),Th=g("ZodULID",(e,t)=>{np.init(e,t),Z.init(e,t)}),Mh=g("ZodXID",(e,t)=>{ip.init(e,t),Z.init(e,t)}),Ch=g("ZodKSUID",(e,t)=>{op.init(e,t),Z.init(e,t)}),Oh=g("ZodIPv4",(e,t)=>{dp.init(e,t),Z.init(e,t)}),Zh=g("ZodIPv6",(e,t)=>{lp.init(e,t),Z.init(e,t)}),Rh=g("ZodCIDRv4",(e,t)=>{pp.init(e,t),Z.init(e,t)}),Nh=g("ZodCIDRv6",(e,t)=>{fp.init(e,t),Z.init(e,t)}),Dh=g("ZodBase64",(e,t)=>{hp.init(e,t),Z.init(e,t)}),Lh=g("ZodBase64URL",(e,t)=>{gp.init(e,t),Z.init(e,t)}),jh=g("ZodE164",(e,t)=>{_p.init(e,t),Z.init(e,t)}),Uh=g("ZodJWT",(e,t)=>{vp.init(e,t),Z.init(e,t)}),Ns=g("ZodNumber",(e,t)=>{Ss.init(e,t),D.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Lf(e,n,i,o),vt(e,"ZodNumber",{gt(n,i){return this.check(es(n,i))},gte(n,i){return this.check(yn(n,i))},min(n,i){return this.check(yn(n,i))},lt(n,i){return this.check(Qo(n,i))},lte(n,i){return this.check(_n(n,i))},max(n,i){return this.check(_n(n,i))},int(n){return this.check(is(n))},safe(n){return this.check(is(n))},positive(n){return this.check(es(0,n))},nonnegative(n){return this.check(yn(0,n))},negative(n){return this.check(Qo(0,n))},nonpositive(n){return this.check(_n(0,n))},multipleOf(n,i){return this.check(ts(n,i))},step(n,i){return this.check(ts(n,i))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function be(e){return gf(Ns,e)}var Fh=g("ZodNumberFormat",(e,t)=>{bp.init(e,t),Ns.init(e,t)});function is(e){return _f(Fh,e)}var Kh=g("ZodBoolean",(e,t)=>{wp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>jf(e,r,n,i)});function V(e){return yf(Kh,e)}var Bh=g("ZodUnknown",(e,t)=>{xp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>{}});function wn(){return vf(Bh)}var Hh=g("ZodNever",(e,t)=>{kp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Uf(e,r,n,i)});function qh(e){return bf(Hh,e)}var Vh=g("ZodArray",(e,t)=>{zp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>qf(e,r,n,i),e.element=t.element,vt(e,"ZodArray",{min(r,n){return this.check(Jt(r,n))},nonempty(r){return this.check(Jt(1,r))},max(r,n){return this.check(As(r,n))},length(r,n){return this.check(Ts(r,n))},unwrap(){return this.element}})});function Ve(e,t){return Mf(Vh,e,t)}var Wh=g("ZodObject",(e,t)=>{$p.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Vf(e,r,n,i),A(e,"shape",()=>t.shape),vt(e,"ZodObject",{keyof(){return Pn(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:wn()})},loose(){return this.clone({...this._zod.def,catchall:wn()})},strict(){return this.clone({...this._zod.def,catchall:qh()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Bd(this,r)},safeExtend(r){return Hd(this,r)},merge(r){return qd(this,r)},pick(r){return Fd(this,r)},omit(r){return Kd(this,r)},partial(...r){return Vd(Ls,this,r[0])},required(...r){return Wd(js,this,r[0])}})});function P(e,t){let r={type:"object",shape:e??{},...x(t)};return new Wh(r)}var Ds=g("ZodUnion",(e,t)=>{Es.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Wf(e,r,n,i),e.options=t.options});function Jh(e,t){return new Ds({type:"union",options:e,...x(t)})}var Gh=g("ZodDiscriminatedUnion",(e,t)=>{Ds.init(e,t),Ip.init(e,t)});function Xh(e,t,r){return new Gh({type:"union",options:t,discriminator:e,...x(r)})}var Yh=g("ZodIntersection",(e,t)=>{Ep.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Jf(e,r,n,i)});function Qh(e,t){return new Yh({type:"intersection",left:e,right:t})}var xn=g("ZodEnum",(e,t)=>{Pp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Ff(e,n,i,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xn({...t,checks:[],...x(i),entries:o})},e.exclude=(n,i)=>{let o={...t.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new xn({...t,checks:[],...x(i),entries:o})}});function Pn(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new xn({type:"enum",entries:r,...x(t)})}var em=g("ZodLiteral",(e,t)=>{Ap.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Kf(e,r,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Xt(e,t){return new em({type:"literal",values:Array.isArray(e)?e:[e],...x(t)})}var tm=g("ZodTransform",(e,t)=>{Tp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hf(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ds(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(yt(o,r.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(yt(s))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function rm(e){return new tm({type:"transform",transform:e})}var Ls=g("ZodOptional",(e,t)=>{Ps.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Zs(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function os(e){return new Ls({type:"optional",innerType:e})}var nm=g("ZodExactOptional",(e,t)=>{Mp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Zs(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function im(e){return new nm({type:"optional",innerType:e})}var om=g("ZodNullable",(e,t)=>{Cp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Gf(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function ss(e){return new om({type:"nullable",innerType:e})}var sm=g("ZodDefault",(e,t)=>{Op.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Yf(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function am(e,t){return new sm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():fs(t)}})}var cm=g("ZodPrefault",(e,t)=>{Zp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Qf(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function um(e,t){return new cm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():fs(t)}})}var js=g("ZodNonOptional",(e,t)=>{Rp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Xf(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function dm(e,t){return new js({type:"nonoptional",innerType:e,...x(t)})}var lm=g("ZodCatch",(e,t)=>{Np.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>eh(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function pm(e,t){return new lm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var fm=g("ZodPipe",(e,t)=>{Dp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>th(e,r,n,i),e.in=t.in,e.out=t.out});function as(e,t){return new fm({type:"pipe",in:e,out:t})}var hm=g("ZodReadonly",(e,t)=>{Lp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>rh(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function mm(e){return new hm({type:"readonly",innerType:e})}var gm=g("ZodCustom",(e,t)=>{jp.init(e,t),D.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Bf(e,r,n,i)});function _m(e,t={}){return Cf(gm,e,t)}function ym(e,t){return Of(e,t)}var Je=wn(),vm=P({supportsContentEdits:V().optional(),supportsOptions:V().optional()}),bm=P({supportsContentEdits:V().optional(),supportsOptions:V().optional(),supportsForceUpdate:V().optional(),supportsHostTransport:V().optional()}),wm=P({offset:be().int().nonnegative(),length:be().int().nonnegative(),newText:Y()}),Us=Xh("kind",[P({kind:Xt("replace"),path:Ve(Y()),newValue:Je}),P({kind:Xt("stringEdits"),path:Ve(Y()),stringEdits:Ve(wm)})]),xm=P({content:Je.optional(),options:Je.optional(),readOnly:V().optional(),serverRevision:be().int().nonnegative().optional(),acknowledgedClientRevision:be().int().nonnegative().optional(),force:V().optional()}),km=F({id:"web-editor-host",description:"Methods the host exposes to the editor (web-editor/0.12)."},{initialized:M(P({protocolVersion:Xt("web-editor/0.12"),contentType:Pn(["text","json"]),capabilities:vm.optional()}),P({protocolVersion:Xt("web-editor-host/0.12"),capabilities:bm.optional()})),applyContentEdit:ie(P({edits:Ve(Us),clientRevision:be().int().nonnegative(),basedOnServerRevision:be().int().nonnegative()})),reportSize:ie(P({height:be().nonnegative()}))}),zm=F({id:"web-editor",description:"Methods the editor exposes to the host (web-editor/0.12)."},{update:ie(xm),applyContentEdits:ie(P({edits:Ve(Us),serverRevision:be().int().nonnegative(),acknowledgedClientRevision:be().int().nonnegative()})),getContentSchema:M(P({}),P({schema:Je}))}),Sm=F({id:"web-editor-host-transport",description:"Optional messages the web editor sends to its host."},{message:ie(P({message:Je}))}),$m=F({id:"web-editor-client-transport",description:"Optional messages the web editor host sends to the editor."},{message:ie(P({message:Je}))}),qt=P({registered:V(),isDefault:V()}),An=P({handleId:Y(),appId:Y(),serviceId:Y(),serviceIdPrefix:Y()}),Im=An.extend({parentAppId:Y()}),Iz=F({id:"vscode-app-host",description:"Methods an app `.vscode-app.html` exposes to the host (vscode-app-host/0.1)."},{getContext:M(P({}),P({dataDocument:P({contentType:Pn(["text","json"])}).nullable(),embedding:Im.nullable()})),loadApp:M(P({path:Y()}),An).withStream({server:P({})}),unloadApp:M(P({handleId:Y()}),P({})),embeddedReady:ie(P({})),setModalVisibility:M(P({visible:V(),presentation:P({title:Y().optional()}).optional()}),P({})),getEditorRegistration:M(P({extension:Y()}),P({global:qt,workspace:qt,hasWorkspace:V()})),configureEditorAssociation:M(P({extension:Y(),dismissable:V().optional()}),P({global:qt,workspace:qt,hasWorkspace:V(),changed:V()}))}),Ez=F({id:"vscode-app-embedding-events",description:"Lifecycle notifications for child apps loaded by a VS Code app."},{changed:ie(An),removed:ie(P({handleId:Y()}))});function cs(e,t){let r=e;for(let n of t)if(n.kind==="replace")r=us(r,n.path,n.newValue);else{let i=Pm(r,n.path);if(typeof i!="string")throw new Error(`applyContentEdits: stringEdits at path [${n.path.join(", ")}] requires a string, got ${typeof i}`);r=us(r,n.path,Em(i,n.stringEdits))}return r}function Em(e,t){let r=e;for(let n of t)r=r.slice(0,n.offset)+n.newText+r.slice(n.offset+n.length);return r}function Pm(e,t){let r=e;for(let n of t){if(r==null)return;r=r[n]}return r}function us(e,t,r){if(t.length===0)return r;let n=e===null||typeof e!="object"?{}:e,i=n;for(let o=0;o<t.length-1;o++){let s=t[o],a=i[s];(a===null||typeof a!="object")&&(i[s]={}),i=i[s]}return i[t[t.length-1]]=r,n}var ht=class{_listeners=new Set;event=e=>(this._listeners.add(e),{dispose:()=>this._listeners.delete(e)});fire(e){for(let t of this._listeners)try{t(e)}catch(r){console.error("Emitter listener threw:",r)}}dispose(){this._listeners.clear()}};function Am(){return Ft.create(new gn(window,window.parent))}function Tm(){return new mn(Am())}function Mm(e){return e==="windowParent"?Tm():e}var Fs=class Ks{_connection;_host;_hostTransportProxy;_onError;_hostTransport;_content=void 0;_readOnly=!1;_options=void 0;_hostCapabilities;_pendingHostTransportMessages=[];_hostTransportActivated=!1;_clientRevision=0;_basedOnServerRevision=0;_pendingLocalEdits=0;_onDidChangeContent=new ht;onDidChangeContent=this._onDidChangeContent.event;_onDidApplyHostEdits=new ht;onDidApplyHostEdits=this._onDidApplyHostEdits.event;_onDidChangeReadOnly=new ht;onDidChangeReadOnly=this._onDidChangeReadOnly.event;_onDidChangeOptions=new ht;onDidChangeOptions=this._onDidChangeOptions.event;_onDidReceiveHostMessage=new ht;onDidConnect;static async connect(t){let r=new Ks(t);return await r.onDidConnect,r}constructor(t){this._connection=Mm(t.connection),this._onError=t.onError??((r,n)=>console.error("WebEditorClient:",r,n)),this._host=this._connection.get(km),this._hostTransportProxy=this._connection.get(Sm),this._connection.register(zm,{update:r=>this._handleUpdate(r),applyContentEdits:r=>this._handleApplyContentEdits(r),getContentSchema:async()=>({schema:t.getContentSchema?await t.getContentSchema():null})}),this._connection.register($m,{message:({message:r})=>{this._hostTransportActivated?this._onDidReceiveHostMessage.fire(r):this._pendingHostTransportMessages.push(r)}}),this.onDidConnect=this._host.initialized({protocolVersion:"web-editor/0.12",contentType:t.contentType??"text",capabilities:t.capabilities}).then(r=>(this._hostCapabilities=r.capabilities,r.capabilities?.supportsHostTransport?this._hostTransport={onMessage:n=>{let i=this._onDidReceiveHostMessage.event(n);if(!this._hostTransportActivated){this._hostTransportActivated=!0;for(let o of this._pendingHostTransportMessages.splice(0))n(o)}return i},sendMessage:n=>this._hostTransportProxy.message({message:n})}:this._pendingHostTransportMessages.length=0,{capabilities:r.capabilities}))}get connection(){return this._connection}get hostTransport(){return this._hostTransport}getContent(){return this._content}getReadOnly(){return this._readOnly}getOptions(){return this._options}getHostCapabilities(){return this._hostCapabilities}applyEdits(t){if(t.length!==0){try{this._content=cs(this._content,t)}catch(r){this._onError("Failed to apply local edits",r);return}this._clientRevision++,this._pendingLocalEdits++,this._onDidChangeContent.fire({content:this._content,force:!1}),this._host.applyContentEdit({edits:t,clientRevision:this._clientRevision,basedOnServerRevision:this._basedOnServerRevision})}}reportSize(t){this._host.reportSize({height:t})}dispose(){this._onDidChangeContent.dispose(),this._onDidApplyHostEdits.dispose(),this._onDidChangeReadOnly.dispose(),this._onDidChangeOptions.dispose(),this._onDidReceiveHostMessage.dispose(),this._pendingHostTransportMessages.length=0,this._connection.close()}_handleUpdate(t){if(t.acknowledgedClientRevision!==void 0&&this._acknowledge(t.acknowledgedClientRevision),t.serverRevision!==void 0&&(this._basedOnServerRevision=t.serverRevision),t.readOnly!==void 0&&t.readOnly!==this._readOnly&&(this._readOnly=t.readOnly,this._onDidChangeReadOnly.fire({readOnly:t.readOnly})),t.options!==void 0&&(this._options=t.options,this._onDidChangeOptions.fire({options:t.options})),t.content!==void 0){if(this._pendingLocalEdits>0&&!t.force)return;this._content=t.content,this._onDidChangeContent.fire({content:t.content,force:t.force===!0})}}_handleApplyContentEdits(t){if(this._acknowledge(t.acknowledgedClientRevision),this._basedOnServerRevision=t.serverRevision,!(this._pendingLocalEdits>0)){try{this._content=cs(this._content,t.edits)}catch(r){this._onError("Failed to apply host edits",r);return}this._onDidApplyHostEdits.fire({edits:t.edits,content:this._content})}}_acknowledge(t){let r=Math.max(0,this._clientRevision-(this._clientRevision-t)),n=Math.max(0,this._clientRevision-r);this._pendingLocalEdits=n}};var Xe="comm",rr="rule",nr="decl";var Bs="@media",Hs="@import";var qs="@supports";var Vs="@namespace",bt="@keyframes";var ir="@layer",Ws="@scope";var Tn=Math.abs,wt=String.fromCharCode;function or(e){return e.trim()}function Ye(e,t,r){return e.replace(t,r)}function Js(e,t,r){return e.indexOf(t,r)}function we(e,t){return e.charCodeAt(t)|0}function xe(e,t,r){return e.slice(t,r)}function ee(e){return e.length}function sr(e){return e.length}function Qe(e,t){return t.push(e),e}var ar=1,et=1,Gs=0,se=0,j=0,rt="";function cr(e,t,r,n,i,o,s,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:ar,column:et,length:s,return:"",siblings:a}}function Xs(){return j}function Ys(){return j=se>0?we(rt,--se):0,et--,j===10&&(et=1,ar--),j}function ae(){return j=se<Gs?we(rt,se++):0,et++,j===10&&(et=1,ar++),j}function ke(){return we(rt,se)}function xt(){return se}function ur(e,t){return xe(rt,e,t)}function tt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qs(e){return ar=et=1,Gs=ee(rt=e),se=0,[]}function ea(e){return rt="",e}function dr(e){return or(ur(se-1,Mn(e===91?e+2:e===40?e+1:e)))}function ta(e){for(;(j=ke())&&j<33;)ae();return tt(e)>2||tt(j)>3?"":" "}function ra(e,t){for(;--t&&ae()&&!(j<48||j>102||j>57&&j<65||j>70&&j<97););return ur(e,xt()+(t<6&&ke()==32&&ae()==32))}function Mn(e){for(;ae();)switch(j){case e:return se;case 34:case 39:e!==34&&e!==39&&Mn(j);break;case 40:e===41&&Mn(e);break;case 92:ae();break}return se}function na(e,t){for(;ae()&&e+j!==57;)if(e+j===84&&ke()===47)break;return"/*"+ur(t,se-1)+"*"+wt(e===47?e:ae())}function ia(e){for(;!tt(ke());)ae();return ur(e,se)}function aa(e){return ea(lr("",null,null,null,[""],e=Qs(e),0,[0],e))}function lr(e,t,r,n,i,o,s,a,c){for(var u=0,d=0,l=s,p=0,f=0,m=0,_=1,b=1,S=1,$=0,y="",w=i,T=o,L=n,I=y;b;)switch(m=$,$=ae()){case 40:if(m!=108&&we(I,l-1)==58){Js(I+=Ye(dr($),"&","&\f"),"&\f",Tn(u?a[u-1]:0))!=-1&&(S=-1);break}case 34:case 39:case 91:I+=dr($);break;case 9:case 10:case 13:case 32:I+=ta(m);break;case 92:I+=ra(xt()-1,7);continue;case 47:switch(ke()){case 42:case 47:Qe(Om(na(ae(),xt()),t,r,c),c),(tt(m||1)==5||tt(ke()||1)==5)&&ee(I)&&xe(I,-1,void 0)!==" "&&(I+=" ");break;default:I+="/"}break;case 123*_:a[u++]=ee(I)*S;case 125*_:case 59:case 0:switch($){case 0:case 125:b=0;case 59+d:S==-1&&(I=Ye(I,/\f/g,"")),f>0&&(ee(I)-l||_===0&&m===47)&&Qe(f>32?sa(I+";",n,r,l-1,c):sa(Ye(I," ","")+";",n,r,l-2,c),c);break;case 59:I+=";";default:if(Qe(L=oa(I,t,r,u,d,i,a,y,w=[],T=[],l,o),o),$===123)if(d===0)lr(I,t,L,L,w,o,l,a,T);else{switch(p){case 99:if(we(I,3)===110)break;case 108:if(we(I,2)===97)break;default:d=0;case 100:case 109:case 115:}d?lr(e,L,L,n&&Qe(oa(e,L,L,0,0,i,a,y,i,w=[],l,T),T),i,T,l,a,n?w:T):lr(I,L,L,L,[""],T,0,a,T)}}u=d=f=0,_=S=1,y=I="",l=s;break;case 58:l=1+ee(I),f=m;default:if(_<1){if($==123)--_;else if($==125&&_++==0&&Ys()==125)continue}switch(I+=wt($),$*_){case 38:S=d>0?1:(I+="\f",-1);break;case 44:a[u++]=(ee(I)-1)*S,S=1;break;case 64:ke()===45&&(I+=dr(ae())),p=ke(),d=l=ee(y=I+=ia(xt())),$++;break;case 45:m===45&&ee(I)==2&&(_=0)}}return o}function oa(e,t,r,n,i,o,s,a,c,u,d,l){for(var p=i-1,f=i===0?o:[""],m=sr(f),_=0,b=0,S=0;_<n;++_)for(var $=0,y=xe(e,p+1,p=Tn(b=s[_])),w=e;$<m;++$)(w=or(b>0?f[$]+" "+y:Ye(y,/&\f/g,f[$])))&&(c[S++]=w);return cr(e,t,r,i===0?rr:a,c,u,d,l)}function Om(e,t,r,n){return cr(e,t,r,Xe,wt(Xs()),xe(e,2,-2),0,n)}function sa(e,t,r,n,i){return cr(e,t,r,nr,xe(e,0,n),xe(e,n+1,-1),n,i)}function pr(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function ca(e,t,r,n){switch(e.type){case ir:if(e.children.length)break;case Hs:case Vs:case nr:return e.return=e.return||e.value;case Xe:return"";case bt:return e.return=e.value+"{"+pr(e.children,n)+"}";case rr:if(!ee(e.value=e.props.join(",")))return""}return ee(r=pr(e.children,n))?e.return=e.value+"{"+r+"}":""}function ua(e){var t=sr(e);return function(r,n,i,o){for(var s="",a=0;a<t;a++)s+=e[a](r,n,i,o)||"";return s}}var ha="c4",Zm=h(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Rm=h(async()=>{let{diagram:e}=await import("./c4Diagram-7LVT6UL2-MLOCJVO7.js");return{id:ha,diagram:e}},"loader"),Nm={id:ha,detector:Zm,loader:Rm},Dm=Nm,ma="flowchart",Lm=h((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),jm=h(async()=>{let{diagram:e}=await import("./flowDiagram-HODETNUW-7VPZDPOT.js");return{id:ma,diagram:e}},"loader"),Um={id:ma,detector:Lm,loader:jm},Fm=Um,ga="flowchart-v2",Km=h((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),Bm=h(async()=>{let{diagram:e}=await import("./flowDiagram-HODETNUW-7VPZDPOT.js");return{id:ga,diagram:e}},"loader"),Hm={id:ga,detector:Km,loader:Bm},qm=Hm,_a="swimlane",Vm=h(e=>/^\s*swimlane-beta\b/.test(e),"detector"),Wm=h(async()=>{let{diagram:e}=await import("./swimlanesDiagram-VR7AAH4N-ZWYIELV6.js");return{id:_a,diagram:e}},"loader"),Jm={id:_a,detector:Vm,loader:Wm},Gm=Jm,ya="er",Xm=h(e=>/^\s*erDiagram/.test(e),"detector"),Ym=h(async()=>{let{diagram:e}=await import("./erDiagram-RLTQ6QDP-VFB2E75C.js");return{id:ya,diagram:e}},"loader"),Qm={id:ya,detector:Xm,loader:Ym},eg=Qm,va="gitGraph",tg=h(e=>/^\s*gitGraph/.test(e),"detector"),rg=h(async()=>{let{diagram:e}=await import("./gitGraphDiagram-WWUBYQGX-2JNXWAO7.js");return{id:va,diagram:e}},"loader"),ng={id:va,detector:tg,loader:rg},ig=ng,ba="gantt",og=h(e=>/^\s*gantt/.test(e),"detector"),sg=h(async()=>{let{diagram:e}=await import("./ganttDiagram-EL5Y4UJY-M4J4OUTC.js");return{id:ba,diagram:e}},"loader"),ag={id:ba,detector:og,loader:sg},cg=ag,wa="info",ug=h(e=>/^\s*info/.test(e),"detector"),dg=h(async()=>{let{diagram:e}=await import("./infoDiagram-27XIBGKW-HIFWTMVR.js");return{id:wa,diagram:e}},"loader"),lg={id:wa,detector:ug,loader:dg},xa="pie",pg=h(e=>/^\s*pie/.test(e),"detector"),fg=h(async()=>{let{diagram:e}=await import("./pieDiagram-E7YTZNPT-T3YNFFQK.js");return{id:xa,diagram:e}},"loader"),hg={id:xa,detector:pg,loader:fg},ka="quadrantChart",mg=h(e=>/^\s*quadrantChart/.test(e),"detector"),gg=h(async()=>{let{diagram:e}=await import("./quadrantDiagram-AXDQQJYC-QK3O7JVZ.js");return{id:ka,diagram:e}},"loader"),_g={id:ka,detector:mg,loader:gg},yg=_g,za="xychart",vg=h(e=>/^\s*xychart(-beta)?/.test(e),"detector"),bg=h(async()=>{let{diagram:e}=await import("./xychartDiagram-S5SC5T6Z-KES46ZNY.js");return{id:za,diagram:e}},"loader"),wg={id:za,detector:vg,loader:bg},xg=wg,Sa="requirement",kg=h(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),zg=h(async()=>{let{diagram:e}=await import("./requirementDiagram-BXWQKSXE-VFXR4URP.js");return{id:Sa,diagram:e}},"loader"),Sg={id:Sa,detector:kg,loader:zg},$g=Sg,$a="sequence",Ig=h(e=>/^\s*sequenceDiagram/.test(e),"detector"),Eg=h(async()=>{let{diagram:e}=await import("./sequenceDiagram-WJ2MYXX4-UX6J5IW6.js");return{id:$a,diagram:e}},"loader"),Pg={id:$a,detector:Ig,loader:Eg},Ag=Pg,Ia="class",Tg=h((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),Mg=h(async()=>{let{diagram:e}=await import("./classDiagram-ZZMXUADV-YM5IATCB.js");return{id:Ia,diagram:e}},"loader"),Cg={id:Ia,detector:Tg,loader:Mg},Og=Cg,Ea="classDiagram",Zg=h((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),Rg=h(async()=>{let{diagram:e}=await import("./classDiagram-v2-VYDZK3BY-IMSSO4VH.js");return{id:Ea,diagram:e}},"loader"),Ng={id:Ea,detector:Zg,loader:Rg},Dg=Ng,Pa="state",Lg=h((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),jg=h(async()=>{let{diagram:e}=await import("./stateDiagram-D77RDMKH-HR7NFLW4.js");return{id:Pa,diagram:e}},"loader"),Ug={id:Pa,detector:Lg,loader:jg},Fg=Ug,Aa="stateDiagram",Kg=h((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),Bg=h(async()=>{let{diagram:e}=await import("./stateDiagram-v2-MP3YSRHH-XZ4JFPI5.js");return{id:Aa,diagram:e}},"loader"),Hg={id:Aa,detector:Kg,loader:Bg},qg=Hg,Ta="journey",Vg=h(e=>/^\s*journey/.test(e),"detector"),Wg=h(async()=>{let{diagram:e}=await import("./journeyDiagram-3NMN7TZE-SFCU2ZZP.js");return{id:Ta,diagram:e}},"loader"),Jg={id:Ta,detector:Vg,loader:Wg},Gg=Jg,Xg=h((e,t,r)=>{R.debug(`rendering svg for syntax error
`);let n=ri(t),i=n.append("g");n.attr("viewBox","0 0 2412 512"),ei(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Ma={draw:Xg},Yg=Ma,Qg={db:{},renderer:Ma,parser:{parse:h(()=>{},"parse")}},e_=Qg,Ca="flowchart-elk",t_=h((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),r_=h(async()=>{let{diagram:e}=await import("./flowDiagram-HODETNUW-7VPZDPOT.js");return{id:Ca,diagram:e}},"loader"),n_={id:Ca,detector:t_,loader:r_},i_=n_,Oa="timeline",o_=h(e=>/^\s*timeline/.test(e),"detector"),s_=h(async()=>{let{diagram:e}=await import("./timeline-definition-24CTP7MA-HOSQ6DE7.js");return{id:Oa,diagram:e}},"loader"),a_={id:Oa,detector:o_,loader:s_},c_=a_,Za="mindmap",u_=h(e=>/^\s*mindmap/.test(e),"detector"),d_=h(async()=>{let{diagram:e}=await import("./mindmap-definition-YA3MSWOX-JGF5Y3TO.js");return{id:Za,diagram:e}},"loader"),l_={id:Za,detector:u_,loader:d_},p_=l_,Ra="kanban",f_=h(e=>/^\s*kanban/.test(e),"detector"),h_=h(async()=>{let{diagram:e}=await import("./kanban-definition-UXKFOSKX-57MFHAG5.js");return{id:Ra,diagram:e}},"loader"),m_={id:Ra,detector:f_,loader:h_},g_=m_,Na="sankey",__=h(e=>/^\s*sankey(-beta)?/.test(e),"detector"),y_=h(async()=>{let{diagram:e}=await import("./sankeyDiagram-P5KCCOFB-J4FNNAAO.js");return{id:Na,diagram:e}},"loader"),v_={id:Na,detector:__,loader:y_},b_=v_,Da="packet",w_=h(e=>/^\s*packet(-beta)?/.test(e),"detector"),x_=h(async()=>{let{diagram:e}=await import("./diagram-Z3DM3KII-QQZ76HCI.js");return{id:Da,diagram:e}},"loader"),k_={id:Da,detector:w_,loader:x_},La="radar",z_=h(e=>/^\s*radar-beta/.test(e),"detector"),S_=h(async()=>{let{diagram:e}=await import("./diagram-UQ7AKVKN-5CAGOLLK.js");return{id:La,diagram:e}},"loader"),$_={id:La,detector:z_,loader:S_},ja="block",I_=h(e=>/^\s*block(-beta)?/.test(e),"detector"),E_=h(async()=>{let{diagram:e}=await import("./blockDiagram-I7D4REHJ-65UBDOAU.js");return{id:ja,diagram:e}},"loader"),P_={id:ja,detector:I_,loader:E_},A_=P_,Ua="treeView",T_=h(e=>/^\s*treeView-beta/.test(e),"detector"),M_=h(async()=>{let{diagram:e}=await import("./diagram-S7CK7UJ4-V6YXEADG.js");return{id:Ua,diagram:e}},"loader"),C_={id:Ua,detector:T_,loader:M_},O_=C_,Fa="architecture",Z_=h(e=>/^\s*architecture/.test(e),"detector"),R_=h(async()=>{let{diagram:e}=await import("./architectureDiagram-5GKGNRK7-4LGFVGBD.js");return{id:Fa,diagram:e}},"loader"),N_={id:Fa,detector:Z_,loader:R_},D_=N_,Ka="eventmodeling",L_=h(e=>/^\s*eventmodeling/.test(e),"detector"),j_=h(async()=>{let{diagram:e}=await import("./diagram-VSXAHHWV-TH4DZ53Q.js");return{id:Ka,diagram:e}},"loader"),U_={id:Ka,detector:L_,loader:j_},F_=U_,Ba="ishikawa",K_=h(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),B_=h(async()=>{let{diagram:e}=await import("./ishikawaDiagram-5VMMS53U-DRDLIOCA.js");return{id:Ba,diagram:e}},"loader"),H_={id:Ba,detector:K_,loader:B_},Ha="venn",q_=h(e=>/^\s*venn-beta/.test(e),"detector"),V_=h(async()=>{let{diagram:e}=await import("./vennDiagram-4TSXK5OY-BWPYENLN.js");return{id:Ha,diagram:e}},"loader"),W_={id:Ha,detector:q_,loader:V_},J_=W_,qa="treemap",G_=h(e=>/^\s*treemap/.test(e),"detector"),X_=h(async()=>{let{diagram:e}=await import("./diagram-VX7I27RA-ZQ2YVXQ7.js");return{id:qa,diagram:e}},"loader"),Y_={id:qa,detector:G_,loader:X_},Va="wardley",Q_=h(e=>/^\s*wardley-beta/i.test(e),"detector"),ey=h(async()=>{let{diagram:e}=await import("./wardleyDiagram-VM6X3IG4-HTWDFMCR.js");return{id:Va,diagram:e}},"loader"),ty={id:Va,detector:Q_,loader:ey},ry=ty,Wa="cynefin",ny=h(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),iy=h(async()=>{let{diagram:e}=await import("./cynefinDiagram-5FMLGOSQ-57E6VJ7B.js");return{id:Wa,diagram:e}},"loader"),oy={id:Wa,detector:ny,loader:iy},Ja="railroad",sy=h(e=>/^\s*railroad-beta/i.test(e),"detector"),ay=h(async()=>{let{diagram:e}=await import("./railroadDiagram-O6MQD6OU-ALLTAL5G.js");return{id:Ja,diagram:e}},"loader"),cy={id:Ja,detector:sy,loader:ay},Ga="railroadEbnf",uy=h(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),dy=h(async()=>{let{diagram:e}=await import("./ebnfDiagram-PWID7BFC-Q5FQ3V2P.js");return{id:Ga,diagram:e}},"loader"),ly={id:Ga,detector:uy,loader:dy},Xa="railroadAbnf",py=h(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),fy=h(async()=>{let{diagram:e}=await import("./abnfDiagram-VCTEODGH-W5YM2BPA.js");return{id:Xa,diagram:e}},"loader"),hy={id:Xa,detector:py,loader:fy},Ya="railroadPeg",my=h(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),gy=h(async()=>{let{diagram:e}=await import("./pegDiagram-XKGWAZYB-Y3SH4FVT.js");return{id:Ya,diagram:e}},"loader"),_y={id:Ya,detector:my,loader:gy},da=!1,hr=h(()=>{da||(da=!0,st("error",e_,e=>e.toLowerCase().trim()==="error"),st("---",{db:{clear:h(()=>{},"clear")},styles:{},renderer:{draw:h(()=>{},"draw")},parser:{parse:h(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:h(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),St(i_,p_,D_),St(Dm,g_,Dg,Og,eg,cg,lg,hg,$g,Ag,Gm,qm,Fm,c_,ig,qg,Fg,Gg,yg,b_,k_,xg,A_,F_,O_,$_,H_,Y_,cy,ly,hy,_y,J_,ry,oy))},"addDiagrams"),yy=h(async()=>{R.debug("Loading registered diagrams");let t=(await Promise.allSettled(Object.entries(zt).map(async([r,{detector:n,loader:i}])=>{if(i)try{$t(r)}catch{try{let{diagram:o,id:s}=await i();st(s,o,n)}catch(o){throw R.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete zt[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){R.error(`Failed to load ${t.length} external diagrams`);for(let r of t)R.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),vy="graphics-document document";function Qa(e,t){e.attr("role",vy),t!==""&&e.attr("aria-roledescription",t)}h(Qa,"setA11yDiagramInfo");function ec(e,t,r,n){if(e.insert!==void 0){if(r){let i=`chart-desc-${n}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(r)}if(t){let i=`chart-title-${n}`;e.attr("aria-labelledby",i),e.insert("title",":first-child").attr("id",i).text(t)}}}h(ec,"addSVGa11yTitleDescription");var On=class tc{constructor(t,r,n,i,o){this.type=t,this.text=r,this.db=n,this.parser=i,this.renderer=o}static{h(this,"Diagram")}static async fromText(t,r={}){let n=je(),i=Sr(t,n);t=si(t)+`
`;try{$t(i)}catch{let u=Qn(i);if(!u)throw new Yn(`Diagram ${i} not found.`);let{id:d,diagram:l}=await u();st(d,l)}let{db:o,parser:s,renderer:a,init:c}=$t(i);return s.parser&&(s.parser.yy=o),o.clear?.(),c?.(n),r.title&&o.setDiagramTitle?.(r.title),await s.parse(t),new tc(i,t,o,s,a)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},la=[],by=h(()=>{la.forEach(e=>{e()}),la=[]},"attachFunctions"),wy=h(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function rc(e){let t=e.match(Xn);if(!t)return{text:e,metadata:{}};let r=t[1],n=r?t[2].split(`
`).map(s=>s.startsWith(r)?s.slice(r.length):s).join(`
`):t[2],i=di(n,{schema:ui})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};let o={};return i.displayMode&&(o.displayMode=i.displayMode.toString()),i.title&&(o.title=i.title.toString()),i.config&&(o.config=i.config),{text:e.slice(t[0].length),metadata:o}}h(rc,"extractFrontMatter");var xy=h(e=>e.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(t,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),ky=h(e=>{let{text:t,metadata:r}=rc(e),{displayMode:n,title:i,config:o={}}=r;return n&&(o.gantt||(o.gantt={}),o.gantt.displayMode=n),{title:i,config:o,text:t}},"processFrontmatter"),zy=h(e=>{let t=Ue.detectInit(e)??{},r=Ue.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:n})=>n==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:ii(e),directive:t}},"processDirectives");function Rn(e){let t=xy(e),r=ky(t),n=zy(r.text),i=oi(r.config,n.directive);return e=wy(n.text),{code:e,title:r.title,config:i}}h(Rn,"preprocessDiagram");function nc(e){let t=new TextEncoder().encode(e),r=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(r)}h(nc,"toBase64");var Sy=5e4,$y="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Iy="sandbox",Ey="loose",Py="http://www.w3.org/2000/svg",Ay="http://www.w3.org/1999/xlink",Ty="http://www.w3.org/1999/xhtml",My="100%",Cy="100%",Oy="border:0;margin:0;",Zy="margin:0",Ry="allow-top-navigation-by-user-activation allow-popups",Ny='The "iframe" tag is not supported by your browser.',Dy=["foreignobject"],Ly=["dominant-baseline"];function Nn(e){let t=Rn(e);return ot(),Jn(t.config??{}),t}h(Nn,"processAndSetConfigs");async function ic(e,t){hr();try{let{code:r,config:n}=Nn(e);return{diagramType:(await sc(r)).type,config:n}}catch(r){if(t?.suppressErrors)return!1;throw r}}h(ic,"parse");var pa=h((e,t,r=[])=>{let n=Kn(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${n}`},"cssImportantStyles"),jy=h((e,t=new Map)=>{let r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){let a=Gn(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(c=>{Ir(c.styles)||a.forEach(u=>{r.insertRule(pa(c.id,u,c.styles),r.cssRules.length)}),Ir(c.textStyles)||r.insertRule(pa(c.id,"tspan",(c?.textStyles||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){let i=new CSSStyleSheet;i.replaceSync(e.themeCSS),n=$r(i)+`
`}else n+=`${e.themeCSS}
`;return n+$r(r)},"createCssStyles"),Uy=h((e,t)=>pr(aa(`${e}{${t}}`),ua([h(function(n,i,o,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===bt)return;n.props=n.props.map(a=>a===e&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(a.startsWith(`${e} `)||a.startsWith(`${e}>`))&&!a.startsWith(`${e} ||`)?a:`${e} ${a}`)}else n.type.startsWith("@")&&([...[Bs,qs,ir,Ws,"@container","@starting-style"],bt].includes(n.type)||(R.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=Xe))},"addNamespace"),ca])),"compileCSS"),Fy=h((e,t,r,n)=>{let i=jy(e,r),o=ti(t,i,{...e.themeVariables,theme:e.theme,look:e.look},n);return Uy(n,o)},"createUserStyles"),Ky=h((e="",t,r)=>{let n=e;return!r&&!t&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=ai(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),By=h((e="",t)=>{let r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":Cy,n=nc(`<body style="${Zy}">${e}</body>`);return`<iframe style="width:${My};height:${r};${Oy}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${Ry}">
  ${Ny}
</iframe>`},"putIntoIFrame"),fa=h((e,t,r,n,i)=>{let o=e.append("div");o.attr("id",r),n&&o.attr("style",n);let s=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Py);return i&&s.attr("xmlns:xlink",i),s.append("g"),e},"appendDivSvgG");function Zn(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}h(Zn,"sandboxedIframe");var Hy=h((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),qy=h(async function(e,t,r){hr();let n=Nn(t);t=n.code;let i=je();R.debug(i),t.length>(i?.maxTextSize??Sy)&&(t=$y);let o=`#${e}`,s="i"+e,a="#"+s,c="d"+e,u="#"+c,d=h(()=>{let it=pe(p?a:u).node();it&&"remove"in it&&it.remove()},"removeTempElements"),l=pe(document.body),p=i.securityLevel===Iy,f=i.securityLevel===Ey,m=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){let U=Zn(pe(r),s);l=pe(U.nodes()[0].contentDocument.body),l.node().style.margin="0"}else l=pe(r);fa(l,e,c,`font-family: ${m}`,Ay)}else{if(Hy(document,e,c,s),p){let U=Zn(pe(document.body),s);l=pe(U.nodes()[0].contentDocument.body),l.node().style.margin="0"}else l=pe("body");fa(l,e,c)}let _,b;try{_=await On.fromText(t,{title:n.title})}catch(U){if(i.suppressErrorRendering)throw d(),U;_=await On.fromText("error"),b=U}let S=l.select(u).node(),$=_.type,y=S.firstChild,w=y.firstChild,T=_.renderer.getClasses?.(t,_),L=Fy(i,$,T,o),I=document.createElement("style");I.innerHTML=L,y.insertBefore(I,w);try{await _.renderer.draw(t,e,"11.17.2",_)}catch(U){throw i.suppressErrorRendering?d():Yg.draw(t,e,"11.17.2"),U}let Uc=l.select(`${u} svg`),Fc=_.db.getAccTitle?.(),Kc=_.db.getAccDescription?.();ac($,Uc,Fc,Kc);let Bc=h(()=>{l.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Ty);let U=l.select(u).node().innerHTML;if(R.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),U=Ky(U,p,Bn(i.arrowMarkerAbsolute)),p){let it=l.select(u+" svg").node();U=By(U,it)}else f||(U=Un.sanitize(U,{ADD_TAGS:Dy,ADD_ATTR:Ly,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return by(),U},"serializeSvg")();if(b)throw b;return d(),{diagramType:$,svg:Bc,bindFunctions:_.db.bindFunctions}},"render");function oc(e={}){let t=Fn({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),qn(t),t?.theme&&t.theme in kt?t.themeVariables=kt[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=kt.default.getThemeVariables(t.themeVariables));let r=typeof t=="object"?Hn(t):zr();xr(r.logLevel),hr()}h(oc,"initialize");var sc=h((e,t={})=>{let{code:r}=Rn(e);return On.fromText(r,t)},"getDiagramFromText");function ac(e,t,r,n){Qa(t,e),ec(t,r,n,t.attr("id"))}h(ac,"addA11yInfo");var Le=Object.freeze({render:qy,parse:ic,getDiagramFromText:sc,initialize:oc,getConfig:je,setConfig:Wn,getSiteConfig:zr,updateSiteConfig:Vn,reset:h(()=>{ot()},"reset"),globalReset:h(()=>{ot(kr)},"globalReset"),defaultConfig:kr});xr(je().logLevel);ot(je());var Vy=h((e,t,r)=>{R.warn(e),Er(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),cc=h(async function(e={querySelector:".mermaid"}){try{await Wy(e)}catch(t){if(Er(t)&&R.error(t.str),ze.parseError&&ze.parseError(t),!e.suppressErrors)throw R.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Wy=h(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n=Le.getConfig();R.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");R.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(R.debug("Start On Load: "+n?.startOnLoad),Le.updateSiteConfig({startOnLoad:n?.startOnLoad}));let o=new Ue.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed),s,a=[];for(let c of Array.from(i)){if(R.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");let u=`mermaid-${o.next()}`;s=c.innerHTML,s=ci(Ue.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");let d=Ue.detectInit(s);d&&R.debug("Detected early reinit: ",d);try{let{svg:l,bindFunctions:p}=await pc(u,s,c);c.innerHTML=l,e&&await e(u),p&&p(c)}catch(l){Vy(l,a,ze.parseError)}}if(a.length>0)throw a[0]},"runThrowsErrors"),uc=h(function(e){Le.initialize(e)},"initialize"),Jy=h(async function(e,t,r){R.warn("mermaid.init is deprecated. Please use run instead."),e&&uc(e);let n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await cc(n)},"init"),Gy=h(async(e,{lazyLoad:t=!0}={})=>{hr(),St(...e),t===!1&&await yy()},"registerExternalDiagrams"),dc=h(function(){if(ze.startOnLoad){let{startOnLoad:e}=Le.getConfig();e&&ze.run().catch(t=>R.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",dc,!1);var Xy=h(function(e){ze.parseError=e},"setParseErrorHandler"),fr=[],Cn=!1,lc=h(async()=>{if(!Cn){for(Cn=!0;fr.length>0;){let e=fr.shift();if(e)try{await e()}catch(t){R.error("Error executing queue",t)}}Cn=!1}},"executeQueue"),Yy=h(async(e,t)=>new Promise((r,n)=>{let i=h(()=>new Promise((o,s)=>{Le.parse(e,t).then(a=>{o(a),r(a)},a=>{R.error("Error parsing",a),ze.parseError?.(a),s(a),n(a)})}),"performCall");fr.push(i),lc().catch(n)}),"parse"),pc=h((e,t,r)=>new Promise((n,i)=>{let o=h(()=>new Promise((s,a)=>{Le.render(e,t,r).then(c=>{s(c),n(c)},c=>{R.error("Error parsing",c),ze.parseError?.(c),a(c),i(c)})}),"performCall");fr.push(o),lc().catch(i)}),"render"),Qy=h(()=>Object.keys(zt).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ze={startOnLoad:!0,mermaidAPI:Le,parse:Yy,render:pc,init:Jy,run:cc,registerExternalDiagrams:Gy,registerLayoutLoaders:li,initialize:uc,parseError:void 0,contentLoaded:dc,setParseErrorHandler:Xy,detectType:Sr,registerIconPacks:ni,getRegisteredDiagramsMetadata:Qy},Se=ze;var fc=pi(async()=>await import("./render-TAZW7USW-O6JCSWLJ.js"),"loader"),ev=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap"],tv=[{name:"elk",loader:fc,algorithm:"elk.layered"},...ev.map(e=>({name:e,loader:fc,algorithm:e}))],hc=tv;var rv=fi(async()=>await import("./render-DLZURBVE-CYTUHGH4.js"),"loader"),nv=[{name:"tidy-tree",loader:rv,algorithm:"tidy-tree"}],mc=nv;var gc="zenuml",iv=Pr(e=>/^\s*zenuml/.test(e),"detector"),ov=Pr(async()=>{let{diagram:e}=await import("./zenuml-definition-ZCSB3OVJ-XAHTVQO3.js");return{id:gc,diagram:e}},"loader"),sv={id:gc,detector:iv,loader:ov},_c=sv;var yc=[{name:"logos",loader:()=>import("./logos-ULGNDP7E.js").then(e=>e.icons)},{name:"mdi",loader:()=>import("./mdi-3KYDHIYZ.js").then(e=>e.icons)}];var $c={top:8,bottom:8},gr=12,vc=4,bc=8,ce=4,wc=20,_r=2,av=20,xc=8,kc="http://www.w3.org/2000/svg";function Ic(e){let t=e.querySelector("svg");t&&cv(t)}function cv(e){if(!/^(flowchart|class)/.test(e.getAttribute("aria-roledescription")??""))return!1;let t=uv(e);if(!t.length)return!1;let r=_v(e),n=dv(e,t,r.endpoints),i=[];for(let{label:o,origin:s,labelPosition:a,title:c,box:u}of t){let d=s.y+a.y,l=mv(r,d,d+c.height),{x:p,clear:f}=hv({start:u.left,end:u.right},c.width,l);if(!f){let m=r.arrowheads.filter(_=>_.left<p+c.width+ce&&_.right>p-ce&&_.bottom>d);d=Math.max(u.top,Math.min(d,...m.map(_=>_.top-c.height))),i.push({left:p-ce,top:d+_r,right:p+c.width+ce,bottom:d+c.height-_r})}(Math.abs(p-s.x-a.x)>.01||Math.abs(d-s.y-a.y)>.01)&&(o.setAttribute("transform",`translate(${p-s.x}, ${d-s.y})`),n=!0)}return fv(e,i,r.arrowheads)||n}function uv(e){let t=[];for(let r of e.querySelectorAll("g.cluster")){let n=r.querySelectorAll(":scope > rect"),i=r.querySelector(":scope > g.cluster-label"),o=yr(r,e),s=Ac(i?.getAttribute("transform"));if(n.length!==1||n[0].hasAttribute("transform")||!i||!o||!s)continue;let a=Pc(n[0]),c=a&&vv(i,a,s);if(a&&c){let u={left:o.x+a.left,top:o.y+a.top,right:o.x+a.right,bottom:o.y+a.bottom};t.push({rect:n[0],label:i,origin:o,labelPosition:s,title:c,drawn:u,box:u})}}return t}function dv(e,t,r){let n=new Map(t.map(a=>[a,lv(a,t)])),i=a=>a.bottom-a.top,o=({drawn:a})=>r.some(({x:c,y:u})=>u>=a.top-1&&u<=a.bottom+1&&(c>=a.left-wc&&c<=a.left+1||c>=a.right-1&&c<=a.right+wc));for(let a of[...t].sort((c,u)=>i(c.drawn)-i(u.drawn))){if(o(a))continue;let{left:c,right:u}=a.box,d=a.title.width+2*gr-(u-c);d>0&&(c-=d/2,u+=d/2);for(let[l,p]of n)p===a&&(c=Math.min(c,l.box.left-mr(l.drawn.left-a.drawn.left)),u=Math.max(u,l.box.right+mr(a.drawn.right-l.drawn.right)));a.box={...a.box,left:c,right:u}}for(let a of[...t].sort((c,u)=>i(u.drawn)-i(c.drawn))){let c=n.get(a);if(c){let u=Math.min(a.drawn.left,Math.max(a.box.left,c.box.left+mr(a.drawn.left-c.drawn.left))),d=Math.max(a.drawn.right,Math.min(a.box.right,c.box.right-mr(c.drawn.right-a.drawn.right)));a.box={...a.box,left:u,right:d}}}let s=t.filter(({box:a,drawn:c})=>a.left<c.left||a.right>c.right);for(let{rect:a,origin:c,box:u}of s)a.setAttribute("x",String(u.left-c.x)),a.setAttribute("width",String(u.right-u.left));return pv(e,s.map(a=>a.box)),s.length>0}function lv(e,t){let{left:r,top:n,right:i,bottom:o}=e.drawn,s=(r+i)/2,a;for(let c of t){let u=c.drawn;u.top<=n&&u.bottom>=o&&u.bottom-u.top>o-n&&u.left<s&&s<u.right&&(!a||u.bottom-u.top<a.drawn.bottom-a.drawn.top)&&(a=c)}return a}function mr(e){return e<0?gr:Math.min(e,gr)}function pv(e,t){let r=Dn(e);if(!t.length||!r)return;let{x:n,y:i,width:o,height:s}=r,a=Math.min(n,...t.map(p=>p.left-bc)),c=Math.max(n+o,...t.map(p=>p.right+bc)),u=c-a-o;if(u<=0)return;e.setAttribute("viewBox",`${a} ${i} ${c-a} ${s}`);let d=parseFloat(e.style.maxWidth);Number.isFinite(d)&&(e.style.maxWidth=`${d+u}px`);let l=e.getAttribute("width");l&&!l.endsWith("%")&&Number.isFinite(parseFloat(l))&&e.setAttribute("width",String(parseFloat(l)+u))}function Dn(e){let t=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(parseFloat);if(t?.length!==4||!t.every(Number.isFinite))return;let[r,n,i,o]=t;return{x:r,y:n,width:i,height:o}}function fv(e,t,r){let n=Dn(e);if(!t.length||!n||!/^[\w-]+$/.test(e.id))return!1;let i={left:n.x-n.width,top:n.y-n.height,right:n.x+2*n.width,bottom:n.y+2*n.height},o=r.filter(a=>t.some(c=>a.left<c.right&&a.right>c.left&&a.top<c.bottom&&a.bottom>c.top)),s=!1;return e.querySelectorAll(".edgePaths").forEach((a,c)=>{let u=yr(a,e);if(!u||a.hasAttribute("clip-path"))return;let d=({left:m,top:_,right:b,bottom:S})=>`M${m-u.x},${_-u.y}H${b-u.x}V${S-u.y}H${m-u.x}Z`,l=({left:m,top:_,right:b,bottom:S})=>`M${m-u.x},${_-u.y}V${S-u.y}H${b-u.x}V${_-u.y}Z`,p=e.ownerDocument.createElementNS(kc,"path");p.setAttribute("d",[d(i),...t.map(l),...o.map(d)].join(""));let f=e.ownerDocument.createElementNS(kc,"clipPath");f.id=`${e.id}-subgraph-titles-${c}`,f.append(p),a.before(f),a.setAttribute("clip-path",`url(#${f.id})`),s=!0}),s}function hv(e,t,r){let n=(e.start+e.end-t)/2,i=Math.max(0,Math.min(gr,n-e.start)),o=e.start+i,s=e.end-i-t,a=f=>Math.max(0,...r.map(m=>Math.min(m.end-f+ce,f+t+ce-m.start)));for(let f of[n,o,s])if(a(f)<=0)return{x:f,clear:!0};let c=[],u=e.start+Math.min(vc,i),d=e.end-Math.min(vc,i)-t;for(let f of[...r].sort((m,_)=>m.start-_.start))c.push({start:u,end:Math.min(d,f.start-ce-t)}),u=Math.max(u,f.end+ce);c.push({start:u,end:d});let l;for(let f of c.filter(m=>m.start<=m.end)){let m=Math.min(Math.max(o,f.start),f.end);(l===void 0||Math.abs(m-o)<Math.abs(l-o))&&(l=m)}if(l!==void 0)return{x:l,clear:!0};let p=o;for(let f of[n,s])a(f)<a(p)-.5&&(p=f);return{x:p,clear:!1}}function mv(e,t,r){let n=[];for(let i of e.edges)for(let o=1;o<i.length;o++){let s=gv(i[o-1],i[o],t-ce,r+ce);s&&n.push(s)}for(let i of e.labels)i.top<r+ce&&i.bottom>t-ce&&n.push({start:i.left,end:i.right});for(let i of e.arrowheads)i.top<r-_r&&i.bottom>t+_r&&n.push({start:i.left,end:i.right});return n}function gv(e,t,r,n){if(e.y<r&&t.y<r||e.y>n&&t.y>n)return;let i=a=>e.x+(t.x-e.x)*(a-e.y)/(t.y-e.y),o=e.y<r?i(r):e.y>n?i(n):e.x,s=t.y<r?i(r):t.y>n?i(n):t.x;return{start:Math.min(o,s),end:Math.max(o,s)}}function _v(e){let t=[],r=[],n=[];for(let o of e.querySelectorAll(".edgePaths path")){let s=yr(o,e),a=o.getAttribute("d"),c=s&&a?Ec(a,s):[];t.push(...c);let u=c[0],d=c[c.length-1];u&&d&&n.push(u[0],d[d.length-1]);let l=u&&Sc(e,o,"marker-start",u[0],zc(u[0],u.slice(1))),p=d&&Sc(e,o,"marker-end",d[d.length-1],zc(d[d.length-1],d.slice(0,-1).reverse(),-1));r.push(...[l,p].filter(f=>f!==void 0))}let i=[];for(let o of e.querySelectorAll(".edgeLabel foreignObject, .edgeLabel rect.background")){let s=yr(o,e),a=Pc(o);s&&a&&a.right>a.left&&a.bottom>a.top&&i.push({left:s.x+a.left,top:s.y+a.top,right:s.x+a.right,bottom:s.y+a.bottom})}return{edges:t,labels:i,arrowheads:r,endpoints:n}}function zc(e,t,r=1){for(let n of t){let i=Math.hypot(n.x-e.x,n.y-e.y);if(i>.01)return{x:r*(n.x-e.x)/i,y:r*(n.y-e.y)/i}}}function Sc(e,t,r,n,i){let o=t.getAttribute(r)?.match(/^url\(#(?<id>[\w-]+)\)$/)?.groups?.id,s=o?e.querySelector(`marker[id="${o}"]`):null,a=s&&yv(s);if(!s||!a||!i)return;let c=Dn(s),u=re(s,"markerWidth")??3,d=re(s,"markerHeight")??3,l=c&&c.width>0&&c.height>0?Math.min(u/c.width,d/c.height):1,p=re(s,"refX")??0,f=re(s,"refY")??0,m=s.getAttribute("orient")??"0",_=m==="auto"?Math.atan2(i.y,i.x):m==="auto-start-reverse"?Math.atan2(i.y,i.x)+(r==="marker-start"?Math.PI:0):(parseFloat(m)||0)*Math.PI/180,b=[],S=[];for(let $ of[a.left,a.right])for(let y of[a.top,a.bottom]){let w=($-p)*l,T=(y-f)*l;b.push(n.x+w*Math.cos(_)-T*Math.sin(_)),S.push(n.y+w*Math.sin(_)+T*Math.cos(_))}return{left:Math.min(...b),top:Math.min(...S),right:Math.max(...b),bottom:Math.max(...S)}}function yv(e){let t=[];for(let n of e.querySelectorAll("path, polygon, polyline, circle"))if(n.localName==="path")t.push(...Ec(n.getAttribute("d")??"",{x:0,y:0}).flat());else if(n.localName==="circle"){let i=re(n,"cx")??0,o=re(n,"cy")??0,s=re(n,"r")??0;t.push({x:i-s,y:o-s},{x:i+s,y:o+s})}else{let i=(n.getAttribute("points")??"").trim().split(/[\s,]+/).map(parseFloat);for(let o=0;o+1<i.length;o+=2)t.push({x:i[o],y:i[o+1]})}let r=t.filter(n=>Number.isFinite(n.x)&&Number.isFinite(n.y));if(r.length)return{left:Math.min(...r.map(n=>n.x)),top:Math.min(...r.map(n=>n.y)),right:Math.max(...r.map(n=>n.x)),bottom:Math.max(...r.map(n=>n.y))}}function Ec(e,t){let r=e.match(/[a-z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi)??[],n=[],i=[],o={x:0,y:0},s=o,a="",c=0,u=m=>m!==void 0&&!/^[a-z]$/i.test(m),d=m=>{let _=parseFloat(r[c++]),b=parseFloat(r[c++]);return{x:m.x+_,y:m.y+b}},l=m=>{i.push({x:t.x+m.x,y:t.y+m.y}),o=m},p=(m,_,b)=>{let S=o;for(let $=1;$<=xc;$++){let y=$/xc,w=1-y;l({x:w*w*w*S.x+3*w*w*y*m.x+3*w*y*y*_.x+y*y*y*b.x,y:w*w*w*S.y+3*w*w*y*m.y+3*w*y*y*_.y+y*y*y*b.y})}},f=(m,_)=>{let b=o;p({x:b.x+2/3*(m.x-b.x),y:b.y+2/3*(m.y-b.y)},{x:_.x+2/3*(m.x-_.x),y:_.y+2/3*(m.y-_.y)},_)};for(;c<r.length;){u(r[c])||(a=r[c++]);let m=a===a.toLowerCase()?o:{x:0,y:0};switch(a.toUpperCase()){case"M":i.length>1&&n.push(i),i=[],l(d(m)),s=o,a=a==="M"?"L":"l";break;case"L":l(d(m));break;case"H":l({x:m.x+parseFloat(r[c++]),y:o.y});break;case"V":l({x:o.x,y:m.y+parseFloat(r[c++])});break;case"C":p(d(m),d(m),d(m));break;case"S":p(o,d(m),d(m));break;case"Q":f(d(m),d(m));break;case"T":l(d(m));break;case"A":c+=5,l(d(m));break;case"Z":l(s),a="";break;default:c=r.length;break}}return i.length>1&&n.push(i),n.filter(m=>m.every(_=>Number.isFinite(_.x)&&Number.isFinite(_.y)))}function vv(e,t,r){let n=e.querySelector("foreignObject");if(n){let s=re(n,"width"),a=re(n,"height");return s&&a&&s>0&&a>0?{width:s,height:a}:void 0}let i=2*((t.left+t.right)/2-r.x),o=Math.max(1,e.querySelectorAll(".text-outer-tspan").length);return i>0?{width:i,height:o*av}:void 0}function Pc(e){let t=re(e,"x")??0,r=re(e,"y")??0,n=re(e,"width"),i=re(e,"height");if(!(n===void 0||i===void 0))return{left:t,top:r,right:t+n,bottom:r+i}}function re(e,t){let r=parseFloat(e.getAttribute(t)??"");return Number.isFinite(r)?r:void 0}function yr(e,t){let r=0,n=0;for(let i=e;i&&i!==t;i=i.parentElement){let o=i.getAttribute("transform");if(o){let s=Ac(o);if(!s)return;r+=s.x,n+=s.y}}return{x:r,y:n}}function Ac(e){let t=e?.match(/^\s*translate\(\s*(?<x>[-+.\de]+)(?:\s*,?\s*(?<y>[-+.\de]+))?\s*\)\s*$/i);if(!t?.groups)return;let r=parseFloat(t.groups.x),n=parseFloat(t.groups.y??"0");return Number.isFinite(r)&&Number.isFinite(n)?{x:r,y:n}:void 0}var br="vscode";function Mc(){return document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast")&&!document.body.classList.contains("vscode-high-contrast-light")}function bv(e){let t=document.createElement("span");t.style.display="none",t.style.color=e,document.body.appendChild(t);try{return wv(getComputedStyle(t).color)}finally{t.remove()}}function wv(e){let t=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)$/);if(!t)return;let r=parseInt(t[1],10),n=parseInt(t[2],10),i=parseInt(t[3],10),o=t[4]!==void 0?Math.round(parseFloat(t[4])*255):255,s=a=>Math.max(0,Math.min(255,a)).toString(16).padStart(2,"0");return o<255?`#${s(r)}${s(n)}${s(i)}${s(o)}`:`#${s(r)}${s(n)}${s(i)}`}function xv(...e){for(let t of e){if(!Ln(t))continue;let r=bv(`var(${t})`);if(r)return r}}function Ln(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}var vr=class{_value;_listeners=new Set;get value(){return this._value??=Tc()}refresh(){let t=Tc();if(t.fingerprint===this._value?.fingerprint)return!1;this._value=t;for(let r of this._listeners)r();return!0}invalidate(){this._value=void 0}onDidChange(t){return this._listeners.add(t),{dispose:()=>this._listeners.delete(t)}}resolveMermaidTheme(t){let r=Mc()?t.darkModeTheme:t.lightModeTheme;return r===br?{theme:"base",themeVariables:this.value.variables}:{theme:r,themeVariables:{}}}observeDomChanges(){let t=new MutationObserver(()=>this.refresh());return t.observe(document.body,{attributes:!0,attributeFilter:["class","data-vscode-theme-id","data-vscode-theme-kind"]}),t.observe(document.documentElement,{attributes:!0,attributeFilter:["style"]}),{dispose:()=>t.disconnect()}}};function Tc(){let e={darkMode:Mc()},t=(o,...s)=>{let a=xv(...s);a&&(e[o]=a)};t("background","--vscode-editor-background"),t("textColor","--vscode-charts-foreground","--vscode-editor-foreground","--vscode-foreground"),t("lineColor","--vscode-chart-line","--vscode-charts-lines","--vscode-editor-foreground","--vscode-foreground"),t("primaryColor","--vscode-editorWidget-background"),t("primaryTextColor","--vscode-charts-foreground","--vscode-editor-foreground","--vscode-foreground"),t("primaryBorderColor","--vscode-chart-line","--vscode-editorWidget-border","--vscode-focusBorder"),t("mainBkg","--vscode-editorWidget-background"),t("nodeBorder","--vscode-chart-line","--vscode-editorWidget-border","--vscode-focusBorder"),t("secondaryColor","--vscode-input-background","--vscode-editorWidget-background"),t("secondaryTextColor","--vscode-input-foreground","--vscode-foreground"),t("secondaryBorderColor","--vscode-input-border","--vscode-editorWidget-border"),t("tertiaryColor","--vscode-textBlockQuote-background","--vscode-input-background"),t("tertiaryTextColor","--vscode-foreground"),t("tertiaryBorderColor","--vscode-textBlockQuote-border","--vscode-editorWidget-border"),t("clusterBkg","--vscode-editor-background"),t("clusterBorder","--vscode-chart-guide","--vscode-editorWidget-border"),t("noteBkgColor","--vscode-textBlockQuote-background","--vscode-editorWidget-background"),t("noteTextColor","--vscode-foreground"),t("noteBorderColor","--vscode-textBlockQuote-border","--vscode-editorWidget-border"),t("errorBkgColor","--vscode-inputValidation-errorBackground","--vscode-editorError-background"),t("errorTextColor","--vscode-editorError-foreground","--vscode-foreground"),t("titleColor","--vscode-charts-foreground","--vscode-editor-foreground","--vscode-foreground"),t("edgeLabelBackground","--vscode-editor-background");let r=["--vscode-charts-blue","--vscode-charts-green","--vscode-charts-orange","--vscode-charts-red","--vscode-charts-purple","--vscode-charts-yellow"];for(let o=0;o<r.length;o++)t(`pie${o+1}`,r[o]),t(`cScale${o}`,r[o]);let n=Ln("--vscode-font-family");n&&(e.fontFamily=n);let i=Ln("--vscode-font-size");return i&&(e.fontSize=i),{variables:e,fingerprint:JSON.stringify(e)}}function wr(e){let t=document.createElement("pre");return t.className="mermaid-error",t.innerText=kv(e),t}function kv(e){if(e instanceof Error)return e.message;if(e&&typeof e=="object"){let t=e;if(typeof t.message=="string"&&t.message)return t.message;if(typeof t.str=="string"&&t.str)return t.str}return String(e)}function zv(e){let t;try{t=JSON.parse(e.dataset.vscodeContext||"{}")}catch{t={}}e.dataset.vscodeContext=JSON.stringify({...t,mermaidError:!0})}function Sv(e,t,r,n){let i=(e.textContent??"").trim();if(!i)return;let o=Nc(i),s=$v(i,t),a=`d${s}`;return e.id=s,e.dataset.vscodeContext=JSON.stringify({webviewSection:"mermaid",mermaidSource:i,preventDefaultContextMenuItems:!0}),e.innerHTML="",{containerId:s,contentHash:o,p:(async()=>{try{if(await Se.parse(i),n.aborted)throw new DOMException("Aborted","AbortError");let c=await Se.render(a,i);if(n.aborted)throw new DOMException("Aborted","AbortError");r(e,c.svg,!1),c.bindFunctions?.(e)}catch(c){throw c instanceof Error&&c.name!=="AbortError"&&(zv(e),r(e,wr(c).outerHTML,!0)),c}})()}}async function Cc(e,t,r){let n=new Set;for(let o of e.querySelectorAll(".mermaid > svg"))o.remove();for(let o of e.querySelectorAll("svg"))o.parentElement?.id.startsWith("dmermaid")&&o.parentElement.remove();let i=[];for(let o of e.querySelectorAll(".mermaid")){let s=Sv(o,n,(a,c,u)=>{t(a,c,s.contentHash,u)},r);s&&i.push(s.p)}await Promise.all(i)}async function Oc(){Se.registerIconPacks(yc),Se.registerLayoutLoaders(hc),Se.registerLayoutLoaders(mc),await Se.registerExternalDiagrams([_c])}var jn={darkModeTheme:br,lightModeTheme:br,maxTextSize:5e4,clickDrag:"alt",showControls:"onHoverOrFocus",resizable:!0,maxHeight:""};function Zc(){let t=document.getElementById("markdown-mermaid")?.dataset.config;if(!t)return jn;try{return{...jn,...JSON.parse(t)}}catch{return jn}}function Rc(e,t){return{startOnLoad:!1,flowchart:{subGraphTitleMargin:{...$c}},...t.resolveMermaidTheme(e)}}function Nc(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return(t>>>0).toString(16).padStart(8,"0")}function $v(e,t){let r=Nc(e),n=`mermaid-${r}`,i=0;for(;t.has(n);)i++,n=`mermaid-${r}-${i}`;return t.add(n),n}var nt=document.querySelector("main"),Dc=Zc(),Lc=new vr;function jc(){let e=getComputedStyle(document.documentElement).colorScheme.split(/\s+/)[0]==="dark";document.body.classList.toggle("vscode-dark",e),document.body.classList.toggle("vscode-light",!e)}async function Iv(){jc(),await Oc();let e=await Fs.connect({connection:"windowParent"}),t,r=()=>{let c=nt.firstElementChild;if(!c)return;let u=c.querySelector("svg"),d=u?.viewBox.baseVal,l=Math.ceil(Math.round(100*(u&&d&&d.width>0?Math.min(parseFloat(u.style.maxWidth)||d.width,document.documentElement.clientWidth)*d.height/d.width:c.getBoundingClientRect().height))/100);l>0&&l!==t&&(t=l,e.reportSize(l))},n=new ResizeObserver(r);n.observe(document.documentElement);let i,o=async()=>{i?.abort();let c=i=new AbortController,u=e.getContent();Se.initialize({...Rc(Dc,Lc),maxTextSize:Dc.maxTextSize});let d=document.createElement("div");d.className="mermaid",d.textContent=typeof u=="string"?u:"";let l=document.createElement("div");l.append(d),nt.setAttribute("aria-busy","true");try{await Cc(l,(p,f,m,_)=>{p.innerHTML=f,_||Ic(p)},c.signal)}catch(p){if(c.signal.aborted)return;d.hasChildNodes()||d.replaceChildren(wr(p))}c.signal.aborted||(d.querySelector("svg")?.removeAttribute("height"),d.querySelector(".mermaid-error")?.setAttribute("role","alert"),nt.replaceChildren(d),nt.setAttribute("aria-busy","false"),r())},s=e.onDidChangeContent(()=>{o()}),a=new MutationObserver(()=>{jc(),Lc.refresh()&&o()});a.observe(document.head,{subtree:!0,childList:!0,characterData:!0}),o(),window.addEventListener("pagehide",()=>{i?.abort(),s.dispose(),a.disconnect(),n.disconnect(),e.dispose()},{once:!0})}Iv().catch(e=>{console.error("Mermaid code block editor failed",e);let t=wr(e);t.setAttribute("role","alert"),nt.replaceChildren(t),nt.setAttribute("aria-busy","false")});
/*! Bundled license information:

mermaid/dist/mermaid.core.mjs:
  (*! Check if previously processed *)
  (*!
   * Wait for document loaded before starting the execution
   *)
*/