ris-mcp-ts 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  // GENERATED by pnpm gen:ui — do not edit
2
- export const TREFFERLISTE_HTML = "<!doctype html>\n<html lang=\"de\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>RIS Trefferliste</title>\n <script type=\"module\" crossorigin>const Aa=(function(){const t=typeof document<\"u\"&&document.createElement(\"link\").relList;return t&&t.supports&&t.supports(\"modulepreload\")?\"modulepreload\":\"preload\"})(),ja=function(e){return\"/\"+e},go={},Ma=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(g=>({status:\"fulfilled\",value:g}),g=>({status:\"rejected\",reason:g}))))};document.getElementsByTagName(\"link\");const i=document.querySelector(\"meta[property=csp-nonce]\"),a=i?.nonce||i?.getAttribute(\"nonce\");r=c(n.map(u=>{if(u=ja(u),u in go)return;go[u]=!0;const f=u.endsWith(\".css\"),g=f?'[rel=\"stylesheet\"]':\"\";if(document.querySelector(`link[href=\"${u}\"]${g}`))return;const _=document.createElement(\"link\");if(_.rel=f?\"stylesheet\":Aa,f||(_.as=\"script\"),_.crossOrigin=\"\",_.href=u,a&&_.setAttribute(\"nonce\",a),document.head.appendChild(_),f)return new Promise((b,I)=>{_.addEventListener(\"load\",b),_.addEventListener(\"error\",()=>I(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event(\"vite:preloadError\",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return r.then(i=>{for(const a of i||[])a.status===\"rejected\"&&s(a.reason);return t().catch(s)})},vm=Object.freeze({status:\"aborted\"});function l(e,t,n){function o(a,c){if(a._zod||Object.defineProperty(a,\"_zod\",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,f=Object.keys(u);for(let g=0;g<f.length;g++){const _=f[g];_ in a||(a[_]=u[_].bind(a))}}const r=n?.Parent??Object;class s extends r{}Object.defineProperty(s,\"name\",{value:e});function i(a){var c;const u=n?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(i,\"init\",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,\"name\",{value:e}),i}const ym=Symbol(\"zod_brand\");class ke extends Error{constructor(){super(\"Encountered Promise during synchronous parse. Use .parseAsync() instead.\")}}class tn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name=\"ZodEncodeError\"}}const Vt={};function G(e){return e&&Object.assign(Vt,e),Vt}function qa(e){return e}function La(e){return e}function Da(e){}function Ha(e){throw new Error(\"Unexpected value in exhaustive check\")}function Ua(e){}function nn(e){const t=Object.values(e).filter(o=>typeof o==\"number\");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function Fa(e,t=\"|\"){return e.map(n=>Wo(n)).join(t)}function ct(e,t){return typeof t==\"bigint\"?t.toString():t}function De(e){return{get value(){{const t=e();return Object.defineProperty(this,\"value\",{value:t}),t}}}}function ye(e){return e==null}function St(e){const t=e.startsWith(\"^\")?1:0,n=e.endsWith(\"$\")?e.length-1:e.length;return e.slice(t,n)}function Jo(e,t){const n=(e.toString().split(\".\")[1]||\"\").length,o=t.toString();let r=(o.split(\".\")[1]||\"\").length;if(r===0&&/\\d?e-\\d?/.test(o)){const c=o.match(/\\d?e-(\\d?)/);c?.[1]&&(r=Number.parseInt(c[1]))}const s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(\".\",\"\")),a=Number.parseInt(t.toFixed(s).replace(\".\",\"\"));return i%a/10**s}const _o=Symbol(\"evaluating\");function S(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==_o)return o===void 0&&(o=_o,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ja(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function se(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Ba(e){return se(e._zod.def)}function Va(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function Ka(e){const t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{const r={};for(let s=0;s<t.length;s++)r[t[s]]=o[s];return r})}function Wa(e=10){const t=\"abcdefghijklmnopqrstuvwxyz\";let n=\"\";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function Kt(e){return JSON.stringify(e)}function Bo(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,\"\").replace(/[\\s_-]+/g,\"-\").replace(/^-+|-+$/g,\"\")}const on=\"captureStackTrace\"in Error?Error.captureStackTrace:(...e)=>{};function ze(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}const Vo=De(()=>{if(typeof navigator<\"u\"&&navigator?.userAgent?.includes(\"Cloudflare\"))return!1;try{const e=Function;return new e(\"\"),!0}catch{return!1}});function be(e){if(ze(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!=\"function\")return!0;const n=t.prototype;return!(ze(n)===!1||Object.prototype.hasOwnProperty.call(n,\"isPrototypeOf\")===!1)}function zt(e){return be(e)?{...e}:Array.isArray(e)?[...e]:e}function Ga(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const Qa=e=>{const t=typeof e;switch(t){case\"undefined\":return\"undefined\";case\"string\":return\"string\";case\"number\":return Number.isNaN(e)?\"nan\":\"number\";case\"boolean\":return\"boolean\";case\"function\":return\"function\";case\"bigint\":return\"bigint\";case\"symbol\":return\"symbol\";case\"object\":return Array.isArray(e)?\"array\":e===null?\"null\":e.then&&typeof e.then==\"function\"&&e.catch&&typeof e.catch==\"function\"?\"promise\":typeof Map<\"u\"&&e instanceof Map?\"map\":typeof Set<\"u\"&&e instanceof Set?\"set\":typeof Date<\"u\"&&e instanceof Date?\"date\":typeof File<\"u\"&&e instanceof File?\"file\":\"object\";default:throw new Error(`Unknown data type: ${t}`)}},ut=new Set([\"string\",\"number\",\"symbol\"]),Ko=new Set([\"string\",\"number\",\"bigint\",\"boolean\",\"symbol\",\"undefined\"]);function ue(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function ie(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function m(e){const 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 Ya(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,s){return t??(t=e()),Reflect.set(t,o,r,s)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function Wo(e){return typeof e==\"bigint\"?e.toString()+\"n\":typeof e==\"string\"?`\"${e}\"`:`${e}`}function Go(e){return Object.keys(e).filter(t=>e[t]._zod.optin===\"optional\"&&e[t]._zod.optout===\"optional\")}const Qo={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]},Yo={int64:[BigInt(\"-9223372036854775808\"),BigInt(\"9223372036854775807\")],uint64:[BigInt(0),BigInt(\"18446744073709551615\")]};function Xo(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(\".pick() cannot be used on object schemas containing refinements\");const s=se(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: \"${a}\"`);t[a]&&(i[a]=n.shape[a])}return he(this,\"shape\",i),i},checks:[]});return ie(e,s)}function er(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(\".omit() cannot be used on object schemas containing refinements\");const s=se(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: \"${a}\"`);t[a]&&delete i[a]}return he(this,\"shape\",i),i},checks:[]});return ie(e,s)}function tr(e,t){if(!be(t))throw new Error(\"Invalid input to extend: expected a plain object\");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\")}const r=se(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return he(this,\"shape\",s),s}});return ie(e,r)}function nr(e,t){if(!be(t))throw new Error(\"Invalid input to safeExtend: expected a plain object\");const n=se(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return he(this,\"shape\",o),o}});return ie(e,n)}function or(e,t){const n=se(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return he(this,\"shape\",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ie(e,n)}function rr(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(\".partial() cannot be used on object schemas containing refinements\");const i=se(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: \"${u}\"`);n[u]&&(c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u];return he(this,\"shape\",c),c},checks:[]});return ie(t,i)}function sr(e,t,n){const o=se(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: \"${i}\"`);n[i]&&(s[i]=new e({type:\"nonoptional\",innerType:r[i]}))}else for(const i in r)s[i]=new e({type:\"nonoptional\",innerType:r[i]});return he(this,\"shape\",s),s}});return ie(t,o)}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function oe(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Re(e){return typeof e==\"string\"?e:e?.message}function Q(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const r=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(n.customError?.(e))??Re(n.localeError?.(e))??\"Invalid input\";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function $t(e){return e instanceof Set?\"set\":e instanceof Map?\"map\":e instanceof File?\"file\":\"unknown\"}function Tt(e){return Array.isArray(e)?\"array\":typeof e==\"string\"?\"string\":\"unknown\"}function Xa(e){const t=typeof e;switch(t){case\"number\":return Number.isNaN(e)?\"nan\":\"number\";case\"object\":{if(e===null)return\"null\";if(Array.isArray(e))return\"array\";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&\"constructor\"in n&&n.constructor)return n.constructor.name}}return t}function $e(...e){const[t,n,o]=e;return typeof t==\"string\"?{message:t,code:\"custom\",input:n,inst:o}:{...t}}function ec(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function ir(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function ar(e){let t=\"\";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function tc(e){const t=e.replace(/-/g,\"+\").replace(/_/g,\"/\"),n=\"=\".repeat((4-t.length%4)%4);return ir(t+n)}function nc(e){return ar(e).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=/g,\"\")}function oc(e){const t=e.replace(/^0x/,\"\");if(t.length%2!==0)throw new Error(\"Invalid hex string length\");const n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function rc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,\"0\")).join(\"\")}class sc{constructor(...t){}}const wm=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:Yo,Class:sc,NUMBER_FORMAT_RANGES:Qo,aborted:_e,allowsEval:Vo,assert:Ua,assertEqual:qa,assertIs:Da,assertNever:Ha,assertNotEqual:La,assignProp:he,base64ToUint8Array:ir,base64urlToUint8Array:tc,cached:De,captureStackTrace:on,cleanEnum:ec,cleanRegex:St,clone:ie,cloneDef:Ba,createTransparentProxy:Ya,defineLazy:S,esc:Kt,escapeRegex:ue,extend:tr,finalizeIssue:Q,floatSafeRemainder:Jo,getElementAtPath:Va,getEnumValues:nn,getLengthableOrigin:Tt,getParsedType:Qa,getSizableOrigin:$t,hexToUint8Array:oc,isObject:ze,isPlainObject:be,issue:$e,joinValues:Fa,jsonStringifyReplacer:ct,merge:or,mergeDefs:se,normalizeParams:m,nullish:ye,numKeys:Ga,objectClone:Ja,omit:er,optionalKeys:Go,parsedType:Xa,partial:rr,pick:Xo,prefixIssues:oe,primitiveTypes:Ko,promiseAllObject:Ka,propertyKeyTypes:ut,randomString:Wa,required:sr,safeExtend:nr,shallowClone:zt,slugify:Bo,stringifyPrimitive:Wo,uint8ArrayToBase64:ar,uint8ArrayToBase64url:nc,uint8ArrayToHex:rc,unwrapMessage:Re},Symbol.toStringTag,{value:\"Module\"})),cr=(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,ct,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},ur=l(\"$ZodError\",cr),Y=l(\"$ZodError\",cr,{Parent:Error});function ic(e,t=n=>n.message){const n={},o=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function ac(e,t=n=>n.message){const n={_errors:[]},o=r=>{for(const s of r.issues)if(s.code===\"invalid_union\"&&s.errors.length)s.errors.map(i=>o({issues:i}));else if(s.code===\"invalid_key\")o({issues:s.issues});else if(s.code===\"invalid_element\")o({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return o(e),n}function km(e,t=n=>n.message){const n={errors:[]},o=(r,s=[])=>{var i,a;for(const c of r.issues)if(c.code===\"invalid_union\"&&c.errors.length)c.errors.map(u=>o({issues:u},c.path));else if(c.code===\"invalid_key\")o({issues:c.issues},c.path);else if(c.code===\"invalid_element\")o({issues:c.issues},c.path);else{const u=[...s,...c.path];if(u.length===0){n.errors.push(t(c));continue}let f=n,g=0;for(;g<u.length;){const _=u[g],b=g===u.length-1;typeof _==\"string\"?(f.properties??(f.properties={}),(i=f.properties)[_]??(i[_]={errors:[]}),f=f.properties[_]):(f.items??(f.items=[]),(a=f.items)[_]??(a[_]={errors:[]}),f=f.items[_]),b&&f.errors.push(t(c)),g++}}};return o(e),n}function cc(e){const t=[],n=e.map(o=>typeof o==\"object\"?o.key:o);for(const o of n)typeof o==\"number\"?t.push(`[${o}]`):typeof o==\"symbol\"?t.push(`[${JSON.stringify(String(o))}]`):/[^\\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push(\".\"),t.push(o));return t.join(\"\")}function Sm(e){const t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(const o of n)t.push(`✖ ${o.message}`),o.path?.length&&t.push(` → at ${cc(o.path)}`);return t.join(`\n`)}const Et=e=>(t,n,o,r)=>{const s=o?Object.assign(o,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new ke;if(i.issues.length){const a=new(r?.Err??e)(i.issues.map(c=>Q(c,s,G())));throw on(a,r?.callee),a}return i.value},bo=Et(Y),Pt=e=>async(t,n,o,r)=>{const s=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(r?.Err??e)(i.issues.map(c=>Q(c,s,G())));throw on(a,r?.callee),a}return i.value},vo=Pt(Y),Zt=e=>(t,n,o)=>{const r=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new ke;return s.issues.length?{success:!1,error:new(e??ur)(s.issues.map(i=>Q(i,r,G())))}:{success:!0,data:s.value}},lr=Zt(Y),It=e=>async(t,n,o)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Q(i,r,G())))}:{success:!0,data:s.value}},uc=It(Y),dr=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return Et(e)(t,n,r)},zm=dr(Y),pr=e=>(t,n,o)=>Et(e)(t,n,o),$m=pr(Y),fr=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return Pt(e)(t,n,r)},Tm=fr(Y),hr=e=>async(t,n,o)=>Pt(e)(t,n,o),Em=hr(Y),mr=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return Zt(e)(t,n,r)},Pm=mr(Y),gr=e=>(t,n,o)=>Zt(e)(t,n,o),Zm=gr(Y),_r=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return It(e)(t,n,r)},Im=_r(Y),br=e=>async(t,n,o)=>It(e)(t,n,o),xm=br(Y),vr=/^[cC][^\\s-]{8,}$/,yr=/^[0-9a-z]+$/,wr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kr=/^[0-9a-vA-V]{20}$/,Sr=/^[A-Za-z0-9]{27}$/,zr=/^[a-zA-Z0-9_-]{21}$/,$r=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,lc=/^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/,Tr=/^([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})$/,Te=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)$/,dc=Te(4),pc=Te(6),fc=Te(7),Er=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,hc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,mc=/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,Pr=/^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u,gc=Pr,_c=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,bc=\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\";function Zr(){return new RegExp(bc,\"u\")}const Ir=/^(?:(?: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])$/,xr=/^(([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}|:))$/,Rr=e=>{const t=ue(e??\":\");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Cr=/^((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])$/,Nr=/^(([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])$/,Or=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rn=/^[A-Za-z0-9_-]*$/,Ar=/^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/,jr=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/,Mr=/^\\+[1-9]\\d{6,14}$/,qr=\"(?:(?:\\\\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])))\",Lr=new RegExp(`^${qr}$`);function Dr(e){const 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 Hr(e){return new RegExp(`^${Dr(e)}$`)}function Ur(e){const t=Dr({precision:e.precision}),n=[\"Z\"];e.local&&n.push(\"\"),e.offset&&n.push(\"([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)\");const o=`${t}(?:${n.join(\"|\")})`;return new RegExp(`^${qr}T(?:${o})$`)}const Fr=e=>{const t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??\"\"}}`:\"[\\\\s\\\\S]*\";return new RegExp(`^${t}$`)},Jr=/^-?\\d+n?$/,Br=/^-?\\d+$/,sn=/^-?\\d+(?:\\.\\d+)?$/,Vr=/^(?:true|false)$/i,Kr=/^null$/i,Wr=/^undefined$/i,Gr=/^[^A-Z]*$/,Qr=/^[^a-z]*$/,Yr=/^[0-9a-fA-F]*$/;function He(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ue(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const vc=/^[0-9a-fA-F]{32}$/,yc=He(22,\"==\"),wc=Ue(22),kc=/^[0-9a-fA-F]{40}$/,Sc=He(27,\"=\"),zc=Ue(27),$c=/^[0-9a-fA-F]{64}$/,Tc=He(43,\"=\"),Ec=Ue(43),Pc=/^[0-9a-fA-F]{96}$/,Zc=He(64,\"\"),Ic=Ue(64),xc=/^[0-9a-fA-F]{128}$/,Rc=He(86,\"==\"),Cc=Ue(86),Nc=Object.freeze(Object.defineProperty({__proto__:null,base64:Or,base64url:rn,bigint:Jr,boolean:Vr,browserEmail:_c,cidrv4:Cr,cidrv6:Nr,cuid:vr,cuid2:yr,date:Lr,datetime:Ur,domain:jr,duration:$r,e164:Mr,email:Er,emoji:Zr,extendedDuration:lc,guid:Tr,hex:Yr,hostname:Ar,html5Email:hc,idnEmail:gc,integer:Br,ipv4:Ir,ipv6:xr,ksuid:Sr,lowercase:Gr,mac:Rr,md5_base64:yc,md5_base64url:wc,md5_hex:vc,nanoid:zr,null:Kr,number:sn,rfc5322Email:mc,sha1_base64:Sc,sha1_base64url:zc,sha1_hex:kc,sha256_base64:Tc,sha256_base64url:Ec,sha256_hex:$c,sha384_base64:Zc,sha384_base64url:Ic,sha384_hex:Pc,sha512_base64:Rc,sha512_base64url:Cc,sha512_hex:xc,string:Fr,time:Hr,ulid:wr,undefined:Wr,unicodeEmail:Pr,uppercase:Qr,uuid:Te,uuid4:dc,uuid6:pc,uuid7:fc,xid:kr},Symbol.toStringTag,{value:\"Module\"})),A=l(\"$ZodCheck\",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Xr={number:\"number\",bigint:\"bigint\",object:\"date\"},es=l(\"$ZodCheckLessThan\",(e,t)=>{A.init(e,t);const n=Xr[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:\"too_big\",maximum:typeof t.value==\"object\"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ts=l(\"$ZodCheckGreaterThan\",(e,t)=>{A.init(e,t);const n=Xr[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:\"too_small\",minimum:typeof t.value==\"object\"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Oc=l(\"$ZodCheckMultipleOf\",(e,t)=>{A.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error(\"Cannot mix number and bigint in multiple_of check.\");(typeof n.value==\"bigint\"?n.value%t.value===BigInt(0):Jo(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:\"not_multiple_of\",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ac=l(\"$ZodCheckNumberFormat\",(e,t)=>{A.init(e,t),t.format=t.format||\"float64\";const n=t.format?.includes(\"int\"),o=n?\"int\":\"number\",[r,s]=Qo[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=r,a.maximum=s,n&&(a.pattern=Br)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:\"invalid_type\",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:\"too_big\",maximum:Number.MAX_SAFE_INTEGER,note:\"Integers must be within the safe integer range.\",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:\"too_small\",minimum:Number.MIN_SAFE_INTEGER,note:\"Integers must be within the safe integer range.\",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<r&&i.issues.push({origin:\"number\",input:a,code:\"too_small\",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:\"number\",input:a,code:\"too_big\",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),jc=l(\"$ZodCheckBigIntFormat\",(e,t)=>{A.init(e,t);const[n,o]=Yo[t.format];e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,s.minimum=n,s.maximum=o}),e._zod.check=r=>{const s=r.value;s<n&&r.issues.push({origin:\"bigint\",input:s,code:\"too_small\",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&r.issues.push({origin:\"bigint\",input:s,code:\"too_big\",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Mc=l(\"$ZodCheckMaxSize\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const r=o.value;r.size<=t.maximum||o.issues.push({origin:$t(r),code:\"too_big\",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qc=l(\"$ZodCheckMinSize\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const r=o.value;r.size>=t.minimum||o.issues.push({origin:$t(r),code:\"too_small\",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Lc=l(\"$ZodCheckSizeEquals\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{const r=o.value,s=r.size;if(s===t.size)return;const i=s>t.size;o.issues.push({origin:$t(r),...i?{code:\"too_big\",maximum:t.size}:{code:\"too_small\",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Dc=l(\"$ZodCheckMaxLength\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const r=o.value;if(r.length<=t.maximum)return;const i=Tt(r);o.issues.push({origin:i,code:\"too_big\",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Hc=l(\"$ZodCheckMinLength\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const r=o.value;if(r.length>=t.minimum)return;const i=Tt(r);o.issues.push({origin:i,code:\"too_small\",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Uc=l(\"$ZodCheckLengthEquals\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{const r=o.value,s=r.length;if(s===t.length)return;const i=Tt(r),a=s>t.length;o.issues.push({origin:i,...a?{code:\"too_big\",maximum:t.length}:{code:\"too_small\",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),xt=l(\"$ZodCheckStringFormat\",(e,t)=>{var n,o;A.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:\"string\",code:\"invalid_format\",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Fc=l(\"$ZodCheckRegex\",(e,t)=>{xt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:\"string\",code:\"invalid_format\",format:\"regex\",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jc=l(\"$ZodCheckLowerCase\",(e,t)=>{t.pattern??(t.pattern=Gr),xt.init(e,t)}),Bc=l(\"$ZodCheckUpperCase\",(e,t)=>{t.pattern??(t.pattern=Qr),xt.init(e,t)}),Vc=l(\"$ZodCheckIncludes\",(e,t)=>{A.init(e,t);const n=ue(t.includes),o=new RegExp(typeof t.position==\"number\"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:\"string\",code:\"invalid_format\",format:\"includes\",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Kc=l(\"$ZodCheckStartsWith\",(e,t)=>{A.init(e,t);const n=new RegExp(`^${ue(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"starts_with\",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Wc=l(\"$ZodCheckEndsWith\",(e,t)=>{A.init(e,t);const n=new RegExp(`.*${ue(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"ends_with\",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function yo(e,t,n){e.issues.length&&t.issues.push(...oe(n,e.issues))}const Gc=l(\"$ZodCheckProperty\",(e,t)=>{A.init(e,t),e._zod.check=n=>{const o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>yo(r,n,t.property));yo(o,n,t.property)}}),Qc=l(\"$ZodCheckMimeType\",(e,t)=>{A.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:\"invalid_value\",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Yc=l(\"$ZodCheckOverwrite\",(e,t)=>{A.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Xc{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t==\"function\"){t(this,{execution:\"sync\"}),t(this,{execution:\"async\"});return}const o=t.split(`\n`).filter(i=>i),r=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(r)).map(i=>\" \".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,r=[...(this?.content??[\"\"]).map(s=>` ${s}`)];return new t(...n,r.join(`\n`))}}const eu={major:4,minor:3,patch:6},y=l(\"$ZodType\",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eu;const o=[...e._zod.def.checks??[]];e._zod.traits.has(\"$ZodCheck\")&&o.unshift(e);for(const r of o)for(const s of r._zod.onattach)s(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(i,a,c)=>{let u=_e(i),f;for(const g of a){if(g._zod.def.when){if(!g._zod.def.when(i))continue}else if(u)continue;const _=i.issues.length,b=g._zod.check(i);if(b instanceof Promise&&c?.async===!1)throw new ke;if(f||b instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await b,i.issues.length!==_&&(u||(u=_e(i,_)))});else{if(i.issues.length===_)continue;u||(u=_e(i,_))}}return f?f.then(()=>i):i},s=(i,a,c)=>{if(_e(i))return i.aborted=!0,i;const u=r(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new ke;return u.then(f=>e._zod.parse(f,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===\"backward\"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(f=>s(f,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new ke;return c.then(u=>r(u,o,a))}return r(c,o,a)}}S(e,\"~standard\",()=>({validate:r=>{try{const s=lr(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return uc(e,r).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:\"zod\",version:1}))}),Rt=l(\"$ZodString\",(e,t)=>{y.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Fr(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==\"string\"||n.issues.push({expected:\"string\",code:\"invalid_type\",input:n.value,inst:e}),n}}),R=l(\"$ZodStringFormat\",(e,t)=>{xt.init(e,t),Rt.init(e,t)}),tu=l(\"$ZodGUID\",(e,t)=>{t.pattern??(t.pattern=Tr),R.init(e,t)}),nu=l(\"$ZodUUID\",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??(t.pattern=Te(o))}else t.pattern??(t.pattern=Te());R.init(e,t)}),ou=l(\"$ZodEmail\",(e,t)=>{t.pattern??(t.pattern=Er),R.init(e,t)}),ru=l(\"$ZodURL\",(e,t)=>{R.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:\"invalid_format\",format:\"url\",note:\"Invalid hostname\",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(\":\")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:\"invalid_format\",format:\"url\",note:\"Invalid protocol\",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:\"invalid_format\",format:\"url\",input:n.value,inst:e,continue:!t.abort})}}}),su=l(\"$ZodEmoji\",(e,t)=>{t.pattern??(t.pattern=Zr()),R.init(e,t)}),iu=l(\"$ZodNanoID\",(e,t)=>{t.pattern??(t.pattern=zr),R.init(e,t)}),au=l(\"$ZodCUID\",(e,t)=>{t.pattern??(t.pattern=vr),R.init(e,t)}),cu=l(\"$ZodCUID2\",(e,t)=>{t.pattern??(t.pattern=yr),R.init(e,t)}),uu=l(\"$ZodULID\",(e,t)=>{t.pattern??(t.pattern=wr),R.init(e,t)}),lu=l(\"$ZodXID\",(e,t)=>{t.pattern??(t.pattern=kr),R.init(e,t)}),du=l(\"$ZodKSUID\",(e,t)=>{t.pattern??(t.pattern=Sr),R.init(e,t)}),pu=l(\"$ZodISODateTime\",(e,t)=>{t.pattern??(t.pattern=Ur(t)),R.init(e,t)}),fu=l(\"$ZodISODate\",(e,t)=>{t.pattern??(t.pattern=Lr),R.init(e,t)}),hu=l(\"$ZodISOTime\",(e,t)=>{t.pattern??(t.pattern=Hr(t)),R.init(e,t)}),mu=l(\"$ZodISODuration\",(e,t)=>{t.pattern??(t.pattern=$r),R.init(e,t)}),gu=l(\"$ZodIPv4\",(e,t)=>{t.pattern??(t.pattern=Ir),R.init(e,t),e._zod.bag.format=\"ipv4\"}),_u=l(\"$ZodIPv6\",(e,t)=>{t.pattern??(t.pattern=xr),R.init(e,t),e._zod.bag.format=\"ipv6\",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:\"invalid_format\",format:\"ipv6\",input:n.value,inst:e,continue:!t.abort})}}}),bu=l(\"$ZodMAC\",(e,t)=>{t.pattern??(t.pattern=Rr(t.delimiter)),R.init(e,t),e._zod.bag.format=\"mac\"}),vu=l(\"$ZodCIDRv4\",(e,t)=>{t.pattern??(t.pattern=Cr),R.init(e,t)}),yu=l(\"$ZodCIDRv6\",(e,t)=>{t.pattern??(t.pattern=Nr),R.init(e,t),e._zod.check=n=>{const o=n.value.split(\"/\");try{if(o.length!==2)throw new Error;const[r,s]=o;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:\"invalid_format\",format:\"cidrv6\",input:n.value,inst:e,continue:!t.abort})}}});function ns(e){if(e===\"\")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wu=l(\"$ZodBase64\",(e,t)=>{t.pattern??(t.pattern=Or),R.init(e,t),e._zod.bag.contentEncoding=\"base64\",e._zod.check=n=>{ns(n.value)||n.issues.push({code:\"invalid_format\",format:\"base64\",input:n.value,inst:e,continue:!t.abort})}});function ku(e){if(!rn.test(e))return!1;const t=e.replace(/[-_]/g,o=>o===\"-\"?\"+\":\"/\"),n=t.padEnd(Math.ceil(t.length/4)*4,\"=\");return ns(n)}const Su=l(\"$ZodBase64URL\",(e,t)=>{t.pattern??(t.pattern=rn),R.init(e,t),e._zod.bag.contentEncoding=\"base64url\",e._zod.check=n=>{ku(n.value)||n.issues.push({code:\"invalid_format\",format:\"base64url\",input:n.value,inst:e,continue:!t.abort})}}),zu=l(\"$ZodE164\",(e,t)=>{t.pattern??(t.pattern=Mr),R.init(e,t)});function $u(e,t=null){try{const n=e.split(\".\");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const r=JSON.parse(atob(o));return!(\"typ\"in r&&r?.typ!==\"JWT\"||!r.alg||t&&(!(\"alg\"in r)||r.alg!==t))}catch{return!1}}const Tu=l(\"$ZodJWT\",(e,t)=>{R.init(e,t),e._zod.check=n=>{$u(n.value,t.alg)||n.issues.push({code:\"invalid_format\",format:\"jwt\",input:n.value,inst:e,continue:!t.abort})}}),Eu=l(\"$ZodCustomStringFormat\",(e,t)=>{R.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:\"invalid_format\",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),os=l(\"$ZodNumber\",(e,t)=>{y.init(e,t),e._zod.pattern=e._zod.bag.pattern??sn,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const r=n.value;if(typeof r==\"number\"&&!Number.isNaN(r)&&Number.isFinite(r))return n;const s=typeof r==\"number\"?Number.isNaN(r)?\"NaN\":Number.isFinite(r)?void 0:\"Infinity\":void 0;return n.issues.push({expected:\"number\",code:\"invalid_type\",input:r,inst:e,...s?{received:s}:{}}),n}}),Pu=l(\"$ZodNumberFormat\",(e,t)=>{Ac.init(e,t),os.init(e,t)}),rs=l(\"$ZodBoolean\",(e,t)=>{y.init(e,t),e._zod.pattern=Vr,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const r=n.value;return typeof r==\"boolean\"||n.issues.push({expected:\"boolean\",code:\"invalid_type\",input:r,inst:e}),n}}),ss=l(\"$ZodBigInt\",(e,t)=>{y.init(e,t),e._zod.pattern=Jr,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==\"bigint\"||n.issues.push({expected:\"bigint\",code:\"invalid_type\",input:n.value,inst:e}),n}}),Zu=l(\"$ZodBigIntFormat\",(e,t)=>{jc.init(e,t),ss.init(e,t)}),Iu=l(\"$ZodSymbol\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return typeof r==\"symbol\"||n.issues.push({expected:\"symbol\",code:\"invalid_type\",input:r,inst:e}),n}}),xu=l(\"$ZodUndefined\",(e,t)=>{y.init(e,t),e._zod.pattern=Wr,e._zod.values=new Set([void 0]),e._zod.optin=\"optional\",e._zod.optout=\"optional\",e._zod.parse=(n,o)=>{const r=n.value;return typeof r>\"u\"||n.issues.push({expected:\"undefined\",code:\"invalid_type\",input:r,inst:e}),n}}),Ru=l(\"$ZodNull\",(e,t)=>{y.init(e,t),e._zod.pattern=Kr,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{const r=n.value;return r===null||n.issues.push({expected:\"null\",code:\"invalid_type\",input:r,inst:e}),n}}),Cu=l(\"$ZodAny\",(e,t)=>{y.init(e,t),e._zod.parse=n=>n}),Nu=l(\"$ZodUnknown\",(e,t)=>{y.init(e,t),e._zod.parse=n=>n}),Ou=l(\"$ZodNever\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:\"never\",code:\"invalid_type\",input:n.value,inst:e}),n)}),Au=l(\"$ZodVoid\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return typeof r>\"u\"||n.issues.push({expected:\"void\",code:\"invalid_type\",input:r,inst:e}),n}}),ju=l(\"$ZodDate\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const r=n.value,s=r instanceof Date;return s&&!Number.isNaN(r.getTime())||n.issues.push({expected:\"date\",code:\"invalid_type\",input:r,...s?{received:\"Invalid Date\"}:{},inst:e}),n}});function wo(e,t,n){e.issues.length&&t.issues.push(...oe(n,e.issues)),t.value[n]=e.value}const Mu=l(\"$ZodArray\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:\"array\",code:\"invalid_type\",input:r,inst:e}),n;n.value=Array(r.length);const s=[];for(let i=0;i<r.length;i++){const a=r[i],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>wo(u,n,i))):wo(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function lt(e,t,n,o,r){if(e.issues.length){if(r&&!(n in o))return;t.issues.push(...oe(n,e.issues))}e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function is(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has(\"$ZodType\"))throw new Error(`Invalid element at key \"${o}\": expected a Zod schema`);const n=Go(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function as(e,t,n,o,r,s){const i=[],a=r.keySet,c=r.catchall._zod,u=c.def.type,f=c.optout===\"optional\";for(const g in t){if(a.has(g))continue;if(u===\"never\"){i.push(g);continue}const _=c.run({value:t[g],issues:[]},o);_ instanceof Promise?e.push(_.then(b=>lt(b,n,g,t,f))):lt(_,n,g,t,f)}return i.length&&n.issues.push({code:\"unrecognized_keys\",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const qu=l(\"$ZodObject\",(e,t)=>{if(y.init(e,t),!Object.getOwnPropertyDescriptor(t,\"shape\")?.get){const a=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{const c={...a};return Object.defineProperty(t,\"shape\",{value:c}),c}})}const o=De(()=>is(t));S(e._zod,\"propValues\",()=>{const a=t.shape,c={};for(const u in a){const f=a[u]._zod;if(f.values){c[u]??(c[u]=new Set);for(const g of f.values)c[u].add(g)}}return c});const r=ze,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=o.value);const u=a.value;if(!r(u))return a.issues.push({expected:\"object\",code:\"invalid_type\",input:u,inst:e}),a;a.value={};const f=[],g=i.shape;for(const _ of i.keys){const b=g[_],I=b._zod.optout===\"optional\",N=b._zod.run({value:u[_],issues:[]},c);N instanceof Promise?f.push(N.then(we=>lt(we,a,_,u,I))):lt(N,a,_,u,I)}return s?as(f,u,a,c,o.value,e):f.length?Promise.all(f).then(()=>a):a}}),Lu=l(\"$ZodObjectJIT\",(e,t)=>{qu.init(e,t);const n=e._zod.parse,o=De(()=>is(t)),r=_=>{const b=new Xc([\"shape\",\"payload\",\"ctx\"]),I=o.value,N=j=>{const M=Kt(j);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};b.write(\"const input = payload.value;\");const we=Object.create(null);let Xe=0;for(const j of I.keys)we[j]=`key_${Xe++}`;b.write(\"const newResult = {};\");for(const j of I.keys){const M=we[j],ne=Kt(j),Oa=_[j]?._zod?.optout===\"optional\";b.write(`const ${M} = ${N(j)};`),Oa?b.write(`\n if (${M}.issues.length) {\n if (${ne} in input) {\n payload.issues = payload.issues.concat(${M}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${ne}, ...iss.path] : [${ne}]\n })));\n }\n }\n \n if (${M}.value === undefined) {\n if (${ne} in input) {\n newResult[${ne}] = undefined;\n }\n } else {\n newResult[${ne}] = ${M}.value;\n }\n \n `):b.write(`\n if (${M}.issues.length) {\n payload.issues = payload.issues.concat(${M}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${ne}, ...iss.path] : [${ne}]\n })));\n }\n \n if (${M}.value === undefined) {\n if (${ne} in input) {\n newResult[${ne}] = undefined;\n }\n } else {\n newResult[${ne}] = ${M}.value;\n }\n \n `)}b.write(\"payload.value = newResult;\"),b.write(\"return payload;\");const L=b.compile();return(j,M)=>L(_,j,M)};let s;const i=ze,a=!Vt.jitless,u=a&&Vo.value,f=t.catchall;let g;e._zod.parse=(_,b)=>{g??(g=o.value);const I=_.value;return i(I)?a&&u&&b?.async===!1&&b.jitless!==!0?(s||(s=r(t.shape)),_=s(_,b),f?as([],I,_,b,g,e):_):n(_,b):(_.issues.push({expected:\"object\",code:\"invalid_type\",input:I,inst:e}),_)}});function ko(e,t,n,o){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!_e(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:\"invalid_union\",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Q(i,o,G())))}),t)}const an=l(\"$ZodUnion\",(e,t)=>{y.init(e,t),S(e._zod,\"optin\",()=>t.options.some(r=>r._zod.optin===\"optional\")?\"optional\":void 0),S(e._zod,\"optout\",()=>t.options.some(r=>r._zod.optout===\"optional\")?\"optional\":void 0),S(e._zod,\"values\",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),S(e._zod,\"pattern\",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>St(s.source)).join(\"|\")})$`)}});const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(n)return o(r,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>ko(c,r,e,s)):ko(a,r,e,s)}});function So(e,t,n,o){const r=e.filter(s=>s.issues.length===0);return r.length===1?(t.value=r[0].value,t):(r.length===0?t.issues.push({code:\"invalid_union\",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Q(i,o,G())))}):t.issues.push({code:\"invalid_union\",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const Du=l(\"$ZodXor\",(e,t)=>{an.init(e,t),t.inclusive=!1;const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(n)return o(r,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:r.value,issues:[]},s);u instanceof Promise?(a.push(u),i=!0):a.push(u)}return i?Promise.all(a).then(c=>So(c,r,e,s)):So(a,r,e,s)}}),Hu=l(\"$ZodDiscriminatedUnion\",(e,t)=>{t.inclusive=!1,an.init(e,t);const n=e._zod.parse;S(e._zod,\"propValues\",()=>{const r={};for(const s of t.options){const i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index \"${t.options.indexOf(s)}\"`);for(const[a,c]of Object.entries(i)){r[a]||(r[a]=new Set);for(const u of c)r[a].add(u)}}return r});const o=De(()=>{const r=t.options,s=new Map;for(const i of r){const a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index \"${t.options.indexOf(i)}\"`);for(const c of a){if(s.has(c))throw new Error(`Duplicate discriminator value \"${String(c)}\"`);s.set(c,i)}}return s});e._zod.parse=(r,s)=>{const i=r.value;if(!ze(i))return r.issues.push({code:\"invalid_type\",expected:\"object\",input:i,inst:e}),r;const a=o.value.get(i?.[t.discriminator]);return a?a._zod.run(r,s):t.unionFallback?n(r,s):(r.issues.push({code:\"invalid_union\",errors:[],note:\"No matching discriminator\",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),r)}}),Uu=l(\"$ZodIntersection\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value,s=t.left._zod.run({value:r,issues:[]},o),i=t.right._zod.run({value:r,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>zo(n,c,u)):zo(n,s,i)}});function Wt(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(be(e)&&be(t)){const n=Object.keys(t),o=Object.keys(e).filter(s=>n.indexOf(s)!==-1),r={...e,...t};for(const s of o){const i=Wt(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};r[s]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const r=e[o],s=t[o],i=Wt(r,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function zo(e,t,n){const o=new Map;let r;for(const a of t.issues)if(a.code===\"unrecognized_keys\"){r??(r=a);for(const c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code===\"unrecognized_keys\")for(const c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(a);const s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&r&&e.issues.push({...r,keys:s}),_e(e))return e;const i=Wt(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const cs=l(\"$ZodTuple\",(e,t)=>{y.init(e,t);const n=t.items;e._zod.parse=(o,r)=>{const s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:\"tuple\",code:\"invalid_type\"}),o;o.value=[];const i=[],a=[...n].reverse().findIndex(f=>f._zod.optin!==\"optional\"),c=a===-1?0:n.length-a;if(!t.rest){const f=s.length>n.length,g=s.length<c-1;if(f||g)return o.issues.push({...f?{code:\"too_big\",maximum:n.length,inclusive:!0}:{code:\"too_small\",minimum:n.length},input:s,inst:e,origin:\"array\"}),o}let u=-1;for(const f of n){if(u++,u>=s.length&&u>=c)continue;const g=f._zod.run({value:s[u],issues:[]},r);g instanceof Promise?i.push(g.then(_=>et(_,o,u))):et(g,o,u)}if(t.rest){const f=s.slice(n.length);for(const g of f){u++;const _=t.rest._zod.run({value:g,issues:[]},r);_ instanceof Promise?i.push(_.then(b=>et(b,o,u))):et(_,o,u)}}return i.length?Promise.all(i).then(()=>o):o}});function et(e,t,n){e.issues.length&&t.issues.push(...oe(n,e.issues)),t.value[n]=e.value}const Fu=l(\"$ZodRecord\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!be(r))return n.issues.push({expected:\"record\",code:\"invalid_type\",input:r,inst:e}),n;const s=[],i=t.keyType._zod.values;if(i){n.value={};const a=new Set;for(const u of i)if(typeof u==\"string\"||typeof u==\"number\"||typeof u==\"symbol\"){a.add(typeof u==\"number\"?u.toString():u);const f=t.valueType._zod.run({value:r[u],issues:[]},o);f instanceof Promise?s.push(f.then(g=>{g.issues.length&&n.issues.push(...oe(u,g.issues)),n.value[u]=g.value})):(f.issues.length&&n.issues.push(...oe(u,f.issues)),n.value[u]=f.value)}let c;for(const u in r)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:\"unrecognized_keys\",input:r,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(r)){if(a===\"__proto__\")continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error(\"Async schemas not supported in object keys currently\");if(typeof a==\"string\"&&sn.test(a)&&c.issues.length){const g=t.keyType._zod.run({value:Number(a),issues:[]},o);if(g instanceof Promise)throw new Error(\"Async schemas not supported in object keys currently\");g.issues.length===0&&(c=g)}if(c.issues.length){t.mode===\"loose\"?n.value[a]=r[a]:n.issues.push({code:\"invalid_key\",origin:\"record\",issues:c.issues.map(g=>Q(g,o,G())),input:a,path:[a],inst:e});continue}const f=t.valueType._zod.run({value:r[a],issues:[]},o);f instanceof Promise?s.push(f.then(g=>{g.issues.length&&n.issues.push(...oe(a,g.issues)),n.value[c.value]=g.value})):(f.issues.length&&n.issues.push(...oe(a,f.issues)),n.value[c.value]=f.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Ju=l(\"$ZodMap\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!(r instanceof Map))return n.issues.push({expected:\"map\",code:\"invalid_type\",input:r,inst:e}),n;const s=[];n.value=new Map;for(const[i,a]of r){const c=t.keyType._zod.run({value:i,issues:[]},o),u=t.valueType._zod.run({value:a,issues:[]},o);c instanceof Promise||u instanceof Promise?s.push(Promise.all([c,u]).then(([f,g])=>{$o(f,g,n,i,r,e,o)})):$o(c,u,n,i,r,e,o)}return s.length?Promise.all(s).then(()=>n):n}});function $o(e,t,n,o,r,s,i){e.issues.length&&(ut.has(typeof o)?n.issues.push(...oe(o,e.issues)):n.issues.push({code:\"invalid_key\",origin:\"map\",input:r,inst:s,issues:e.issues.map(a=>Q(a,i,G()))})),t.issues.length&&(ut.has(typeof o)?n.issues.push(...oe(o,t.issues)):n.issues.push({origin:\"map\",code:\"invalid_element\",input:r,inst:s,key:o,issues:t.issues.map(a=>Q(a,i,G()))})),n.value.set(e.value,t.value)}const Bu=l(\"$ZodSet\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:\"set\",code:\"invalid_type\"}),n;const s=[];n.value=new Set;for(const i of r){const a=t.valueType._zod.run({value:i,issues:[]},o);a instanceof Promise?s.push(a.then(c=>To(c,n))):To(a,n)}return s.length?Promise.all(s).then(()=>n):n}});function To(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Vu=l(\"$ZodEnum\",(e,t)=>{y.init(e,t);const n=nn(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>ut.has(typeof r)).map(r=>typeof r==\"string\"?ue(r):r.toString()).join(\"|\")})$`),e._zod.parse=(r,s)=>{const i=r.value;return o.has(i)||r.issues.push({code:\"invalid_value\",values:n,input:i,inst:e}),r}}),Ku=l(\"$ZodLiteral\",(e,t)=>{if(y.init(e,t),t.values.length===0)throw new Error(\"Cannot create literal schema with no valid values\");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o==\"string\"?ue(o):o?ue(o.toString()):String(o)).join(\"|\")})$`),e._zod.parse=(o,r)=>{const s=o.value;return n.has(s)||o.issues.push({code:\"invalid_value\",values:t.values,input:s,inst:e}),o}}),Wu=l(\"$ZodFile\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return r instanceof File||n.issues.push({expected:\"file\",code:\"invalid_type\",input:r,inst:e}),n}}),Gu=l(\"$ZodTransform\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")throw new tn(e.constructor.name);const r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(n.value=i,n));if(r instanceof Promise)throw new ke;return n.value=r,n}});function Eo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const us=l(\"$ZodOptional\",(e,t)=>{y.init(e,t),e._zod.optin=\"optional\",e._zod.optout=\"optional\",S(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),S(e._zod,\"pattern\",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${St(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin===\"optional\"){const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>Eo(s,n.value)):Eo(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Qu=l(\"$ZodExactOptional\",(e,t)=>{us.init(e,t),S(e._zod,\"values\",()=>t.innerType._zod.values),S(e._zod,\"pattern\",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),Yu=l(\"$ZodNullable\",(e,t)=>{y.init(e,t),S(e._zod,\"optin\",()=>t.innerType._zod.optin),S(e._zod,\"optout\",()=>t.innerType._zod.optout),S(e._zod,\"pattern\",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${St(n.source)}|null)$`):void 0}),S(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Xu=l(\"$ZodDefault\",(e,t)=>{y.init(e,t),e._zod.optin=\"optional\",S(e._zod,\"values\",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>Po(s,t)):Po(r,t)}});function Po(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const el=l(\"$ZodPrefault\",(e,t)=>{y.init(e,t),e._zod.optin=\"optional\",S(e._zod,\"values\",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction===\"backward\"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),tl=l(\"$ZodNonOptional\",(e,t)=>{y.init(e,t),S(e._zod,\"values\",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>Zo(s,e)):Zo(r,e)}});function Zo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:e.value,inst:t}),e}const nl=l(\"$ZodSuccess\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")throw new tn(\"ZodSuccess\");const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>(n.value=s.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),ol=l(\"$ZodCatch\",(e,t)=>{y.init(e,t),S(e._zod,\"optin\",()=>t.innerType._zod.optin),S(e._zod,\"optout\",()=>t.innerType._zod.optout),S(e._zod,\"values\",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(n,o);const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Q(i,o,G()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(s=>Q(s,o,G()))},input:n.value}),n.issues=[]),n)}}),rl=l(\"$ZodNaN\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!=\"number\"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:\"nan\",code:\"invalid_type\"}),n)}),sl=l(\"$ZodPipe\",(e,t)=>{y.init(e,t),S(e._zod,\"values\",()=>t.in._zod.values),S(e._zod,\"optin\",()=>t.in._zod.optin),S(e._zod,\"optout\",()=>t.out._zod.optout),S(e._zod,\"propValues\",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction===\"backward\"){const s=t.out._zod.run(n,o);return s instanceof Promise?s.then(i=>tt(i,t.in,o)):tt(s,t.in,o)}const r=t.in._zod.run(n,o);return r instanceof Promise?r.then(s=>tt(s,t.out,o)):tt(r,t.out,o)}});function tt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ls=l(\"$ZodCodec\",(e,t)=>{y.init(e,t),S(e._zod,\"values\",()=>t.in._zod.values),S(e._zod,\"optin\",()=>t.in._zod.optin),S(e._zod,\"optout\",()=>t.out._zod.optout),S(e._zod,\"propValues\",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||\"forward\")===\"forward\"){const s=t.in._zod.run(n,o);return s instanceof Promise?s.then(i=>nt(i,t,o)):nt(s,t,o)}else{const s=t.out._zod.run(n,o);return s instanceof Promise?s.then(i=>nt(i,t,o)):nt(s,t,o)}}});function nt(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||\"forward\")===\"forward\"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(s=>ot(e,s,t.out,n)):ot(e,r,t.out,n)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(s=>ot(e,s,t.in,n)):ot(e,r,t.in,n)}}function ot(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}const il=l(\"$ZodReadonly\",(e,t)=>{y.init(e,t),S(e._zod,\"propValues\",()=>t.innerType._zod.propValues),S(e._zod,\"values\",()=>t.innerType._zod.values),S(e._zod,\"optin\",()=>t.innerType?._zod?.optin),S(e._zod,\"optout\",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(n,o);const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(Io):Io(r)}});function Io(e){return e.value=Object.freeze(e.value),e}const al=l(\"$ZodTemplateLiteral\",(e,t)=>{y.init(e,t);const n=[];for(const o of t.parts)if(typeof o==\"object\"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);const r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);const s=r.startsWith(\"^\")?1:0,i=r.endsWith(\"$\")?r.length-1:r.length;n.push(r.slice(s,i))}else if(o===null||Ko.has(typeof o))n.push(ue(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join(\"\")}$`),e._zod.parse=(o,r)=>typeof o.value!=\"string\"?(o.issues.push({input:o.value,inst:e,expected:\"string\",code:\"invalid_type\"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:\"invalid_format\",format:t.format??\"template_literal\",pattern:e._zod.pattern.source}),o)}),cl=l(\"$ZodFunction\",(e,t)=>(y.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!=\"function\")throw new Error(\"implement() must be called with a function\");return function(...o){const r=e._def.input?bo(e._def.input,o):o,s=Reflect.apply(n,this,r);return e._def.output?bo(e._def.output,s):s}},e.implementAsync=n=>{if(typeof n!=\"function\")throw new Error(\"implementAsync() must be called with a function\");return async function(...o){const r=e._def.input?await vo(e._def.input,o):o,s=await Reflect.apply(n,this,r);return e._def.output?await vo(e._def.output,s):s}},e._zod.parse=(n,o)=>typeof n.value!=\"function\"?(n.issues.push({code:\"invalid_type\",expected:\"function\",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type===\"promise\"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{const o=e.constructor;return Array.isArray(n[0])?new o({type:\"function\",input:new cs({type:\"tuple\",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:\"function\",input:n[0],output:e._def.output})},e.output=n=>{const o=e.constructor;return new o({type:\"function\",input:e._def.input,output:n})},e)),ul=l(\"$ZodPromise\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),ll=l(\"$ZodLazy\",(e,t)=>{y.init(e,t),S(e._zod,\"innerType\",()=>t.getter()),S(e._zod,\"pattern\",()=>e._zod.innerType?._zod?.pattern),S(e._zod,\"propValues\",()=>e._zod.innerType?._zod?.propValues),S(e._zod,\"optin\",()=>e._zod.innerType?._zod?.optin??void 0),S(e._zod,\"optout\",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),dl=l(\"$ZodCustom\",(e,t)=>{A.init(e,t),y.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(s=>xo(s,n,o,e));xo(r,n,o,e)}});function xo(e,t,n,o){if(!e){const r={code:\"custom\",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push($e(r))}}var Ro;const Rm=Symbol(\"ZodOutput\"),Cm=Symbol(\"ZodInput\");class pl{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];return this._map.set(t,o),o&&typeof o==\"object\"&&\"id\"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n==\"object\"&&\"id\"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fl(){return new pl}(Ro=globalThis).__zod_globalRegistry??(Ro.__zod_globalRegistry=fl());const ae=globalThis.__zod_globalRegistry;function hl(e,t){return new e({type:\"string\",...m(t)})}function Nm(e,t){return new e({type:\"string\",coerce:!0,...m(t)})}function ds(e,t){return new e({type:\"string\",format:\"email\",check:\"string_format\",abort:!1,...m(t)})}function Gt(e,t){return new e({type:\"string\",format:\"guid\",check:\"string_format\",abort:!1,...m(t)})}function ps(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,...m(t)})}function fs(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v4\",...m(t)})}function hs(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v6\",...m(t)})}function ms(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v7\",...m(t)})}function cn(e,t){return new e({type:\"string\",format:\"url\",check:\"string_format\",abort:!1,...m(t)})}function gs(e,t){return new e({type:\"string\",format:\"emoji\",check:\"string_format\",abort:!1,...m(t)})}function _s(e,t){return new e({type:\"string\",format:\"nanoid\",check:\"string_format\",abort:!1,...m(t)})}function bs(e,t){return new e({type:\"string\",format:\"cuid\",check:\"string_format\",abort:!1,...m(t)})}function vs(e,t){return new e({type:\"string\",format:\"cuid2\",check:\"string_format\",abort:!1,...m(t)})}function ys(e,t){return new e({type:\"string\",format:\"ulid\",check:\"string_format\",abort:!1,...m(t)})}function ws(e,t){return new e({type:\"string\",format:\"xid\",check:\"string_format\",abort:!1,...m(t)})}function ks(e,t){return new e({type:\"string\",format:\"ksuid\",check:\"string_format\",abort:!1,...m(t)})}function Ss(e,t){return new e({type:\"string\",format:\"ipv4\",check:\"string_format\",abort:!1,...m(t)})}function zs(e,t){return new e({type:\"string\",format:\"ipv6\",check:\"string_format\",abort:!1,...m(t)})}function ml(e,t){return new e({type:\"string\",format:\"mac\",check:\"string_format\",abort:!1,...m(t)})}function $s(e,t){return new e({type:\"string\",format:\"cidrv4\",check:\"string_format\",abort:!1,...m(t)})}function Ts(e,t){return new e({type:\"string\",format:\"cidrv6\",check:\"string_format\",abort:!1,...m(t)})}function Es(e,t){return new e({type:\"string\",format:\"base64\",check:\"string_format\",abort:!1,...m(t)})}function Ps(e,t){return new e({type:\"string\",format:\"base64url\",check:\"string_format\",abort:!1,...m(t)})}function Zs(e,t){return new e({type:\"string\",format:\"e164\",check:\"string_format\",abort:!1,...m(t)})}function Is(e,t){return new e({type:\"string\",format:\"jwt\",check:\"string_format\",abort:!1,...m(t)})}const Om={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function gl(e,t){return new e({type:\"string\",format:\"datetime\",check:\"string_format\",offset:!1,local:!1,precision:null,...m(t)})}function _l(e,t){return new e({type:\"string\",format:\"date\",check:\"string_format\",...m(t)})}function bl(e,t){return new e({type:\"string\",format:\"time\",check:\"string_format\",precision:null,...m(t)})}function vl(e,t){return new e({type:\"string\",format:\"duration\",check:\"string_format\",...m(t)})}function yl(e,t){return new e({type:\"number\",checks:[],...m(t)})}function Am(e,t){return new e({type:\"number\",coerce:!0,checks:[],...m(t)})}function wl(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"safeint\",...m(t)})}function kl(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"float32\",...m(t)})}function Sl(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"float64\",...m(t)})}function zl(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"int32\",...m(t)})}function $l(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"uint32\",...m(t)})}function Tl(e,t){return new e({type:\"boolean\",...m(t)})}function jm(e,t){return new e({type:\"boolean\",coerce:!0,...m(t)})}function El(e,t){return new e({type:\"bigint\",...m(t)})}function Mm(e,t){return new e({type:\"bigint\",coerce:!0,...m(t)})}function Pl(e,t){return new e({type:\"bigint\",check:\"bigint_format\",abort:!1,format:\"int64\",...m(t)})}function Zl(e,t){return new e({type:\"bigint\",check:\"bigint_format\",abort:!1,format:\"uint64\",...m(t)})}function Il(e,t){return new e({type:\"symbol\",...m(t)})}function xl(e,t){return new e({type:\"undefined\",...m(t)})}function Rl(e,t){return new e({type:\"null\",...m(t)})}function Cl(e){return new e({type:\"any\"})}function Nl(e){return new e({type:\"unknown\"})}function Ol(e,t){return new e({type:\"never\",...m(t)})}function Al(e,t){return new e({type:\"void\",...m(t)})}function jl(e,t){return new e({type:\"date\",...m(t)})}function qm(e,t){return new e({type:\"date\",coerce:!0,...m(t)})}function Ml(e,t){return new e({type:\"nan\",...m(t)})}function Ne(e,t){return new es({check:\"less_than\",...m(t),value:e,inclusive:!1})}function de(e,t){return new es({check:\"less_than\",...m(t),value:e,inclusive:!0})}function Oe(e,t){return new ts({check:\"greater_than\",...m(t),value:e,inclusive:!1})}function re(e,t){return new ts({check:\"greater_than\",...m(t),value:e,inclusive:!0})}function Lm(e){return Oe(0,e)}function Dm(e){return Ne(0,e)}function Hm(e){return de(0,e)}function Um(e){return re(0,e)}function Qt(e,t){return new Oc({check:\"multiple_of\",...m(t),value:e})}function un(e,t){return new Mc({check:\"max_size\",...m(t),maximum:e})}function Ae(e,t){return new qc({check:\"min_size\",...m(t),minimum:e})}function xs(e,t){return new Lc({check:\"size_equals\",...m(t),size:e})}function Rs(e,t){return new Dc({check:\"max_length\",...m(t),maximum:e})}function dt(e,t){return new Hc({check:\"min_length\",...m(t),minimum:e})}function Cs(e,t){return new Uc({check:\"length_equals\",...m(t),length:e})}function ql(e,t){return new Fc({check:\"string_format\",format:\"regex\",...m(t),pattern:e})}function Ll(e){return new Jc({check:\"string_format\",format:\"lowercase\",...m(e)})}function Dl(e){return new Bc({check:\"string_format\",format:\"uppercase\",...m(e)})}function Hl(e,t){return new Vc({check:\"string_format\",format:\"includes\",...m(t),includes:e})}function Ul(e,t){return new Kc({check:\"string_format\",format:\"starts_with\",...m(t),prefix:e})}function Fl(e,t){return new Wc({check:\"string_format\",format:\"ends_with\",...m(t),suffix:e})}function Fm(e,t,n){return new Gc({check:\"property\",property:e,schema:t,...m(n)})}function Jl(e,t){return new Qc({check:\"mime_type\",mime:e,...m(t)})}function Ze(e){return new Yc({check:\"overwrite\",tx:e})}function Bl(e){return Ze(t=>t.normalize(e))}function Vl(){return Ze(e=>e.trim())}function Kl(){return Ze(e=>e.toLowerCase())}function Wl(){return Ze(e=>e.toUpperCase())}function Gl(){return Ze(e=>Bo(e))}function Ql(e,t,n){return new e({type:\"array\",element:t,...m(n)})}function Jm(e,t,n){return new e({type:\"union\",options:t,...m(n)})}function Bm(e,t,n){return new e({type:\"union\",options:t,inclusive:!1,...m(n)})}function Vm(e,t,n,o){return new e({type:\"union\",options:n,discriminator:t,...m(o)})}function Km(e,t,n){return new e({type:\"intersection\",left:t,right:n})}function Wm(e,t,n,o){const r=n instanceof y,s=r?o:n,i=r?n:null;return new e({type:\"tuple\",items:t,rest:i,...m(s)})}function Gm(e,t,n,o){return new e({type:\"record\",keyType:t,valueType:n,...m(o)})}function Qm(e,t,n,o){return new e({type:\"map\",keyType:t,valueType:n,...m(o)})}function Ym(e,t,n){return new e({type:\"set\",valueType:t,...m(n)})}function Xm(e,t,n){const o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:\"enum\",entries:o,...m(n)})}function eg(e,t,n){return new e({type:\"enum\",entries:t,...m(n)})}function tg(e,t,n){return new e({type:\"literal\",values:Array.isArray(t)?t:[t],...m(n)})}function Yl(e,t){return new e({type:\"file\",...m(t)})}function ng(e,t){return new e({type:\"transform\",transform:t})}function og(e,t){return new e({type:\"optional\",innerType:t})}function rg(e,t){return new e({type:\"nullable\",innerType:t})}function sg(e,t,n){return new e({type:\"default\",innerType:t,get defaultValue(){return typeof n==\"function\"?n():zt(n)}})}function ig(e,t,n){return new e({type:\"nonoptional\",innerType:t,...m(n)})}function ag(e,t){return new e({type:\"success\",innerType:t})}function cg(e,t,n){return new e({type:\"catch\",innerType:t,catchValue:typeof n==\"function\"?n:()=>n})}function ug(e,t,n){return new e({type:\"pipe\",in:t,out:n})}function lg(e,t){return new e({type:\"readonly\",innerType:t})}function dg(e,t,n){return new e({type:\"template_literal\",parts:t,...m(n)})}function pg(e,t){return new e({type:\"lazy\",getter:t})}function fg(e,t){return new e({type:\"promise\",innerType:t})}function Xl(e,t,n){const o=m(n);return o.abort??(o.abort=!0),new e({type:\"custom\",check:\"custom\",fn:t,...o})}function ed(e,t,n){return new e({type:\"custom\",check:\"custom\",fn:t,...m(n)})}function td(e){const t=nd(n=>(n.addIssue=o=>{if(typeof o==\"string\")n.issues.push($e(o,n.value,t._zod.def));else{const r=o;r.fatal&&(r.continue=!1),r.code??(r.code=\"custom\"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push($e(r))}},e(n.value,n)));return t}function nd(e,t){const n=new A({check:\"custom\",...m(t)});return n._zod.check=e,n}function od(e){const t=new A({check:\"describe\"});return t._zod.onattach=[n=>{const o=ae.get(n)??{};ae.add(n,{...o,description:e})}],t._zod.check=()=>{},t}function rd(e){const t=new A({check:\"meta\"});return t._zod.onattach=[n=>{const o=ae.get(n)??{};ae.add(n,{...o,...e})}],t._zod.check=()=>{},t}function sd(e,t){const n=m(t);let o=n.truthy??[\"true\",\"1\",\"yes\",\"on\",\"y\",\"enabled\"],r=n.falsy??[\"false\",\"0\",\"no\",\"off\",\"n\",\"disabled\"];n.case!==\"sensitive\"&&(o=o.map(b=>typeof b==\"string\"?b.toLowerCase():b),r=r.map(b=>typeof b==\"string\"?b.toLowerCase():b));const s=new Set(o),i=new Set(r),a=e.Codec??ls,c=e.Boolean??rs,u=e.String??Rt,f=new u({type:\"string\",error:n.error}),g=new c({type:\"boolean\",error:n.error}),_=new a({type:\"pipe\",in:f,out:g,transform:((b,I)=>{let N=b;return n.case!==\"sensitive\"&&(N=N.toLowerCase()),s.has(N)?!0:i.has(N)?!1:(I.issues.push({code:\"invalid_value\",expected:\"stringbool\",values:[...s,...i],input:I.value,inst:_,continue:!1}),{})}),reverseTransform:((b,I)=>b===!0?o[0]||\"true\":r[0]||\"false\"),error:n.error});return _}function Ct(e,t,n,o={}){const r=m(o),s={...m(o),check:\"string_format\",type:\"string\",format:t,fn:typeof n==\"function\"?n:a=>n.test(a),...r};return n instanceof RegExp&&(s.pattern=n),new e(s)}function pt(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??ae,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 x(e,t,n={path:[],schemaPath:[]}){var o;const r=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const _=i.schema,b=t.processors[r.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);b(e,t,_,f)}const g=e._zod.parent;g&&(i.ref||(i.ref=g),x(g,t,f),t.seen.get(g).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io===\"input\"&&F(e)&&(delete i.schema.examples,delete i.schema.default),t.io===\"input\"&&i.schema._prefault&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function ft(e,t){const n=e.seen.get(t);if(!n)throw new Error(\"Unprocessed schema. This is a bug in Zod.\");const o=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id \"${a}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}const r=i=>{const a=e.target===\"draft-2020-12\"?\"$defs\":\"definitions\";if(e.external){const g=e.external.registry.get(i[0])?.id,_=e.external.uri??(I=>I);if(g)return{ref:_(g)};const b=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=b,{defId:b,ref:`${_(\"__shared\")}#/${a}/${b}`}}if(i[1]===n)return{ref:\"#\"};const u=`#/${a}/`,f=i[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:u+f}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=r(i);a.def={...a.schema},u&&(a.defId=u);const f=a.schema;for(const g in f)delete f[g];f.$ref=c};if(e.cycles===\"throw\")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join(\"/\")}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused===\"ref\"){s(i);continue}}}function ht(e,t){const n=e.seen.get(t);if(!n)throw new Error(\"Unprocessed schema. This is a bug in Zod.\");const o=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},f=a.ref;if(a.ref=null,f){o(f);const _=e.seen.get(f),b=_.schema;if(b.$ref&&(e.target===\"draft-07\"||e.target===\"draft-04\"||e.target===\"openapi-3.0\")?(c.allOf=c.allOf??[],c.allOf.push(b)):Object.assign(c,b),Object.assign(c,u),i._zod.parent===f)for(const N in c)N===\"$ref\"||N===\"allOf\"||N in u||delete c[N];if(b.$ref&&_.def)for(const N in c)N===\"$ref\"||N===\"allOf\"||N in _.def&&JSON.stringify(c[N])===JSON.stringify(_.def[N])&&delete c[N]}const g=i._zod.parent;if(g&&g!==f){o(g);const _=e.seen.get(g);if(_?.schema.$ref&&(c.$ref=_.schema.$ref,_.def))for(const b in c)b===\"$ref\"||b===\"allOf\"||b in _.def&&JSON.stringify(c[b])===JSON.stringify(_.def[b])&&delete c[b]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())o(i[0]);const r={};if(e.target===\"draft-2020-12\"?r.$schema=\"https://json-schema.org/draft/2020-12/schema\":e.target===\"draft-07\"?r.$schema=\"http://json-schema.org/draft-07/schema#\":e.target===\"draft-04\"?r.$schema=\"http://json-schema.org/draft-04/schema#\":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error(\"Schema is missing an `id` property\");r.$id=e.external.uri(i)}Object.assign(r,n.def??n.schema);const s=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(s[a.defId]=a.def)}e.external||Object.keys(s).length>0&&(e.target===\"draft-2020-12\"?r.$defs=s:r.definitions=s);try{const i=JSON.parse(JSON.stringify(r));return Object.defineProperty(i,\"~standard\",{value:{...t[\"~standard\"],jsonSchema:{input:mt(t,\"input\",e.processors),output:mt(t,\"output\",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error(\"Error converting schema to JSON.\")}}function F(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if(o.type===\"transform\")return!0;if(o.type===\"array\")return F(o.element,n);if(o.type===\"set\")return F(o.valueType,n);if(o.type===\"lazy\")return F(o.getter(),n);if(o.type===\"promise\"||o.type===\"optional\"||o.type===\"nonoptional\"||o.type===\"nullable\"||o.type===\"readonly\"||o.type===\"default\"||o.type===\"prefault\")return F(o.innerType,n);if(o.type===\"intersection\")return F(o.left,n)||F(o.right,n);if(o.type===\"record\"||o.type===\"map\")return F(o.keyType,n)||F(o.valueType,n);if(o.type===\"pipe\")return F(o.in,n)||F(o.out,n);if(o.type===\"object\"){for(const r in o.shape)if(F(o.shape[r],n))return!0;return!1}if(o.type===\"union\"){for(const r of o.options)if(F(r,n))return!0;return!1}if(o.type===\"tuple\"){for(const r of o.items)if(F(r,n))return!0;return!!(o.rest&&F(o.rest,n))}return!1}const id=(e,t={})=>n=>{const o=pt({...n,processors:t});return x(e,o),ft(o,e),ht(o,e)},mt=(e,t,n={})=>o=>{const{libraryOptions:r,target:s}=o??{},i=pt({...r??{},target:s,io:t,processors:n});return x(e,i),ft(i,e),ht(i,e)},ad={guid:\"uuid\",url:\"uri\",datetime:\"date-time\",json_string:\"json-string\",regex:\"\"},Ns=(e,t,n,o)=>{const r=n;r.type=\"string\";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s==\"number\"&&(r.minLength=s),typeof i==\"number\"&&(r.maxLength=i),a&&(r.format=ad[a]??a,r.format===\"\"&&delete r.format,a===\"time\"&&delete r.format),u&&(r.contentEncoding=u),c&&c.size>0){const f=[...c];f.length===1?r.pattern=f[0].source:f.length>1&&(r.allOf=[...f.map(g=>({...t.target===\"draft-07\"||t.target===\"draft-04\"||t.target===\"openapi-3.0\"?{type:\"string\"}:{},pattern:g.source}))])}},Os=(e,t,n,o)=>{const r=n,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=e._zod.bag;typeof a==\"string\"&&a.includes(\"int\")?r.type=\"integer\":r.type=\"number\",typeof f==\"number\"&&(t.target===\"draft-04\"||t.target===\"openapi-3.0\"?(r.minimum=f,r.exclusiveMinimum=!0):r.exclusiveMinimum=f),typeof s==\"number\"&&(r.minimum=s,typeof f==\"number\"&&t.target!==\"draft-04\"&&(f>=s?delete r.minimum:delete r.exclusiveMinimum)),typeof u==\"number\"&&(t.target===\"draft-04\"||t.target===\"openapi-3.0\"?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u),typeof i==\"number\"&&(r.maximum=i,typeof u==\"number\"&&t.target!==\"draft-04\"&&(u<=i?delete r.maximum:delete r.exclusiveMaximum)),typeof c==\"number\"&&(r.multipleOf=c)},As=(e,t,n,o)=>{n.type=\"boolean\"},js=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"BigInt cannot be represented in JSON Schema\")},Ms=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Symbols cannot be represented in JSON Schema\")},qs=(e,t,n,o)=>{t.target===\"openapi-3.0\"?(n.type=\"string\",n.nullable=!0,n.enum=[null]):n.type=\"null\"},Ls=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Undefined cannot be represented in JSON Schema\")},Ds=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Void cannot be represented in JSON Schema\")},Hs=(e,t,n,o)=>{n.not={}},Us=(e,t,n,o)=>{},Fs=(e,t,n,o)=>{},Js=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Date cannot be represented in JSON Schema\")},Bs=(e,t,n,o)=>{const r=e._zod.def,s=nn(r.entries);s.every(i=>typeof i==\"number\")&&(n.type=\"number\"),s.every(i=>typeof i==\"string\")&&(n.type=\"string\"),n.enum=s},Vs=(e,t,n,o)=>{const r=e._zod.def,s=[];for(const i of r.values)if(i===void 0){if(t.unrepresentable===\"throw\")throw new Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof i==\"bigint\"){if(t.unrepresentable===\"throw\")throw new Error(\"BigInt literals cannot be represented in JSON Schema\");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){const i=s[0];n.type=i===null?\"null\":typeof i,t.target===\"draft-04\"||t.target===\"openapi-3.0\"?n.enum=[i]:n.const=i}else s.every(i=>typeof i==\"number\")&&(n.type=\"number\"),s.every(i=>typeof i==\"string\")&&(n.type=\"string\"),s.every(i=>typeof i==\"boolean\")&&(n.type=\"boolean\"),s.every(i=>i===null)&&(n.type=\"null\"),n.enum=s},Ks=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"NaN cannot be represented in JSON Schema\")},Ws=(e,t,n,o)=>{const r=n,s=e._zod.pattern;if(!s)throw new Error(\"Pattern not found in template literal\");r.type=\"string\",r.pattern=s.source},Gs=(e,t,n,o)=>{const r=n,s={type:\"string\",format:\"binary\",contentEncoding:\"binary\"},{minimum:i,maximum:a,mime:c}=e._zod.bag;i!==void 0&&(s.minLength=i),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(r,s)},Qs=(e,t,n,o)=>{n.type=\"boolean\"},Ys=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Custom types cannot be represented in JSON Schema\")},Xs=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Function types cannot be represented in JSON Schema\")},ei=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Transforms cannot be represented in JSON Schema\")},ti=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Map cannot be represented in JSON Schema\")},ni=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Set cannot be represented in JSON Schema\")},oi=(e,t,n,o)=>{const r=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i==\"number\"&&(r.minItems=i),typeof a==\"number\"&&(r.maxItems=a),r.type=\"array\",r.items=x(s.element,t,{...o,path:[...o.path,\"items\"]})},ri=(e,t,n,o)=>{const r=n,s=e._zod.def;r.type=\"object\",r.properties={};const i=s.shape;for(const u in i)r.properties[u]=x(i[u],t,{...o,path:[...o.path,\"properties\",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const f=s.shape[u]._zod;return t.io===\"input\"?f.optin===void 0:f.optout===void 0}));c.size>0&&(r.required=Array.from(c)),s.catchall?._zod.def.type===\"never\"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=x(s.catchall,t,{...o,path:[...o.path,\"additionalProperties\"]})):t.io===\"output\"&&(r.additionalProperties=!1)},ln=(e,t,n,o)=>{const r=e._zod.def,s=r.inclusive===!1,i=r.options.map((a,c)=>x(a,t,{...o,path:[...o.path,s?\"oneOf\":\"anyOf\",c]}));s?n.oneOf=i:n.anyOf=i},si=(e,t,n,o)=>{const r=e._zod.def,s=x(r.left,t,{...o,path:[...o.path,\"allOf\",0]}),i=x(r.right,t,{...o,path:[...o.path,\"allOf\",1]}),a=u=>\"allOf\"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},ii=(e,t,n,o)=>{const r=n,s=e._zod.def;r.type=\"array\";const i=t.target===\"draft-2020-12\"?\"prefixItems\":\"items\",a=t.target===\"draft-2020-12\"||t.target===\"openapi-3.0\"?\"items\":\"additionalItems\",c=s.items.map((_,b)=>x(_,t,{...o,path:[...o.path,i,b]})),u=s.rest?x(s.rest,t,{...o,path:[...o.path,a,...t.target===\"openapi-3.0\"?[s.items.length]:[]]}):null;t.target===\"draft-2020-12\"?(r.prefixItems=c,u&&(r.items=u)):t.target===\"openapi-3.0\"?(r.items={anyOf:c},u&&r.items.anyOf.push(u),r.minItems=c.length,u||(r.maxItems=c.length)):(r.items=c,u&&(r.additionalItems=u));const{minimum:f,maximum:g}=e._zod.bag;typeof f==\"number\"&&(r.minItems=f),typeof g==\"number\"&&(r.maxItems=g)},ai=(e,t,n,o)=>{const r=n,s=e._zod.def;r.type=\"object\";const i=s.keyType,c=i._zod.bag?.patterns;if(s.mode===\"loose\"&&c&&c.size>0){const f=x(s.valueType,t,{...o,path:[...o.path,\"patternProperties\",\"*\"]});r.patternProperties={};for(const g of c)r.patternProperties[g.source]=f}else(t.target===\"draft-07\"||t.target===\"draft-2020-12\")&&(r.propertyNames=x(s.keyType,t,{...o,path:[...o.path,\"propertyNames\"]})),r.additionalProperties=x(s.valueType,t,{...o,path:[...o.path,\"additionalProperties\"]});const u=i._zod.values;if(u){const f=[...u].filter(g=>typeof g==\"string\"||typeof g==\"number\");f.length>0&&(r.required=f)}},ci=(e,t,n,o)=>{const r=e._zod.def,s=x(r.innerType,t,o),i=t.seen.get(e);t.target===\"openapi-3.0\"?(i.ref=r.innerType,n.nullable=!0):n.anyOf=[s,{type:\"null\"}]},ui=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},li=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},di=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,t.io===\"input\"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},pi=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType;let i;try{i=r.catchValue(void 0)}catch{throw new Error(\"Dynamic catch values are not supported in JSON Schema\")}n.default=i},fi=(e,t,n,o)=>{const r=e._zod.def,s=t.io===\"input\"?r.in._zod.def.type===\"transform\"?r.out:r.in:r.out;x(s,t,o);const i=t.seen.get(e);i.ref=s},hi=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,n.readOnly=!0},mi=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},dn=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},gi=(e,t,n,o)=>{const r=e._zod.innerType;x(r,t,o);const s=t.seen.get(e);s.ref=r},Co={string:Ns,number:Os,boolean:As,bigint:js,symbol:Ms,null:qs,undefined:Ls,void:Ds,never:Hs,any:Us,unknown:Fs,date:Js,enum:Bs,literal:Vs,nan:Ks,template_literal:Ws,file:Gs,success:Qs,custom:Ys,function:Xs,transform:ei,map:ti,set:ni,array:oi,object:ri,union:ln,intersection:si,tuple:ii,record:ai,nullable:ci,nonoptional:ui,default:li,prefault:di,catch:pi,pipe:fi,readonly:hi,promise:mi,optional:dn,lazy:gi};function hg(e,t){if(\"_idmap\"in e){const o=e,r=pt({...t,processors:Co}),s={};for(const c of o._idmap.entries()){const[u,f]=c;x(f,r)}const i={},a={registry:o,uri:t?.uri,defs:s};r.external=a;for(const c of o._idmap.entries()){const[u,f]=c;ft(r,f),i[u]=ht(r,f)}if(Object.keys(s).length>0){const c=r.target===\"draft-2020-12\"?\"$defs\":\"definitions\";i.__shared={[c]:s}}return{schemas:i}}const n=pt({...t,processors:Co});return x(e,n),ft(n,e),ht(n,e)}function pn(e){return!!e._zod}function _i(e,t){return pn(e)?lr(e,t):e.safeParse(t)}function cd(e){if(!e)return;let t;if(pn(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t==\"function\")try{return t()}catch{return}return t}}function ud(e){if(pn(e)){const s=e._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}const n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const o=e.value;if(o!==void 0)return o}const bi=l(\"ZodISODateTime\",(e,t)=>{pu.init(e,t),C.init(e,t)});function fn(e){return gl(bi,e)}const vi=l(\"ZodISODate\",(e,t)=>{fu.init(e,t),C.init(e,t)});function yi(e){return _l(vi,e)}const wi=l(\"ZodISOTime\",(e,t)=>{hu.init(e,t),C.init(e,t)});function ki(e){return bl(wi,e)}const Si=l(\"ZodISODuration\",(e,t)=>{mu.init(e,t),C.init(e,t)});function zi(e){return vl(Si,e)}const mg=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:vi,ZodISODateTime:bi,ZodISODuration:Si,ZodISOTime:wi,date:yi,datetime:fn,duration:zi,time:ki},Symbol.toStringTag,{value:\"Module\"})),$i=(e,t)=>{ur.init(e,t),e.name=\"ZodError\",Object.defineProperties(e,{format:{value:n=>ac(e,n)},flatten:{value:n=>ic(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ct,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ct,2)}},isEmpty:{get(){return e.issues.length===0}}})},gg=l(\"ZodError\",$i),X=l(\"ZodError\",$i,{Parent:Error}),ld=Et(X),dd=Pt(X),pd=Zt(X),fd=It(X),hd=dr(X),md=pr(X),gd=fr(X),_d=hr(X),bd=mr(X),vd=gr(X),yd=_r(X),wd=br(X),k=l(\"ZodType\",(e,t)=>(y.init(e,t),Object.assign(e[\"~standard\"],{jsonSchema:{input:mt(e,\"input\"),output:mt(e,\"output\")}}),e.toJSONSchema=id(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,\"_def\",{value:t}),e.check=(...n)=>e.clone(se(t,{checks:[...t.checks??[],...n.map(o=>typeof o==\"function\"?{_zod:{check:o,def:{check:\"custom\"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(n,o)=>ie(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>ld(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>pd(e,n,o),e.parseAsync=async(n,o)=>dd(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>fd(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>hd(e,n,o),e.decode=(n,o)=>md(e,n,o),e.encodeAsync=async(n,o)=>gd(e,n,o),e.decodeAsync=async(n,o)=>_d(e,n,o),e.safeEncode=(n,o)=>bd(e,n,o),e.safeDecode=(n,o)=>vd(e,n,o),e.safeEncodeAsync=async(n,o)=>yd(e,n,o),e.safeDecodeAsync=async(n,o)=>wd(e,n,o),e.refine=(n,o)=>e.check(pa(n,o)),e.superRefine=n=>e.check(fa(n)),e.overwrite=n=>e.check(Ze(n)),e.optional=()=>O(e),e.exactOptional=()=>Vi(e),e.nullable=()=>bt(e),e.nullish=()=>O(bt(e)),e.nonoptional=n=>Xi(e,n),e.array=()=>v(e),e.or=n=>z([e,n]),e.and=n=>jt(e,n),e.transform=n=>vt(e,qn(n)),e.default=n=>Gi(e,n),e.prefault=n=>Yi(e,n),e.catch=n=>na(e,n),e.pipe=n=>vt(e,n),e.readonly=()=>sa(e),e.describe=n=>{const o=e.clone();return ae.add(o,{description:n}),o},Object.defineProperty(e,\"description\",{get(){return ae.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ae.get(e);const o=e.clone();return ae.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),hn=l(\"_ZodString\",(e,t)=>{Rt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>Ns(e,o,r);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(ql(...o)),e.includes=(...o)=>e.check(Hl(...o)),e.startsWith=(...o)=>e.check(Ul(...o)),e.endsWith=(...o)=>e.check(Fl(...o)),e.min=(...o)=>e.check(dt(...o)),e.max=(...o)=>e.check(Rs(...o)),e.length=(...o)=>e.check(Cs(...o)),e.nonempty=(...o)=>e.check(dt(1,...o)),e.lowercase=o=>e.check(Ll(o)),e.uppercase=o=>e.check(Dl(o)),e.trim=()=>e.check(Vl()),e.normalize=(...o)=>e.check(Bl(...o)),e.toLowerCase=()=>e.check(Kl()),e.toUpperCase=()=>e.check(Wl()),e.slugify=()=>e.check(Gl())}),mn=l(\"ZodString\",(e,t)=>{Rt.init(e,t),hn.init(e,t),e.email=n=>e.check(ds(gn,n)),e.url=n=>e.check(cn(Nt,n)),e.jwt=n=>e.check(Is(xn,n)),e.emoji=n=>e.check(gs(_n,n)),e.guid=n=>e.check(Gt(gt,n)),e.uuid=n=>e.check(ps(ce,n)),e.uuidv4=n=>e.check(fs(ce,n)),e.uuidv6=n=>e.check(hs(ce,n)),e.uuidv7=n=>e.check(ms(ce,n)),e.nanoid=n=>e.check(_s(bn,n)),e.guid=n=>e.check(Gt(gt,n)),e.cuid=n=>e.check(bs(vn,n)),e.cuid2=n=>e.check(vs(yn,n)),e.ulid=n=>e.check(ys(wn,n)),e.base64=n=>e.check(Es(Pn,n)),e.base64url=n=>e.check(Ps(Zn,n)),e.xid=n=>e.check(ws(kn,n)),e.ksuid=n=>e.check(ks(Sn,n)),e.ipv4=n=>e.check(Ss(zn,n)),e.ipv6=n=>e.check(zs($n,n)),e.cidrv4=n=>e.check($s(Tn,n)),e.cidrv6=n=>e.check(Ts(En,n)),e.e164=n=>e.check(Zs(In,n)),e.datetime=n=>e.check(fn(n)),e.date=n=>e.check(yi(n)),e.time=n=>e.check(ki(n)),e.duration=n=>e.check(zi(n))});function d(e){return hl(mn,e)}const C=l(\"ZodStringFormat\",(e,t)=>{R.init(e,t),hn.init(e,t)}),gn=l(\"ZodEmail\",(e,t)=>{ou.init(e,t),C.init(e,t)});function kd(e){return ds(gn,e)}const gt=l(\"ZodGUID\",(e,t)=>{tu.init(e,t),C.init(e,t)});function Sd(e){return Gt(gt,e)}const ce=l(\"ZodUUID\",(e,t)=>{nu.init(e,t),C.init(e,t)});function zd(e){return ps(ce,e)}function $d(e){return fs(ce,e)}function Td(e){return hs(ce,e)}function Ed(e){return ms(ce,e)}const Nt=l(\"ZodURL\",(e,t)=>{ru.init(e,t),C.init(e,t)});function Pd(e){return cn(Nt,e)}function Zd(e){return cn(Nt,{protocol:/^https?$/,hostname:jr,...m(e)})}const _n=l(\"ZodEmoji\",(e,t)=>{su.init(e,t),C.init(e,t)});function Id(e){return gs(_n,e)}const bn=l(\"ZodNanoID\",(e,t)=>{iu.init(e,t),C.init(e,t)});function xd(e){return _s(bn,e)}const vn=l(\"ZodCUID\",(e,t)=>{au.init(e,t),C.init(e,t)});function Rd(e){return bs(vn,e)}const yn=l(\"ZodCUID2\",(e,t)=>{cu.init(e,t),C.init(e,t)});function Cd(e){return vs(yn,e)}const wn=l(\"ZodULID\",(e,t)=>{uu.init(e,t),C.init(e,t)});function Nd(e){return ys(wn,e)}const kn=l(\"ZodXID\",(e,t)=>{lu.init(e,t),C.init(e,t)});function Od(e){return ws(kn,e)}const Sn=l(\"ZodKSUID\",(e,t)=>{du.init(e,t),C.init(e,t)});function Ad(e){return ks(Sn,e)}const zn=l(\"ZodIPv4\",(e,t)=>{gu.init(e,t),C.init(e,t)});function jd(e){return Ss(zn,e)}const Ti=l(\"ZodMAC\",(e,t)=>{bu.init(e,t),C.init(e,t)});function Md(e){return ml(Ti,e)}const $n=l(\"ZodIPv6\",(e,t)=>{_u.init(e,t),C.init(e,t)});function qd(e){return zs($n,e)}const Tn=l(\"ZodCIDRv4\",(e,t)=>{vu.init(e,t),C.init(e,t)});function Ld(e){return $s(Tn,e)}const En=l(\"ZodCIDRv6\",(e,t)=>{yu.init(e,t),C.init(e,t)});function Dd(e){return Ts(En,e)}const Pn=l(\"ZodBase64\",(e,t)=>{wu.init(e,t),C.init(e,t)});function Hd(e){return Es(Pn,e)}const Zn=l(\"ZodBase64URL\",(e,t)=>{Su.init(e,t),C.init(e,t)});function Ud(e){return Ps(Zn,e)}const In=l(\"ZodE164\",(e,t)=>{zu.init(e,t),C.init(e,t)});function Fd(e){return Zs(In,e)}const xn=l(\"ZodJWT\",(e,t)=>{Tu.init(e,t),C.init(e,t)});function Jd(e){return Is(xn,e)}const Fe=l(\"ZodCustomStringFormat\",(e,t)=>{Eu.init(e,t),C.init(e,t)});function Bd(e,t,n={}){return Ct(Fe,e,t,n)}function Vd(e){return Ct(Fe,\"hostname\",Ar,e)}function Kd(e){return Ct(Fe,\"hex\",Yr,e)}function Wd(e,t){const n=t?.enc??\"hex\",o=`${e}_${n}`,r=Nc[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return Ct(Fe,o,r,t)}const Rn=l(\"ZodNumber\",(e,t)=>{os.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>Os(e,o,r),e.gt=(o,r)=>e.check(Oe(o,r)),e.gte=(o,r)=>e.check(re(o,r)),e.min=(o,r)=>e.check(re(o,r)),e.lt=(o,r)=>e.check(Ne(o,r)),e.lte=(o,r)=>e.check(de(o,r)),e.max=(o,r)=>e.check(de(o,r)),e.int=o=>e.check(Yt(o)),e.safe=o=>e.check(Yt(o)),e.positive=o=>e.check(Oe(0,o)),e.nonnegative=o=>e.check(re(0,o)),e.negative=o=>e.check(Ne(0,o)),e.nonpositive=o=>e.check(de(0,o)),e.multipleOf=(o,r)=>e.check(Qt(o,r)),e.step=(o,r)=>e.check(Qt(o,r)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??\"\").includes(\"int\")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function w(e){return yl(Rn,e)}const Ie=l(\"ZodNumberFormat\",(e,t)=>{Pu.init(e,t),Rn.init(e,t)});function Yt(e){return wl(Ie,e)}function Gd(e){return kl(Ie,e)}function Qd(e){return Sl(Ie,e)}function Yd(e){return zl(Ie,e)}function Xd(e){return $l(Ie,e)}const Cn=l(\"ZodBoolean\",(e,t)=>{rs.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>As(e,n,o)});function Z(e){return Tl(Cn,e)}const Nn=l(\"ZodBigInt\",(e,t)=>{ss.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>js(e,o),e.gte=(o,r)=>e.check(re(o,r)),e.min=(o,r)=>e.check(re(o,r)),e.gt=(o,r)=>e.check(Oe(o,r)),e.gte=(o,r)=>e.check(re(o,r)),e.min=(o,r)=>e.check(re(o,r)),e.lt=(o,r)=>e.check(Ne(o,r)),e.lte=(o,r)=>e.check(de(o,r)),e.max=(o,r)=>e.check(de(o,r)),e.positive=o=>e.check(Oe(BigInt(0),o)),e.negative=o=>e.check(Ne(BigInt(0),o)),e.nonpositive=o=>e.check(de(BigInt(0),o)),e.nonnegative=o=>e.check(re(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(Qt(o,r));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function ep(e){return El(Nn,e)}const On=l(\"ZodBigIntFormat\",(e,t)=>{Zu.init(e,t),Nn.init(e,t)});function tp(e){return Pl(On,e)}function np(e){return Zl(On,e)}const Ei=l(\"ZodSymbol\",(e,t)=>{Iu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ms(e,n)});function op(e){return Il(Ei,e)}const Pi=l(\"ZodUndefined\",(e,t)=>{xu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ls(e,n)});function _t(e){return xl(Pi,e)}const Zi=l(\"ZodNull\",(e,t)=>{Ru.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>qs(e,n,o)});function An(e){return Rl(Zi,e)}const Ii=l(\"ZodAny\",(e,t)=>{Cu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Us()});function jn(){return Cl(Ii)}const xi=l(\"ZodUnknown\",(e,t)=>{Nu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Fs()});function E(){return Nl(xi)}const Ri=l(\"ZodNever\",(e,t)=>{Ou.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Hs(e,n,o)});function je(e){return Ol(Ri,e)}const Ci=l(\"ZodVoid\",(e,t)=>{Au.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ds(e,n)});function rp(e){return Al(Ci,e)}const Ni=l(\"ZodDate\",(e,t)=>{ju.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>Js(e,o),e.min=(o,r)=>e.check(re(o,r)),e.max=(o,r)=>e.check(de(o,r));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function sp(e){return jl(Ni,e)}const Oi=l(\"ZodArray\",(e,t)=>{Mu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>oi(e,n,o,r),e.element=t.element,e.min=(n,o)=>e.check(dt(n,o)),e.nonempty=n=>e.check(dt(1,n)),e.max=(n,o)=>e.check(Rs(n,o)),e.length=(n,o)=>e.check(Cs(n,o)),e.unwrap=()=>e.element});function v(e,t){return Ql(Oi,e,t)}function ip(e){const t=e._zod.def.shape;return B(Object.keys(t))}const Ot=l(\"ZodObject\",(e,t)=>{Lu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ri(e,n,o,r),S(e,\"shape\",()=>t.shape),e.keyof=()=>B(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:E()}),e.loose=()=>e.clone({...e._zod.def,catchall:E()}),e.strict=()=>e.clone({...e._zod.def,catchall:je()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>tr(e,n),e.safeExtend=n=>nr(e,n),e.merge=n=>or(e,n),e.pick=n=>Xo(e,n),e.omit=n=>er(e,n),e.partial=(...n)=>rr(Ln,e,n[0]),e.required=(...n)=>sr(Dn,e,n[0])});function h(e,t){const n={type:\"object\",shape:e??{},...m(t)};return new Ot(n)}function ap(e,t){return new Ot({type:\"object\",shape:e,catchall:je(),...m(t)})}function J(e,t){return new Ot({type:\"object\",shape:e,catchall:E(),...m(t)})}const At=l(\"ZodUnion\",(e,t)=>{an.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ln(e,n,o,r),e.options=t.options});function z(e,t){return new At({type:\"union\",options:e,...m(t)})}const Ai=l(\"ZodXor\",(e,t)=>{At.init(e,t),Du.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ln(e,n,o,r),e.options=t.options});function cp(e,t){return new Ai({type:\"union\",options:e,inclusive:!1,...m(t)})}const ji=l(\"ZodDiscriminatedUnion\",(e,t)=>{At.init(e,t),Hu.init(e,t)});function Mn(e,t,n){return new ji({type:\"union\",options:t,discriminator:e,...m(n)})}const Mi=l(\"ZodIntersection\",(e,t)=>{Uu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>si(e,n,o,r)});function jt(e,t){return new Mi({type:\"intersection\",left:e,right:t})}const qi=l(\"ZodTuple\",(e,t)=>{cs.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ii(e,n,o,r),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Li(e,t,n){const o=t instanceof y,r=o?n:t,s=o?t:null;return new qi({type:\"tuple\",items:e,rest:s,...m(r)})}const Mt=l(\"ZodRecord\",(e,t)=>{Fu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ai(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType});function $(e,t,n){return new Mt({type:\"record\",keyType:e,valueType:t,...m(n)})}function up(e,t,n){const o=ie(e);return o._zod.values=void 0,new Mt({type:\"record\",keyType:o,valueType:t,...m(n)})}function lp(e,t,n){return new Mt({type:\"record\",keyType:e,valueType:t,mode:\"loose\",...m(n)})}const Di=l(\"ZodMap\",(e,t)=>{Ju.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ti(e,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Ae(...n)),e.nonempty=n=>e.check(Ae(1,n)),e.max=(...n)=>e.check(un(...n)),e.size=(...n)=>e.check(xs(...n))});function dp(e,t,n){return new Di({type:\"map\",keyType:e,valueType:t,...m(n)})}const Hi=l(\"ZodSet\",(e,t)=>{Bu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ni(e,n),e.min=(...n)=>e.check(Ae(...n)),e.nonempty=n=>e.check(Ae(1,n)),e.max=(...n)=>e.check(un(...n)),e.size=(...n)=>e.check(xs(...n))});function pp(e,t){return new Hi({type:\"set\",valueType:e,...m(t)})}const Me=l(\"ZodEnum\",(e,t)=>{Vu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>Bs(e,o,r),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{const s={};for(const i of o)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Me({...t,checks:[],...m(r),entries:s})},e.exclude=(o,r)=>{const s={...t.entries};for(const i of o)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Me({...t,checks:[],...m(r),entries:s})}});function B(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Me({type:\"enum\",entries:n,...m(t)})}function fp(e,t){return new Me({type:\"enum\",entries:e,...m(t)})}const Ui=l(\"ZodLiteral\",(e,t)=>{Ku.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Vs(e,n,o),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 p(e,t){return new Ui({type:\"literal\",values:Array.isArray(e)?e:[e],...m(t)})}const Fi=l(\"ZodFile\",(e,t)=>{Wu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Gs(e,n,o),e.min=(n,o)=>e.check(Ae(n,o)),e.max=(n,o)=>e.check(un(n,o)),e.mime=(n,o)=>e.check(Jl(Array.isArray(n)?n:[n],o))});function hp(e){return Yl(Fi,e)}const Ji=l(\"ZodTransform\",(e,t)=>{Gu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ei(e,n),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")throw new tn(e.constructor.name);n.addIssue=s=>{if(typeof s==\"string\")n.issues.push($e(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code=\"custom\"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push($e(i))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then(s=>(n.value=s,n)):(n.value=r,n)}});function qn(e){return new Ji({type:\"transform\",transform:e})}const Ln=l(\"ZodOptional\",(e,t)=>{us.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>dn(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function O(e){return new Ln({type:\"optional\",innerType:e})}const Bi=l(\"ZodExactOptional\",(e,t)=>{Qu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>dn(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Vi(e){return new Bi({type:\"optional\",innerType:e})}const Ki=l(\"ZodNullable\",(e,t)=>{Yu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ci(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function bt(e){return new Ki({type:\"nullable\",innerType:e})}function mp(e){return O(bt(e))}const Wi=l(\"ZodDefault\",(e,t)=>{Xu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>li(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Gi(e,t){return new Wi({type:\"default\",innerType:e,get defaultValue(){return typeof t==\"function\"?t():zt(t)}})}const Qi=l(\"ZodPrefault\",(e,t)=>{el.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>di(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Yi(e,t){return new Qi({type:\"prefault\",innerType:e,get defaultValue(){return typeof t==\"function\"?t():zt(t)}})}const Dn=l(\"ZodNonOptional\",(e,t)=>{tl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ui(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Xi(e,t){return new Dn({type:\"nonoptional\",innerType:e,...m(t)})}const ea=l(\"ZodSuccess\",(e,t)=>{nl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Qs(e,n,o),e.unwrap=()=>e._zod.def.innerType});function gp(e){return new ea({type:\"success\",innerType:e})}const ta=l(\"ZodCatch\",(e,t)=>{ol.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>pi(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function na(e,t){return new ta({type:\"catch\",innerType:e,catchValue:typeof t==\"function\"?t:()=>t})}const oa=l(\"ZodNaN\",(e,t)=>{rl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ks(e,n)});function _p(e){return Ml(oa,e)}const Hn=l(\"ZodPipe\",(e,t)=>{sl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>fi(e,n,o,r),e.in=t.in,e.out=t.out});function vt(e,t){return new Hn({type:\"pipe\",in:e,out:t})}const Un=l(\"ZodCodec\",(e,t)=>{Hn.init(e,t),ls.init(e,t)});function bp(e,t,n){return new Un({type:\"pipe\",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const ra=l(\"ZodReadonly\",(e,t)=>{il.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>hi(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function sa(e){return new ra({type:\"readonly\",innerType:e})}const ia=l(\"ZodTemplateLiteral\",(e,t)=>{al.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ws(e,n,o)});function vp(e,t){return new ia({type:\"template_literal\",parts:e,...m(t)})}const aa=l(\"ZodLazy\",(e,t)=>{ll.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>gi(e,n,o,r),e.unwrap=()=>e._zod.def.getter()});function ca(e){return new aa({type:\"lazy\",getter:e})}const ua=l(\"ZodPromise\",(e,t)=>{ul.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>mi(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function yp(e){return new ua({type:\"promise\",innerType:e})}const la=l(\"ZodFunction\",(e,t)=>{cl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Xs(e,n)});function No(e){return new la({type:\"function\",input:Array.isArray(e?.input)?Li(e?.input):e?.input??v(E()),output:e?.output??E()})}const qt=l(\"ZodCustom\",(e,t)=>{dl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ys(e,n)});function wp(e){const t=new A({check:\"custom\"});return t._zod.check=e,t}function da(e,t){return Xl(qt,e??(()=>!0),t)}function pa(e,t={}){return ed(qt,e,t)}function fa(e){return td(e)}const kp=od,Sp=rd;function zp(e,t={}){const n=new qt({type:\"custom\",check:\"custom\",fn:o=>o instanceof e,abort:!0,...m(t)});return n._zod.bag.Class=e,n._zod.check=o=>{o.value instanceof e||o.issues.push({code:\"invalid_type\",expected:e.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}const $p=(...e)=>sd({Codec:Un,Boolean:Cn,String:mn},...e);function Tp(e){const t=ca(()=>z([d(e),w(),Z(),An(),v(t),$(d(),t)]));return t}function Fn(e,t){return vt(qn(e),t)}const _g=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:Ii,ZodArray:Oi,ZodBase64:Pn,ZodBase64URL:Zn,ZodBigInt:Nn,ZodBigIntFormat:On,ZodBoolean:Cn,ZodCIDRv4:Tn,ZodCIDRv6:En,ZodCUID:vn,ZodCUID2:yn,ZodCatch:ta,ZodCodec:Un,ZodCustom:qt,ZodCustomStringFormat:Fe,ZodDate:Ni,ZodDefault:Wi,ZodDiscriminatedUnion:ji,ZodE164:In,ZodEmail:gn,ZodEmoji:_n,ZodEnum:Me,ZodExactOptional:Bi,ZodFile:Fi,ZodFunction:la,ZodGUID:gt,ZodIPv4:zn,ZodIPv6:$n,ZodIntersection:Mi,ZodJWT:xn,ZodKSUID:Sn,ZodLazy:aa,ZodLiteral:Ui,ZodMAC:Ti,ZodMap:Di,ZodNaN:oa,ZodNanoID:bn,ZodNever:Ri,ZodNonOptional:Dn,ZodNull:Zi,ZodNullable:Ki,ZodNumber:Rn,ZodNumberFormat:Ie,ZodObject:Ot,ZodOptional:Ln,ZodPipe:Hn,ZodPrefault:Qi,ZodPromise:ua,ZodReadonly:ra,ZodRecord:Mt,ZodSet:Hi,ZodString:mn,ZodStringFormat:C,ZodSuccess:ea,ZodSymbol:Ei,ZodTemplateLiteral:ia,ZodTransform:Ji,ZodTuple:qi,ZodType:k,ZodULID:wn,ZodURL:Nt,ZodUUID:ce,ZodUndefined:Pi,ZodUnion:At,ZodUnknown:xi,ZodVoid:Ci,ZodXID:kn,ZodXor:Ai,_ZodString:hn,_default:Gi,_function:No,any:jn,array:v,base64:Hd,base64url:Ud,bigint:ep,boolean:Z,catch:na,check:wp,cidrv4:Ld,cidrv6:Dd,codec:bp,cuid:Rd,cuid2:Cd,custom:da,date:sp,describe:kp,discriminatedUnion:Mn,e164:Fd,email:kd,emoji:Id,enum:B,exactOptional:Vi,file:hp,float32:Gd,float64:Qd,function:No,guid:Sd,hash:Wd,hex:Kd,hostname:Vd,httpUrl:Zd,instanceof:zp,int:Yt,int32:Yd,int64:tp,intersection:jt,ipv4:jd,ipv6:qd,json:Tp,jwt:Jd,keyof:ip,ksuid:Ad,lazy:ca,literal:p,looseObject:J,looseRecord:lp,mac:Md,map:dp,meta:Sp,nan:_p,nanoid:xd,nativeEnum:fp,never:je,nonoptional:Xi,null:An,nullable:bt,nullish:mp,number:w,object:h,optional:O,partialRecord:up,pipe:vt,prefault:Yi,preprocess:Fn,promise:yp,readonly:sa,record:$,refine:pa,set:pp,strictObject:ap,string:d,stringFormat:Bd,stringbool:$p,success:gp,superRefine:fa,symbol:op,templateLiteral:vp,transform:qn,tuple:Li,uint32:Xd,uint64:np,ulid:Nd,undefined:_t,union:z,unknown:E,url:Pd,uuid:zd,uuidv4:$d,uuidv6:Td,uuidv7:Ed,void:rp,xid:Od,xor:cp},Symbol.toStringTag,{value:\"Module\"})),ge=\"io.modelcontextprotocol/related-task\",Lt=\"2.0\",q=da(e=>e!==null&&(typeof e==\"object\"||typeof e==\"function\")),ha=z([d(),w().int()]),ma=d();J({ttl:w().optional(),pollInterval:w().optional()});const Ep=h({ttl:w().optional()}),Pp=h({taskId:d()}),Jn=J({progressToken:ha.optional(),[ge]:Pp.optional()}),W=h({_meta:Jn.optional()}),Je=W.extend({task:Ep.optional()}),Zp=e=>Je.safeParse(e).success,H=h({method:d(),params:W.loose().optional()}),ee=h({_meta:Jn.optional()}),te=h({method:d(),params:ee.loose().optional()}),U=J({_meta:Jn.optional()}),Be=z([d(),w().int()]),ga=h({jsonrpc:p(Lt),id:Be,...H.shape}).strict(),Oo=e=>ga.safeParse(e).success,_a=h({jsonrpc:p(Lt),...te.shape}).strict(),Ip=e=>_a.safeParse(e).success,Bn=h({jsonrpc:p(Lt),id:Be,result:U}).strict(),rt=e=>Bn.safeParse(e).success;var P;(function(e){e[e.ConnectionClosed=-32e3]=\"ConnectionClosed\",e[e.RequestTimeout=-32001]=\"RequestTimeout\",e[e.ParseError=-32700]=\"ParseError\",e[e.InvalidRequest=-32600]=\"InvalidRequest\",e[e.MethodNotFound=-32601]=\"MethodNotFound\",e[e.InvalidParams=-32602]=\"InvalidParams\",e[e.InternalError=-32603]=\"InternalError\",e[e.UrlElicitationRequired=-32042]=\"UrlElicitationRequired\"})(P||(P={}));const Vn=h({jsonrpc:p(Lt),id:Be.optional(),error:h({code:w().int(),message:d(),data:E().optional()})}).strict(),xp=e=>Vn.safeParse(e).success,Rp=z([ga,_a,Bn,Vn]);z([Bn,Vn]);const Kn=U.strict(),Cp=ee.extend({requestId:Be.optional(),reason:d().optional()}),Wn=te.extend({method:p(\"notifications/cancelled\"),params:Cp}),Np=h({src:d(),mimeType:d().optional(),sizes:v(d()).optional(),theme:B([\"light\",\"dark\"]).optional()}),Ve=h({icons:v(Np).optional()}),Ee=h({name:d(),title:d().optional()}),Dt=Ee.extend({...Ee.shape,...Ve.shape,version:d(),websiteUrl:d().optional(),description:d().optional()}),Op=jt(h({applyDefaults:Z().optional()}),$(d(),E())),Ap=Fn(e=>e&&typeof e==\"object\"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,jt(h({form:Op.optional(),url:q.optional()}),$(d(),E()).optional())),jp=J({list:q.optional(),cancel:q.optional(),requests:J({sampling:J({createMessage:q.optional()}).optional(),elicitation:J({create:q.optional()}).optional()}).optional()}),Mp=J({list:q.optional(),cancel:q.optional(),requests:J({tools:J({call:q.optional()}).optional()}).optional()}),qp=h({experimental:$(d(),q).optional(),sampling:h({context:q.optional(),tools:q.optional()}).optional(),elicitation:Ap.optional(),roots:h({listChanged:Z().optional()}).optional(),tasks:jp.optional(),extensions:$(d(),q).optional()}),Lp=W.extend({protocolVersion:d(),capabilities:qp,clientInfo:Dt}),Dp=H.extend({method:p(\"initialize\"),params:Lp}),Hp=h({experimental:$(d(),q).optional(),logging:q.optional(),completions:q.optional(),prompts:h({listChanged:Z().optional()}).optional(),resources:h({subscribe:Z().optional(),listChanged:Z().optional()}).optional(),tools:h({listChanged:Z().optional()}).optional(),tasks:Mp.optional(),extensions:$(d(),q).optional()}),Up=U.extend({protocolVersion:d(),capabilities:Hp,serverInfo:Dt,instructions:d().optional()}),Fp=te.extend({method:p(\"notifications/initialized\"),params:ee.optional()}),Ht=H.extend({method:p(\"ping\"),params:W.optional()}),Jp=h({progress:w(),total:O(w()),message:O(d())}),Bp=h({...ee.shape,...Jp.shape,progressToken:ha}),Gn=te.extend({method:p(\"notifications/progress\"),params:Bp}),Vp=W.extend({cursor:ma.optional()}),Ke=H.extend({params:Vp.optional()}),We=U.extend({nextCursor:ma.optional()}),Kp=B([\"working\",\"input_required\",\"completed\",\"failed\",\"cancelled\"]),Ge=h({taskId:d(),status:Kp,ttl:z([w(),An()]),createdAt:d(),lastUpdatedAt:d(),pollInterval:O(w()),statusMessage:O(d())}),Qn=U.extend({task:Ge}),Wp=ee.merge(Ge),yt=te.extend({method:p(\"notifications/tasks/status\"),params:Wp}),Yn=H.extend({method:p(\"tasks/get\"),params:W.extend({taskId:d()})}),Xn=U.merge(Ge),eo=H.extend({method:p(\"tasks/result\"),params:W.extend({taskId:d()})});U.loose();const to=Ke.extend({method:p(\"tasks/list\")}),no=We.extend({tasks:v(Ge)}),oo=H.extend({method:p(\"tasks/cancel\"),params:W.extend({taskId:d()})}),Gp=U.merge(Ge),ba=h({uri:d(),mimeType:O(d()),_meta:$(d(),E()).optional()}),va=ba.extend({text:d()}),ro=d().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:\"Invalid Base64 string\"}),ya=ba.extend({blob:ro}),Qe=B([\"user\",\"assistant\"]),xe=h({audience:v(Qe).optional(),priority:w().min(0).max(1).optional(),lastModified:fn({offset:!0}).optional()}),wa=h({...Ee.shape,...Ve.shape,uri:d(),description:O(d()),mimeType:O(d()),size:O(w()),annotations:xe.optional(),_meta:O(J({}))}),Qp=h({...Ee.shape,...Ve.shape,uriTemplate:d(),description:O(d()),mimeType:O(d()),annotations:xe.optional(),_meta:O(J({}))}),Yp=Ke.extend({method:p(\"resources/list\")}),ka=We.extend({resources:v(wa)}),Xp=Ke.extend({method:p(\"resources/templates/list\")}),ef=We.extend({resourceTemplates:v(Qp)}),so=W.extend({uri:d()}),tf=so,nf=H.extend({method:p(\"resources/read\"),params:tf}),Sa=U.extend({contents:v(z([va,ya]))}),of=te.extend({method:p(\"notifications/resources/list_changed\"),params:ee.optional()}),rf=so,sf=H.extend({method:p(\"resources/subscribe\"),params:rf}),af=so,cf=H.extend({method:p(\"resources/unsubscribe\"),params:af}),uf=ee.extend({uri:d()}),lf=te.extend({method:p(\"notifications/resources/updated\"),params:uf}),df=h({name:d(),description:O(d()),required:O(Z())}),pf=h({...Ee.shape,...Ve.shape,description:O(d()),arguments:O(v(df)),_meta:O(J({}))}),ff=Ke.extend({method:p(\"prompts/list\")}),hf=We.extend({prompts:v(pf)}),mf=W.extend({name:d(),arguments:$(d(),d()).optional()}),gf=H.extend({method:p(\"prompts/get\"),params:mf}),io=h({type:p(\"text\"),text:d(),annotations:xe.optional(),_meta:$(d(),E()).optional()}),ao=h({type:p(\"image\"),data:ro,mimeType:d(),annotations:xe.optional(),_meta:$(d(),E()).optional()}),co=h({type:p(\"audio\"),data:ro,mimeType:d(),annotations:xe.optional(),_meta:$(d(),E()).optional()}),_f=h({type:p(\"tool_use\"),name:d(),id:d(),input:$(d(),E()),_meta:$(d(),E()).optional()}),za=h({type:p(\"resource\"),resource:z([va,ya]),annotations:xe.optional(),_meta:$(d(),E()).optional()}),$a=wa.extend({type:p(\"resource_link\")}),Ye=z([io,ao,co,$a,za]),bf=h({role:Qe,content:Ye}),vf=U.extend({description:d().optional(),messages:v(bf)}),yf=te.extend({method:p(\"notifications/prompts/list_changed\"),params:ee.optional()}),wf=h({title:d().optional(),readOnlyHint:Z().optional(),destructiveHint:Z().optional(),idempotentHint:Z().optional(),openWorldHint:Z().optional()}),kf=h({taskSupport:B([\"required\",\"optional\",\"forbidden\"]).optional()}),uo=h({...Ee.shape,...Ve.shape,description:d().optional(),inputSchema:h({type:p(\"object\"),properties:$(d(),q).optional(),required:v(d()).optional()}).catchall(E()),outputSchema:h({type:p(\"object\"),properties:$(d(),q).optional(),required:v(d()).optional()}).catchall(E()).optional(),annotations:wf.optional(),execution:kf.optional(),_meta:$(d(),E()).optional()}),Ta=Ke.extend({method:p(\"tools/list\")}),Sf=We.extend({tools:v(uo)}),Ut=U.extend({content:v(Ye).default([]),structuredContent:$(d(),E()).optional(),isError:Z().optional()});Ut.or(U.extend({toolResult:E()}));const zf=Je.extend({name:d(),arguments:$(d(),E()).optional()}),Ea=H.extend({method:p(\"tools/call\"),params:zf}),$f=te.extend({method:p(\"notifications/tools/list_changed\"),params:ee.optional()});h({autoRefresh:Z().default(!0),debounceMs:w().int().nonnegative().default(300)});const Pa=B([\"debug\",\"info\",\"notice\",\"warning\",\"error\",\"critical\",\"alert\",\"emergency\"]),Tf=W.extend({level:Pa}),Ef=H.extend({method:p(\"logging/setLevel\"),params:Tf}),Pf=ee.extend({level:Pa,logger:d().optional(),data:E()}),Zf=te.extend({method:p(\"notifications/message\"),params:Pf}),If=h({name:d().optional()}),xf=h({hints:v(If).optional(),costPriority:w().min(0).max(1).optional(),speedPriority:w().min(0).max(1).optional(),intelligencePriority:w().min(0).max(1).optional()}),Rf=h({mode:B([\"auto\",\"required\",\"none\"]).optional()}),Cf=h({type:p(\"tool_result\"),toolUseId:d().describe(\"The unique identifier for the corresponding tool call.\"),content:v(Ye).default([]),structuredContent:h({}).loose().optional(),isError:Z().optional(),_meta:$(d(),E()).optional()}),Nf=Mn(\"type\",[io,ao,co]),wt=Mn(\"type\",[io,ao,co,_f,Cf]),Of=h({role:Qe,content:z([wt,v(wt)]),_meta:$(d(),E()).optional()}),Af=Je.extend({messages:v(Of),modelPreferences:xf.optional(),systemPrompt:d().optional(),includeContext:B([\"none\",\"thisServer\",\"allServers\"]).optional(),temperature:w().optional(),maxTokens:w().int(),stopSequences:v(d()).optional(),metadata:q.optional(),tools:v(uo).optional(),toolChoice:Rf.optional()}),jf=H.extend({method:p(\"sampling/createMessage\"),params:Af}),Za=U.extend({model:d(),stopReason:O(B([\"endTurn\",\"stopSequence\",\"maxTokens\"]).or(d())),role:Qe,content:Nf}),Ia=U.extend({model:d(),stopReason:O(B([\"endTurn\",\"stopSequence\",\"maxTokens\",\"toolUse\"]).or(d())),role:Qe,content:z([wt,v(wt)])}),Mf=h({type:p(\"boolean\"),title:d().optional(),description:d().optional(),default:Z().optional()}),qf=h({type:p(\"string\"),title:d().optional(),description:d().optional(),minLength:w().optional(),maxLength:w().optional(),format:B([\"email\",\"uri\",\"date\",\"date-time\"]).optional(),default:d().optional()}),Lf=h({type:B([\"number\",\"integer\"]),title:d().optional(),description:d().optional(),minimum:w().optional(),maximum:w().optional(),default:w().optional()}),Df=h({type:p(\"string\"),title:d().optional(),description:d().optional(),enum:v(d()),default:d().optional()}),Hf=h({type:p(\"string\"),title:d().optional(),description:d().optional(),oneOf:v(h({const:d(),title:d()})),default:d().optional()}),Uf=h({type:p(\"string\"),title:d().optional(),description:d().optional(),enum:v(d()),enumNames:v(d()).optional(),default:d().optional()}),Ff=z([Df,Hf]),Jf=h({type:p(\"array\"),title:d().optional(),description:d().optional(),minItems:w().optional(),maxItems:w().optional(),items:h({type:p(\"string\"),enum:v(d())}),default:v(d()).optional()}),Bf=h({type:p(\"array\"),title:d().optional(),description:d().optional(),minItems:w().optional(),maxItems:w().optional(),items:h({anyOf:v(h({const:d(),title:d()}))}),default:v(d()).optional()}),Vf=z([Jf,Bf]),Kf=z([Uf,Ff,Vf]),Wf=z([Kf,Mf,qf,Lf]),Gf=Je.extend({mode:p(\"form\").optional(),message:d(),requestedSchema:h({type:p(\"object\"),properties:$(d(),Wf),required:v(d()).optional()})}),Qf=Je.extend({mode:p(\"url\"),message:d(),elicitationId:d(),url:d().url()}),Yf=z([Gf,Qf]),Xf=H.extend({method:p(\"elicitation/create\"),params:Yf}),eh=ee.extend({elicitationId:d()}),th=te.extend({method:p(\"notifications/elicitation/complete\"),params:eh}),nh=U.extend({action:B([\"accept\",\"decline\",\"cancel\"]),content:Fn(e=>e===null?void 0:e,$(d(),z([d(),w(),Z(),v(d())])).optional())}),oh=h({type:p(\"ref/resource\"),uri:d()}),rh=h({type:p(\"ref/prompt\"),name:d()}),sh=W.extend({ref:z([rh,oh]),argument:h({name:d(),value:d()}),context:h({arguments:$(d(),d()).optional()}).optional()}),ih=H.extend({method:p(\"completion/complete\"),params:sh}),ah=U.extend({completion:J({values:v(d()).max(100),total:O(w().int()),hasMore:O(Z())})}),ch=h({uri:d().startsWith(\"file://\"),name:d().optional(),_meta:$(d(),E()).optional()}),uh=H.extend({method:p(\"roots/list\"),params:W.optional()}),lh=U.extend({roots:v(ch)}),dh=te.extend({method:p(\"notifications/roots/list_changed\"),params:ee.optional()});z([Ht,Dp,ih,Ef,gf,ff,Yp,Xp,nf,sf,cf,Ea,Ta,Yn,eo,to,oo]);z([Wn,Gn,Fp,dh,yt]);z([Kn,Za,Ia,nh,lh,Xn,no,Qn]);z([Ht,jf,Xf,uh,Yn,eo,to,oo]);z([Wn,Gn,Zf,lf,of,$f,yf,yt,th]);z([Kn,Up,ah,vf,hf,ka,ef,Sa,Ut,Sf,Xn,no,Qn]);class T extends Error{constructor(t,n,o){super(`MCP error ${t}: ${n}`),this.code=t,this.data=o,this.name=\"McpError\"}static fromError(t,n,o){if(t===P.UrlElicitationRequired&&o){const r=o;if(r.elicitations)return new ph(r.elicitations,n)}return new T(t,n,o)}}class ph extends T{constructor(t,n=`URL elicitation${t.length>1?\"s\":\"\"} required`){super(P.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function me(e){return e===\"completed\"||e===\"failed\"||e===\"cancelled\"}new Set(\"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789\");function Ao(e){const n=cd(e)?.method;if(!n)throw new Error(\"Schema is missing a method literal\");const o=ud(n);if(typeof o!=\"string\")throw new Error(\"Schema method literal must be a string\");return o}function jo(e,t){const n=_i(e,t);if(!n.success)throw n.error;return n.data}const fh=6e4;class hh{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Wn,n=>{this._oncancel(n)}),this.setNotificationHandler(Gn,n=>{this._onprogress(n)}),this.setRequestHandler(Ht,n=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Yn,async(n,o)=>{const r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new T(P.InvalidParams,\"Failed to retrieve task: Task not found\");return{...r}}),this.setRequestHandler(eo,async(n,o)=>{const r=async()=>{const s=n.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,o.sessionId);){if(a.type===\"response\"||a.type===\"error\"){const c=a.message,u=c.id,f=this._requestResolvers.get(u);if(f)if(this._requestResolvers.delete(u),a.type===\"response\")f(c);else{const g=c,_=new T(g.error.code,g.error.message,g.error.data);f(_)}else{const g=a.type===\"response\"?\"Response\":\"Error\";this._onerror(new Error(`${g} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:o.requestId})}}const i=await this._taskStore.getTask(s,o.sessionId);if(!i)throw new T(P.InvalidParams,`Task not found: ${s}`);if(!me(i.status))return await this._waitForTaskUpdate(s,o.signal),await r();if(me(i.status)){const a=await this._taskStore.getTaskResult(s,o.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ge]:{taskId:s}}}}return await r()};return await r()}),this.setRequestHandler(to,async(n,o)=>{try{const{tasks:r,nextCursor:s}=await this._taskStore.listTasks(n.params?.cursor,o.sessionId);return{tasks:r,nextCursor:s,_meta:{}}}catch(r){throw new T(P.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(oo,async(n,o)=>{try{const r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new T(P.InvalidParams,`Task not found: ${n.params.taskId}`);if(me(r.status))throw new T(P.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,\"cancelled\",\"Client cancelled task execution.\",o.sessionId),this._clearTaskQueue(n.params.taskId);const s=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!s)throw new T(P.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...s}}catch(r){throw r instanceof T?r:new T(P.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,n,o,r,s=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:r})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const o=Date.now()-n.startTime;if(n.maxTotalTimeout&&o>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),T.fromError(P.RequestTimeout,\"Maximum total timeout exceeded\",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:o});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error(\"Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.\");this._transport=t;const n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};const o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};const r=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{r?.(s,i),rt(s)||xp(s)?this._onresponse(s):Oo(s)?this._onrequest(s,i):Ip(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(const o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();const n=T.fromError(P.ConnectionClosed,\"Connection closed\");this._transport=void 0,this.onclose?.();for(const o of t.values())o(n)}_onerror(t){this.onerror?.(t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(t,n){const o=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,s=t.params?._meta?.[ge]?.taskId;if(o===void 0){const f={jsonrpc:\"2.0\",id:t.id,error:{code:P.MethodNotFound,message:\"Method not found\"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:\"error\",message:f,timestamp:Date.now()},r?.sessionId).catch(g=>this._onerror(new Error(`Failed to enqueue error response: ${g}`))):r?.send(f).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(t.id,i);const a=Zp(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,r?.sessionId):void 0,u={signal:i.signal,sessionId:r?.sessionId,_meta:t.params?._meta,sendNotification:async f=>{if(i.signal.aborted)return;const g={relatedRequestId:t.id};s&&(g.relatedTask={taskId:s}),await this.notification(f,g)},sendRequest:async(f,g,_)=>{if(i.signal.aborted)throw new T(P.ConnectionClosed,\"Request was cancelled\");const b={..._,relatedRequestId:t.id};s&&!b.relatedTask&&(b.relatedTask={taskId:s});const I=b.relatedTask?.taskId??s;return I&&c&&await c.updateTaskStatus(I,\"input_required\"),await this.request(f,g,b)},authInfo:n?.authInfo,requestId:t.id,requestInfo:n?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>o(t,u)).then(async f=>{if(i.signal.aborted)return;const g={result:f,jsonrpc:\"2.0\",id:t.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:\"response\",message:g,timestamp:Date.now()},r?.sessionId):await r?.send(g)},async f=>{if(i.signal.aborted)return;const g={jsonrpc:\"2.0\",id:t.id,error:{code:Number.isSafeInteger(f.code)?f.code:P.InternalError,message:f.message??\"Internal error\",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:\"error\",message:g,timestamp:Date.now()},r?.sessionId):await r?.send(g)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===i&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...o}=t.params,r=Number(n),s=this._progressHandlers.get(r);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const i=this._responseHandlers.get(r),a=this._timeoutInfo.get(r);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),i(c);return}s(o)}_onresponse(t){const n=Number(t.id),o=this._requestResolvers.get(n);if(o){if(this._requestResolvers.delete(n),rt(t))o(t);else{const i=new T(t.error.code,t.error.message,t.error.data);o(i)}return}const r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let s=!1;if(rt(t)&&t.result&&typeof t.result==\"object\"){const i=t.result;if(i.task&&typeof i.task==\"object\"){const a=i.task;typeof a.taskId==\"string\"&&(s=!0,this._taskProgressTokens.set(a.taskId,n))}}if(s||this._progressHandlers.delete(n),rt(t))r(t);else{const i=T.fromError(t.error.code,t.error.message,t.error.data);r(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,n,o){const{task:r}=o??{};if(!r){try{yield{type:\"result\",result:await this.request(t,n,o)}}catch(i){yield{type:\"error\",error:i instanceof T?i:new T(P.InternalError,String(i))}}return}let s;try{const i=await this.request(t,Qn,o);if(i.task)s=i.task.taskId,yield{type:\"taskCreated\",task:i.task};else throw new T(P.InternalError,\"Task creation did not return a task\");for(;;){const a=await this.getTask({taskId:s},o);if(yield{type:\"taskStatus\",task:a},me(a.status)){a.status===\"completed\"?yield{type:\"result\",result:await this.getTaskResult({taskId:s},n,o)}:a.status===\"failed\"?yield{type:\"error\",error:new T(P.InternalError,`Task ${s} failed`)}:a.status===\"cancelled\"&&(yield{type:\"error\",error:new T(P.InternalError,`Task ${s} was cancelled`)});return}if(a.status===\"input_required\"){yield{type:\"result\",result:await this.getTaskResult({taskId:s},n,o)};return}const c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),o?.signal?.throwIfAborted()}}catch(i){yield{type:\"error\",error:i instanceof T?i:new T(P.InternalError,String(i))}}}request(t,n,o){const{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=o??{};return new Promise((u,f)=>{const g=L=>{f(L)};if(!this._transport){g(new Error(\"Not connected\"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(L){g(L);return}o?.signal?.throwIfAborted();const _=this._requestMessageId++,b={...t,jsonrpc:\"2.0\",id:_};o?.onprogress&&(this._progressHandlers.set(_,o.onprogress),b.params={...t.params,_meta:{...t.params?._meta||{},progressToken:_}}),a&&(b.params={...b.params,task:a}),c&&(b.params={...b.params,_meta:{...b.params?._meta||{},[ge]:c}});const I=L=>{this._responseHandlers.delete(_),this._progressHandlers.delete(_),this._cleanupTimeout(_),this._transport?.send({jsonrpc:\"2.0\",method:\"notifications/cancelled\",params:{requestId:_,reason:String(L)}},{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i}).catch(M=>this._onerror(new Error(`Failed to send cancellation: ${M}`)));const j=L instanceof T?L:new T(P.RequestTimeout,String(L));f(j)};this._responseHandlers.set(_,L=>{if(!o?.signal?.aborted){if(L instanceof Error)return f(L);try{const j=_i(n,L.result);j.success?u(j.data):f(j.error)}catch(j){f(j)}}}),o?.signal?.addEventListener(\"abort\",()=>{I(o?.signal?.reason)});const N=o?.timeout??fh,we=()=>I(T.fromError(P.RequestTimeout,\"Request timed out\",{timeout:N}));this._setupTimeout(_,N,o?.maxTotalTimeout,we,o?.resetTimeoutOnProgress??!1);const Xe=c?.taskId;if(Xe){const L=j=>{const M=this._responseHandlers.get(_);M?M(j):this._onerror(new Error(`Response handler missing for side-channeled request ${_}`))};this._requestResolvers.set(_,L),this._enqueueTaskMessage(Xe,{type:\"request\",message:b,timestamp:Date.now()}).catch(j=>{this._cleanupTimeout(_),f(j)})}else this._transport.send(b,{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i}).catch(L=>{this._cleanupTimeout(_),f(L)})})}async getTask(t,n){return this.request({method:\"tasks/get\",params:t},Xn,n)}async getTaskResult(t,n,o){return this.request({method:\"tasks/result\",params:t},n,o)}async listTasks(t,n){return this.request({method:\"tasks/list\",params:t},no,n)}async cancelTask(t,n){return this.request({method:\"tasks/cancel\",params:t},Gp,n)}async notification(t,n){if(!this._transport)throw new Error(\"Not connected\");this.assertNotificationCapability(t.method);const o=n?.relatedTask?.taskId;if(o){const a={...t,jsonrpc:\"2.0\",params:{...t.params,_meta:{...t.params?._meta||{},[ge]:n.relatedTask}}};await this._enqueueTaskMessage(o,{type:\"notification\",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:\"2.0\"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ge]:n.relatedTask}}}),this._transport?.send(a,n).catch(c=>this._onerror(c))});return}let i={...t,jsonrpc:\"2.0\"};n?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ge]:n.relatedTask}}}),await this._transport.send(i,n)}setRequestHandler(t,n){const o=Ao(t);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(r,s)=>{const i=jo(t,r);return Promise.resolve(n(i,s))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){const o=Ao(t);this._notificationHandlers.set(o,r=>{const s=jo(t,r);return Promise.resolve(n(s))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error(\"Cannot enqueue task message: taskStore and taskMessageQueue are not configured\");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,o,r)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const o=await this._taskMessageQueue.dequeueAll(t,n);for(const r of o)if(r.type===\"request\"&&Oo(r.message)){const s=r.message.id,i=this._requestResolvers.get(s);i?(i(new T(P.InternalError,\"Task cancelled or completed\")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){let o=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(t);r?.pollInterval&&(o=r.pollInterval)}catch{}return new Promise((r,s)=>{if(n.aborted){s(new T(P.InvalidRequest,\"Request cancelled\"));return}const i=setTimeout(r,o);n.addEventListener(\"abort\",()=>{clearTimeout(i),s(new T(P.InvalidRequest,\"Request cancelled\"))},{once:!0})})}requestTaskStore(t,n){const o=this._taskStore;if(!o)throw new Error(\"No task store configured\");return{createTask:async r=>{if(!t)throw new Error(\"No request provided\");return await o.createTask(r,t.id,{method:t.method,params:t.params},n)},getTask:async r=>{const s=await o.getTask(r,n);if(!s)throw new T(P.InvalidParams,\"Failed to retrieve task: Task not found\");return s},storeTaskResult:async(r,s,i)=>{await o.storeTaskResult(r,s,i,n);const a=await o.getTask(r,n);if(a){const c=yt.parse({method:\"notifications/tasks/status\",params:a});await this.notification(c),me(a.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>o.getTaskResult(r,n),updateTaskStatus:async(r,s,i)=>{const a=await o.getTask(r,n);if(!a)throw new T(P.InvalidParams,`Task \"${r}\" not found - it may have been cleaned up`);if(me(a.status))throw new T(P.InvalidParams,`Cannot update task \"${r}\" from terminal status \"${a.status}\" to \"${s}\". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(r,s,i,n);const c=await o.getTask(r,n);if(c){const u=yt.parse({method:\"notifications/tasks/status\",params:c});await this.notification(u),me(c.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>o.listTasks(r,n)}}}function Mo(e){return e!==null&&typeof e==\"object\"&&!Array.isArray(e)}function mh(e,t){const n={...e};for(const o in t){const r=o,s=t[r];if(s===void 0)continue;const i=n[r];Mo(i)&&Mo(s)?n[r]={...i,...s}:n[r]=s}return n}(e=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(e,{get:(t,n)=>(typeof require<\"u\"?require:t)[n]}):e)(function(e){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+e+'\" is not supported')});class gh extends hh{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(t,n){}_ensureEventSlot(t){let n=this._eventSlots.get(t);if(!n){let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);n={listeners:[]},this._eventSlots.set(t,n);let r=o.shape.method.value;this._registeredMethods.add(r);let s=n;super.setNotificationHandler(o,i=>{let a=i.params;this.onEventDispatch(t,a),s.onHandler?.(a);for(let c of[...s.listeners])c(a)})}return n}setEventHandler(t,n){let o=this._ensureEventSlot(t);o.onHandler&&n&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener(\"${String(t)}\", …) to add multiple listeners without replacing.`),o.onHandler=n}getEventHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,n){this._ensureEventSlot(t).listeners.push(n)}removeEventListener(t,n){let o=this._eventSlots.get(t);if(!o)return;let r=o.listeners.indexOf(n);r!==-1&&o.listeners.splice(r,1)}setRequestHandler=(t,n)=>{this._assertMethodNotRegistered(t,\"setRequestHandler\"),super.setRequestHandler(t,n)};setNotificationHandler=(t,n)=>{this._assertMethodNotRegistered(t,\"setNotificationHandler\"),super.setNotificationHandler(t,n)};warnIfRequestHandlerReplaced(t,n,o){n&&o&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(t,n)=>{let o=t.shape.method.value;this._registeredMethods.add(o),super.setRequestHandler(t,n)};_assertMethodNotRegistered(t,n){let o=t.shape.method.value;if(this._registeredMethods.has(o))throw Error(`Handler for \"${o}\" already registered (via ${n}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(o)}}var _h=\"2026-01-26\",bh=\"ui/notifications/tool-input-partial\";class vh{eventTarget;eventSource;messageListener;constructor(t=window.parent,n){this.eventTarget=t,this.eventSource=n,this.messageListener=o=>{if(n&&o.source!==this.eventSource){console.debug(\"Ignoring message from unknown source\",o);return}let r=Rp.safeParse(o.data);r.success?(console.debug(\"Parsed message\",r.data),this.onmessage?.(r.data)):o.data?.jsonrpc!==\"2.0\"?console.debug(\"Ignoring non-JSON-RPC message\",r.error.message,o):(console.error(\"Failed to parse message\",r.error.message,o),this.onerror?.(Error(\"Invalid JSON-RPC message received: \"+r.error.message)))}}async start(){window.addEventListener(\"message\",this.messageListener)}async send(t,n){t.method!==bh&&console.debug(\"Sending message\",t),this.eventTarget.postMessage(t,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var yh=z([p(\"light\"),p(\"dark\")]).describe(\"Color theme preference for the host environment.\"),qe=z([p(\"inline\"),p(\"fullscreen\"),p(\"pip\")]).describe(\"Display mode for UI presentation.\"),wh=z([p(\"--color-background-primary\"),p(\"--color-background-secondary\"),p(\"--color-background-tertiary\"),p(\"--color-background-inverse\"),p(\"--color-background-ghost\"),p(\"--color-background-info\"),p(\"--color-background-danger\"),p(\"--color-background-success\"),p(\"--color-background-warning\"),p(\"--color-background-disabled\"),p(\"--color-text-primary\"),p(\"--color-text-secondary\"),p(\"--color-text-tertiary\"),p(\"--color-text-inverse\"),p(\"--color-text-ghost\"),p(\"--color-text-info\"),p(\"--color-text-danger\"),p(\"--color-text-success\"),p(\"--color-text-warning\"),p(\"--color-text-disabled\"),p(\"--color-border-primary\"),p(\"--color-border-secondary\"),p(\"--color-border-tertiary\"),p(\"--color-border-inverse\"),p(\"--color-border-ghost\"),p(\"--color-border-info\"),p(\"--color-border-danger\"),p(\"--color-border-success\"),p(\"--color-border-warning\"),p(\"--color-border-disabled\"),p(\"--color-ring-primary\"),p(\"--color-ring-secondary\"),p(\"--color-ring-inverse\"),p(\"--color-ring-info\"),p(\"--color-ring-danger\"),p(\"--color-ring-success\"),p(\"--color-ring-warning\"),p(\"--font-sans\"),p(\"--font-mono\"),p(\"--font-weight-normal\"),p(\"--font-weight-medium\"),p(\"--font-weight-semibold\"),p(\"--font-weight-bold\"),p(\"--font-text-xs-size\"),p(\"--font-text-sm-size\"),p(\"--font-text-md-size\"),p(\"--font-text-lg-size\"),p(\"--font-heading-xs-size\"),p(\"--font-heading-sm-size\"),p(\"--font-heading-md-size\"),p(\"--font-heading-lg-size\"),p(\"--font-heading-xl-size\"),p(\"--font-heading-2xl-size\"),p(\"--font-heading-3xl-size\"),p(\"--font-text-xs-line-height\"),p(\"--font-text-sm-line-height\"),p(\"--font-text-md-line-height\"),p(\"--font-text-lg-line-height\"),p(\"--font-heading-xs-line-height\"),p(\"--font-heading-sm-line-height\"),p(\"--font-heading-md-line-height\"),p(\"--font-heading-lg-line-height\"),p(\"--font-heading-xl-line-height\"),p(\"--font-heading-2xl-line-height\"),p(\"--font-heading-3xl-line-height\"),p(\"--border-radius-xs\"),p(\"--border-radius-sm\"),p(\"--border-radius-md\"),p(\"--border-radius-lg\"),p(\"--border-radius-xl\"),p(\"--border-radius-full\"),p(\"--border-width-regular\"),p(\"--shadow-hairline\"),p(\"--shadow-sm\"),p(\"--shadow-md\"),p(\"--shadow-lg\")]).describe(\"CSS variable keys available to MCP apps for theming.\"),kh=$(wh.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),z([d(),_t()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`);h({method:p(\"ui/open-link\"),params:h({url:d().describe(\"URL to open in the host's browser\")})});var Sh=h({isError:Z().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),zh=h({isError:Z().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),$h=h({isError:Z().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough();h({method:p(\"ui/notifications/sandbox-proxy-ready\"),params:h({})});var lo=h({connectDomains:v(d()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:v(d()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:v(d()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:v(d()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),po=h({camera:h({}).optional().describe(\"Request camera access.\\n\\nMaps to Permission Policy `camera` feature.\"),microphone:h({}).optional().describe(\"Request microphone access.\\n\\nMaps to Permission Policy `microphone` feature.\"),geolocation:h({}).optional().describe(\"Request geolocation access.\\n\\nMaps to Permission Policy `geolocation` feature.\"),clipboardWrite:h({}).optional().describe(\"Request clipboard write access.\\n\\nMaps to Permission Policy `clipboard-write` feature.\")});h({method:p(\"ui/notifications/size-changed\"),params:h({width:w().optional().describe(\"New width in pixels.\"),height:w().optional().describe(\"New height in pixels.\")})});var Th=h({method:p(\"ui/notifications/tool-input\"),params:h({arguments:$(d(),E().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),Eh=h({method:p(\"ui/notifications/tool-input-partial\"),params:h({arguments:$(d(),E().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),Ph=h({method:p(\"ui/notifications/tool-cancelled\"),params:h({reason:d().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),Zh=h({fonts:d().optional()}),Ih=h({variables:kh.optional().describe(\"CSS variables for theming the app.\"),css:Zh.optional().describe(\"CSS blocks that apps can inject.\")}),xh=h({method:p(\"ui/resource-teardown\"),params:h({})});$(d(),E());var qo=h({text:h({}).optional().describe(\"Host supports text content blocks.\"),image:h({}).optional().describe(\"Host supports image content blocks.\"),audio:h({}).optional().describe(\"Host supports audio content blocks.\"),resource:h({}).optional().describe(\"Host supports resource content blocks.\"),resourceLink:h({}).optional().describe(\"Host supports resource link content blocks.\"),structuredContent:h({}).optional().describe(\"Host supports structured content.\")});h({method:p(\"ui/notifications/request-teardown\"),params:h({}).optional()});var Rh=h({experimental:$(d(),$(d(),jn()).describe(\"Experimental features keyed by identifier.\")).optional().describe(\"Experimental features keyed by identifier.\"),openLinks:h({}).optional().describe(\"Host supports opening external URLs.\"),downloadFile:h({}).optional().describe(\"Host supports file downloads via ui/download-file.\"),serverTools:h({listChanged:Z().optional().describe(\"Host supports tools/list_changed notifications.\")}).optional().describe(\"Host can proxy tool calls to the MCP server.\"),serverResources:h({listChanged:Z().optional().describe(\"Host supports resources/list_changed notifications.\")}).optional().describe(\"Host can proxy resource reads to the MCP server.\"),logging:h({}).optional().describe(\"Host accepts log messages.\"),sandbox:h({permissions:po.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:lo.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:qo.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:qo.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\"),sampling:h({tools:h({}).optional().describe(\"Host supports tool use via `tools` and `toolChoice` parameters.\")}).optional().describe(\"Host supports LLM sampling (sampling/createMessage) from the view.\\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.\")}),Ch=h({experimental:$(d(),$(d(),jn()).describe(\"Experimental features keyed by identifier.\")).optional().describe(\"Experimental features keyed by identifier.\"),tools:h({listChanged:Z().optional().describe(\"App supports tools/list_changed notifications.\")}).optional().describe(\"App exposes MCP-style tools that the host can call.\"),availableDisplayModes:v(qe).optional().describe(\"Display modes the app supports.\")});h({method:p(\"ui/notifications/initialized\"),params:h({}).optional()});h({csp:lo.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:po.optional().describe(\"Sandbox permissions requested by the UI resource.\"),domain:d().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Z().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)});h({method:p(\"ui/request-display-mode\"),params:h({mode:qe.describe(\"The display mode being requested.\")})});var Nh=h({mode:qe.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),Oh=z([p(\"model\"),p(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\");h({resourceUri:d().optional(),visibility:v(Oh).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`),csp:je().optional(),permissions:je().optional()});h({mimeTypes:v(d()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')});h({method:p(\"ui/download-file\"),params:h({contents:v(z([za,$a])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})});h({method:p(\"ui/message\"),params:h({role:p(\"user\").describe('Message role, currently only \"user\" is supported.'),content:v(Ye).describe(\"Message content blocks (text, image, etc.).\")})});h({method:p(\"ui/notifications/sandbox-resource-ready\"),params:h({html:d().describe(\"HTML content to load into the inner iframe.\"),sandbox:d().optional().describe(\"Optional override for the inner iframe's sandbox attribute.\"),csp:lo.optional().describe(\"CSP configuration from resource metadata.\"),permissions:po.optional().describe(\"Sandbox permissions from resource metadata.\")})});var Ah=h({method:p(\"ui/notifications/tool-result\"),params:Ut.describe(\"Standard MCP tool execution result.\")}),xa=h({toolInfo:h({id:Be.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:uo.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:yh.optional().describe(\"Current color theme preference.\"),styles:Ih.optional().describe(\"Style configuration for theming the app.\"),displayMode:qe.optional().describe(\"How the UI is currently displayed.\"),availableDisplayModes:v(qe).optional().describe(\"Display modes the host supports.\"),containerDimensions:z([h({height:w().describe(\"Fixed container height in pixels.\")}),h({maxHeight:z([w(),_t()]).optional().describe(\"Maximum container height in pixels.\")})]).and(z([h({width:w().describe(\"Fixed container width in pixels.\")}),h({maxWidth:z([w(),_t()]).optional().describe(\"Maximum container width in pixels.\")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:d().optional().describe(\"User's language and region preference in BCP 47 format.\"),timeZone:d().optional().describe(\"User's timezone in IANA format.\"),userAgent:d().optional().describe(\"Host application identifier.\"),platform:z([p(\"web\"),p(\"desktop\"),p(\"mobile\")]).optional().describe(\"Platform type for responsive design decisions.\"),deviceCapabilities:h({touch:Z().optional().describe(\"Whether the device supports touch input.\"),hover:Z().optional().describe(\"Whether the device supports hover interactions.\")}).optional().describe(\"Device input capabilities.\"),safeAreaInsets:h({top:w().describe(\"Top safe area inset in pixels.\"),right:w().describe(\"Right safe area inset in pixels.\"),bottom:w().describe(\"Bottom safe area inset in pixels.\"),left:w().describe(\"Left safe area inset in pixels.\")}).optional().describe(\"Mobile safe area boundaries in pixels.\")}).passthrough(),jh=h({method:p(\"ui/notifications/host-context-changed\"),params:xa.describe(\"Partial context update containing only changed fields.\")});h({method:p(\"ui/update-model-context\"),params:h({content:v(Ye).optional().describe(\"Context content blocks (text, image, etc.).\"),structuredContent:$(d(),E().describe(\"Structured content for machine-readable context data.\")).optional().describe(\"Structured content for machine-readable context data.\")})});h({method:p(\"ui/initialize\"),params:h({appInfo:Dt.describe(\"App identification (name and version).\"),appCapabilities:Ch.describe(\"Features and capabilities this app provides.\"),protocolVersion:d().describe(\"Protocol version this app supports.\")})});var Mh=h({protocolVersion:d().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:Dt.describe(\"Host application identification and version.\"),hostCapabilities:Rh.describe(\"Features and capabilities provided by the host.\"),hostContext:xa.describe(\"Rich context about the host environment.\")}).passthrough(),qh={target:\"draft-2020-12\"};async function Lo(e,t){let n=e[\"~standard\"];if(n.jsonSchema)return n.jsonSchema[t](qh);if(n.vendor===\"zod\"){let{z:o}=await Ma(()=>import(\"./index-BauBISYp.js\"),void 0);return o.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Do(e,t,n=\"\"){let o=await e[\"~standard\"].validate(t);if(o.issues){let r=o.issues.map(s=>{let i=s.path?.map(a=>typeof a==\"object\"?a.key:a).join(\".\");return i?`${i}: ${s.message}`:s.message}).join(\"; \");throw Error(n+r)}return o.value}function Lh(e){let t=document.documentElement;t.setAttribute(\"data-theme\",e),t.style.colorScheme=e}function Dh(e,t=document.documentElement){for(let[n,o]of Object.entries(e))o!==void 0&&t.style.setProperty(n,o)}class fo extends gh{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(t){if(this._initializedSent)return;let n=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(n);console.warn(`${n}. This will throw in a future release.`)}eventSchemas={toolinput:Th,toolinputpartial:Eh,toolresult:Ah,toolcancelled:Ph,hostcontextchanged:jh};static ONE_SHOT_EVENTS=new Set([\"toolinput\",\"toolinputpartial\",\"toolresult\",\"toolcancelled\"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!fo.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] \"${String(t)}\" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(t,n){n&&this._assertHandlerTiming(t),super.setEventHandler(t,n)}addEventListener(t,n){this._assertHandlerTiming(t),super.addEventListener(t,n)}onEventDispatch(t,n){t===\"hostcontextchanged\"&&(this._hostContext={...this._hostContext,...n})}constructor(t,n={},o={autoResize:!0}){super(o),this._appInfo=t,this._capabilities=n,this.options=o,o.allowUnsafeEval||G({jitless:!0}),this.setRequestHandler(Ht,r=>(console.log(\"Received ping:\",r.params),{})),this.setEventHandler(\"hostcontextchanged\",void 0)}registerCapabilities(t){if(this.transport)throw Error(\"Cannot register capabilities after transport is established\");this._capabilities=mh(this._capabilities,t)}registerTool(t,n,o){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let r=this,s=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},i=n.inputSchema!==void 0,a={title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,annotations:n.annotations,_meta:n._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(c){Object.assign(this,c),s()},remove(){r._registeredTools[t]===a&&(delete r._registeredTools[t],s())},handler:async(c,u)=>{if(!a.enabled)throw Error(`Tool ${t} is disabled`);let f;if(i){let g=a.inputSchema,_=g?await Do(g,c??{},`Invalid input for tool ${t}: `):c??{};f=await o(_,u)}else f=await o(u);return a.outputSchema&&!f.isError&&(f.structuredContent=await Do(a.outputSchema,f.structuredContent,`Invalid output for tool ${t}: `)),f}};return this._registeredTools[t]=a,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),a}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,n)=>{let o=this._registeredTools[t.name];if(!o)throw Error(`Tool ${t.name} not found`);return o.handler(t.arguments,n)},this.onlisttools=async(t,n)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([o,r])=>r.enabled).map(async([o,r])=>{let s={name:o,title:r.title,description:r.description,inputSchema:r.inputSchema?await Lo(r.inputSchema,\"input\"):{type:\"object\",properties:{}}};return r.outputSchema&&(s.outputSchema=await Lo(r.outputSchema,\"output\")),r.annotations&&(s.annotations=r.annotations),r._meta&&(s._meta=r._meta),s}))}))}async sendToolListChanged(t={}){this._assertInitialized(\"sendToolListChanged\"),await this.notification({method:\"notifications/tools/list_changed\",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(\"toolinput\")}set ontoolinput(t){this.setEventHandler(\"toolinput\",t)}get ontoolinputpartial(){return this.getEventHandler(\"toolinputpartial\")}set ontoolinputpartial(t){this.setEventHandler(\"toolinputpartial\",t)}get ontoolresult(){return this.getEventHandler(\"toolresult\")}set ontoolresult(t){this.setEventHandler(\"toolresult\",t)}get ontoolcancelled(){return this.getEventHandler(\"toolcancelled\")}set ontoolcancelled(t){this.setEventHandler(\"toolcancelled\",t)}get onhostcontextchanged(){return this.getEventHandler(\"hostcontextchanged\")}set onhostcontextchanged(t){this.setEventHandler(\"hostcontextchanged\",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced(\"onteardown\",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler(xh,(n,o)=>{if(!this._onteardown)throw Error(\"No onteardown handler set\");return this._onteardown(n.params,o)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced(\"oncalltool\",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler(Ea,(n,o)=>{if(!this._oncalltool)throw Error(\"No oncalltool handler set\");return this._oncalltool(n.params,o)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced(\"onlisttools\",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler(Ta,(n,o)=>{if(!this._onlisttools)throw Error(\"No onlisttools handler set\");return this._onlisttools(n.params,o)})}assertCapabilityForMethod(t){switch(t){case\"sampling/createMessage\":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case\"tools/call\":case\"tools/list\":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;case\"ping\":case\"ui/resource-teardown\":return;default:throw Error(`No handler for method ${t} registered`)}}assertNotificationCapability(t){}assertTaskCapability(t){throw Error(\"Tasks are not supported in MCP Apps\")}assertTaskHandlerCapability(t){throw Error(\"Task handlers are not supported in MCP Apps\")}async callServerTool(t,n){if(this._assertInitialized(\"callServerTool\"),typeof t==\"string\")throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${t}\"). Did you mean: callServerTool({ name: \"${t}\", arguments: { ... } })?`);return await this.request({method:\"tools/call\",params:t},Ut,{onprogress:()=>{},resetTimeoutOnProgress:!0,...n})}async readServerResource(t,n){return this._assertInitialized(\"readServerResource\"),await this.request({method:\"resources/read\",params:t},Sa,n)}async listServerResources(t,n){return this._assertInitialized(\"listServerResources\"),await this.request({method:\"resources/list\",params:t},ka,n)}async createSamplingMessage(t,n){this._assertInitialized(\"createSamplingMessage\");let o=t.tools?Ia:Za;return await this.request({method:\"sampling/createMessage\",params:t},o,n)}sendMessage(t,n){return this._assertInitialized(\"sendMessage\"),this.request({method:\"ui/message\",params:t},$h,n)}sendLog(t){return this.notification({method:\"notifications/message\",params:t})}updateModelContext(t,n){return this._assertInitialized(\"updateModelContext\"),this.request({method:\"ui/update-model-context\",params:t},Kn,n)}openLink(t,n){return this._assertInitialized(\"openLink\"),this.request({method:\"ui/open-link\",params:t},Sh,n)}sendOpenLink=this.openLink;downloadFile(t,n){return this._assertInitialized(\"downloadFile\"),this.request({method:\"ui/download-file\",params:t},zh,n)}requestTeardown(t={}){return this.notification({method:\"ui/notifications/request-teardown\",params:t})}requestDisplayMode(t,n){return this._assertInitialized(\"requestDisplayMode\"),this.request({method:\"ui/request-display-mode\",params:t},Nh,n)}sendSizeChanged(t){return this.notification({method:\"ui/notifications/size-changed\",params:t})}setupSizeChangedNotifications(){let t=!1,n=0,o=0,r=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let i=document.documentElement,a=i.style.height;i.style.height=\"max-content\";let c=Math.ceil(i.getBoundingClientRect().height);i.style.height=a;let u=Math.ceil(window.innerWidth);(u!==n||c!==o)&&(n=u,o=c,this.sendSizeChanged({width:u,height:c}))}))};r();let s=new ResizeObserver(r);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new vh(window.parent,window.parent),n){if(this.transport)throw Error(\"App is already connected. Call close() before connecting again.\");this._initializedSent=!1,await super.connect(t);try{let o=await this.request({method:\"ui/initialize\",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:_h}},Mh,n);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:\"ui/notifications/initialized\"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}function pe(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}function Hh(e){const t=e.content;return Array.isArray(t)?t.filter(n=>pe(n)&&typeof n.text==\"string\").map(n=>n.text).join(`\n`):\"\"}function Ra(e){if(!pe(e))return{structuredContent:null,source:\"missing\",text:\"\",isError:!1};const t=e.structuredContent,n=t!=null;return{structuredContent:n?t:null,source:n?\"toolresult\":\"missing\",text:Hh(e),isError:e.isError===!0}}function Uh(e){if(!pe(e))return null;const t=e.openai;if(!pe(t))return null;const n=t.toolOutput;return n===void 0?null:n}function Fh(e,t=globalThis){const n=Ra(e);if(n.source===\"toolresult\"||n.isError)return n;const o=Uh(t);return o===null?n:{...n,structuredContent:o,source:\"host-global\"}}function Ho(e){if(!pe(e))return;const t=e.theme;(t===\"light\"||t===\"dark\")&&Lh(t);const n=e.styles;pe(n)&&pe(n.variables)&&Dh(n.variables)}function Uo(e){return pe(e)&&e.isError===!0}async function Jh(e,t=new fo({name:\"ris-mcp-trefferliste\",version:\"1.0.0\"})){return t.addEventListener(\"toolresult\",n=>{e.onToolResult(Fh(n))}),t.addEventListener(\"hostcontextchanged\",Ho),await t.connect(),Ho(t.getHostContext()),{async callTool(n){return Ra(await t.callServerTool(n))},async openLink(n){try{return!Uo(await t.openLink({url:n}))}catch{return!1}},async sendPrompt(n){try{return!Uo(await t.sendMessage({role:\"user\",content:[{type:\"text\",text:n}]}))}catch{return!1}}}}const K={loading:\"Suche läuft …\",emptyTitle:\"Keine Treffer\",emptyDetail:\"Die Suche hat keine Dokumente geliefert. Andere Suchworte könnten helfen.\",degradedTitle:\"Keine strukturierten Daten erhalten.\",invalidPayloadTitle:\"Unerwartete Daten erhalten.\",toolErrorTitle:\"Die Suche ist fehlgeschlagen.\",connectFailedTitle:\"Die Trefferliste konnte nicht geladen werden.\",answerInChat:\"Die vollständige Antwort steht im Chat.\",pageUnchanged:\"Die angezeigte Seite bleibt unverändert.\",sessionExpired:\"Verbindung abgelaufen — Suche im Chat erneut ausführen.\",linkRefused:\"Der Link konnte nicht geöffnet werden.\",promptRefused:\"Die Nachricht konnte nicht gesendet werden.\"};function le(e,t,n){const o=document.createElement(e);return o.className=t,n!==void 0&&(o.textContent=n),o}function Ca(e=3){const t=le(\"div\",\"ris-skeleton\");t.setAttribute(\"role\",\"status\"),t.setAttribute(\"aria-busy\",\"true\"),t.append(le(\"p\",\"ris-skeleton-label\",K.loading));for(let n=0;n<e;n+=1){const o=le(\"div\",\"ris-skeleton-row\");o.setAttribute(\"aria-hidden\",\"true\"),o.append(le(\"span\",\"ris-skeleton-line ris-skeleton-line-title\")),o.append(le(\"span\",\"ris-skeleton-line ris-skeleton-line-meta\")),t.append(o)}return t}function Se(e,t,n){const o=le(\"div\",`ris-notice ris-notice-${e}`);return o.setAttribute(\"role\",e===\"error\"?\"alert\":\"status\"),o.append(le(\"p\",\"ris-notice-title\",t)),n&&o.append(le(\"p\",\"ris-notice-detail\",n)),o}const Bh={ris_bundesrecht:\"Bundesrecht\",ris_landesrecht:\"Landesrecht\",ris_judikatur:\"Judikatur\",ris_bundesgesetzblatt:\"Bundesgesetzblatt\",ris_landesgesetzblatt:\"Landesgesetzblatt\",ris_regierungsvorlagen:\"Regierungsvorlagen\",ris_bezirke:\"Bezirksverwaltung\",ris_gemeinden:\"Gemeinderecht\",ris_sonstige:\"Sonstige\",ris_history:\"Änderungshistorie\",ris_verordnungen:\"Verordnungen\"},Vh={BrKons:\"Bundesrecht\",LrKons:\"Landesrecht\",Erv:\"Engl. Übersetzung\",Justiz:\"Justiz\",Vwgh:\"VwGH\",Vfgh:\"VfGH\",Bvwg:\"BVwG\",Lvwg:\"LVwG\",BgblAuth:\"BGBl. authentisch\",BgblAlt:\"BGBl. 1945–2003\",BgblPdf:\"BGBl. PDF\",LgblAuth:\"LGBl. authentisch\",Lgbl:\"LGBl.\",RegV:\"Regierungsvorlage\"},Kh=[\"suchworte\",\"titel\",\"paragraph\",\"geschaeftszahl\",\"dokumentnummer\"],Ft=\"seite\";function st(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}function at(e){return typeof e==\"number\"&&Number.isFinite(e)}function V(e){return typeof e==\"string\"?e.trim():\"\"}function it(e){return Math.trunc(e).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g,\".\")}function Jt(e){const t=/^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(e);return t?`${t[3]}.${t[2]}.${t[1]}`:e}function Wh(e){return V(e).split(\";\").map(t=>t.trim()).filter(t=>t.length>0)}function Gh(e){return`Bitte lade das Dokument ${e} mit ris_dokument.`}function Qh(e){if(!st(e))return null;const{total_hits:t,page:n,page_size:o,has_more:r,documents:s}=e;return!at(t)||!at(n)||!at(o)||typeof r!=\"boolean\"||!Array.isArray(s)?null:s.every(a=>st(a)&&typeof a.dokumentnummer==\"string\"&&typeof a.applikation==\"string\"&&st(a.content_urls)&&st(a.citation))?e:null}function Yh(e){return Bh[e]??e.replace(/^ris_/,\"\")}function Xh(e){if(!e)return\"\";for(const t of Kh){const n=V(e[t]);if(n)return n}return\"\"}function em(e){const t=[],n=r=>r,o=(r,s,i=n)=>{const a=V(s);a&&t.push({label:r,value:i(a)})};return\"gericht\"in e?(o(\"Gericht\",e.gericht),o(\"Entscheidungsdatum\",e.entscheidungsdatum,Jt),o(\"Geschäftszahl\",e.geschaeftszahl),o(\"Rechtssatznummer\",e.rechtssatznummer)):(o(\"In Kraft seit\",e.citation.inkrafttreten,Jt),o(\"Außer Kraft seit\",e.citation.ausserkrafttreten,Jt)),o(\"Dokumentnummer\",e.dokumentnummer),t}function tm(e,t){if(\"gericht\"in e&&t.length>0)return t[0];const n=V(e.citation_display);return n&&n!==e.dokumentnummer?n:t[0]||V(e.titel)||V(e.kurztitel)||e.dokumentnummer}function nm(e,t){const n=V(e.kurztitel)||V(e.titel);return n===t||n===V(e.geschaeftszahl)?\"\":n}function om(e){const t=Wh(e.geschaeftszahl),n=tm(e,t);return{id:e.dokumentnummer,title:n,subtitle:nm(e,n),badge:Vh[e.applikation]??e.applikation,meta:em(e),caseNumbers:t,risUrl:V(e.content_urls.html)||V(e.dokument_url)||null,pdfUrl:V(e.content_urls.pdf)||null}}function Xt(e,t){if(!e)return null;const n=V(e.tool);if(!n)return null;const r=(at(e[Ft])?e[Ft]:1)+t;if(r<1)return null;const{tool:s,...i}=e;return{name:n,arguments:{...i,[Ft]:r}}}function rm(e){const t=e.documents.map(om),n=Math.max(0,e.page-1)*Math.max(0,e.page_size)+1,o=n+t.length-1;return{toolLabel:e.query?Yh(V(e.query.tool)):\"\",queryLabel:Xh(e.query),hitsLabel:`${it(e.total_hits)} Treffer`,rangeLabel:t.length===0?\"\":`${it(n)}–${it(o)} von ${it(e.total_hits)}`,isEmpty:t.length===0,hasPrev:Xt(e.query,-1)!==null,hasNext:e.has_more&&Xt(e.query,1)!==null,rows:t}}function D(e,t,n){const o=document.createElement(e);return t&&(o.className=t),n!==void 0&&(o.textContent=n),o}function Ce(e,t,n){const o=document.createElement(\"button\");return o.type=\"button\",o.className=e,o.textContent=t,o.addEventListener(\"click\",n),o}function sm(e,t){const n=t===\"mount\"?K.answerInChat:K.pageUnchanged;if(e.isError)return{kind:\"notice\",node:Se(\"error\",K.toolErrorTitle,e.text)};if(e.source===\"missing\")return{kind:\"notice\",node:Se(\"info\",K.degradedTitle,n)};const o=Qh(e.structuredContent);return o?{kind:\"result\",result:o}:{kind:\"notice\",node:Se(\"info\",K.invalidPayloadTitle,n)}}function im(e){const t=D(\"header\",\"ris-header\");return e.toolLabel&&t.append(D(\"span\",\"ris-tool-badge\",e.toolLabel)),e.queryLabel&&t.append(D(\"span\",\"ris-query\",e.queryLabel)),t.append(D(\"span\",\"ris-hits\",e.hitsLabel)),t}function am(e){const t=D(\"dl\",\"ris-meta\");for(const n of e.meta)t.append(D(\"dt\",void 0,n.label)),t.append(D(\"dd\",void 0,n.value));return t}function cm(e,t){const n=D(\"div\",\"ris-actions\");return e.risUrl&&n.append(Ce(\"ris-action\",\"Im RIS öffnen\",()=>t.onOpen(e))),e.pdfUrl&&n.append(Ce(\"ris-action\",\"PDF\",()=>t.onPdf(e))),n.append(Ce(\"ris-action\",\"Volltext in den Chat\",()=>t.onFullText(e))),n}function um(e,t,n){const o=D(\"li\",\"ris-row\"),r=`ris-detail-${t}`,s=document.createElement(\"button\");s.type=\"button\",s.className=\"ris-row-toggle\",s.setAttribute(\"aria-expanded\",\"false\"),s.setAttribute(\"aria-controls\",r);const i=D(\"span\",\"ris-row-heading\");i.append(D(\"span\",\"ris-row-title\",e.title)),e.caseNumbers.length>1&&i.append(D(\"span\",\"ris-row-more\",`+${e.caseNumbers.length-1} weitere`)),s.append(i),e.subtitle&&s.append(D(\"span\",\"ris-row-subtitle\",e.subtitle)),s.append(D(\"span\",\"ris-row-badge\",e.badge));const a=D(\"div\",\"ris-row-detail\");return a.id=r,a.hidden=!0,a.append(am(e),cm(e,n)),s.addEventListener(\"click\",()=>{const c=s.getAttribute(\"aria-expanded\")===\"true\";s.setAttribute(\"aria-expanded\",String(!c)),a.hidden=c}),o.append(s,a),o}function lm(e,t){const n=D(\"footer\",\"ris-footer\"),o=Ce(\"ris-page ris-page-prev\",\"‹ Zurück\",()=>t.onPage(-1));o.setAttribute(\"aria-label\",\"Vorherige Seite\"),o.disabled=!e.hasPrev;const r=Ce(\"ris-page ris-page-next\",\"Weiter ›\",()=>t.onPage(1));return r.setAttribute(\"aria-label\",\"Nächste Seite\"),r.disabled=!e.hasNext,n.append(o,D(\"span\",\"ris-range\",e.rangeLabel),r),n}function dm(e,t,n){const o=im(t);if(t.isEmpty){e.replaceChildren(o,Se(\"info\",K.emptyTitle,K.emptyDetail));return}const r=D(\"ul\",\"ris-rows\");t.rows.forEach((s,i)=>r.append(um(s,i,n))),e.replaceChildren(o,r,lm(t,n))}function pm(e,t){const n=e.querySelector(t===1?\".ris-page-next\":\".ris-page-prev\");if(n&&!n.disabled){n.focus();return}e.querySelector(\".ris-page:not(:disabled)\")?.focus()}function ho(e){const t=document.getElementById(e);if(!t)throw new Error(`Trefferliste: #${e} fehlt im HTML-Shell`);return t}const fm=ho(\"nojs-marker\"),Pe=ho(\"ris-view\"),kt=ho(\"ris-status\");let fe=null,ve=null,Bt=!1;function mo(e,t,n,o){const r=Se(e,n,o);r.dataset.source=t,kt.replaceChildren(r)}function Le(e){const t=kt.firstElementChild;e&&t instanceof HTMLElement&&t.dataset.source!==e||kt.replaceChildren()}function en(){fe&&dm(Pe,rm(fe),_m)}function hm(e,t){if(e.kind===\"result\"){fe=e.result,Le(),en();return}if(t&&fe){en(),kt.replaceChildren(e.node);return}Le(),Pe.replaceChildren(e.node)}async function Fo(e){!e||!ve||(await ve.openLink(e)?Le(\"link\"):mo(\"error\",\"link\",K.linkRefused))}async function mm(e){ve&&(await ve.sendPrompt(Gh(e))?Le(\"prompt\"):mo(\"error\",\"prompt\",K.promptRefused))}async function gm(e){const t=Xt(fe?.query,e);if(!(!t||!ve||Bt)){Bt=!0,Le(),Pe.replaceChildren(Ca(fe?.documents.length));try{Na(await ve.callTool(t))}catch{en(),mo(\"error\",\"pagination\",K.sessionExpired)}finally{Bt=!1,pm(Pe,e)}}}const _m={onOpen:e=>{Fo(e.risUrl)},onPdf:e=>{Fo(e.pdfUrl)},onFullText:e=>{mm(e.id)},onPage:e=>{gm(e)}};function Na(e){const t=fe!==null;hm(sm(e,t?\"follow-up\":\"mount\"),t)}fm.hidden=!0;Pe.replaceChildren(Ca());Jh({onToolResult:Na}).then(e=>{ve=e}).catch(()=>{fe||Pe.replaceChildren(Se(\"error\",K.connectFailedTitle,K.answerInChat))});export{Cu as $,es as A,Jc as B,Dc as C,Mc as D,Qc as E,Hc as F,qc as G,Oc as H,Ac as I,Yc as J,Gc as K,Fc as L,Lc as M,Kc as N,xt as O,Bc as P,ls as Q,dl as R,Eu as S,ju as T,Xu as U,Hu as V,zu as W,ou as X,su as Y,tn as Z,Vu as _,x as a,Es as a$,ur as a0,Qu as a1,Wu as a2,cl as a3,tu as a4,gu as a5,_u as a6,fu as a7,pu as a8,mu as a9,Bu as aA,Rt as aB,R as aC,nl as aD,Iu as aE,al as aF,Gu as aG,cs as aH,y as aI,uu as aJ,ru as aK,nu as aL,xu as aM,an as aN,Nu as aO,Au as aP,lu as aQ,Du as aR,ym as aS,l as aT,Cm as aU,Rm as aV,Xc as aW,vm as aX,Om as aY,Cl as aZ,Ql as a_,hu as aa,Uu as ab,Tu as ac,du as ad,ll as ae,Ku as af,bu as ag,Ju as ah,rl as ai,iu as aj,Ou as ak,tl as al,Ru as am,Yu as an,os as ao,Pu as ap,qu as aq,Lu as ar,us as as,sl as at,el as au,ul as av,il as aw,Y as ax,Fu as ay,pl as az,Co as b,Dm as b$,Ps as b0,El as b1,Tl as b2,cg as b3,nd as b4,$s as b5,Ts as b6,Mm as b7,jm as b8,qm as b9,Pl as bA,Km as bB,Ss as bC,zs as bD,_l as bE,gl as bF,vl as bG,bl as bH,Is as bI,ks as bJ,pg as bK,Cs as bL,tg as bM,Ll as bN,Ne as bO,de as bP,ml as bQ,Qm as bR,Rs as bS,un as bT,Jl as bU,dt as bV,Ae as bW,Qt as bX,Ml as bY,_s as bZ,eg as b_,Am as ba,Nm as bb,bs as bc,vs as bd,Xl as be,jl as bf,pr as bg,hr as bh,sg as bi,Vm as bj,Zs as bk,ds as bl,gs as bm,dr as bn,fr as bo,Fl as bp,Xm as bq,Yl as br,kl as bs,Sl as bt,Oe as bu,re as bv,Gt as bw,Hl as bx,wl as by,zl as bz,Mu as c,od as c$,Ol as c0,Um as c1,ig as c2,Hm as c3,Bl as c4,Rl as c5,rg as c6,yl as c7,og as c8,Ze as c9,dg as cA,Kl as cB,Wl as cC,ng as cD,Vl as cE,Wm as cF,$l as cG,Zl as cH,ys as cI,xl as cJ,Jm as cK,Nl as cL,Dl as cM,cn as cN,ps as cO,fs as cP,hs as cQ,ms as cR,Al as cS,ws as cT,Bm as cU,ie as cV,G as cW,mt as cX,id as cY,$m as cZ,Em as c_,Et as ca,Pt as cb,ug as cc,Lm as cd,fg as ce,Fm as cf,lg as cg,Gm as ch,ed as ci,ql as cj,gr as ck,br as cl,mr as cm,_r as cn,Zt as co,It as cp,Ym as cq,xs as cr,Gl as cs,Ul as ct,hl as cu,Ct as cv,sd as cw,ag as cx,td as cy,Il as cz,ke as d,wi as d$,zm as d0,Tm as d1,ic as d2,ac as d3,Vt as d4,ae as d5,ns as d6,ku as d7,$u as d8,rd as d9,Pn as dA,Zn as dB,On as dC,Tn as dD,En as dE,vn as dF,yn as dG,ta as dH,Un as dI,qt as dJ,Fe as dK,Wi as dL,ji as dM,In as dN,gn as dO,_n as dP,Me as dQ,gg as dR,Bi as dS,Fi as dT,la as dU,gt as dV,zn as dW,$n as dX,vi as dY,bi as dZ,Si as d_,bo as da,vo as db,Sm as dc,Nc as dd,fl as de,Zm as df,xm as dg,Pm as dh,Im as di,lr as dj,uc as dk,cc as dl,hg as dm,km as dn,wm as dp,eu as dq,_g as dr,mg as ds,mn as dt,Rn as du,Cn as dv,Nn as dw,Ni as dx,Ii as dy,Oi as dz,ft as e,Id as e$,Mi as e0,xn as e1,Sn as e2,aa as e3,Ui as e4,Ti as e5,Di as e6,oa as e7,bn as e8,Ri as e9,Ci as eA,kn as eB,Ai as eC,hn as eD,Gi as eE,No as eF,jn as eG,v as eH,Hd as eI,Ud as eJ,ep as eK,Z as eL,na as eM,wp as eN,Ld as eO,Dd as eP,bp as eQ,Rd as eR,Cd as eS,da as eT,sp as eU,md as eV,_d as eW,kp as eX,Mn as eY,Fd as eZ,kd as e_,Dn as ea,Zi as eb,Ki as ec,Ie as ed,Ot as ee,Ln as ef,Hn as eg,Qi as eh,ua as ei,ra as ej,X as ek,Mt as el,Hi as em,C as en,ea as eo,Ei as ep,ia as eq,Ji as er,qi as es,k as et,wn as eu,Nt as ev,ce as ew,Pi as ex,At as ey,xi as ez,ht as f,fa as f$,hd as f0,gd as f1,B as f2,Vi as f3,hp as f4,Gd as f5,Qd as f6,Sd as f7,Wd as f8,Kd as f9,bt as fA,mp as fB,w as fC,h as fD,O as fE,ld as fF,dd as fG,up as fH,vt as fI,Yi as fJ,Fn as fK,yp as fL,sa as fM,$ as fN,pa as fO,vd as fP,wd as fQ,bd as fR,yd as fS,pd as fT,fd as fU,pp as fV,ap as fW,d as fX,Bd as fY,$p as fZ,gp as f_,Vd as fa,Zd as fb,zp as fc,Yt as fd,Yd as fe,tp as ff,jt as fg,jd as fh,qd as fi,Tp as fj,Jd as fk,ip as fl,Ad as fm,ca as fn,p as fo,J as fp,lp as fq,Md as fr,dp as fs,Sp as ft,_p as fu,xd as fv,fp as fw,je as fx,Xi as fy,An as fz,wu as g,op as g0,vp as g1,qn as g2,Li as g3,Xd as g4,np as g5,Nd as g6,_t as g7,z as g8,E as g9,Pd as ga,zd as gb,$d as gc,Td as gd,Ed as ge,rp as gf,Od as gg,cp as gh,Su as h,pt as i,Fa as j,ss as k,Zu as l,rs as m,vu as n,yu as o,Xa as p,au as q,cu as r,Wo as s,ol as t,A as u,jc as v,Wc as w,ts as x,Vc as y,Uc as z};</script>\n <style rel=\"stylesheet\" crossorigin>:root{color-scheme:light dark;--ris-bg: var(--color-background-primary, #ffffff);--ris-bg-raised: var(--color-background-secondary, #f7f7f8);--ris-bg-hover: var(--color-background-tertiary, #efeff1);--ris-fg: var(--color-text-primary, #18181b);--ris-fg-muted: var(--color-text-secondary, #52525b);--ris-fg-subtle: var(--color-text-tertiary, #71717a);--ris-border: var(--color-border-primary, #e0e0e3);--ris-border-strong: var(--color-border-secondary, #c8c8cd);--ris-ring: var(--color-ring-primary, #2563eb);--ris-danger-fg: var(--color-text-danger, #b42318);--ris-danger-bg: var(--color-background-danger, #fef3f2);--ris-danger-border: var(--color-border-danger, #f5c6c1);--ris-font: var( --font-sans, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif );--ris-font-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);--ris-text-xs: var(--font-text-xs-size, .75rem);--ris-text-sm: var(--font-text-sm-size, .8125rem);--ris-text-md: var(--font-text-md-size, .875rem);--ris-text-lg: var(--font-text-lg-size, 1rem);--ris-weight-medium: var(--font-weight-medium, 500);--ris-weight-semibold: var(--font-weight-semibold, 600);--ris-radius-sm: var(--border-radius-sm, 4px);--ris-radius-md: var(--border-radius-md, 8px);--ris-radius-full: var(--border-radius-full, 999px)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--ris-bg: var(--color-background-primary, #1b1b1f);--ris-bg-raised: var(--color-background-secondary, #242429);--ris-bg-hover: var(--color-background-tertiary, #2e2e34);--ris-fg: var(--color-text-primary, #ededf0);--ris-fg-muted: var(--color-text-secondary, #b4b4bb);--ris-fg-subtle: var(--color-text-tertiary, #8e8e96);--ris-border: var(--color-border-primary, #35353c);--ris-border-strong: var(--color-border-secondary, #4a4a53);--ris-ring: var(--color-ring-primary, #7aa2f7);--ris-danger-fg: var(--color-text-danger, #ff9c92);--ris-danger-bg: var(--color-background-danger, #3a1f1d);--ris-danger-border: var(--color-border-danger, #5c2f2b)}}:root[data-theme=dark]{color-scheme:dark;--ris-bg: var(--color-background-primary, #1b1b1f);--ris-bg-raised: var(--color-background-secondary, #242429);--ris-bg-hover: var(--color-background-tertiary, #2e2e34);--ris-fg: var(--color-text-primary, #ededf0);--ris-fg-muted: var(--color-text-secondary, #b4b4bb);--ris-fg-subtle: var(--color-text-tertiary, #8e8e96);--ris-border: var(--color-border-primary, #35353c);--ris-border-strong: var(--color-border-secondary, #4a4a53);--ris-ring: var(--color-ring-primary, #7aa2f7);--ris-danger-fg: var(--color-text-danger, #ff9c92);--ris-danger-bg: var(--color-background-danger, #3a1f1d);--ris-danger-border: var(--color-border-danger, #5c2f2b)}:root[data-theme=light]{color-scheme:light}body{margin:0;padding:12px;font-family:var(--ris-font);font-size:var(--ris-text-md);line-height:1.5;color:var(--ris-fg);background:var(--ris-bg);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;cursor:pointer}:focus-visible{outline:2px solid var(--ris-ring);outline-offset:2px;border-radius:var(--ris-radius-sm)}.ris-notice{padding:12px 14px;border:1px solid var(--ris-border);border-radius:var(--ris-radius-md);background:var(--ris-bg-raised)}.ris-notice-error{color:var(--ris-danger-fg);border-color:var(--ris-danger-border);background:var(--ris-danger-bg)}.ris-notice-title{margin:0;font-weight:var(--ris-weight-semibold)}.ris-notice-detail{margin:4px 0 0;font-size:var(--ris-text-sm);color:var(--ris-fg-muted);white-space:pre-wrap}.ris-notice-error .ris-notice-detail{color:inherit}.ris-skeleton-label{margin:0 0 10px;font-size:var(--ris-text-sm);color:var(--ris-fg-subtle)}.ris-skeleton-row{padding:12px 0;border-top:1px solid var(--ris-border)}.ris-skeleton-line{display:block;height:10px;border-radius:var(--ris-radius-sm);background:var(--ris-bg-hover)}.ris-skeleton-line-title{width:62%}.ris-skeleton-line-meta{width:38%;margin-top:8px;height:8px}@media(prefers-reduced-motion:no-preference){.ris-skeleton-line{animation:ris-pulse 1.4s ease-in-out infinite}}@keyframes ris-pulse{50%{opacity:.45}}.ris-header{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;padding-bottom:10px}.ris-tool-badge{padding:2px 8px;font-size:var(--ris-text-xs);font-weight:var(--ris-weight-semibold);color:var(--ris-fg-muted);background:var(--ris-bg-hover);border-radius:var(--ris-radius-full)}.ris-query{font-weight:var(--ris-weight-semibold);font-size:var(--ris-text-lg);overflow-wrap:anywhere}.ris-hits{margin-left:auto;font-size:var(--ris-text-sm);color:var(--ris-fg-subtle);white-space:nowrap}.ris-rows{margin:0;padding:0;list-style:none;border-top:1px solid var(--ris-border)}.ris-row{border-bottom:1px solid var(--ris-border)}.ris-row-toggle{display:grid;grid-template-columns:1fr auto auto;align-items:start;gap:4px 10px;width:100%;padding:10px 2px;text-align:left;background:none;border:0;border-radius:var(--ris-radius-sm)}.ris-row-toggle:hover{background:var(--ris-bg-hover)}.ris-row-heading{grid-column:1;display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;font-weight:var(--ris-weight-medium);overflow-wrap:anywhere}.ris-row-more{font-size:var(--ris-text-xs);font-weight:var(--font-weight-normal, 400);color:var(--ris-fg-subtle);white-space:nowrap}.ris-row-subtitle{grid-column:1;grid-row:2;font-size:var(--ris-text-sm);color:var(--ris-fg-muted);overflow-wrap:anywhere}.ris-row-badge{grid-column:2;grid-row:1;padding:1px 7px;font-size:var(--ris-text-xs);color:var(--ris-fg-muted);border:1px solid var(--ris-border-strong);border-radius:var(--ris-radius-full);white-space:nowrap}.ris-row-toggle:after{content:\"\";grid-column:3;grid-row:1;align-self:center;width:6px;height:6px;border-right:1.5px solid var(--ris-fg-subtle);border-bottom:1.5px solid var(--ris-fg-subtle);transform:rotate(45deg) translate(-2px,-2px)}.ris-row-toggle[aria-expanded=true]:after{transform:rotate(-135deg) translate(-2px,-2px)}.ris-row-detail{padding:2px 2px 14px}.ris-meta{display:grid;grid-template-columns:minmax(6rem,max-content) 1fr;gap:2px 12px;margin:0 0 12px;font-size:var(--ris-text-sm)}.ris-meta dt{color:var(--ris-fg-subtle)}.ris-meta dd{margin:0;overflow-wrap:anywhere}.ris-actions{display:flex;flex-wrap:wrap;gap:8px}.ris-action{padding:5px 11px;font-size:var(--ris-text-sm);font-weight:var(--ris-weight-medium);background:var(--ris-bg-raised);border:1px solid var(--ris-border-strong);border-radius:var(--ris-radius-md)}.ris-action:hover{background:var(--ris-bg-hover)}.ris-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:12px}.ris-page{padding:5px 11px;font-size:var(--ris-text-sm);background:var(--ris-bg-raised);border:1px solid var(--ris-border-strong);border-radius:var(--ris-radius-md)}.ris-page:hover:not(:disabled){background:var(--ris-bg-hover)}.ris-page:disabled{color:var(--color-text-disabled, var(--ris-fg-subtle));cursor:default;opacity:.55}.ris-range{font-size:var(--ris-text-sm);color:var(--ris-fg-subtle);white-space:nowrap}#ris-status:not(:empty){padding-top:12px}</style>\n </head>\n <body>\n <!--\n Visible only when the bundle never executes; main.ts hides it as its first\n act, so a still-visible marker means \"the script never ran\" rather than\n \"the widget mounted and found nothing\".\n -->\n <p id=\"nojs-marker\" class=\"ris-notice ris-notice-error\">\n Die Trefferliste konnte nicht geladen werden — die vollständige Antwort steht im Chat.\n </p>\n <main id=\"ris-view\"></main>\n <div id=\"ris-status\"></div>\n </body>\n</html>\n";
2
+ export const TREFFERLISTE_HTML = "<!doctype html>\n<html lang=\"de\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>RIS Trefferliste</title>\n <script type=\"module\" crossorigin>const Ha=(function(){const t=typeof document<\"u\"&&document.createElement(\"link\").relList;return t&&t.supports&&t.supports(\"modulepreload\")?\"modulepreload\":\"preload\"})(),Ua=function(e){return\"/\"+e},bo={},Fa=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(g=>({status:\"fulfilled\",value:g}),g=>({status:\"rejected\",reason:g}))))};document.getElementsByTagName(\"link\");const i=document.querySelector(\"meta[property=csp-nonce]\"),a=i?.nonce||i?.getAttribute(\"nonce\");r=c(n.map(u=>{if(u=Ua(u),u in bo)return;bo[u]=!0;const f=u.endsWith(\".css\"),g=f?'[rel=\"stylesheet\"]':\"\";if(document.querySelector(`link[href=\"${u}\"]${g}`))return;const _=document.createElement(\"link\");if(_.rel=f?\"stylesheet\":Ha,f||(_.as=\"script\"),_.crossOrigin=\"\",_.href=u,a&&_.setAttribute(\"nonce\",a),document.head.appendChild(_),f)return new Promise((b,Z)=>{_.addEventListener(\"load\",b),_.addEventListener(\"error\",()=>Z(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event(\"vite:preloadError\",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return r.then(i=>{for(const a of i||[])a.status===\"rejected\"&&s(a.reason);return t().catch(s)})},xm=Object.freeze({status:\"aborted\"});function l(e,t,n){function o(a,c){if(a._zod||Object.defineProperty(a,\"_zod\",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,f=Object.keys(u);for(let g=0;g<f.length;g++){const _=f[g];_ in a||(a[_]=u[_].bind(a))}}const r=n?.Parent??Object;class s extends r{}Object.defineProperty(s,\"name\",{value:e});function i(a){var c;const u=n?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(i,\"init\",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,\"name\",{value:e}),i}const Rm=Symbol(\"zod_brand\");class ke extends Error{constructor(){super(\"Encountered Promise during synchronous parse. Use .parseAsync() instead.\")}}class nn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name=\"ZodEncodeError\"}}const Wt={};function G(e){return e&&Object.assign(Wt,e),Wt}function Ja(e){return e}function Ba(e){return e}function Va(e){}function Ka(e){throw new Error(\"Unexpected value in exhaustive check\")}function Wa(e){}function on(e){const t=Object.values(e).filter(o=>typeof o==\"number\");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function Ga(e,t=\"|\"){return e.map(n=>Qo(n)).join(t)}function ut(e,t){return typeof t==\"bigint\"?t.toString():t}function He(e){return{get value(){{const t=e();return Object.defineProperty(this,\"value\",{value:t}),t}}}}function ye(e){return e==null}function Tt(e){const t=e.startsWith(\"^\")?1:0,n=e.endsWith(\"$\")?e.length-1:e.length;return e.slice(t,n)}function Vo(e,t){const n=(e.toString().split(\".\")[1]||\"\").length,o=t.toString();let r=(o.split(\".\")[1]||\"\").length;if(r===0&&/\\d?e-\\d?/.test(o)){const c=o.match(/\\d?e-(\\d?)/);c?.[1]&&(r=Number.parseInt(c[1]))}const s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(\".\",\"\")),a=Number.parseInt(t.toFixed(s).replace(\".\",\"\"));return i%a/10**s}const vo=Symbol(\"evaluating\");function S(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==vo)return o===void 0&&(o=vo,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Qa(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ie(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Ya(e){return ie(e._zod.def)}function Xa(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function ec(e){const t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{const r={};for(let s=0;s<t.length;s++)r[t[s]]=o[s];return r})}function tc(e=10){const t=\"abcdefghijklmnopqrstuvwxyz\";let n=\"\";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function Gt(e){return JSON.stringify(e)}function Ko(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,\"\").replace(/[\\s_-]+/g,\"-\").replace(/^-+|-+$/g,\"\")}const rn=\"captureStackTrace\"in Error?Error.captureStackTrace:(...e)=>{};function ze(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}const Wo=He(()=>{if(typeof navigator<\"u\"&&navigator?.userAgent?.includes(\"Cloudflare\"))return!1;try{const e=Function;return new e(\"\"),!0}catch{return!1}});function be(e){if(ze(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!=\"function\")return!0;const n=t.prototype;return!(ze(n)===!1||Object.prototype.hasOwnProperty.call(n,\"isPrototypeOf\")===!1)}function $t(e){return be(e)?{...e}:Array.isArray(e)?[...e]:e}function nc(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const oc=e=>{const t=typeof e;switch(t){case\"undefined\":return\"undefined\";case\"string\":return\"string\";case\"number\":return Number.isNaN(e)?\"nan\":\"number\";case\"boolean\":return\"boolean\";case\"function\":return\"function\";case\"bigint\":return\"bigint\";case\"symbol\":return\"symbol\";case\"object\":return Array.isArray(e)?\"array\":e===null?\"null\":e.then&&typeof e.then==\"function\"&&e.catch&&typeof e.catch==\"function\"?\"promise\":typeof Map<\"u\"&&e instanceof Map?\"map\":typeof Set<\"u\"&&e instanceof Set?\"set\":typeof Date<\"u\"&&e instanceof Date?\"date\":typeof File<\"u\"&&e instanceof File?\"file\":\"object\";default:throw new Error(`Unknown data type: ${t}`)}},lt=new Set([\"string\",\"number\",\"symbol\"]),Go=new Set([\"string\",\"number\",\"bigint\",\"boolean\",\"symbol\",\"undefined\"]);function le(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function ae(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function m(e){const 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 rc(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,s){return t??(t=e()),Reflect.set(t,o,r,s)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function Qo(e){return typeof e==\"bigint\"?e.toString()+\"n\":typeof e==\"string\"?`\"${e}\"`:`${e}`}function Yo(e){return Object.keys(e).filter(t=>e[t]._zod.optin===\"optional\"&&e[t]._zod.optout===\"optional\")}const Xo={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]},er={int64:[BigInt(\"-9223372036854775808\"),BigInt(\"9223372036854775807\")],uint64:[BigInt(0),BigInt(\"18446744073709551615\")]};function tr(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(\".pick() cannot be used on object schemas containing refinements\");const s=ie(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: \"${a}\"`);t[a]&&(i[a]=n.shape[a])}return he(this,\"shape\",i),i},checks:[]});return ae(e,s)}function nr(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(\".omit() cannot be used on object schemas containing refinements\");const s=ie(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: \"${a}\"`);t[a]&&delete i[a]}return he(this,\"shape\",i),i},checks:[]});return ae(e,s)}function or(e,t){if(!be(t))throw new Error(\"Invalid input to extend: expected a plain object\");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\")}const r=ie(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return he(this,\"shape\",s),s}});return ae(e,r)}function rr(e,t){if(!be(t))throw new Error(\"Invalid input to safeExtend: expected a plain object\");const n=ie(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return he(this,\"shape\",o),o}});return ae(e,n)}function sr(e,t){const n=ie(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return he(this,\"shape\",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ae(e,n)}function ir(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(\".partial() cannot be used on object schemas containing refinements\");const i=ie(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: \"${u}\"`);n[u]&&(c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u];return he(this,\"shape\",c),c},checks:[]});return ae(t,i)}function ar(e,t,n){const o=ie(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: \"${i}\"`);n[i]&&(s[i]=new e({type:\"nonoptional\",innerType:r[i]}))}else for(const i in r)s[i]=new e({type:\"nonoptional\",innerType:r[i]});return he(this,\"shape\",s),s}});return ae(t,o)}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function oe(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Ce(e){return typeof e==\"string\"?e:e?.message}function Q(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const r=Ce(e.inst?._zod.def?.error?.(e))??Ce(t?.error?.(e))??Ce(n.customError?.(e))??Ce(n.localeError?.(e))??\"Invalid input\";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Et(e){return e instanceof Set?\"set\":e instanceof Map?\"map\":e instanceof File?\"file\":\"unknown\"}function Pt(e){return Array.isArray(e)?\"array\":typeof e==\"string\"?\"string\":\"unknown\"}function sc(e){const t=typeof e;switch(t){case\"number\":return Number.isNaN(e)?\"nan\":\"number\";case\"object\":{if(e===null)return\"null\";if(Array.isArray(e))return\"array\";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&\"constructor\"in n&&n.constructor)return n.constructor.name}}return t}function Te(...e){const[t,n,o]=e;return typeof t==\"string\"?{message:t,code:\"custom\",input:n,inst:o}:{...t}}function ic(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function cr(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function ur(e){let t=\"\";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function ac(e){const t=e.replace(/-/g,\"+\").replace(/_/g,\"/\"),n=\"=\".repeat((4-t.length%4)%4);return cr(t+n)}function cc(e){return ur(e).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=/g,\"\")}function uc(e){const t=e.replace(/^0x/,\"\");if(t.length%2!==0)throw new Error(\"Invalid hex string length\");const n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function lc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,\"0\")).join(\"\")}class dc{constructor(...t){}}const Cm=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:er,Class:dc,NUMBER_FORMAT_RANGES:Xo,aborted:_e,allowsEval:Wo,assert:Wa,assertEqual:Ja,assertIs:Va,assertNever:Ka,assertNotEqual:Ba,assignProp:he,base64ToUint8Array:cr,base64urlToUint8Array:ac,cached:He,captureStackTrace:rn,cleanEnum:ic,cleanRegex:Tt,clone:ae,cloneDef:Ya,createTransparentProxy:rc,defineLazy:S,esc:Gt,escapeRegex:le,extend:or,finalizeIssue:Q,floatSafeRemainder:Vo,getElementAtPath:Xa,getEnumValues:on,getLengthableOrigin:Pt,getParsedType:oc,getSizableOrigin:Et,hexToUint8Array:uc,isObject:ze,isPlainObject:be,issue:Te,joinValues:Ga,jsonStringifyReplacer:ut,merge:sr,mergeDefs:ie,normalizeParams:m,nullish:ye,numKeys:nc,objectClone:Qa,omit:nr,optionalKeys:Yo,parsedType:sc,partial:ir,pick:tr,prefixIssues:oe,primitiveTypes:Go,promiseAllObject:ec,propertyKeyTypes:lt,randomString:tc,required:ar,safeExtend:rr,shallowClone:$t,slugify:Ko,stringifyPrimitive:Qo,uint8ArrayToBase64:ur,uint8ArrayToBase64url:cc,uint8ArrayToHex:lc,unwrapMessage:Ce},Symbol.toStringTag,{value:\"Module\"})),lr=(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,ut,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},dr=l(\"$ZodError\",lr),Y=l(\"$ZodError\",lr,{Parent:Error});function pc(e,t=n=>n.message){const n={},o=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function fc(e,t=n=>n.message){const n={_errors:[]},o=r=>{for(const s of r.issues)if(s.code===\"invalid_union\"&&s.errors.length)s.errors.map(i=>o({issues:i}));else if(s.code===\"invalid_key\")o({issues:s.issues});else if(s.code===\"invalid_element\")o({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return o(e),n}function Nm(e,t=n=>n.message){const n={errors:[]},o=(r,s=[])=>{var i,a;for(const c of r.issues)if(c.code===\"invalid_union\"&&c.errors.length)c.errors.map(u=>o({issues:u},c.path));else if(c.code===\"invalid_key\")o({issues:c.issues},c.path);else if(c.code===\"invalid_element\")o({issues:c.issues},c.path);else{const u=[...s,...c.path];if(u.length===0){n.errors.push(t(c));continue}let f=n,g=0;for(;g<u.length;){const _=u[g],b=g===u.length-1;typeof _==\"string\"?(f.properties??(f.properties={}),(i=f.properties)[_]??(i[_]={errors:[]}),f=f.properties[_]):(f.items??(f.items=[]),(a=f.items)[_]??(a[_]={errors:[]}),f=f.items[_]),b&&f.errors.push(t(c)),g++}}};return o(e),n}function hc(e){const t=[],n=e.map(o=>typeof o==\"object\"?o.key:o);for(const o of n)typeof o==\"number\"?t.push(`[${o}]`):typeof o==\"symbol\"?t.push(`[${JSON.stringify(String(o))}]`):/[^\\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push(\".\"),t.push(o));return t.join(\"\")}function Om(e){const t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(const o of n)t.push(`✖ ${o.message}`),o.path?.length&&t.push(` → at ${hc(o.path)}`);return t.join(`\n`)}const It=e=>(t,n,o,r)=>{const s=o?Object.assign(o,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new ke;if(i.issues.length){const a=new(r?.Err??e)(i.issues.map(c=>Q(c,s,G())));throw rn(a,r?.callee),a}return i.value},yo=It(Y),Zt=e=>async(t,n,o,r)=>{const s=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(r?.Err??e)(i.issues.map(c=>Q(c,s,G())));throw rn(a,r?.callee),a}return i.value},wo=Zt(Y),xt=e=>(t,n,o)=>{const r=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new ke;return s.issues.length?{success:!1,error:new(e??dr)(s.issues.map(i=>Q(i,r,G())))}:{success:!0,data:s.value}},pr=xt(Y),Rt=e=>async(t,n,o)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Q(i,r,G())))}:{success:!0,data:s.value}},mc=Rt(Y),fr=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return It(e)(t,n,r)},Am=fr(Y),hr=e=>(t,n,o)=>It(e)(t,n,o),jm=hr(Y),mr=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return Zt(e)(t,n,r)},Mm=mr(Y),gr=e=>async(t,n,o)=>Zt(e)(t,n,o),qm=gr(Y),_r=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return xt(e)(t,n,r)},Lm=_r(Y),br=e=>(t,n,o)=>xt(e)(t,n,o),Dm=br(Y),vr=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:\"backward\"}):{direction:\"backward\"};return Rt(e)(t,n,r)},Hm=vr(Y),yr=e=>async(t,n,o)=>Rt(e)(t,n,o),Um=yr(Y),wr=/^[cC][^\\s-]{8,}$/,kr=/^[0-9a-z]+$/,Sr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zr=/^[0-9a-vA-V]{20}$/,Tr=/^[A-Za-z0-9]{27}$/,$r=/^[a-zA-Z0-9_-]{21}$/,Er=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,gc=/^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/,Pr=/^([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})$/,$e=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)$/,_c=$e(4),bc=$e(6),vc=$e(7),Ir=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,yc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,wc=/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,Zr=/^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u,kc=Zr,Sc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,zc=\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\";function xr(){return new RegExp(zc,\"u\")}const Rr=/^(?:(?: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])$/,Cr=/^(([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}|:))$/,Nr=e=>{const t=le(e??\":\");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Or=/^((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])$/,Ar=/^(([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])$/,jr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sn=/^[A-Za-z0-9_-]*$/,Mr=/^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/,qr=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/,Lr=/^\\+[1-9]\\d{6,14}$/,Dr=\"(?:(?:\\\\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])))\",Hr=new RegExp(`^${Dr}$`);function Ur(e){const 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 Fr(e){return new RegExp(`^${Ur(e)}$`)}function Jr(e){const t=Ur({precision:e.precision}),n=[\"Z\"];e.local&&n.push(\"\"),e.offset&&n.push(\"([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)\");const o=`${t}(?:${n.join(\"|\")})`;return new RegExp(`^${Dr}T(?:${o})$`)}const Br=e=>{const t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??\"\"}}`:\"[\\\\s\\\\S]*\";return new RegExp(`^${t}$`)},Vr=/^-?\\d+n?$/,Kr=/^-?\\d+$/,an=/^-?\\d+(?:\\.\\d+)?$/,Wr=/^(?:true|false)$/i,Gr=/^null$/i,Qr=/^undefined$/i,Yr=/^[^A-Z]*$/,Xr=/^[^a-z]*$/,es=/^[0-9a-fA-F]*$/;function Ue(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Fe(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Tc=/^[0-9a-fA-F]{32}$/,$c=Ue(22,\"==\"),Ec=Fe(22),Pc=/^[0-9a-fA-F]{40}$/,Ic=Ue(27,\"=\"),Zc=Fe(27),xc=/^[0-9a-fA-F]{64}$/,Rc=Ue(43,\"=\"),Cc=Fe(43),Nc=/^[0-9a-fA-F]{96}$/,Oc=Ue(64,\"\"),Ac=Fe(64),jc=/^[0-9a-fA-F]{128}$/,Mc=Ue(86,\"==\"),qc=Fe(86),Lc=Object.freeze(Object.defineProperty({__proto__:null,base64:jr,base64url:sn,bigint:Vr,boolean:Wr,browserEmail:Sc,cidrv4:Or,cidrv6:Ar,cuid:wr,cuid2:kr,date:Hr,datetime:Jr,domain:qr,duration:Er,e164:Lr,email:Ir,emoji:xr,extendedDuration:gc,guid:Pr,hex:es,hostname:Mr,html5Email:yc,idnEmail:kc,integer:Kr,ipv4:Rr,ipv6:Cr,ksuid:Tr,lowercase:Yr,mac:Nr,md5_base64:$c,md5_base64url:Ec,md5_hex:Tc,nanoid:$r,null:Gr,number:an,rfc5322Email:wc,sha1_base64:Ic,sha1_base64url:Zc,sha1_hex:Pc,sha256_base64:Rc,sha256_base64url:Cc,sha256_hex:xc,sha384_base64:Oc,sha384_base64url:Ac,sha384_hex:Nc,sha512_base64:Mc,sha512_base64url:qc,sha512_hex:jc,string:Br,time:Fr,ulid:Sr,undefined:Qr,unicodeEmail:Zr,uppercase:Xr,uuid:$e,uuid4:_c,uuid6:bc,uuid7:vc,xid:zr},Symbol.toStringTag,{value:\"Module\"})),A=l(\"$ZodCheck\",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ts={number:\"number\",bigint:\"bigint\",object:\"date\"},ns=l(\"$ZodCheckLessThan\",(e,t)=>{A.init(e,t);const n=ts[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:\"too_big\",maximum:typeof t.value==\"object\"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),os=l(\"$ZodCheckGreaterThan\",(e,t)=>{A.init(e,t);const n=ts[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:\"too_small\",minimum:typeof t.value==\"object\"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dc=l(\"$ZodCheckMultipleOf\",(e,t)=>{A.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error(\"Cannot mix number and bigint in multiple_of check.\");(typeof n.value==\"bigint\"?n.value%t.value===BigInt(0):Vo(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:\"not_multiple_of\",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Hc=l(\"$ZodCheckNumberFormat\",(e,t)=>{A.init(e,t),t.format=t.format||\"float64\";const n=t.format?.includes(\"int\"),o=n?\"int\":\"number\",[r,s]=Xo[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=r,a.maximum=s,n&&(a.pattern=Kr)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:\"invalid_type\",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:\"too_big\",maximum:Number.MAX_SAFE_INTEGER,note:\"Integers must be within the safe integer range.\",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:\"too_small\",minimum:Number.MIN_SAFE_INTEGER,note:\"Integers must be within the safe integer range.\",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<r&&i.issues.push({origin:\"number\",input:a,code:\"too_small\",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:\"number\",input:a,code:\"too_big\",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Uc=l(\"$ZodCheckBigIntFormat\",(e,t)=>{A.init(e,t);const[n,o]=er[t.format];e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,s.minimum=n,s.maximum=o}),e._zod.check=r=>{const s=r.value;s<n&&r.issues.push({origin:\"bigint\",input:s,code:\"too_small\",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&r.issues.push({origin:\"bigint\",input:s,code:\"too_big\",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Fc=l(\"$ZodCheckMaxSize\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const r=o.value;r.size<=t.maximum||o.issues.push({origin:Et(r),code:\"too_big\",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Jc=l(\"$ZodCheckMinSize\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const r=o.value;r.size>=t.minimum||o.issues.push({origin:Et(r),code:\"too_small\",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bc=l(\"$ZodCheckSizeEquals\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{const r=o.value,s=r.size;if(s===t.size)return;const i=s>t.size;o.issues.push({origin:Et(r),...i?{code:\"too_big\",maximum:t.size}:{code:\"too_small\",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Vc=l(\"$ZodCheckMaxLength\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const r=o.value;if(r.length<=t.maximum)return;const i=Pt(r);o.issues.push({origin:i,code:\"too_big\",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kc=l(\"$ZodCheckMinLength\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const r=o.value;if(r.length>=t.minimum)return;const i=Pt(r);o.issues.push({origin:i,code:\"too_small\",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wc=l(\"$ZodCheckLengthEquals\",(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=o=>{const r=o.value;return!ye(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{const r=o.value,s=r.length;if(s===t.length)return;const i=Pt(r),a=s>t.length;o.issues.push({origin:i,...a?{code:\"too_big\",maximum:t.length}:{code:\"too_small\",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ct=l(\"$ZodCheckStringFormat\",(e,t)=>{var n,o;A.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:\"string\",code:\"invalid_format\",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Gc=l(\"$ZodCheckRegex\",(e,t)=>{Ct.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:\"string\",code:\"invalid_format\",format:\"regex\",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Qc=l(\"$ZodCheckLowerCase\",(e,t)=>{t.pattern??(t.pattern=Yr),Ct.init(e,t)}),Yc=l(\"$ZodCheckUpperCase\",(e,t)=>{t.pattern??(t.pattern=Xr),Ct.init(e,t)}),Xc=l(\"$ZodCheckIncludes\",(e,t)=>{A.init(e,t);const n=le(t.includes),o=new RegExp(typeof t.position==\"number\"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:\"string\",code:\"invalid_format\",format:\"includes\",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),eu=l(\"$ZodCheckStartsWith\",(e,t)=>{A.init(e,t);const n=new RegExp(`^${le(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"starts_with\",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),tu=l(\"$ZodCheckEndsWith\",(e,t)=>{A.init(e,t);const n=new RegExp(`.*${le(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"ends_with\",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function ko(e,t,n){e.issues.length&&t.issues.push(...oe(n,e.issues))}const nu=l(\"$ZodCheckProperty\",(e,t)=>{A.init(e,t),e._zod.check=n=>{const o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>ko(r,n,t.property));ko(o,n,t.property)}}),ou=l(\"$ZodCheckMimeType\",(e,t)=>{A.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:\"invalid_value\",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),ru=l(\"$ZodCheckOverwrite\",(e,t)=>{A.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class su{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t==\"function\"){t(this,{execution:\"sync\"}),t(this,{execution:\"async\"});return}const o=t.split(`\n`).filter(i=>i),r=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(r)).map(i=>\" \".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,r=[...(this?.content??[\"\"]).map(s=>` ${s}`)];return new t(...n,r.join(`\n`))}}const iu={major:4,minor:3,patch:6},y=l(\"$ZodType\",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=iu;const o=[...e._zod.def.checks??[]];e._zod.traits.has(\"$ZodCheck\")&&o.unshift(e);for(const r of o)for(const s of r._zod.onattach)s(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(i,a,c)=>{let u=_e(i),f;for(const g of a){if(g._zod.def.when){if(!g._zod.def.when(i))continue}else if(u)continue;const _=i.issues.length,b=g._zod.check(i);if(b instanceof Promise&&c?.async===!1)throw new ke;if(f||b instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await b,i.issues.length!==_&&(u||(u=_e(i,_)))});else{if(i.issues.length===_)continue;u||(u=_e(i,_))}}return f?f.then(()=>i):i},s=(i,a,c)=>{if(_e(i))return i.aborted=!0,i;const u=r(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new ke;return u.then(f=>e._zod.parse(f,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===\"backward\"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(f=>s(f,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new ke;return c.then(u=>r(u,o,a))}return r(c,o,a)}}S(e,\"~standard\",()=>({validate:r=>{try{const s=pr(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return mc(e,r).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:\"zod\",version:1}))}),Nt=l(\"$ZodString\",(e,t)=>{y.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Br(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==\"string\"||n.issues.push({expected:\"string\",code:\"invalid_type\",input:n.value,inst:e}),n}}),R=l(\"$ZodStringFormat\",(e,t)=>{Ct.init(e,t),Nt.init(e,t)}),au=l(\"$ZodGUID\",(e,t)=>{t.pattern??(t.pattern=Pr),R.init(e,t)}),cu=l(\"$ZodUUID\",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??(t.pattern=$e(o))}else t.pattern??(t.pattern=$e());R.init(e,t)}),uu=l(\"$ZodEmail\",(e,t)=>{t.pattern??(t.pattern=Ir),R.init(e,t)}),lu=l(\"$ZodURL\",(e,t)=>{R.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:\"invalid_format\",format:\"url\",note:\"Invalid hostname\",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(\":\")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:\"invalid_format\",format:\"url\",note:\"Invalid protocol\",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:\"invalid_format\",format:\"url\",input:n.value,inst:e,continue:!t.abort})}}}),du=l(\"$ZodEmoji\",(e,t)=>{t.pattern??(t.pattern=xr()),R.init(e,t)}),pu=l(\"$ZodNanoID\",(e,t)=>{t.pattern??(t.pattern=$r),R.init(e,t)}),fu=l(\"$ZodCUID\",(e,t)=>{t.pattern??(t.pattern=wr),R.init(e,t)}),hu=l(\"$ZodCUID2\",(e,t)=>{t.pattern??(t.pattern=kr),R.init(e,t)}),mu=l(\"$ZodULID\",(e,t)=>{t.pattern??(t.pattern=Sr),R.init(e,t)}),gu=l(\"$ZodXID\",(e,t)=>{t.pattern??(t.pattern=zr),R.init(e,t)}),_u=l(\"$ZodKSUID\",(e,t)=>{t.pattern??(t.pattern=Tr),R.init(e,t)}),bu=l(\"$ZodISODateTime\",(e,t)=>{t.pattern??(t.pattern=Jr(t)),R.init(e,t)}),vu=l(\"$ZodISODate\",(e,t)=>{t.pattern??(t.pattern=Hr),R.init(e,t)}),yu=l(\"$ZodISOTime\",(e,t)=>{t.pattern??(t.pattern=Fr(t)),R.init(e,t)}),wu=l(\"$ZodISODuration\",(e,t)=>{t.pattern??(t.pattern=Er),R.init(e,t)}),ku=l(\"$ZodIPv4\",(e,t)=>{t.pattern??(t.pattern=Rr),R.init(e,t),e._zod.bag.format=\"ipv4\"}),Su=l(\"$ZodIPv6\",(e,t)=>{t.pattern??(t.pattern=Cr),R.init(e,t),e._zod.bag.format=\"ipv6\",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:\"invalid_format\",format:\"ipv6\",input:n.value,inst:e,continue:!t.abort})}}}),zu=l(\"$ZodMAC\",(e,t)=>{t.pattern??(t.pattern=Nr(t.delimiter)),R.init(e,t),e._zod.bag.format=\"mac\"}),Tu=l(\"$ZodCIDRv4\",(e,t)=>{t.pattern??(t.pattern=Or),R.init(e,t)}),$u=l(\"$ZodCIDRv6\",(e,t)=>{t.pattern??(t.pattern=Ar),R.init(e,t),e._zod.check=n=>{const o=n.value.split(\"/\");try{if(o.length!==2)throw new Error;const[r,s]=o;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:\"invalid_format\",format:\"cidrv6\",input:n.value,inst:e,continue:!t.abort})}}});function rs(e){if(e===\"\")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Eu=l(\"$ZodBase64\",(e,t)=>{t.pattern??(t.pattern=jr),R.init(e,t),e._zod.bag.contentEncoding=\"base64\",e._zod.check=n=>{rs(n.value)||n.issues.push({code:\"invalid_format\",format:\"base64\",input:n.value,inst:e,continue:!t.abort})}});function Pu(e){if(!sn.test(e))return!1;const t=e.replace(/[-_]/g,o=>o===\"-\"?\"+\":\"/\"),n=t.padEnd(Math.ceil(t.length/4)*4,\"=\");return rs(n)}const Iu=l(\"$ZodBase64URL\",(e,t)=>{t.pattern??(t.pattern=sn),R.init(e,t),e._zod.bag.contentEncoding=\"base64url\",e._zod.check=n=>{Pu(n.value)||n.issues.push({code:\"invalid_format\",format:\"base64url\",input:n.value,inst:e,continue:!t.abort})}}),Zu=l(\"$ZodE164\",(e,t)=>{t.pattern??(t.pattern=Lr),R.init(e,t)});function xu(e,t=null){try{const n=e.split(\".\");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const r=JSON.parse(atob(o));return!(\"typ\"in r&&r?.typ!==\"JWT\"||!r.alg||t&&(!(\"alg\"in r)||r.alg!==t))}catch{return!1}}const Ru=l(\"$ZodJWT\",(e,t)=>{R.init(e,t),e._zod.check=n=>{xu(n.value,t.alg)||n.issues.push({code:\"invalid_format\",format:\"jwt\",input:n.value,inst:e,continue:!t.abort})}}),Cu=l(\"$ZodCustomStringFormat\",(e,t)=>{R.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:\"invalid_format\",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),ss=l(\"$ZodNumber\",(e,t)=>{y.init(e,t),e._zod.pattern=e._zod.bag.pattern??an,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const r=n.value;if(typeof r==\"number\"&&!Number.isNaN(r)&&Number.isFinite(r))return n;const s=typeof r==\"number\"?Number.isNaN(r)?\"NaN\":Number.isFinite(r)?void 0:\"Infinity\":void 0;return n.issues.push({expected:\"number\",code:\"invalid_type\",input:r,inst:e,...s?{received:s}:{}}),n}}),Nu=l(\"$ZodNumberFormat\",(e,t)=>{Hc.init(e,t),ss.init(e,t)}),is=l(\"$ZodBoolean\",(e,t)=>{y.init(e,t),e._zod.pattern=Wr,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const r=n.value;return typeof r==\"boolean\"||n.issues.push({expected:\"boolean\",code:\"invalid_type\",input:r,inst:e}),n}}),as=l(\"$ZodBigInt\",(e,t)=>{y.init(e,t),e._zod.pattern=Vr,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==\"bigint\"||n.issues.push({expected:\"bigint\",code:\"invalid_type\",input:n.value,inst:e}),n}}),Ou=l(\"$ZodBigIntFormat\",(e,t)=>{Uc.init(e,t),as.init(e,t)}),Au=l(\"$ZodSymbol\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return typeof r==\"symbol\"||n.issues.push({expected:\"symbol\",code:\"invalid_type\",input:r,inst:e}),n}}),ju=l(\"$ZodUndefined\",(e,t)=>{y.init(e,t),e._zod.pattern=Qr,e._zod.values=new Set([void 0]),e._zod.optin=\"optional\",e._zod.optout=\"optional\",e._zod.parse=(n,o)=>{const r=n.value;return typeof r>\"u\"||n.issues.push({expected:\"undefined\",code:\"invalid_type\",input:r,inst:e}),n}}),Mu=l(\"$ZodNull\",(e,t)=>{y.init(e,t),e._zod.pattern=Gr,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{const r=n.value;return r===null||n.issues.push({expected:\"null\",code:\"invalid_type\",input:r,inst:e}),n}}),qu=l(\"$ZodAny\",(e,t)=>{y.init(e,t),e._zod.parse=n=>n}),Lu=l(\"$ZodUnknown\",(e,t)=>{y.init(e,t),e._zod.parse=n=>n}),Du=l(\"$ZodNever\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:\"never\",code:\"invalid_type\",input:n.value,inst:e}),n)}),Hu=l(\"$ZodVoid\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return typeof r>\"u\"||n.issues.push({expected:\"void\",code:\"invalid_type\",input:r,inst:e}),n}}),Uu=l(\"$ZodDate\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const r=n.value,s=r instanceof Date;return s&&!Number.isNaN(r.getTime())||n.issues.push({expected:\"date\",code:\"invalid_type\",input:r,...s?{received:\"Invalid Date\"}:{},inst:e}),n}});function So(e,t,n){e.issues.length&&t.issues.push(...oe(n,e.issues)),t.value[n]=e.value}const Fu=l(\"$ZodArray\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:\"array\",code:\"invalid_type\",input:r,inst:e}),n;n.value=Array(r.length);const s=[];for(let i=0;i<r.length;i++){const a=r[i],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>So(u,n,i))):So(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function dt(e,t,n,o,r){if(e.issues.length){if(r&&!(n in o))return;t.issues.push(...oe(n,e.issues))}e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function cs(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has(\"$ZodType\"))throw new Error(`Invalid element at key \"${o}\": expected a Zod schema`);const n=Yo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function us(e,t,n,o,r,s){const i=[],a=r.keySet,c=r.catchall._zod,u=c.def.type,f=c.optout===\"optional\";for(const g in t){if(a.has(g))continue;if(u===\"never\"){i.push(g);continue}const _=c.run({value:t[g],issues:[]},o);_ instanceof Promise?e.push(_.then(b=>dt(b,n,g,t,f))):dt(_,n,g,t,f)}return i.length&&n.issues.push({code:\"unrecognized_keys\",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Ju=l(\"$ZodObject\",(e,t)=>{if(y.init(e,t),!Object.getOwnPropertyDescriptor(t,\"shape\")?.get){const a=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{const c={...a};return Object.defineProperty(t,\"shape\",{value:c}),c}})}const o=He(()=>cs(t));S(e._zod,\"propValues\",()=>{const a=t.shape,c={};for(const u in a){const f=a[u]._zod;if(f.values){c[u]??(c[u]=new Set);for(const g of f.values)c[u].add(g)}}return c});const r=ze,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=o.value);const u=a.value;if(!r(u))return a.issues.push({expected:\"object\",code:\"invalid_type\",input:u,inst:e}),a;a.value={};const f=[],g=i.shape;for(const _ of i.keys){const b=g[_],Z=b._zod.optout===\"optional\",N=b._zod.run({value:u[_],issues:[]},c);N instanceof Promise?f.push(N.then(we=>dt(we,a,_,u,Z))):dt(N,a,_,u,Z)}return s?us(f,u,a,c,o.value,e):f.length?Promise.all(f).then(()=>a):a}}),Bu=l(\"$ZodObjectJIT\",(e,t)=>{Ju.init(e,t);const n=e._zod.parse,o=He(()=>cs(t)),r=_=>{const b=new su([\"shape\",\"payload\",\"ctx\"]),Z=o.value,N=j=>{const M=Gt(j);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};b.write(\"const input = payload.value;\");const we=Object.create(null);let et=0;for(const j of Z.keys)we[j]=`key_${et++}`;b.write(\"const newResult = {};\");for(const j of Z.keys){const M=we[j],ne=Gt(j),Da=_[j]?._zod?.optout===\"optional\";b.write(`const ${M} = ${N(j)};`),Da?b.write(`\n if (${M}.issues.length) {\n if (${ne} in input) {\n payload.issues = payload.issues.concat(${M}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${ne}, ...iss.path] : [${ne}]\n })));\n }\n }\n \n if (${M}.value === undefined) {\n if (${ne} in input) {\n newResult[${ne}] = undefined;\n }\n } else {\n newResult[${ne}] = ${M}.value;\n }\n \n `):b.write(`\n if (${M}.issues.length) {\n payload.issues = payload.issues.concat(${M}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${ne}, ...iss.path] : [${ne}]\n })));\n }\n \n if (${M}.value === undefined) {\n if (${ne} in input) {\n newResult[${ne}] = undefined;\n }\n } else {\n newResult[${ne}] = ${M}.value;\n }\n \n `)}b.write(\"payload.value = newResult;\"),b.write(\"return payload;\");const L=b.compile();return(j,M)=>L(_,j,M)};let s;const i=ze,a=!Wt.jitless,u=a&&Wo.value,f=t.catchall;let g;e._zod.parse=(_,b)=>{g??(g=o.value);const Z=_.value;return i(Z)?a&&u&&b?.async===!1&&b.jitless!==!0?(s||(s=r(t.shape)),_=s(_,b),f?us([],Z,_,b,g,e):_):n(_,b):(_.issues.push({expected:\"object\",code:\"invalid_type\",input:Z,inst:e}),_)}});function zo(e,t,n,o){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!_e(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:\"invalid_union\",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Q(i,o,G())))}),t)}const cn=l(\"$ZodUnion\",(e,t)=>{y.init(e,t),S(e._zod,\"optin\",()=>t.options.some(r=>r._zod.optin===\"optional\")?\"optional\":void 0),S(e._zod,\"optout\",()=>t.options.some(r=>r._zod.optout===\"optional\")?\"optional\":void 0),S(e._zod,\"values\",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),S(e._zod,\"pattern\",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>Tt(s.source)).join(\"|\")})$`)}});const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(n)return o(r,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>zo(c,r,e,s)):zo(a,r,e,s)}});function To(e,t,n,o){const r=e.filter(s=>s.issues.length===0);return r.length===1?(t.value=r[0].value,t):(r.length===0?t.issues.push({code:\"invalid_union\",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Q(i,o,G())))}):t.issues.push({code:\"invalid_union\",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const Vu=l(\"$ZodXor\",(e,t)=>{cn.init(e,t),t.inclusive=!1;const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(n)return o(r,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:r.value,issues:[]},s);u instanceof Promise?(a.push(u),i=!0):a.push(u)}return i?Promise.all(a).then(c=>To(c,r,e,s)):To(a,r,e,s)}}),Ku=l(\"$ZodDiscriminatedUnion\",(e,t)=>{t.inclusive=!1,cn.init(e,t);const n=e._zod.parse;S(e._zod,\"propValues\",()=>{const r={};for(const s of t.options){const i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index \"${t.options.indexOf(s)}\"`);for(const[a,c]of Object.entries(i)){r[a]||(r[a]=new Set);for(const u of c)r[a].add(u)}}return r});const o=He(()=>{const r=t.options,s=new Map;for(const i of r){const a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index \"${t.options.indexOf(i)}\"`);for(const c of a){if(s.has(c))throw new Error(`Duplicate discriminator value \"${String(c)}\"`);s.set(c,i)}}return s});e._zod.parse=(r,s)=>{const i=r.value;if(!ze(i))return r.issues.push({code:\"invalid_type\",expected:\"object\",input:i,inst:e}),r;const a=o.value.get(i?.[t.discriminator]);return a?a._zod.run(r,s):t.unionFallback?n(r,s):(r.issues.push({code:\"invalid_union\",errors:[],note:\"No matching discriminator\",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),r)}}),Wu=l(\"$ZodIntersection\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value,s=t.left._zod.run({value:r,issues:[]},o),i=t.right._zod.run({value:r,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>$o(n,c,u)):$o(n,s,i)}});function Qt(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(be(e)&&be(t)){const n=Object.keys(t),o=Object.keys(e).filter(s=>n.indexOf(s)!==-1),r={...e,...t};for(const s of o){const i=Qt(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};r[s]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const r=e[o],s=t[o],i=Qt(r,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $o(e,t,n){const o=new Map;let r;for(const a of t.issues)if(a.code===\"unrecognized_keys\"){r??(r=a);for(const c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code===\"unrecognized_keys\")for(const c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(a);const s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&r&&e.issues.push({...r,keys:s}),_e(e))return e;const i=Qt(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const ls=l(\"$ZodTuple\",(e,t)=>{y.init(e,t);const n=t.items;e._zod.parse=(o,r)=>{const s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:\"tuple\",code:\"invalid_type\"}),o;o.value=[];const i=[],a=[...n].reverse().findIndex(f=>f._zod.optin!==\"optional\"),c=a===-1?0:n.length-a;if(!t.rest){const f=s.length>n.length,g=s.length<c-1;if(f||g)return o.issues.push({...f?{code:\"too_big\",maximum:n.length,inclusive:!0}:{code:\"too_small\",minimum:n.length},input:s,inst:e,origin:\"array\"}),o}let u=-1;for(const f of n){if(u++,u>=s.length&&u>=c)continue;const g=f._zod.run({value:s[u],issues:[]},r);g instanceof Promise?i.push(g.then(_=>tt(_,o,u))):tt(g,o,u)}if(t.rest){const f=s.slice(n.length);for(const g of f){u++;const _=t.rest._zod.run({value:g,issues:[]},r);_ instanceof Promise?i.push(_.then(b=>tt(b,o,u))):tt(_,o,u)}}return i.length?Promise.all(i).then(()=>o):o}});function tt(e,t,n){e.issues.length&&t.issues.push(...oe(n,e.issues)),t.value[n]=e.value}const Gu=l(\"$ZodRecord\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!be(r))return n.issues.push({expected:\"record\",code:\"invalid_type\",input:r,inst:e}),n;const s=[],i=t.keyType._zod.values;if(i){n.value={};const a=new Set;for(const u of i)if(typeof u==\"string\"||typeof u==\"number\"||typeof u==\"symbol\"){a.add(typeof u==\"number\"?u.toString():u);const f=t.valueType._zod.run({value:r[u],issues:[]},o);f instanceof Promise?s.push(f.then(g=>{g.issues.length&&n.issues.push(...oe(u,g.issues)),n.value[u]=g.value})):(f.issues.length&&n.issues.push(...oe(u,f.issues)),n.value[u]=f.value)}let c;for(const u in r)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:\"unrecognized_keys\",input:r,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(r)){if(a===\"__proto__\")continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error(\"Async schemas not supported in object keys currently\");if(typeof a==\"string\"&&an.test(a)&&c.issues.length){const g=t.keyType._zod.run({value:Number(a),issues:[]},o);if(g instanceof Promise)throw new Error(\"Async schemas not supported in object keys currently\");g.issues.length===0&&(c=g)}if(c.issues.length){t.mode===\"loose\"?n.value[a]=r[a]:n.issues.push({code:\"invalid_key\",origin:\"record\",issues:c.issues.map(g=>Q(g,o,G())),input:a,path:[a],inst:e});continue}const f=t.valueType._zod.run({value:r[a],issues:[]},o);f instanceof Promise?s.push(f.then(g=>{g.issues.length&&n.issues.push(...oe(a,g.issues)),n.value[c.value]=g.value})):(f.issues.length&&n.issues.push(...oe(a,f.issues)),n.value[c.value]=f.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Qu=l(\"$ZodMap\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!(r instanceof Map))return n.issues.push({expected:\"map\",code:\"invalid_type\",input:r,inst:e}),n;const s=[];n.value=new Map;for(const[i,a]of r){const c=t.keyType._zod.run({value:i,issues:[]},o),u=t.valueType._zod.run({value:a,issues:[]},o);c instanceof Promise||u instanceof Promise?s.push(Promise.all([c,u]).then(([f,g])=>{Eo(f,g,n,i,r,e,o)})):Eo(c,u,n,i,r,e,o)}return s.length?Promise.all(s).then(()=>n):n}});function Eo(e,t,n,o,r,s,i){e.issues.length&&(lt.has(typeof o)?n.issues.push(...oe(o,e.issues)):n.issues.push({code:\"invalid_key\",origin:\"map\",input:r,inst:s,issues:e.issues.map(a=>Q(a,i,G()))})),t.issues.length&&(lt.has(typeof o)?n.issues.push(...oe(o,t.issues)):n.issues.push({origin:\"map\",code:\"invalid_element\",input:r,inst:s,key:o,issues:t.issues.map(a=>Q(a,i,G()))})),n.value.set(e.value,t.value)}const Yu=l(\"$ZodSet\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:\"set\",code:\"invalid_type\"}),n;const s=[];n.value=new Set;for(const i of r){const a=t.valueType._zod.run({value:i,issues:[]},o);a instanceof Promise?s.push(a.then(c=>Po(c,n))):Po(a,n)}return s.length?Promise.all(s).then(()=>n):n}});function Po(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Xu=l(\"$ZodEnum\",(e,t)=>{y.init(e,t);const n=on(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>lt.has(typeof r)).map(r=>typeof r==\"string\"?le(r):r.toString()).join(\"|\")})$`),e._zod.parse=(r,s)=>{const i=r.value;return o.has(i)||r.issues.push({code:\"invalid_value\",values:n,input:i,inst:e}),r}}),el=l(\"$ZodLiteral\",(e,t)=>{if(y.init(e,t),t.values.length===0)throw new Error(\"Cannot create literal schema with no valid values\");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o==\"string\"?le(o):o?le(o.toString()):String(o)).join(\"|\")})$`),e._zod.parse=(o,r)=>{const s=o.value;return n.has(s)||o.issues.push({code:\"invalid_value\",values:t.values,input:s,inst:e}),o}}),tl=l(\"$ZodFile\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;return r instanceof File||n.issues.push({expected:\"file\",code:\"invalid_type\",input:r,inst:e}),n}}),nl=l(\"$ZodTransform\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")throw new nn(e.constructor.name);const r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(n.value=i,n));if(r instanceof Promise)throw new ke;return n.value=r,n}});function Io(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ds=l(\"$ZodOptional\",(e,t)=>{y.init(e,t),e._zod.optin=\"optional\",e._zod.optout=\"optional\",S(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),S(e._zod,\"pattern\",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Tt(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin===\"optional\"){const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>Io(s,n.value)):Io(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),ol=l(\"$ZodExactOptional\",(e,t)=>{ds.init(e,t),S(e._zod,\"values\",()=>t.innerType._zod.values),S(e._zod,\"pattern\",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),rl=l(\"$ZodNullable\",(e,t)=>{y.init(e,t),S(e._zod,\"optin\",()=>t.innerType._zod.optin),S(e._zod,\"optout\",()=>t.innerType._zod.optout),S(e._zod,\"pattern\",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Tt(n.source)}|null)$`):void 0}),S(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),sl=l(\"$ZodDefault\",(e,t)=>{y.init(e,t),e._zod.optin=\"optional\",S(e._zod,\"values\",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>Zo(s,t)):Zo(r,t)}});function Zo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const il=l(\"$ZodPrefault\",(e,t)=>{y.init(e,t),e._zod.optin=\"optional\",S(e._zod,\"values\",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction===\"backward\"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),al=l(\"$ZodNonOptional\",(e,t)=>{y.init(e,t),S(e._zod,\"values\",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>xo(s,e)):xo(r,e)}});function xo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:e.value,inst:t}),e}const cl=l(\"$ZodSuccess\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")throw new nn(\"ZodSuccess\");const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>(n.value=s.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),ul=l(\"$ZodCatch\",(e,t)=>{y.init(e,t),S(e._zod,\"optin\",()=>t.innerType._zod.optin),S(e._zod,\"optout\",()=>t.innerType._zod.optout),S(e._zod,\"values\",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(n,o);const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Q(i,o,G()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(s=>Q(s,o,G()))},input:n.value}),n.issues=[]),n)}}),ll=l(\"$ZodNaN\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!=\"number\"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:\"nan\",code:\"invalid_type\"}),n)}),dl=l(\"$ZodPipe\",(e,t)=>{y.init(e,t),S(e._zod,\"values\",()=>t.in._zod.values),S(e._zod,\"optin\",()=>t.in._zod.optin),S(e._zod,\"optout\",()=>t.out._zod.optout),S(e._zod,\"propValues\",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction===\"backward\"){const s=t.out._zod.run(n,o);return s instanceof Promise?s.then(i=>nt(i,t.in,o)):nt(s,t.in,o)}const r=t.in._zod.run(n,o);return r instanceof Promise?r.then(s=>nt(s,t.out,o)):nt(r,t.out,o)}});function nt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ps=l(\"$ZodCodec\",(e,t)=>{y.init(e,t),S(e._zod,\"values\",()=>t.in._zod.values),S(e._zod,\"optin\",()=>t.in._zod.optin),S(e._zod,\"optout\",()=>t.out._zod.optout),S(e._zod,\"propValues\",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||\"forward\")===\"forward\"){const s=t.in._zod.run(n,o);return s instanceof Promise?s.then(i=>ot(i,t,o)):ot(s,t,o)}else{const s=t.out._zod.run(n,o);return s instanceof Promise?s.then(i=>ot(i,t,o)):ot(s,t,o)}}});function ot(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||\"forward\")===\"forward\"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(s=>rt(e,s,t.out,n)):rt(e,r,t.out,n)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(s=>rt(e,s,t.in,n)):rt(e,r,t.in,n)}}function rt(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}const pl=l(\"$ZodReadonly\",(e,t)=>{y.init(e,t),S(e._zod,\"propValues\",()=>t.innerType._zod.propValues),S(e._zod,\"values\",()=>t.innerType._zod.values),S(e._zod,\"optin\",()=>t.innerType?._zod?.optin),S(e._zod,\"optout\",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(n,o);const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(Ro):Ro(r)}});function Ro(e){return e.value=Object.freeze(e.value),e}const fl=l(\"$ZodTemplateLiteral\",(e,t)=>{y.init(e,t);const n=[];for(const o of t.parts)if(typeof o==\"object\"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);const r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);const s=r.startsWith(\"^\")?1:0,i=r.endsWith(\"$\")?r.length-1:r.length;n.push(r.slice(s,i))}else if(o===null||Go.has(typeof o))n.push(le(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join(\"\")}$`),e._zod.parse=(o,r)=>typeof o.value!=\"string\"?(o.issues.push({input:o.value,inst:e,expected:\"string\",code:\"invalid_type\"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:\"invalid_format\",format:t.format??\"template_literal\",pattern:e._zod.pattern.source}),o)}),hl=l(\"$ZodFunction\",(e,t)=>(y.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!=\"function\")throw new Error(\"implement() must be called with a function\");return function(...o){const r=e._def.input?yo(e._def.input,o):o,s=Reflect.apply(n,this,r);return e._def.output?yo(e._def.output,s):s}},e.implementAsync=n=>{if(typeof n!=\"function\")throw new Error(\"implementAsync() must be called with a function\");return async function(...o){const r=e._def.input?await wo(e._def.input,o):o,s=await Reflect.apply(n,this,r);return e._def.output?await wo(e._def.output,s):s}},e._zod.parse=(n,o)=>typeof n.value!=\"function\"?(n.issues.push({code:\"invalid_type\",expected:\"function\",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type===\"promise\"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{const o=e.constructor;return Array.isArray(n[0])?new o({type:\"function\",input:new ls({type:\"tuple\",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:\"function\",input:n[0],output:e._def.output})},e.output=n=>{const o=e.constructor;return new o({type:\"function\",input:e._def.input,output:n})},e)),ml=l(\"$ZodPromise\",(e,t)=>{y.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),gl=l(\"$ZodLazy\",(e,t)=>{y.init(e,t),S(e._zod,\"innerType\",()=>t.getter()),S(e._zod,\"pattern\",()=>e._zod.innerType?._zod?.pattern),S(e._zod,\"propValues\",()=>e._zod.innerType?._zod?.propValues),S(e._zod,\"optin\",()=>e._zod.innerType?._zod?.optin??void 0),S(e._zod,\"optout\",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),_l=l(\"$ZodCustom\",(e,t)=>{A.init(e,t),y.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(s=>Co(s,n,o,e));Co(r,n,o,e)}});function Co(e,t,n,o){if(!e){const r={code:\"custom\",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Te(r))}}var No;const Fm=Symbol(\"ZodOutput\"),Jm=Symbol(\"ZodInput\");class bl{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];return this._map.set(t,o),o&&typeof o==\"object\"&&\"id\"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n==\"object\"&&\"id\"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function vl(){return new bl}(No=globalThis).__zod_globalRegistry??(No.__zod_globalRegistry=vl());const ce=globalThis.__zod_globalRegistry;function yl(e,t){return new e({type:\"string\",...m(t)})}function Bm(e,t){return new e({type:\"string\",coerce:!0,...m(t)})}function fs(e,t){return new e({type:\"string\",format:\"email\",check:\"string_format\",abort:!1,...m(t)})}function Yt(e,t){return new e({type:\"string\",format:\"guid\",check:\"string_format\",abort:!1,...m(t)})}function hs(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,...m(t)})}function ms(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v4\",...m(t)})}function gs(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v6\",...m(t)})}function _s(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v7\",...m(t)})}function un(e,t){return new e({type:\"string\",format:\"url\",check:\"string_format\",abort:!1,...m(t)})}function bs(e,t){return new e({type:\"string\",format:\"emoji\",check:\"string_format\",abort:!1,...m(t)})}function vs(e,t){return new e({type:\"string\",format:\"nanoid\",check:\"string_format\",abort:!1,...m(t)})}function ys(e,t){return new e({type:\"string\",format:\"cuid\",check:\"string_format\",abort:!1,...m(t)})}function ws(e,t){return new e({type:\"string\",format:\"cuid2\",check:\"string_format\",abort:!1,...m(t)})}function ks(e,t){return new e({type:\"string\",format:\"ulid\",check:\"string_format\",abort:!1,...m(t)})}function Ss(e,t){return new e({type:\"string\",format:\"xid\",check:\"string_format\",abort:!1,...m(t)})}function zs(e,t){return new e({type:\"string\",format:\"ksuid\",check:\"string_format\",abort:!1,...m(t)})}function Ts(e,t){return new e({type:\"string\",format:\"ipv4\",check:\"string_format\",abort:!1,...m(t)})}function $s(e,t){return new e({type:\"string\",format:\"ipv6\",check:\"string_format\",abort:!1,...m(t)})}function wl(e,t){return new e({type:\"string\",format:\"mac\",check:\"string_format\",abort:!1,...m(t)})}function Es(e,t){return new e({type:\"string\",format:\"cidrv4\",check:\"string_format\",abort:!1,...m(t)})}function Ps(e,t){return new e({type:\"string\",format:\"cidrv6\",check:\"string_format\",abort:!1,...m(t)})}function Is(e,t){return new e({type:\"string\",format:\"base64\",check:\"string_format\",abort:!1,...m(t)})}function Zs(e,t){return new e({type:\"string\",format:\"base64url\",check:\"string_format\",abort:!1,...m(t)})}function xs(e,t){return new e({type:\"string\",format:\"e164\",check:\"string_format\",abort:!1,...m(t)})}function Rs(e,t){return new e({type:\"string\",format:\"jwt\",check:\"string_format\",abort:!1,...m(t)})}const Vm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function kl(e,t){return new e({type:\"string\",format:\"datetime\",check:\"string_format\",offset:!1,local:!1,precision:null,...m(t)})}function Sl(e,t){return new e({type:\"string\",format:\"date\",check:\"string_format\",...m(t)})}function zl(e,t){return new e({type:\"string\",format:\"time\",check:\"string_format\",precision:null,...m(t)})}function Tl(e,t){return new e({type:\"string\",format:\"duration\",check:\"string_format\",...m(t)})}function $l(e,t){return new e({type:\"number\",checks:[],...m(t)})}function Km(e,t){return new e({type:\"number\",coerce:!0,checks:[],...m(t)})}function El(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"safeint\",...m(t)})}function Pl(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"float32\",...m(t)})}function Il(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"float64\",...m(t)})}function Zl(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"int32\",...m(t)})}function xl(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"uint32\",...m(t)})}function Rl(e,t){return new e({type:\"boolean\",...m(t)})}function Wm(e,t){return new e({type:\"boolean\",coerce:!0,...m(t)})}function Cl(e,t){return new e({type:\"bigint\",...m(t)})}function Gm(e,t){return new e({type:\"bigint\",coerce:!0,...m(t)})}function Nl(e,t){return new e({type:\"bigint\",check:\"bigint_format\",abort:!1,format:\"int64\",...m(t)})}function Ol(e,t){return new e({type:\"bigint\",check:\"bigint_format\",abort:!1,format:\"uint64\",...m(t)})}function Al(e,t){return new e({type:\"symbol\",...m(t)})}function jl(e,t){return new e({type:\"undefined\",...m(t)})}function Ml(e,t){return new e({type:\"null\",...m(t)})}function ql(e){return new e({type:\"any\"})}function Ll(e){return new e({type:\"unknown\"})}function Dl(e,t){return new e({type:\"never\",...m(t)})}function Hl(e,t){return new e({type:\"void\",...m(t)})}function Ul(e,t){return new e({type:\"date\",...m(t)})}function Qm(e,t){return new e({type:\"date\",coerce:!0,...m(t)})}function Fl(e,t){return new e({type:\"nan\",...m(t)})}function Ae(e,t){return new ns({check:\"less_than\",...m(t),value:e,inclusive:!1})}function pe(e,t){return new ns({check:\"less_than\",...m(t),value:e,inclusive:!0})}function je(e,t){return new os({check:\"greater_than\",...m(t),value:e,inclusive:!1})}function se(e,t){return new os({check:\"greater_than\",...m(t),value:e,inclusive:!0})}function Ym(e){return je(0,e)}function Xm(e){return Ae(0,e)}function eg(e){return pe(0,e)}function tg(e){return se(0,e)}function Xt(e,t){return new Dc({check:\"multiple_of\",...m(t),value:e})}function ln(e,t){return new Fc({check:\"max_size\",...m(t),maximum:e})}function Me(e,t){return new Jc({check:\"min_size\",...m(t),minimum:e})}function Cs(e,t){return new Bc({check:\"size_equals\",...m(t),size:e})}function Ns(e,t){return new Vc({check:\"max_length\",...m(t),maximum:e})}function pt(e,t){return new Kc({check:\"min_length\",...m(t),minimum:e})}function Os(e,t){return new Wc({check:\"length_equals\",...m(t),length:e})}function Jl(e,t){return new Gc({check:\"string_format\",format:\"regex\",...m(t),pattern:e})}function Bl(e){return new Qc({check:\"string_format\",format:\"lowercase\",...m(e)})}function Vl(e){return new Yc({check:\"string_format\",format:\"uppercase\",...m(e)})}function Kl(e,t){return new Xc({check:\"string_format\",format:\"includes\",...m(t),includes:e})}function Wl(e,t){return new eu({check:\"string_format\",format:\"starts_with\",...m(t),prefix:e})}function Gl(e,t){return new tu({check:\"string_format\",format:\"ends_with\",...m(t),suffix:e})}function ng(e,t,n){return new nu({check:\"property\",property:e,schema:t,...m(n)})}function Ql(e,t){return new ou({check:\"mime_type\",mime:e,...m(t)})}function Ze(e){return new ru({check:\"overwrite\",tx:e})}function Yl(e){return Ze(t=>t.normalize(e))}function Xl(){return Ze(e=>e.trim())}function ed(){return Ze(e=>e.toLowerCase())}function td(){return Ze(e=>e.toUpperCase())}function nd(){return Ze(e=>Ko(e))}function od(e,t,n){return new e({type:\"array\",element:t,...m(n)})}function og(e,t,n){return new e({type:\"union\",options:t,...m(n)})}function rg(e,t,n){return new e({type:\"union\",options:t,inclusive:!1,...m(n)})}function sg(e,t,n,o){return new e({type:\"union\",options:n,discriminator:t,...m(o)})}function ig(e,t,n){return new e({type:\"intersection\",left:t,right:n})}function ag(e,t,n,o){const r=n instanceof y,s=r?o:n,i=r?n:null;return new e({type:\"tuple\",items:t,rest:i,...m(s)})}function cg(e,t,n,o){return new e({type:\"record\",keyType:t,valueType:n,...m(o)})}function ug(e,t,n,o){return new e({type:\"map\",keyType:t,valueType:n,...m(o)})}function lg(e,t,n){return new e({type:\"set\",valueType:t,...m(n)})}function dg(e,t,n){const o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:\"enum\",entries:o,...m(n)})}function pg(e,t,n){return new e({type:\"enum\",entries:t,...m(n)})}function fg(e,t,n){return new e({type:\"literal\",values:Array.isArray(t)?t:[t],...m(n)})}function rd(e,t){return new e({type:\"file\",...m(t)})}function hg(e,t){return new e({type:\"transform\",transform:t})}function mg(e,t){return new e({type:\"optional\",innerType:t})}function gg(e,t){return new e({type:\"nullable\",innerType:t})}function _g(e,t,n){return new e({type:\"default\",innerType:t,get defaultValue(){return typeof n==\"function\"?n():$t(n)}})}function bg(e,t,n){return new e({type:\"nonoptional\",innerType:t,...m(n)})}function vg(e,t){return new e({type:\"success\",innerType:t})}function yg(e,t,n){return new e({type:\"catch\",innerType:t,catchValue:typeof n==\"function\"?n:()=>n})}function wg(e,t,n){return new e({type:\"pipe\",in:t,out:n})}function kg(e,t){return new e({type:\"readonly\",innerType:t})}function Sg(e,t,n){return new e({type:\"template_literal\",parts:t,...m(n)})}function zg(e,t){return new e({type:\"lazy\",getter:t})}function Tg(e,t){return new e({type:\"promise\",innerType:t})}function sd(e,t,n){const o=m(n);return o.abort??(o.abort=!0),new e({type:\"custom\",check:\"custom\",fn:t,...o})}function id(e,t,n){return new e({type:\"custom\",check:\"custom\",fn:t,...m(n)})}function ad(e){const t=cd(n=>(n.addIssue=o=>{if(typeof o==\"string\")n.issues.push(Te(o,n.value,t._zod.def));else{const r=o;r.fatal&&(r.continue=!1),r.code??(r.code=\"custom\"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Te(r))}},e(n.value,n)));return t}function cd(e,t){const n=new A({check:\"custom\",...m(t)});return n._zod.check=e,n}function ud(e){const t=new A({check:\"describe\"});return t._zod.onattach=[n=>{const o=ce.get(n)??{};ce.add(n,{...o,description:e})}],t._zod.check=()=>{},t}function ld(e){const t=new A({check:\"meta\"});return t._zod.onattach=[n=>{const o=ce.get(n)??{};ce.add(n,{...o,...e})}],t._zod.check=()=>{},t}function dd(e,t){const n=m(t);let o=n.truthy??[\"true\",\"1\",\"yes\",\"on\",\"y\",\"enabled\"],r=n.falsy??[\"false\",\"0\",\"no\",\"off\",\"n\",\"disabled\"];n.case!==\"sensitive\"&&(o=o.map(b=>typeof b==\"string\"?b.toLowerCase():b),r=r.map(b=>typeof b==\"string\"?b.toLowerCase():b));const s=new Set(o),i=new Set(r),a=e.Codec??ps,c=e.Boolean??is,u=e.String??Nt,f=new u({type:\"string\",error:n.error}),g=new c({type:\"boolean\",error:n.error}),_=new a({type:\"pipe\",in:f,out:g,transform:((b,Z)=>{let N=b;return n.case!==\"sensitive\"&&(N=N.toLowerCase()),s.has(N)?!0:i.has(N)?!1:(Z.issues.push({code:\"invalid_value\",expected:\"stringbool\",values:[...s,...i],input:Z.value,inst:_,continue:!1}),{})}),reverseTransform:((b,Z)=>b===!0?o[0]||\"true\":r[0]||\"false\"),error:n.error});return _}function Ot(e,t,n,o={}){const r=m(o),s={...m(o),check:\"string_format\",type:\"string\",format:t,fn:typeof n==\"function\"?n:a=>n.test(a),...r};return n instanceof RegExp&&(s.pattern=n),new e(s)}function ft(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??ce,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 x(e,t,n={path:[],schemaPath:[]}){var o;const r=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const _=i.schema,b=t.processors[r.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);b(e,t,_,f)}const g=e._zod.parent;g&&(i.ref||(i.ref=g),x(g,t,f),t.seen.get(g).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io===\"input\"&&F(e)&&(delete i.schema.examples,delete i.schema.default),t.io===\"input\"&&i.schema._prefault&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function ht(e,t){const n=e.seen.get(t);if(!n)throw new Error(\"Unprocessed schema. This is a bug in Zod.\");const o=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id \"${a}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}const r=i=>{const a=e.target===\"draft-2020-12\"?\"$defs\":\"definitions\";if(e.external){const g=e.external.registry.get(i[0])?.id,_=e.external.uri??(Z=>Z);if(g)return{ref:_(g)};const b=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=b,{defId:b,ref:`${_(\"__shared\")}#/${a}/${b}`}}if(i[1]===n)return{ref:\"#\"};const u=`#/${a}/`,f=i[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:u+f}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=r(i);a.def={...a.schema},u&&(a.defId=u);const f=a.schema;for(const g in f)delete f[g];f.$ref=c};if(e.cycles===\"throw\")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join(\"/\")}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused===\"ref\"){s(i);continue}}}function mt(e,t){const n=e.seen.get(t);if(!n)throw new Error(\"Unprocessed schema. This is a bug in Zod.\");const o=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},f=a.ref;if(a.ref=null,f){o(f);const _=e.seen.get(f),b=_.schema;if(b.$ref&&(e.target===\"draft-07\"||e.target===\"draft-04\"||e.target===\"openapi-3.0\")?(c.allOf=c.allOf??[],c.allOf.push(b)):Object.assign(c,b),Object.assign(c,u),i._zod.parent===f)for(const N in c)N===\"$ref\"||N===\"allOf\"||N in u||delete c[N];if(b.$ref&&_.def)for(const N in c)N===\"$ref\"||N===\"allOf\"||N in _.def&&JSON.stringify(c[N])===JSON.stringify(_.def[N])&&delete c[N]}const g=i._zod.parent;if(g&&g!==f){o(g);const _=e.seen.get(g);if(_?.schema.$ref&&(c.$ref=_.schema.$ref,_.def))for(const b in c)b===\"$ref\"||b===\"allOf\"||b in _.def&&JSON.stringify(c[b])===JSON.stringify(_.def[b])&&delete c[b]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())o(i[0]);const r={};if(e.target===\"draft-2020-12\"?r.$schema=\"https://json-schema.org/draft/2020-12/schema\":e.target===\"draft-07\"?r.$schema=\"http://json-schema.org/draft-07/schema#\":e.target===\"draft-04\"?r.$schema=\"http://json-schema.org/draft-04/schema#\":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error(\"Schema is missing an `id` property\");r.$id=e.external.uri(i)}Object.assign(r,n.def??n.schema);const s=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(s[a.defId]=a.def)}e.external||Object.keys(s).length>0&&(e.target===\"draft-2020-12\"?r.$defs=s:r.definitions=s);try{const i=JSON.parse(JSON.stringify(r));return Object.defineProperty(i,\"~standard\",{value:{...t[\"~standard\"],jsonSchema:{input:gt(t,\"input\",e.processors),output:gt(t,\"output\",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error(\"Error converting schema to JSON.\")}}function F(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if(o.type===\"transform\")return!0;if(o.type===\"array\")return F(o.element,n);if(o.type===\"set\")return F(o.valueType,n);if(o.type===\"lazy\")return F(o.getter(),n);if(o.type===\"promise\"||o.type===\"optional\"||o.type===\"nonoptional\"||o.type===\"nullable\"||o.type===\"readonly\"||o.type===\"default\"||o.type===\"prefault\")return F(o.innerType,n);if(o.type===\"intersection\")return F(o.left,n)||F(o.right,n);if(o.type===\"record\"||o.type===\"map\")return F(o.keyType,n)||F(o.valueType,n);if(o.type===\"pipe\")return F(o.in,n)||F(o.out,n);if(o.type===\"object\"){for(const r in o.shape)if(F(o.shape[r],n))return!0;return!1}if(o.type===\"union\"){for(const r of o.options)if(F(r,n))return!0;return!1}if(o.type===\"tuple\"){for(const r of o.items)if(F(r,n))return!0;return!!(o.rest&&F(o.rest,n))}return!1}const pd=(e,t={})=>n=>{const o=ft({...n,processors:t});return x(e,o),ht(o,e),mt(o,e)},gt=(e,t,n={})=>o=>{const{libraryOptions:r,target:s}=o??{},i=ft({...r??{},target:s,io:t,processors:n});return x(e,i),ht(i,e),mt(i,e)},fd={guid:\"uuid\",url:\"uri\",datetime:\"date-time\",json_string:\"json-string\",regex:\"\"},As=(e,t,n,o)=>{const r=n;r.type=\"string\";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s==\"number\"&&(r.minLength=s),typeof i==\"number\"&&(r.maxLength=i),a&&(r.format=fd[a]??a,r.format===\"\"&&delete r.format,a===\"time\"&&delete r.format),u&&(r.contentEncoding=u),c&&c.size>0){const f=[...c];f.length===1?r.pattern=f[0].source:f.length>1&&(r.allOf=[...f.map(g=>({...t.target===\"draft-07\"||t.target===\"draft-04\"||t.target===\"openapi-3.0\"?{type:\"string\"}:{},pattern:g.source}))])}},js=(e,t,n,o)=>{const r=n,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=e._zod.bag;typeof a==\"string\"&&a.includes(\"int\")?r.type=\"integer\":r.type=\"number\",typeof f==\"number\"&&(t.target===\"draft-04\"||t.target===\"openapi-3.0\"?(r.minimum=f,r.exclusiveMinimum=!0):r.exclusiveMinimum=f),typeof s==\"number\"&&(r.minimum=s,typeof f==\"number\"&&t.target!==\"draft-04\"&&(f>=s?delete r.minimum:delete r.exclusiveMinimum)),typeof u==\"number\"&&(t.target===\"draft-04\"||t.target===\"openapi-3.0\"?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u),typeof i==\"number\"&&(r.maximum=i,typeof u==\"number\"&&t.target!==\"draft-04\"&&(u<=i?delete r.maximum:delete r.exclusiveMaximum)),typeof c==\"number\"&&(r.multipleOf=c)},Ms=(e,t,n,o)=>{n.type=\"boolean\"},qs=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"BigInt cannot be represented in JSON Schema\")},Ls=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Symbols cannot be represented in JSON Schema\")},Ds=(e,t,n,o)=>{t.target===\"openapi-3.0\"?(n.type=\"string\",n.nullable=!0,n.enum=[null]):n.type=\"null\"},Hs=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Undefined cannot be represented in JSON Schema\")},Us=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Void cannot be represented in JSON Schema\")},Fs=(e,t,n,o)=>{n.not={}},Js=(e,t,n,o)=>{},Bs=(e,t,n,o)=>{},Vs=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Date cannot be represented in JSON Schema\")},Ks=(e,t,n,o)=>{const r=e._zod.def,s=on(r.entries);s.every(i=>typeof i==\"number\")&&(n.type=\"number\"),s.every(i=>typeof i==\"string\")&&(n.type=\"string\"),n.enum=s},Ws=(e,t,n,o)=>{const r=e._zod.def,s=[];for(const i of r.values)if(i===void 0){if(t.unrepresentable===\"throw\")throw new Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof i==\"bigint\"){if(t.unrepresentable===\"throw\")throw new Error(\"BigInt literals cannot be represented in JSON Schema\");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){const i=s[0];n.type=i===null?\"null\":typeof i,t.target===\"draft-04\"||t.target===\"openapi-3.0\"?n.enum=[i]:n.const=i}else s.every(i=>typeof i==\"number\")&&(n.type=\"number\"),s.every(i=>typeof i==\"string\")&&(n.type=\"string\"),s.every(i=>typeof i==\"boolean\")&&(n.type=\"boolean\"),s.every(i=>i===null)&&(n.type=\"null\"),n.enum=s},Gs=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"NaN cannot be represented in JSON Schema\")},Qs=(e,t,n,o)=>{const r=n,s=e._zod.pattern;if(!s)throw new Error(\"Pattern not found in template literal\");r.type=\"string\",r.pattern=s.source},Ys=(e,t,n,o)=>{const r=n,s={type:\"string\",format:\"binary\",contentEncoding:\"binary\"},{minimum:i,maximum:a,mime:c}=e._zod.bag;i!==void 0&&(s.minLength=i),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(r,s)},Xs=(e,t,n,o)=>{n.type=\"boolean\"},ei=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Custom types cannot be represented in JSON Schema\")},ti=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Function types cannot be represented in JSON Schema\")},ni=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Transforms cannot be represented in JSON Schema\")},oi=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Map cannot be represented in JSON Schema\")},ri=(e,t,n,o)=>{if(t.unrepresentable===\"throw\")throw new Error(\"Set cannot be represented in JSON Schema\")},si=(e,t,n,o)=>{const r=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i==\"number\"&&(r.minItems=i),typeof a==\"number\"&&(r.maxItems=a),r.type=\"array\",r.items=x(s.element,t,{...o,path:[...o.path,\"items\"]})},ii=(e,t,n,o)=>{const r=n,s=e._zod.def;r.type=\"object\",r.properties={};const i=s.shape;for(const u in i)r.properties[u]=x(i[u],t,{...o,path:[...o.path,\"properties\",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const f=s.shape[u]._zod;return t.io===\"input\"?f.optin===void 0:f.optout===void 0}));c.size>0&&(r.required=Array.from(c)),s.catchall?._zod.def.type===\"never\"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=x(s.catchall,t,{...o,path:[...o.path,\"additionalProperties\"]})):t.io===\"output\"&&(r.additionalProperties=!1)},dn=(e,t,n,o)=>{const r=e._zod.def,s=r.inclusive===!1,i=r.options.map((a,c)=>x(a,t,{...o,path:[...o.path,s?\"oneOf\":\"anyOf\",c]}));s?n.oneOf=i:n.anyOf=i},ai=(e,t,n,o)=>{const r=e._zod.def,s=x(r.left,t,{...o,path:[...o.path,\"allOf\",0]}),i=x(r.right,t,{...o,path:[...o.path,\"allOf\",1]}),a=u=>\"allOf\"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},ci=(e,t,n,o)=>{const r=n,s=e._zod.def;r.type=\"array\";const i=t.target===\"draft-2020-12\"?\"prefixItems\":\"items\",a=t.target===\"draft-2020-12\"||t.target===\"openapi-3.0\"?\"items\":\"additionalItems\",c=s.items.map((_,b)=>x(_,t,{...o,path:[...o.path,i,b]})),u=s.rest?x(s.rest,t,{...o,path:[...o.path,a,...t.target===\"openapi-3.0\"?[s.items.length]:[]]}):null;t.target===\"draft-2020-12\"?(r.prefixItems=c,u&&(r.items=u)):t.target===\"openapi-3.0\"?(r.items={anyOf:c},u&&r.items.anyOf.push(u),r.minItems=c.length,u||(r.maxItems=c.length)):(r.items=c,u&&(r.additionalItems=u));const{minimum:f,maximum:g}=e._zod.bag;typeof f==\"number\"&&(r.minItems=f),typeof g==\"number\"&&(r.maxItems=g)},ui=(e,t,n,o)=>{const r=n,s=e._zod.def;r.type=\"object\";const i=s.keyType,c=i._zod.bag?.patterns;if(s.mode===\"loose\"&&c&&c.size>0){const f=x(s.valueType,t,{...o,path:[...o.path,\"patternProperties\",\"*\"]});r.patternProperties={};for(const g of c)r.patternProperties[g.source]=f}else(t.target===\"draft-07\"||t.target===\"draft-2020-12\")&&(r.propertyNames=x(s.keyType,t,{...o,path:[...o.path,\"propertyNames\"]})),r.additionalProperties=x(s.valueType,t,{...o,path:[...o.path,\"additionalProperties\"]});const u=i._zod.values;if(u){const f=[...u].filter(g=>typeof g==\"string\"||typeof g==\"number\");f.length>0&&(r.required=f)}},li=(e,t,n,o)=>{const r=e._zod.def,s=x(r.innerType,t,o),i=t.seen.get(e);t.target===\"openapi-3.0\"?(i.ref=r.innerType,n.nullable=!0):n.anyOf=[s,{type:\"null\"}]},di=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},pi=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},fi=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,t.io===\"input\"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},hi=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType;let i;try{i=r.catchValue(void 0)}catch{throw new Error(\"Dynamic catch values are not supported in JSON Schema\")}n.default=i},mi=(e,t,n,o)=>{const r=e._zod.def,s=t.io===\"input\"?r.in._zod.def.type===\"transform\"?r.out:r.in:r.out;x(s,t,o);const i=t.seen.get(e);i.ref=s},gi=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,n.readOnly=!0},_i=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},pn=(e,t,n,o)=>{const r=e._zod.def;x(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},bi=(e,t,n,o)=>{const r=e._zod.innerType;x(r,t,o);const s=t.seen.get(e);s.ref=r},Oo={string:As,number:js,boolean:Ms,bigint:qs,symbol:Ls,null:Ds,undefined:Hs,void:Us,never:Fs,any:Js,unknown:Bs,date:Vs,enum:Ks,literal:Ws,nan:Gs,template_literal:Qs,file:Ys,success:Xs,custom:ei,function:ti,transform:ni,map:oi,set:ri,array:si,object:ii,union:dn,intersection:ai,tuple:ci,record:ui,nullable:li,nonoptional:di,default:pi,prefault:fi,catch:hi,pipe:mi,readonly:gi,promise:_i,optional:pn,lazy:bi};function $g(e,t){if(\"_idmap\"in e){const o=e,r=ft({...t,processors:Oo}),s={};for(const c of o._idmap.entries()){const[u,f]=c;x(f,r)}const i={},a={registry:o,uri:t?.uri,defs:s};r.external=a;for(const c of o._idmap.entries()){const[u,f]=c;ht(r,f),i[u]=mt(r,f)}if(Object.keys(s).length>0){const c=r.target===\"draft-2020-12\"?\"$defs\":\"definitions\";i.__shared={[c]:s}}return{schemas:i}}const n=ft({...t,processors:Oo});return x(e,n),ht(n,e),mt(n,e)}function fn(e){return!!e._zod}function vi(e,t){return fn(e)?pr(e,t):e.safeParse(t)}function hd(e){if(!e)return;let t;if(fn(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t==\"function\")try{return t()}catch{return}return t}}function md(e){if(fn(e)){const s=e._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}const n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const o=e.value;if(o!==void 0)return o}const yi=l(\"ZodISODateTime\",(e,t)=>{bu.init(e,t),C.init(e,t)});function hn(e){return kl(yi,e)}const wi=l(\"ZodISODate\",(e,t)=>{vu.init(e,t),C.init(e,t)});function ki(e){return Sl(wi,e)}const Si=l(\"ZodISOTime\",(e,t)=>{yu.init(e,t),C.init(e,t)});function zi(e){return zl(Si,e)}const Ti=l(\"ZodISODuration\",(e,t)=>{wu.init(e,t),C.init(e,t)});function $i(e){return Tl(Ti,e)}const Eg=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:wi,ZodISODateTime:yi,ZodISODuration:Ti,ZodISOTime:Si,date:ki,datetime:hn,duration:$i,time:zi},Symbol.toStringTag,{value:\"Module\"})),Ei=(e,t)=>{dr.init(e,t),e.name=\"ZodError\",Object.defineProperties(e,{format:{value:n=>fc(e,n)},flatten:{value:n=>pc(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ut,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ut,2)}},isEmpty:{get(){return e.issues.length===0}}})},Pg=l(\"ZodError\",Ei),X=l(\"ZodError\",Ei,{Parent:Error}),gd=It(X),_d=Zt(X),bd=xt(X),vd=Rt(X),yd=fr(X),wd=hr(X),kd=mr(X),Sd=gr(X),zd=_r(X),Td=br(X),$d=vr(X),Ed=yr(X),k=l(\"ZodType\",(e,t)=>(y.init(e,t),Object.assign(e[\"~standard\"],{jsonSchema:{input:gt(e,\"input\"),output:gt(e,\"output\")}}),e.toJSONSchema=pd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,\"_def\",{value:t}),e.check=(...n)=>e.clone(ie(t,{checks:[...t.checks??[],...n.map(o=>typeof o==\"function\"?{_zod:{check:o,def:{check:\"custom\"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(n,o)=>ae(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>gd(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>bd(e,n,o),e.parseAsync=async(n,o)=>_d(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>vd(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>yd(e,n,o),e.decode=(n,o)=>wd(e,n,o),e.encodeAsync=async(n,o)=>kd(e,n,o),e.decodeAsync=async(n,o)=>Sd(e,n,o),e.safeEncode=(n,o)=>zd(e,n,o),e.safeDecode=(n,o)=>Td(e,n,o),e.safeEncodeAsync=async(n,o)=>$d(e,n,o),e.safeDecodeAsync=async(n,o)=>Ed(e,n,o),e.refine=(n,o)=>e.check(ha(n,o)),e.superRefine=n=>e.check(ma(n)),e.overwrite=n=>e.check(Ze(n)),e.optional=()=>O(e),e.exactOptional=()=>Wi(e),e.nullable=()=>vt(e),e.nullish=()=>O(vt(e)),e.nonoptional=n=>ta(e,n),e.array=()=>v(e),e.or=n=>z([e,n]),e.and=n=>qt(e,n),e.transform=n=>yt(e,Ln(n)),e.default=n=>Yi(e,n),e.prefault=n=>ea(e,n),e.catch=n=>ra(e,n),e.pipe=n=>yt(e,n),e.readonly=()=>aa(e),e.describe=n=>{const o=e.clone();return ce.add(o,{description:n}),o},Object.defineProperty(e,\"description\",{get(){return ce.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ce.get(e);const o=e.clone();return ce.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),mn=l(\"_ZodString\",(e,t)=>{Nt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>As(e,o,r);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Jl(...o)),e.includes=(...o)=>e.check(Kl(...o)),e.startsWith=(...o)=>e.check(Wl(...o)),e.endsWith=(...o)=>e.check(Gl(...o)),e.min=(...o)=>e.check(pt(...o)),e.max=(...o)=>e.check(Ns(...o)),e.length=(...o)=>e.check(Os(...o)),e.nonempty=(...o)=>e.check(pt(1,...o)),e.lowercase=o=>e.check(Bl(o)),e.uppercase=o=>e.check(Vl(o)),e.trim=()=>e.check(Xl()),e.normalize=(...o)=>e.check(Yl(...o)),e.toLowerCase=()=>e.check(ed()),e.toUpperCase=()=>e.check(td()),e.slugify=()=>e.check(nd())}),gn=l(\"ZodString\",(e,t)=>{Nt.init(e,t),mn.init(e,t),e.email=n=>e.check(fs(_n,n)),e.url=n=>e.check(un(At,n)),e.jwt=n=>e.check(Rs(Rn,n)),e.emoji=n=>e.check(bs(bn,n)),e.guid=n=>e.check(Yt(_t,n)),e.uuid=n=>e.check(hs(ue,n)),e.uuidv4=n=>e.check(ms(ue,n)),e.uuidv6=n=>e.check(gs(ue,n)),e.uuidv7=n=>e.check(_s(ue,n)),e.nanoid=n=>e.check(vs(vn,n)),e.guid=n=>e.check(Yt(_t,n)),e.cuid=n=>e.check(ys(yn,n)),e.cuid2=n=>e.check(ws(wn,n)),e.ulid=n=>e.check(ks(kn,n)),e.base64=n=>e.check(Is(In,n)),e.base64url=n=>e.check(Zs(Zn,n)),e.xid=n=>e.check(Ss(Sn,n)),e.ksuid=n=>e.check(zs(zn,n)),e.ipv4=n=>e.check(Ts(Tn,n)),e.ipv6=n=>e.check($s($n,n)),e.cidrv4=n=>e.check(Es(En,n)),e.cidrv6=n=>e.check(Ps(Pn,n)),e.e164=n=>e.check(xs(xn,n)),e.datetime=n=>e.check(hn(n)),e.date=n=>e.check(ki(n)),e.time=n=>e.check(zi(n)),e.duration=n=>e.check($i(n))});function d(e){return yl(gn,e)}const C=l(\"ZodStringFormat\",(e,t)=>{R.init(e,t),mn.init(e,t)}),_n=l(\"ZodEmail\",(e,t)=>{uu.init(e,t),C.init(e,t)});function Pd(e){return fs(_n,e)}const _t=l(\"ZodGUID\",(e,t)=>{au.init(e,t),C.init(e,t)});function Id(e){return Yt(_t,e)}const ue=l(\"ZodUUID\",(e,t)=>{cu.init(e,t),C.init(e,t)});function Zd(e){return hs(ue,e)}function xd(e){return ms(ue,e)}function Rd(e){return gs(ue,e)}function Cd(e){return _s(ue,e)}const At=l(\"ZodURL\",(e,t)=>{lu.init(e,t),C.init(e,t)});function Nd(e){return un(At,e)}function Od(e){return un(At,{protocol:/^https?$/,hostname:qr,...m(e)})}const bn=l(\"ZodEmoji\",(e,t)=>{du.init(e,t),C.init(e,t)});function Ad(e){return bs(bn,e)}const vn=l(\"ZodNanoID\",(e,t)=>{pu.init(e,t),C.init(e,t)});function jd(e){return vs(vn,e)}const yn=l(\"ZodCUID\",(e,t)=>{fu.init(e,t),C.init(e,t)});function Md(e){return ys(yn,e)}const wn=l(\"ZodCUID2\",(e,t)=>{hu.init(e,t),C.init(e,t)});function qd(e){return ws(wn,e)}const kn=l(\"ZodULID\",(e,t)=>{mu.init(e,t),C.init(e,t)});function Ld(e){return ks(kn,e)}const Sn=l(\"ZodXID\",(e,t)=>{gu.init(e,t),C.init(e,t)});function Dd(e){return Ss(Sn,e)}const zn=l(\"ZodKSUID\",(e,t)=>{_u.init(e,t),C.init(e,t)});function Hd(e){return zs(zn,e)}const Tn=l(\"ZodIPv4\",(e,t)=>{ku.init(e,t),C.init(e,t)});function Ud(e){return Ts(Tn,e)}const Pi=l(\"ZodMAC\",(e,t)=>{zu.init(e,t),C.init(e,t)});function Fd(e){return wl(Pi,e)}const $n=l(\"ZodIPv6\",(e,t)=>{Su.init(e,t),C.init(e,t)});function Jd(e){return $s($n,e)}const En=l(\"ZodCIDRv4\",(e,t)=>{Tu.init(e,t),C.init(e,t)});function Bd(e){return Es(En,e)}const Pn=l(\"ZodCIDRv6\",(e,t)=>{$u.init(e,t),C.init(e,t)});function Vd(e){return Ps(Pn,e)}const In=l(\"ZodBase64\",(e,t)=>{Eu.init(e,t),C.init(e,t)});function Kd(e){return Is(In,e)}const Zn=l(\"ZodBase64URL\",(e,t)=>{Iu.init(e,t),C.init(e,t)});function Wd(e){return Zs(Zn,e)}const xn=l(\"ZodE164\",(e,t)=>{Zu.init(e,t),C.init(e,t)});function Gd(e){return xs(xn,e)}const Rn=l(\"ZodJWT\",(e,t)=>{Ru.init(e,t),C.init(e,t)});function Qd(e){return Rs(Rn,e)}const Je=l(\"ZodCustomStringFormat\",(e,t)=>{Cu.init(e,t),C.init(e,t)});function Yd(e,t,n={}){return Ot(Je,e,t,n)}function Xd(e){return Ot(Je,\"hostname\",Mr,e)}function ep(e){return Ot(Je,\"hex\",es,e)}function tp(e,t){const n=t?.enc??\"hex\",o=`${e}_${n}`,r=Lc[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return Ot(Je,o,r,t)}const Cn=l(\"ZodNumber\",(e,t)=>{ss.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>js(e,o,r),e.gt=(o,r)=>e.check(je(o,r)),e.gte=(o,r)=>e.check(se(o,r)),e.min=(o,r)=>e.check(se(o,r)),e.lt=(o,r)=>e.check(Ae(o,r)),e.lte=(o,r)=>e.check(pe(o,r)),e.max=(o,r)=>e.check(pe(o,r)),e.int=o=>e.check(en(o)),e.safe=o=>e.check(en(o)),e.positive=o=>e.check(je(0,o)),e.nonnegative=o=>e.check(se(0,o)),e.negative=o=>e.check(Ae(0,o)),e.nonpositive=o=>e.check(pe(0,o)),e.multipleOf=(o,r)=>e.check(Xt(o,r)),e.step=(o,r)=>e.check(Xt(o,r)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??\"\").includes(\"int\")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function w(e){return $l(Cn,e)}const xe=l(\"ZodNumberFormat\",(e,t)=>{Nu.init(e,t),Cn.init(e,t)});function en(e){return El(xe,e)}function np(e){return Pl(xe,e)}function op(e){return Il(xe,e)}function rp(e){return Zl(xe,e)}function sp(e){return xl(xe,e)}const Nn=l(\"ZodBoolean\",(e,t)=>{is.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ms(e,n,o)});function I(e){return Rl(Nn,e)}const On=l(\"ZodBigInt\",(e,t)=>{as.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>qs(e,o),e.gte=(o,r)=>e.check(se(o,r)),e.min=(o,r)=>e.check(se(o,r)),e.gt=(o,r)=>e.check(je(o,r)),e.gte=(o,r)=>e.check(se(o,r)),e.min=(o,r)=>e.check(se(o,r)),e.lt=(o,r)=>e.check(Ae(o,r)),e.lte=(o,r)=>e.check(pe(o,r)),e.max=(o,r)=>e.check(pe(o,r)),e.positive=o=>e.check(je(BigInt(0),o)),e.negative=o=>e.check(Ae(BigInt(0),o)),e.nonpositive=o=>e.check(pe(BigInt(0),o)),e.nonnegative=o=>e.check(se(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(Xt(o,r));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function ip(e){return Cl(On,e)}const An=l(\"ZodBigIntFormat\",(e,t)=>{Ou.init(e,t),On.init(e,t)});function ap(e){return Nl(An,e)}function cp(e){return Ol(An,e)}const Ii=l(\"ZodSymbol\",(e,t)=>{Au.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ls(e,n)});function up(e){return Al(Ii,e)}const Zi=l(\"ZodUndefined\",(e,t)=>{ju.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Hs(e,n)});function bt(e){return jl(Zi,e)}const xi=l(\"ZodNull\",(e,t)=>{Mu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ds(e,n,o)});function jn(e){return Ml(xi,e)}const Ri=l(\"ZodAny\",(e,t)=>{qu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Js()});function Mn(){return ql(Ri)}const Ci=l(\"ZodUnknown\",(e,t)=>{Lu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Bs()});function E(){return Ll(Ci)}const Ni=l(\"ZodNever\",(e,t)=>{Du.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Fs(e,n,o)});function qe(e){return Dl(Ni,e)}const Oi=l(\"ZodVoid\",(e,t)=>{Hu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Us(e,n)});function lp(e){return Hl(Oi,e)}const Ai=l(\"ZodDate\",(e,t)=>{Uu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>Vs(e,o),e.min=(o,r)=>e.check(se(o,r)),e.max=(o,r)=>e.check(pe(o,r));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function dp(e){return Ul(Ai,e)}const ji=l(\"ZodArray\",(e,t)=>{Fu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>si(e,n,o,r),e.element=t.element,e.min=(n,o)=>e.check(pt(n,o)),e.nonempty=n=>e.check(pt(1,n)),e.max=(n,o)=>e.check(Ns(n,o)),e.length=(n,o)=>e.check(Os(n,o)),e.unwrap=()=>e.element});function v(e,t){return od(ji,e,t)}function pp(e){const t=e._zod.def.shape;return B(Object.keys(t))}const jt=l(\"ZodObject\",(e,t)=>{Bu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ii(e,n,o,r),S(e,\"shape\",()=>t.shape),e.keyof=()=>B(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:E()}),e.loose=()=>e.clone({...e._zod.def,catchall:E()}),e.strict=()=>e.clone({...e._zod.def,catchall:qe()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>or(e,n),e.safeExtend=n=>rr(e,n),e.merge=n=>sr(e,n),e.pick=n=>tr(e,n),e.omit=n=>nr(e,n),e.partial=(...n)=>ir(Dn,e,n[0]),e.required=(...n)=>ar(Hn,e,n[0])});function h(e,t){const n={type:\"object\",shape:e??{},...m(t)};return new jt(n)}function fp(e,t){return new jt({type:\"object\",shape:e,catchall:qe(),...m(t)})}function J(e,t){return new jt({type:\"object\",shape:e,catchall:E(),...m(t)})}const Mt=l(\"ZodUnion\",(e,t)=>{cn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>dn(e,n,o,r),e.options=t.options});function z(e,t){return new Mt({type:\"union\",options:e,...m(t)})}const Mi=l(\"ZodXor\",(e,t)=>{Mt.init(e,t),Vu.init(e,t),e._zod.processJSONSchema=(n,o,r)=>dn(e,n,o,r),e.options=t.options});function hp(e,t){return new Mi({type:\"union\",options:e,inclusive:!1,...m(t)})}const qi=l(\"ZodDiscriminatedUnion\",(e,t)=>{Mt.init(e,t),Ku.init(e,t)});function qn(e,t,n){return new qi({type:\"union\",options:t,discriminator:e,...m(n)})}const Li=l(\"ZodIntersection\",(e,t)=>{Wu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ai(e,n,o,r)});function qt(e,t){return new Li({type:\"intersection\",left:e,right:t})}const Di=l(\"ZodTuple\",(e,t)=>{ls.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ci(e,n,o,r),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Hi(e,t,n){const o=t instanceof y,r=o?n:t,s=o?t:null;return new Di({type:\"tuple\",items:e,rest:s,...m(r)})}const Lt=l(\"ZodRecord\",(e,t)=>{Gu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ui(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType});function T(e,t,n){return new Lt({type:\"record\",keyType:e,valueType:t,...m(n)})}function mp(e,t,n){const o=ae(e);return o._zod.values=void 0,new Lt({type:\"record\",keyType:o,valueType:t,...m(n)})}function gp(e,t,n){return new Lt({type:\"record\",keyType:e,valueType:t,mode:\"loose\",...m(n)})}const Ui=l(\"ZodMap\",(e,t)=>{Qu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>oi(e,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Me(...n)),e.nonempty=n=>e.check(Me(1,n)),e.max=(...n)=>e.check(ln(...n)),e.size=(...n)=>e.check(Cs(...n))});function _p(e,t,n){return new Ui({type:\"map\",keyType:e,valueType:t,...m(n)})}const Fi=l(\"ZodSet\",(e,t)=>{Yu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ri(e,n),e.min=(...n)=>e.check(Me(...n)),e.nonempty=n=>e.check(Me(1,n)),e.max=(...n)=>e.check(ln(...n)),e.size=(...n)=>e.check(Cs(...n))});function bp(e,t){return new Fi({type:\"set\",valueType:e,...m(t)})}const Le=l(\"ZodEnum\",(e,t)=>{Xu.init(e,t),k.init(e,t),e._zod.processJSONSchema=(o,r,s)=>Ks(e,o,r),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{const s={};for(const i of o)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Le({...t,checks:[],...m(r),entries:s})},e.exclude=(o,r)=>{const s={...t.entries};for(const i of o)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Le({...t,checks:[],...m(r),entries:s})}});function B(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Le({type:\"enum\",entries:n,...m(t)})}function vp(e,t){return new Le({type:\"enum\",entries:e,...m(t)})}const Ji=l(\"ZodLiteral\",(e,t)=>{el.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ws(e,n,o),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 p(e,t){return new Ji({type:\"literal\",values:Array.isArray(e)?e:[e],...m(t)})}const Bi=l(\"ZodFile\",(e,t)=>{tl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ys(e,n,o),e.min=(n,o)=>e.check(Me(n,o)),e.max=(n,o)=>e.check(ln(n,o)),e.mime=(n,o)=>e.check(Ql(Array.isArray(n)?n:[n],o))});function yp(e){return rd(Bi,e)}const Vi=l(\"ZodTransform\",(e,t)=>{nl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ni(e,n),e._zod.parse=(n,o)=>{if(o.direction===\"backward\")throw new nn(e.constructor.name);n.addIssue=s=>{if(typeof s==\"string\")n.issues.push(Te(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code=\"custom\"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Te(i))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then(s=>(n.value=s,n)):(n.value=r,n)}});function Ln(e){return new Vi({type:\"transform\",transform:e})}const Dn=l(\"ZodOptional\",(e,t)=>{ds.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>pn(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function O(e){return new Dn({type:\"optional\",innerType:e})}const Ki=l(\"ZodExactOptional\",(e,t)=>{ol.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>pn(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Wi(e){return new Ki({type:\"optional\",innerType:e})}const Gi=l(\"ZodNullable\",(e,t)=>{rl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>li(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function vt(e){return new Gi({type:\"nullable\",innerType:e})}function wp(e){return O(vt(e))}const Qi=l(\"ZodDefault\",(e,t)=>{sl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>pi(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Yi(e,t){return new Qi({type:\"default\",innerType:e,get defaultValue(){return typeof t==\"function\"?t():$t(t)}})}const Xi=l(\"ZodPrefault\",(e,t)=>{il.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>fi(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ea(e,t){return new Xi({type:\"prefault\",innerType:e,get defaultValue(){return typeof t==\"function\"?t():$t(t)}})}const Hn=l(\"ZodNonOptional\",(e,t)=>{al.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>di(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ta(e,t){return new Hn({type:\"nonoptional\",innerType:e,...m(t)})}const na=l(\"ZodSuccess\",(e,t)=>{cl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Xs(e,n,o),e.unwrap=()=>e._zod.def.innerType});function kp(e){return new na({type:\"success\",innerType:e})}const oa=l(\"ZodCatch\",(e,t)=>{ul.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>hi(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ra(e,t){return new oa({type:\"catch\",innerType:e,catchValue:typeof t==\"function\"?t:()=>t})}const sa=l(\"ZodNaN\",(e,t)=>{ll.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Gs(e,n)});function Sp(e){return Fl(sa,e)}const Un=l(\"ZodPipe\",(e,t)=>{dl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>mi(e,n,o,r),e.in=t.in,e.out=t.out});function yt(e,t){return new Un({type:\"pipe\",in:e,out:t})}const Fn=l(\"ZodCodec\",(e,t)=>{Un.init(e,t),ps.init(e,t)});function zp(e,t,n){return new Fn({type:\"pipe\",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const ia=l(\"ZodReadonly\",(e,t)=>{pl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>gi(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function aa(e){return new ia({type:\"readonly\",innerType:e})}const ca=l(\"ZodTemplateLiteral\",(e,t)=>{fl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Qs(e,n,o)});function Tp(e,t){return new ca({type:\"template_literal\",parts:e,...m(t)})}const ua=l(\"ZodLazy\",(e,t)=>{gl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>bi(e,n,o,r),e.unwrap=()=>e._zod.def.getter()});function la(e){return new ua({type:\"lazy\",getter:e})}const da=l(\"ZodPromise\",(e,t)=>{ml.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>_i(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function $p(e){return new da({type:\"promise\",innerType:e})}const pa=l(\"ZodFunction\",(e,t)=>{hl.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ti(e,n)});function Ao(e){return new pa({type:\"function\",input:Array.isArray(e?.input)?Hi(e?.input):e?.input??v(E()),output:e?.output??E()})}const Dt=l(\"ZodCustom\",(e,t)=>{_l.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ei(e,n)});function Ep(e){const t=new A({check:\"custom\"});return t._zod.check=e,t}function fa(e,t){return sd(Dt,e??(()=>!0),t)}function ha(e,t={}){return id(Dt,e,t)}function ma(e){return ad(e)}const Pp=ud,Ip=ld;function Zp(e,t={}){const n=new Dt({type:\"custom\",check:\"custom\",fn:o=>o instanceof e,abort:!0,...m(t)});return n._zod.bag.Class=e,n._zod.check=o=>{o.value instanceof e||o.issues.push({code:\"invalid_type\",expected:e.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}const xp=(...e)=>dd({Codec:Fn,Boolean:Nn,String:gn},...e);function Rp(e){const t=la(()=>z([d(e),w(),I(),jn(),v(t),T(d(),t)]));return t}function Jn(e,t){return yt(Ln(e),t)}const Ig=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:Ri,ZodArray:ji,ZodBase64:In,ZodBase64URL:Zn,ZodBigInt:On,ZodBigIntFormat:An,ZodBoolean:Nn,ZodCIDRv4:En,ZodCIDRv6:Pn,ZodCUID:yn,ZodCUID2:wn,ZodCatch:oa,ZodCodec:Fn,ZodCustom:Dt,ZodCustomStringFormat:Je,ZodDate:Ai,ZodDefault:Qi,ZodDiscriminatedUnion:qi,ZodE164:xn,ZodEmail:_n,ZodEmoji:bn,ZodEnum:Le,ZodExactOptional:Ki,ZodFile:Bi,ZodFunction:pa,ZodGUID:_t,ZodIPv4:Tn,ZodIPv6:$n,ZodIntersection:Li,ZodJWT:Rn,ZodKSUID:zn,ZodLazy:ua,ZodLiteral:Ji,ZodMAC:Pi,ZodMap:Ui,ZodNaN:sa,ZodNanoID:vn,ZodNever:Ni,ZodNonOptional:Hn,ZodNull:xi,ZodNullable:Gi,ZodNumber:Cn,ZodNumberFormat:xe,ZodObject:jt,ZodOptional:Dn,ZodPipe:Un,ZodPrefault:Xi,ZodPromise:da,ZodReadonly:ia,ZodRecord:Lt,ZodSet:Fi,ZodString:gn,ZodStringFormat:C,ZodSuccess:na,ZodSymbol:Ii,ZodTemplateLiteral:ca,ZodTransform:Vi,ZodTuple:Di,ZodType:k,ZodULID:kn,ZodURL:At,ZodUUID:ue,ZodUndefined:Zi,ZodUnion:Mt,ZodUnknown:Ci,ZodVoid:Oi,ZodXID:Sn,ZodXor:Mi,_ZodString:mn,_default:Yi,_function:Ao,any:Mn,array:v,base64:Kd,base64url:Wd,bigint:ip,boolean:I,catch:ra,check:Ep,cidrv4:Bd,cidrv6:Vd,codec:zp,cuid:Md,cuid2:qd,custom:fa,date:dp,describe:Pp,discriminatedUnion:qn,e164:Gd,email:Pd,emoji:Ad,enum:B,exactOptional:Wi,file:yp,float32:np,float64:op,function:Ao,guid:Id,hash:tp,hex:ep,hostname:Xd,httpUrl:Od,instanceof:Zp,int:en,int32:rp,int64:ap,intersection:qt,ipv4:Ud,ipv6:Jd,json:Rp,jwt:Qd,keyof:pp,ksuid:Hd,lazy:la,literal:p,looseObject:J,looseRecord:gp,mac:Fd,map:_p,meta:Ip,nan:Sp,nanoid:jd,nativeEnum:vp,never:qe,nonoptional:ta,null:jn,nullable:vt,nullish:wp,number:w,object:h,optional:O,partialRecord:mp,pipe:yt,prefault:ea,preprocess:Jn,promise:$p,readonly:aa,record:T,refine:ha,set:bp,strictObject:fp,string:d,stringFormat:Yd,stringbool:xp,success:kp,superRefine:ma,symbol:up,templateLiteral:Tp,transform:Ln,tuple:Hi,uint32:sp,uint64:cp,ulid:Ld,undefined:bt,union:z,unknown:E,url:Nd,uuid:Zd,uuidv4:xd,uuidv6:Rd,uuidv7:Cd,void:lp,xid:Dd,xor:hp},Symbol.toStringTag,{value:\"Module\"})),ge=\"io.modelcontextprotocol/related-task\",Ht=\"2.0\",q=fa(e=>e!==null&&(typeof e==\"object\"||typeof e==\"function\")),ga=z([d(),w().int()]),_a=d();J({ttl:w().optional(),pollInterval:w().optional()});const Cp=h({ttl:w().optional()}),Np=h({taskId:d()}),Bn=J({progressToken:ga.optional(),[ge]:Np.optional()}),W=h({_meta:Bn.optional()}),Be=W.extend({task:Cp.optional()}),Op=e=>Be.safeParse(e).success,H=h({method:d(),params:W.loose().optional()}),ee=h({_meta:Bn.optional()}),te=h({method:d(),params:ee.loose().optional()}),U=J({_meta:Bn.optional()}),Ve=z([d(),w().int()]),ba=h({jsonrpc:p(Ht),id:Ve,...H.shape}).strict(),jo=e=>ba.safeParse(e).success,va=h({jsonrpc:p(Ht),...te.shape}).strict(),Ap=e=>va.safeParse(e).success,Vn=h({jsonrpc:p(Ht),id:Ve,result:U}).strict(),st=e=>Vn.safeParse(e).success;var P;(function(e){e[e.ConnectionClosed=-32e3]=\"ConnectionClosed\",e[e.RequestTimeout=-32001]=\"RequestTimeout\",e[e.ParseError=-32700]=\"ParseError\",e[e.InvalidRequest=-32600]=\"InvalidRequest\",e[e.MethodNotFound=-32601]=\"MethodNotFound\",e[e.InvalidParams=-32602]=\"InvalidParams\",e[e.InternalError=-32603]=\"InternalError\",e[e.UrlElicitationRequired=-32042]=\"UrlElicitationRequired\"})(P||(P={}));const Kn=h({jsonrpc:p(Ht),id:Ve.optional(),error:h({code:w().int(),message:d(),data:E().optional()})}).strict(),jp=e=>Kn.safeParse(e).success,Mp=z([ba,va,Vn,Kn]);z([Vn,Kn]);const Wn=U.strict(),qp=ee.extend({requestId:Ve.optional(),reason:d().optional()}),Gn=te.extend({method:p(\"notifications/cancelled\"),params:qp}),Lp=h({src:d(),mimeType:d().optional(),sizes:v(d()).optional(),theme:B([\"light\",\"dark\"]).optional()}),Ke=h({icons:v(Lp).optional()}),Ee=h({name:d(),title:d().optional()}),Ut=Ee.extend({...Ee.shape,...Ke.shape,version:d(),websiteUrl:d().optional(),description:d().optional()}),Dp=qt(h({applyDefaults:I().optional()}),T(d(),E())),Hp=Jn(e=>e&&typeof e==\"object\"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,qt(h({form:Dp.optional(),url:q.optional()}),T(d(),E()).optional())),Up=J({list:q.optional(),cancel:q.optional(),requests:J({sampling:J({createMessage:q.optional()}).optional(),elicitation:J({create:q.optional()}).optional()}).optional()}),Fp=J({list:q.optional(),cancel:q.optional(),requests:J({tools:J({call:q.optional()}).optional()}).optional()}),Jp=h({experimental:T(d(),q).optional(),sampling:h({context:q.optional(),tools:q.optional()}).optional(),elicitation:Hp.optional(),roots:h({listChanged:I().optional()}).optional(),tasks:Up.optional(),extensions:T(d(),q).optional()}),Bp=W.extend({protocolVersion:d(),capabilities:Jp,clientInfo:Ut}),Vp=H.extend({method:p(\"initialize\"),params:Bp}),Kp=h({experimental:T(d(),q).optional(),logging:q.optional(),completions:q.optional(),prompts:h({listChanged:I().optional()}).optional(),resources:h({subscribe:I().optional(),listChanged:I().optional()}).optional(),tools:h({listChanged:I().optional()}).optional(),tasks:Fp.optional(),extensions:T(d(),q).optional()}),Wp=U.extend({protocolVersion:d(),capabilities:Kp,serverInfo:Ut,instructions:d().optional()}),Gp=te.extend({method:p(\"notifications/initialized\"),params:ee.optional()}),Ft=H.extend({method:p(\"ping\"),params:W.optional()}),Qp=h({progress:w(),total:O(w()),message:O(d())}),Yp=h({...ee.shape,...Qp.shape,progressToken:ga}),Qn=te.extend({method:p(\"notifications/progress\"),params:Yp}),Xp=W.extend({cursor:_a.optional()}),We=H.extend({params:Xp.optional()}),Ge=U.extend({nextCursor:_a.optional()}),ef=B([\"working\",\"input_required\",\"completed\",\"failed\",\"cancelled\"]),Qe=h({taskId:d(),status:ef,ttl:z([w(),jn()]),createdAt:d(),lastUpdatedAt:d(),pollInterval:O(w()),statusMessage:O(d())}),Yn=U.extend({task:Qe}),tf=ee.merge(Qe),wt=te.extend({method:p(\"notifications/tasks/status\"),params:tf}),Xn=H.extend({method:p(\"tasks/get\"),params:W.extend({taskId:d()})}),eo=U.merge(Qe),to=H.extend({method:p(\"tasks/result\"),params:W.extend({taskId:d()})});U.loose();const no=We.extend({method:p(\"tasks/list\")}),oo=Ge.extend({tasks:v(Qe)}),ro=H.extend({method:p(\"tasks/cancel\"),params:W.extend({taskId:d()})}),nf=U.merge(Qe),ya=h({uri:d(),mimeType:O(d()),_meta:T(d(),E()).optional()}),wa=ya.extend({text:d()}),so=d().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:\"Invalid Base64 string\"}),ka=ya.extend({blob:so}),Ye=B([\"user\",\"assistant\"]),Re=h({audience:v(Ye).optional(),priority:w().min(0).max(1).optional(),lastModified:hn({offset:!0}).optional()}),Sa=h({...Ee.shape,...Ke.shape,uri:d(),description:O(d()),mimeType:O(d()),size:O(w()),annotations:Re.optional(),_meta:O(J({}))}),of=h({...Ee.shape,...Ke.shape,uriTemplate:d(),description:O(d()),mimeType:O(d()),annotations:Re.optional(),_meta:O(J({}))}),rf=We.extend({method:p(\"resources/list\")}),za=Ge.extend({resources:v(Sa)}),sf=We.extend({method:p(\"resources/templates/list\")}),af=Ge.extend({resourceTemplates:v(of)}),io=W.extend({uri:d()}),cf=io,uf=H.extend({method:p(\"resources/read\"),params:cf}),Ta=U.extend({contents:v(z([wa,ka]))}),lf=te.extend({method:p(\"notifications/resources/list_changed\"),params:ee.optional()}),df=io,pf=H.extend({method:p(\"resources/subscribe\"),params:df}),ff=io,hf=H.extend({method:p(\"resources/unsubscribe\"),params:ff}),mf=ee.extend({uri:d()}),gf=te.extend({method:p(\"notifications/resources/updated\"),params:mf}),_f=h({name:d(),description:O(d()),required:O(I())}),bf=h({...Ee.shape,...Ke.shape,description:O(d()),arguments:O(v(_f)),_meta:O(J({}))}),vf=We.extend({method:p(\"prompts/list\")}),yf=Ge.extend({prompts:v(bf)}),wf=W.extend({name:d(),arguments:T(d(),d()).optional()}),kf=H.extend({method:p(\"prompts/get\"),params:wf}),ao=h({type:p(\"text\"),text:d(),annotations:Re.optional(),_meta:T(d(),E()).optional()}),co=h({type:p(\"image\"),data:so,mimeType:d(),annotations:Re.optional(),_meta:T(d(),E()).optional()}),uo=h({type:p(\"audio\"),data:so,mimeType:d(),annotations:Re.optional(),_meta:T(d(),E()).optional()}),Sf=h({type:p(\"tool_use\"),name:d(),id:d(),input:T(d(),E()),_meta:T(d(),E()).optional()}),$a=h({type:p(\"resource\"),resource:z([wa,ka]),annotations:Re.optional(),_meta:T(d(),E()).optional()}),Ea=Sa.extend({type:p(\"resource_link\")}),Xe=z([ao,co,uo,Ea,$a]),zf=h({role:Ye,content:Xe}),Tf=U.extend({description:d().optional(),messages:v(zf)}),$f=te.extend({method:p(\"notifications/prompts/list_changed\"),params:ee.optional()}),Ef=h({title:d().optional(),readOnlyHint:I().optional(),destructiveHint:I().optional(),idempotentHint:I().optional(),openWorldHint:I().optional()}),Pf=h({taskSupport:B([\"required\",\"optional\",\"forbidden\"]).optional()}),lo=h({...Ee.shape,...Ke.shape,description:d().optional(),inputSchema:h({type:p(\"object\"),properties:T(d(),q).optional(),required:v(d()).optional()}).catchall(E()),outputSchema:h({type:p(\"object\"),properties:T(d(),q).optional(),required:v(d()).optional()}).catchall(E()).optional(),annotations:Ef.optional(),execution:Pf.optional(),_meta:T(d(),E()).optional()}),Pa=We.extend({method:p(\"tools/list\")}),If=Ge.extend({tools:v(lo)}),Jt=U.extend({content:v(Xe).default([]),structuredContent:T(d(),E()).optional(),isError:I().optional()});Jt.or(U.extend({toolResult:E()}));const Zf=Be.extend({name:d(),arguments:T(d(),E()).optional()}),Ia=H.extend({method:p(\"tools/call\"),params:Zf}),xf=te.extend({method:p(\"notifications/tools/list_changed\"),params:ee.optional()});h({autoRefresh:I().default(!0),debounceMs:w().int().nonnegative().default(300)});const Za=B([\"debug\",\"info\",\"notice\",\"warning\",\"error\",\"critical\",\"alert\",\"emergency\"]),Rf=W.extend({level:Za}),Cf=H.extend({method:p(\"logging/setLevel\"),params:Rf}),Nf=ee.extend({level:Za,logger:d().optional(),data:E()}),Of=te.extend({method:p(\"notifications/message\"),params:Nf}),Af=h({name:d().optional()}),jf=h({hints:v(Af).optional(),costPriority:w().min(0).max(1).optional(),speedPriority:w().min(0).max(1).optional(),intelligencePriority:w().min(0).max(1).optional()}),Mf=h({mode:B([\"auto\",\"required\",\"none\"]).optional()}),qf=h({type:p(\"tool_result\"),toolUseId:d().describe(\"The unique identifier for the corresponding tool call.\"),content:v(Xe).default([]),structuredContent:h({}).loose().optional(),isError:I().optional(),_meta:T(d(),E()).optional()}),Lf=qn(\"type\",[ao,co,uo]),kt=qn(\"type\",[ao,co,uo,Sf,qf]),Df=h({role:Ye,content:z([kt,v(kt)]),_meta:T(d(),E()).optional()}),Hf=Be.extend({messages:v(Df),modelPreferences:jf.optional(),systemPrompt:d().optional(),includeContext:B([\"none\",\"thisServer\",\"allServers\"]).optional(),temperature:w().optional(),maxTokens:w().int(),stopSequences:v(d()).optional(),metadata:q.optional(),tools:v(lo).optional(),toolChoice:Mf.optional()}),Uf=H.extend({method:p(\"sampling/createMessage\"),params:Hf}),xa=U.extend({model:d(),stopReason:O(B([\"endTurn\",\"stopSequence\",\"maxTokens\"]).or(d())),role:Ye,content:Lf}),Ra=U.extend({model:d(),stopReason:O(B([\"endTurn\",\"stopSequence\",\"maxTokens\",\"toolUse\"]).or(d())),role:Ye,content:z([kt,v(kt)])}),Ff=h({type:p(\"boolean\"),title:d().optional(),description:d().optional(),default:I().optional()}),Jf=h({type:p(\"string\"),title:d().optional(),description:d().optional(),minLength:w().optional(),maxLength:w().optional(),format:B([\"email\",\"uri\",\"date\",\"date-time\"]).optional(),default:d().optional()}),Bf=h({type:B([\"number\",\"integer\"]),title:d().optional(),description:d().optional(),minimum:w().optional(),maximum:w().optional(),default:w().optional()}),Vf=h({type:p(\"string\"),title:d().optional(),description:d().optional(),enum:v(d()),default:d().optional()}),Kf=h({type:p(\"string\"),title:d().optional(),description:d().optional(),oneOf:v(h({const:d(),title:d()})),default:d().optional()}),Wf=h({type:p(\"string\"),title:d().optional(),description:d().optional(),enum:v(d()),enumNames:v(d()).optional(),default:d().optional()}),Gf=z([Vf,Kf]),Qf=h({type:p(\"array\"),title:d().optional(),description:d().optional(),minItems:w().optional(),maxItems:w().optional(),items:h({type:p(\"string\"),enum:v(d())}),default:v(d()).optional()}),Yf=h({type:p(\"array\"),title:d().optional(),description:d().optional(),minItems:w().optional(),maxItems:w().optional(),items:h({anyOf:v(h({const:d(),title:d()}))}),default:v(d()).optional()}),Xf=z([Qf,Yf]),eh=z([Wf,Gf,Xf]),th=z([eh,Ff,Jf,Bf]),nh=Be.extend({mode:p(\"form\").optional(),message:d(),requestedSchema:h({type:p(\"object\"),properties:T(d(),th),required:v(d()).optional()})}),oh=Be.extend({mode:p(\"url\"),message:d(),elicitationId:d(),url:d().url()}),rh=z([nh,oh]),sh=H.extend({method:p(\"elicitation/create\"),params:rh}),ih=ee.extend({elicitationId:d()}),ah=te.extend({method:p(\"notifications/elicitation/complete\"),params:ih}),ch=U.extend({action:B([\"accept\",\"decline\",\"cancel\"]),content:Jn(e=>e===null?void 0:e,T(d(),z([d(),w(),I(),v(d())])).optional())}),uh=h({type:p(\"ref/resource\"),uri:d()}),lh=h({type:p(\"ref/prompt\"),name:d()}),dh=W.extend({ref:z([lh,uh]),argument:h({name:d(),value:d()}),context:h({arguments:T(d(),d()).optional()}).optional()}),ph=H.extend({method:p(\"completion/complete\"),params:dh}),fh=U.extend({completion:J({values:v(d()).max(100),total:O(w().int()),hasMore:O(I())})}),hh=h({uri:d().startsWith(\"file://\"),name:d().optional(),_meta:T(d(),E()).optional()}),mh=H.extend({method:p(\"roots/list\"),params:W.optional()}),gh=U.extend({roots:v(hh)}),_h=te.extend({method:p(\"notifications/roots/list_changed\"),params:ee.optional()});z([Ft,Vp,ph,Cf,kf,vf,rf,sf,uf,pf,hf,Ia,Pa,Xn,to,no,ro]);z([Gn,Qn,Gp,_h,wt]);z([Wn,xa,Ra,ch,gh,eo,oo,Yn]);z([Ft,Uf,sh,mh,Xn,to,no,ro]);z([Gn,Qn,Of,gf,lf,xf,$f,wt,ah]);z([Wn,Wp,fh,Tf,yf,za,af,Ta,Jt,If,eo,oo,Yn]);class $ extends Error{constructor(t,n,o){super(`MCP error ${t}: ${n}`),this.code=t,this.data=o,this.name=\"McpError\"}static fromError(t,n,o){if(t===P.UrlElicitationRequired&&o){const r=o;if(r.elicitations)return new bh(r.elicitations,n)}return new $(t,n,o)}}class bh extends ${constructor(t,n=`URL elicitation${t.length>1?\"s\":\"\"} required`){super(P.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function me(e){return e===\"completed\"||e===\"failed\"||e===\"cancelled\"}new Set(\"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789\");function Mo(e){const n=hd(e)?.method;if(!n)throw new Error(\"Schema is missing a method literal\");const o=md(n);if(typeof o!=\"string\")throw new Error(\"Schema method literal must be a string\");return o}function qo(e,t){const n=vi(e,t);if(!n.success)throw n.error;return n.data}const vh=6e4;class yh{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Gn,n=>{this._oncancel(n)}),this.setNotificationHandler(Qn,n=>{this._onprogress(n)}),this.setRequestHandler(Ft,n=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Xn,async(n,o)=>{const r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new $(P.InvalidParams,\"Failed to retrieve task: Task not found\");return{...r}}),this.setRequestHandler(to,async(n,o)=>{const r=async()=>{const s=n.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,o.sessionId);){if(a.type===\"response\"||a.type===\"error\"){const c=a.message,u=c.id,f=this._requestResolvers.get(u);if(f)if(this._requestResolvers.delete(u),a.type===\"response\")f(c);else{const g=c,_=new $(g.error.code,g.error.message,g.error.data);f(_)}else{const g=a.type===\"response\"?\"Response\":\"Error\";this._onerror(new Error(`${g} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:o.requestId})}}const i=await this._taskStore.getTask(s,o.sessionId);if(!i)throw new $(P.InvalidParams,`Task not found: ${s}`);if(!me(i.status))return await this._waitForTaskUpdate(s,o.signal),await r();if(me(i.status)){const a=await this._taskStore.getTaskResult(s,o.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ge]:{taskId:s}}}}return await r()};return await r()}),this.setRequestHandler(no,async(n,o)=>{try{const{tasks:r,nextCursor:s}=await this._taskStore.listTasks(n.params?.cursor,o.sessionId);return{tasks:r,nextCursor:s,_meta:{}}}catch(r){throw new $(P.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ro,async(n,o)=>{try{const r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new $(P.InvalidParams,`Task not found: ${n.params.taskId}`);if(me(r.status))throw new $(P.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,\"cancelled\",\"Client cancelled task execution.\",o.sessionId),this._clearTaskQueue(n.params.taskId);const s=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!s)throw new $(P.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...s}}catch(r){throw r instanceof $?r:new $(P.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,n,o,r,s=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:r})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const o=Date.now()-n.startTime;if(n.maxTotalTimeout&&o>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),$.fromError(P.RequestTimeout,\"Maximum total timeout exceeded\",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:o});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error(\"Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.\");this._transport=t;const n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};const o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};const r=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{r?.(s,i),st(s)||jp(s)?this._onresponse(s):jo(s)?this._onrequest(s,i):Ap(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(const o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();const n=$.fromError(P.ConnectionClosed,\"Connection closed\");this._transport=void 0,this.onclose?.();for(const o of t.values())o(n)}_onerror(t){this.onerror?.(t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(t,n){const o=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,s=t.params?._meta?.[ge]?.taskId;if(o===void 0){const f={jsonrpc:\"2.0\",id:t.id,error:{code:P.MethodNotFound,message:\"Method not found\"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:\"error\",message:f,timestamp:Date.now()},r?.sessionId).catch(g=>this._onerror(new Error(`Failed to enqueue error response: ${g}`))):r?.send(f).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(t.id,i);const a=Op(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,r?.sessionId):void 0,u={signal:i.signal,sessionId:r?.sessionId,_meta:t.params?._meta,sendNotification:async f=>{if(i.signal.aborted)return;const g={relatedRequestId:t.id};s&&(g.relatedTask={taskId:s}),await this.notification(f,g)},sendRequest:async(f,g,_)=>{if(i.signal.aborted)throw new $(P.ConnectionClosed,\"Request was cancelled\");const b={..._,relatedRequestId:t.id};s&&!b.relatedTask&&(b.relatedTask={taskId:s});const Z=b.relatedTask?.taskId??s;return Z&&c&&await c.updateTaskStatus(Z,\"input_required\"),await this.request(f,g,b)},authInfo:n?.authInfo,requestId:t.id,requestInfo:n?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>o(t,u)).then(async f=>{if(i.signal.aborted)return;const g={result:f,jsonrpc:\"2.0\",id:t.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:\"response\",message:g,timestamp:Date.now()},r?.sessionId):await r?.send(g)},async f=>{if(i.signal.aborted)return;const g={jsonrpc:\"2.0\",id:t.id,error:{code:Number.isSafeInteger(f.code)?f.code:P.InternalError,message:f.message??\"Internal error\",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:\"error\",message:g,timestamp:Date.now()},r?.sessionId):await r?.send(g)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===i&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...o}=t.params,r=Number(n),s=this._progressHandlers.get(r);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const i=this._responseHandlers.get(r),a=this._timeoutInfo.get(r);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),i(c);return}s(o)}_onresponse(t){const n=Number(t.id),o=this._requestResolvers.get(n);if(o){if(this._requestResolvers.delete(n),st(t))o(t);else{const i=new $(t.error.code,t.error.message,t.error.data);o(i)}return}const r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let s=!1;if(st(t)&&t.result&&typeof t.result==\"object\"){const i=t.result;if(i.task&&typeof i.task==\"object\"){const a=i.task;typeof a.taskId==\"string\"&&(s=!0,this._taskProgressTokens.set(a.taskId,n))}}if(s||this._progressHandlers.delete(n),st(t))r(t);else{const i=$.fromError(t.error.code,t.error.message,t.error.data);r(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,n,o){const{task:r}=o??{};if(!r){try{yield{type:\"result\",result:await this.request(t,n,o)}}catch(i){yield{type:\"error\",error:i instanceof $?i:new $(P.InternalError,String(i))}}return}let s;try{const i=await this.request(t,Yn,o);if(i.task)s=i.task.taskId,yield{type:\"taskCreated\",task:i.task};else throw new $(P.InternalError,\"Task creation did not return a task\");for(;;){const a=await this.getTask({taskId:s},o);if(yield{type:\"taskStatus\",task:a},me(a.status)){a.status===\"completed\"?yield{type:\"result\",result:await this.getTaskResult({taskId:s},n,o)}:a.status===\"failed\"?yield{type:\"error\",error:new $(P.InternalError,`Task ${s} failed`)}:a.status===\"cancelled\"&&(yield{type:\"error\",error:new $(P.InternalError,`Task ${s} was cancelled`)});return}if(a.status===\"input_required\"){yield{type:\"result\",result:await this.getTaskResult({taskId:s},n,o)};return}const c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),o?.signal?.throwIfAborted()}}catch(i){yield{type:\"error\",error:i instanceof $?i:new $(P.InternalError,String(i))}}}request(t,n,o){const{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=o??{};return new Promise((u,f)=>{const g=L=>{f(L)};if(!this._transport){g(new Error(\"Not connected\"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(L){g(L);return}o?.signal?.throwIfAborted();const _=this._requestMessageId++,b={...t,jsonrpc:\"2.0\",id:_};o?.onprogress&&(this._progressHandlers.set(_,o.onprogress),b.params={...t.params,_meta:{...t.params?._meta||{},progressToken:_}}),a&&(b.params={...b.params,task:a}),c&&(b.params={...b.params,_meta:{...b.params?._meta||{},[ge]:c}});const Z=L=>{this._responseHandlers.delete(_),this._progressHandlers.delete(_),this._cleanupTimeout(_),this._transport?.send({jsonrpc:\"2.0\",method:\"notifications/cancelled\",params:{requestId:_,reason:String(L)}},{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i}).catch(M=>this._onerror(new Error(`Failed to send cancellation: ${M}`)));const j=L instanceof $?L:new $(P.RequestTimeout,String(L));f(j)};this._responseHandlers.set(_,L=>{if(!o?.signal?.aborted){if(L instanceof Error)return f(L);try{const j=vi(n,L.result);j.success?u(j.data):f(j.error)}catch(j){f(j)}}}),o?.signal?.addEventListener(\"abort\",()=>{Z(o?.signal?.reason)});const N=o?.timeout??vh,we=()=>Z($.fromError(P.RequestTimeout,\"Request timed out\",{timeout:N}));this._setupTimeout(_,N,o?.maxTotalTimeout,we,o?.resetTimeoutOnProgress??!1);const et=c?.taskId;if(et){const L=j=>{const M=this._responseHandlers.get(_);M?M(j):this._onerror(new Error(`Response handler missing for side-channeled request ${_}`))};this._requestResolvers.set(_,L),this._enqueueTaskMessage(et,{type:\"request\",message:b,timestamp:Date.now()}).catch(j=>{this._cleanupTimeout(_),f(j)})}else this._transport.send(b,{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i}).catch(L=>{this._cleanupTimeout(_),f(L)})})}async getTask(t,n){return this.request({method:\"tasks/get\",params:t},eo,n)}async getTaskResult(t,n,o){return this.request({method:\"tasks/result\",params:t},n,o)}async listTasks(t,n){return this.request({method:\"tasks/list\",params:t},oo,n)}async cancelTask(t,n){return this.request({method:\"tasks/cancel\",params:t},nf,n)}async notification(t,n){if(!this._transport)throw new Error(\"Not connected\");this.assertNotificationCapability(t.method);const o=n?.relatedTask?.taskId;if(o){const a={...t,jsonrpc:\"2.0\",params:{...t.params,_meta:{...t.params?._meta||{},[ge]:n.relatedTask}}};await this._enqueueTaskMessage(o,{type:\"notification\",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:\"2.0\"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ge]:n.relatedTask}}}),this._transport?.send(a,n).catch(c=>this._onerror(c))});return}let i={...t,jsonrpc:\"2.0\"};n?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ge]:n.relatedTask}}}),await this._transport.send(i,n)}setRequestHandler(t,n){const o=Mo(t);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(r,s)=>{const i=qo(t,r);return Promise.resolve(n(i,s))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){const o=Mo(t);this._notificationHandlers.set(o,r=>{const s=qo(t,r);return Promise.resolve(n(s))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error(\"Cannot enqueue task message: taskStore and taskMessageQueue are not configured\");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,o,r)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const o=await this._taskMessageQueue.dequeueAll(t,n);for(const r of o)if(r.type===\"request\"&&jo(r.message)){const s=r.message.id,i=this._requestResolvers.get(s);i?(i(new $(P.InternalError,\"Task cancelled or completed\")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){let o=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(t);r?.pollInterval&&(o=r.pollInterval)}catch{}return new Promise((r,s)=>{if(n.aborted){s(new $(P.InvalidRequest,\"Request cancelled\"));return}const i=setTimeout(r,o);n.addEventListener(\"abort\",()=>{clearTimeout(i),s(new $(P.InvalidRequest,\"Request cancelled\"))},{once:!0})})}requestTaskStore(t,n){const o=this._taskStore;if(!o)throw new Error(\"No task store configured\");return{createTask:async r=>{if(!t)throw new Error(\"No request provided\");return await o.createTask(r,t.id,{method:t.method,params:t.params},n)},getTask:async r=>{const s=await o.getTask(r,n);if(!s)throw new $(P.InvalidParams,\"Failed to retrieve task: Task not found\");return s},storeTaskResult:async(r,s,i)=>{await o.storeTaskResult(r,s,i,n);const a=await o.getTask(r,n);if(a){const c=wt.parse({method:\"notifications/tasks/status\",params:a});await this.notification(c),me(a.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>o.getTaskResult(r,n),updateTaskStatus:async(r,s,i)=>{const a=await o.getTask(r,n);if(!a)throw new $(P.InvalidParams,`Task \"${r}\" not found - it may have been cleaned up`);if(me(a.status))throw new $(P.InvalidParams,`Cannot update task \"${r}\" from terminal status \"${a.status}\" to \"${s}\". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(r,s,i,n);const c=await o.getTask(r,n);if(c){const u=wt.parse({method:\"notifications/tasks/status\",params:c});await this.notification(u),me(c.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>o.listTasks(r,n)}}}function Lo(e){return e!==null&&typeof e==\"object\"&&!Array.isArray(e)}function wh(e,t){const n={...e};for(const o in t){const r=o,s=t[r];if(s===void 0)continue;const i=n[r];Lo(i)&&Lo(s)?n[r]={...i,...s}:n[r]=s}return n}(e=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(e,{get:(t,n)=>(typeof require<\"u\"?require:t)[n]}):e)(function(e){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+e+'\" is not supported')});class kh extends yh{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(t,n){}_ensureEventSlot(t){let n=this._eventSlots.get(t);if(!n){let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);n={listeners:[]},this._eventSlots.set(t,n);let r=o.shape.method.value;this._registeredMethods.add(r);let s=n;super.setNotificationHandler(o,i=>{let a=i.params;this.onEventDispatch(t,a),s.onHandler?.(a);for(let c of[...s.listeners])c(a)})}return n}setEventHandler(t,n){let o=this._ensureEventSlot(t);o.onHandler&&n&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener(\"${String(t)}\", …) to add multiple listeners without replacing.`),o.onHandler=n}getEventHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,n){this._ensureEventSlot(t).listeners.push(n)}removeEventListener(t,n){let o=this._eventSlots.get(t);if(!o)return;let r=o.listeners.indexOf(n);r!==-1&&o.listeners.splice(r,1)}setRequestHandler=(t,n)=>{this._assertMethodNotRegistered(t,\"setRequestHandler\"),super.setRequestHandler(t,n)};setNotificationHandler=(t,n)=>{this._assertMethodNotRegistered(t,\"setNotificationHandler\"),super.setNotificationHandler(t,n)};warnIfRequestHandlerReplaced(t,n,o){n&&o&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(t,n)=>{let o=t.shape.method.value;this._registeredMethods.add(o),super.setRequestHandler(t,n)};_assertMethodNotRegistered(t,n){let o=t.shape.method.value;if(this._registeredMethods.has(o))throw Error(`Handler for \"${o}\" already registered (via ${n}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(o)}}var Sh=\"2026-01-26\",zh=\"ui/notifications/tool-input-partial\";class Th{eventTarget;eventSource;messageListener;constructor(t=window.parent,n){this.eventTarget=t,this.eventSource=n,this.messageListener=o=>{if(n&&o.source!==this.eventSource){console.debug(\"Ignoring message from unknown source\",o);return}let r=Mp.safeParse(o.data);r.success?(console.debug(\"Parsed message\",r.data),this.onmessage?.(r.data)):o.data?.jsonrpc!==\"2.0\"?console.debug(\"Ignoring non-JSON-RPC message\",r.error.message,o):(console.error(\"Failed to parse message\",r.error.message,o),this.onerror?.(Error(\"Invalid JSON-RPC message received: \"+r.error.message)))}}async start(){window.addEventListener(\"message\",this.messageListener)}async send(t,n){t.method!==zh&&console.debug(\"Sending message\",t),this.eventTarget.postMessage(t,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var $h=z([p(\"light\"),p(\"dark\")]).describe(\"Color theme preference for the host environment.\"),De=z([p(\"inline\"),p(\"fullscreen\"),p(\"pip\")]).describe(\"Display mode for UI presentation.\"),Eh=z([p(\"--color-background-primary\"),p(\"--color-background-secondary\"),p(\"--color-background-tertiary\"),p(\"--color-background-inverse\"),p(\"--color-background-ghost\"),p(\"--color-background-info\"),p(\"--color-background-danger\"),p(\"--color-background-success\"),p(\"--color-background-warning\"),p(\"--color-background-disabled\"),p(\"--color-text-primary\"),p(\"--color-text-secondary\"),p(\"--color-text-tertiary\"),p(\"--color-text-inverse\"),p(\"--color-text-ghost\"),p(\"--color-text-info\"),p(\"--color-text-danger\"),p(\"--color-text-success\"),p(\"--color-text-warning\"),p(\"--color-text-disabled\"),p(\"--color-border-primary\"),p(\"--color-border-secondary\"),p(\"--color-border-tertiary\"),p(\"--color-border-inverse\"),p(\"--color-border-ghost\"),p(\"--color-border-info\"),p(\"--color-border-danger\"),p(\"--color-border-success\"),p(\"--color-border-warning\"),p(\"--color-border-disabled\"),p(\"--color-ring-primary\"),p(\"--color-ring-secondary\"),p(\"--color-ring-inverse\"),p(\"--color-ring-info\"),p(\"--color-ring-danger\"),p(\"--color-ring-success\"),p(\"--color-ring-warning\"),p(\"--font-sans\"),p(\"--font-mono\"),p(\"--font-weight-normal\"),p(\"--font-weight-medium\"),p(\"--font-weight-semibold\"),p(\"--font-weight-bold\"),p(\"--font-text-xs-size\"),p(\"--font-text-sm-size\"),p(\"--font-text-md-size\"),p(\"--font-text-lg-size\"),p(\"--font-heading-xs-size\"),p(\"--font-heading-sm-size\"),p(\"--font-heading-md-size\"),p(\"--font-heading-lg-size\"),p(\"--font-heading-xl-size\"),p(\"--font-heading-2xl-size\"),p(\"--font-heading-3xl-size\"),p(\"--font-text-xs-line-height\"),p(\"--font-text-sm-line-height\"),p(\"--font-text-md-line-height\"),p(\"--font-text-lg-line-height\"),p(\"--font-heading-xs-line-height\"),p(\"--font-heading-sm-line-height\"),p(\"--font-heading-md-line-height\"),p(\"--font-heading-lg-line-height\"),p(\"--font-heading-xl-line-height\"),p(\"--font-heading-2xl-line-height\"),p(\"--font-heading-3xl-line-height\"),p(\"--border-radius-xs\"),p(\"--border-radius-sm\"),p(\"--border-radius-md\"),p(\"--border-radius-lg\"),p(\"--border-radius-xl\"),p(\"--border-radius-full\"),p(\"--border-width-regular\"),p(\"--shadow-hairline\"),p(\"--shadow-sm\"),p(\"--shadow-md\"),p(\"--shadow-lg\")]).describe(\"CSS variable keys available to MCP apps for theming.\"),Ph=T(Eh.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),z([d(),bt()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`);h({method:p(\"ui/open-link\"),params:h({url:d().describe(\"URL to open in the host's browser\")})});var Ih=h({isError:I().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),Zh=h({isError:I().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),xh=h({isError:I().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough();h({method:p(\"ui/notifications/sandbox-proxy-ready\"),params:h({})});var po=h({connectDomains:v(d()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:v(d()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:v(d()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:v(d()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),fo=h({camera:h({}).optional().describe(\"Request camera access.\\n\\nMaps to Permission Policy `camera` feature.\"),microphone:h({}).optional().describe(\"Request microphone access.\\n\\nMaps to Permission Policy `microphone` feature.\"),geolocation:h({}).optional().describe(\"Request geolocation access.\\n\\nMaps to Permission Policy `geolocation` feature.\"),clipboardWrite:h({}).optional().describe(\"Request clipboard write access.\\n\\nMaps to Permission Policy `clipboard-write` feature.\")});h({method:p(\"ui/notifications/size-changed\"),params:h({width:w().optional().describe(\"New width in pixels.\"),height:w().optional().describe(\"New height in pixels.\")})});var Rh=h({method:p(\"ui/notifications/tool-input\"),params:h({arguments:T(d(),E().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),Ch=h({method:p(\"ui/notifications/tool-input-partial\"),params:h({arguments:T(d(),E().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),Nh=h({method:p(\"ui/notifications/tool-cancelled\"),params:h({reason:d().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),Oh=h({fonts:d().optional()}),Ah=h({variables:Ph.optional().describe(\"CSS variables for theming the app.\"),css:Oh.optional().describe(\"CSS blocks that apps can inject.\")}),jh=h({method:p(\"ui/resource-teardown\"),params:h({})});T(d(),E());var Do=h({text:h({}).optional().describe(\"Host supports text content blocks.\"),image:h({}).optional().describe(\"Host supports image content blocks.\"),audio:h({}).optional().describe(\"Host supports audio content blocks.\"),resource:h({}).optional().describe(\"Host supports resource content blocks.\"),resourceLink:h({}).optional().describe(\"Host supports resource link content blocks.\"),structuredContent:h({}).optional().describe(\"Host supports structured content.\")});h({method:p(\"ui/notifications/request-teardown\"),params:h({}).optional()});var Mh=h({experimental:T(d(),T(d(),Mn()).describe(\"Experimental features keyed by identifier.\")).optional().describe(\"Experimental features keyed by identifier.\"),openLinks:h({}).optional().describe(\"Host supports opening external URLs.\"),downloadFile:h({}).optional().describe(\"Host supports file downloads via ui/download-file.\"),serverTools:h({listChanged:I().optional().describe(\"Host supports tools/list_changed notifications.\")}).optional().describe(\"Host can proxy tool calls to the MCP server.\"),serverResources:h({listChanged:I().optional().describe(\"Host supports resources/list_changed notifications.\")}).optional().describe(\"Host can proxy resource reads to the MCP server.\"),logging:h({}).optional().describe(\"Host accepts log messages.\"),sandbox:h({permissions:fo.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:po.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:Do.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:Do.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\"),sampling:h({tools:h({}).optional().describe(\"Host supports tool use via `tools` and `toolChoice` parameters.\")}).optional().describe(\"Host supports LLM sampling (sampling/createMessage) from the view.\\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.\")}),qh=h({experimental:T(d(),T(d(),Mn()).describe(\"Experimental features keyed by identifier.\")).optional().describe(\"Experimental features keyed by identifier.\"),tools:h({listChanged:I().optional().describe(\"App supports tools/list_changed notifications.\")}).optional().describe(\"App exposes MCP-style tools that the host can call.\"),availableDisplayModes:v(De).optional().describe(\"Display modes the app supports.\")});h({method:p(\"ui/notifications/initialized\"),params:h({}).optional()});h({csp:po.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:fo.optional().describe(\"Sandbox permissions requested by the UI resource.\"),domain:d().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:I().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)});h({method:p(\"ui/request-display-mode\"),params:h({mode:De.describe(\"The display mode being requested.\")})});var Lh=h({mode:De.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),Dh=z([p(\"model\"),p(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\");h({resourceUri:d().optional(),visibility:v(Dh).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`),csp:qe().optional(),permissions:qe().optional()});h({mimeTypes:v(d()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')});h({method:p(\"ui/download-file\"),params:h({contents:v(z([$a,Ea])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})});h({method:p(\"ui/message\"),params:h({role:p(\"user\").describe('Message role, currently only \"user\" is supported.'),content:v(Xe).describe(\"Message content blocks (text, image, etc.).\")})});h({method:p(\"ui/notifications/sandbox-resource-ready\"),params:h({html:d().describe(\"HTML content to load into the inner iframe.\"),sandbox:d().optional().describe(\"Optional override for the inner iframe's sandbox attribute.\"),csp:po.optional().describe(\"CSP configuration from resource metadata.\"),permissions:fo.optional().describe(\"Sandbox permissions from resource metadata.\")})});var Hh=h({method:p(\"ui/notifications/tool-result\"),params:Jt.describe(\"Standard MCP tool execution result.\")}),Ca=h({toolInfo:h({id:Ve.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:lo.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:$h.optional().describe(\"Current color theme preference.\"),styles:Ah.optional().describe(\"Style configuration for theming the app.\"),displayMode:De.optional().describe(\"How the UI is currently displayed.\"),availableDisplayModes:v(De).optional().describe(\"Display modes the host supports.\"),containerDimensions:z([h({height:w().describe(\"Fixed container height in pixels.\")}),h({maxHeight:z([w(),bt()]).optional().describe(\"Maximum container height in pixels.\")})]).and(z([h({width:w().describe(\"Fixed container width in pixels.\")}),h({maxWidth:z([w(),bt()]).optional().describe(\"Maximum container width in pixels.\")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:d().optional().describe(\"User's language and region preference in BCP 47 format.\"),timeZone:d().optional().describe(\"User's timezone in IANA format.\"),userAgent:d().optional().describe(\"Host application identifier.\"),platform:z([p(\"web\"),p(\"desktop\"),p(\"mobile\")]).optional().describe(\"Platform type for responsive design decisions.\"),deviceCapabilities:h({touch:I().optional().describe(\"Whether the device supports touch input.\"),hover:I().optional().describe(\"Whether the device supports hover interactions.\")}).optional().describe(\"Device input capabilities.\"),safeAreaInsets:h({top:w().describe(\"Top safe area inset in pixels.\"),right:w().describe(\"Right safe area inset in pixels.\"),bottom:w().describe(\"Bottom safe area inset in pixels.\"),left:w().describe(\"Left safe area inset in pixels.\")}).optional().describe(\"Mobile safe area boundaries in pixels.\")}).passthrough(),Uh=h({method:p(\"ui/notifications/host-context-changed\"),params:Ca.describe(\"Partial context update containing only changed fields.\")});h({method:p(\"ui/update-model-context\"),params:h({content:v(Xe).optional().describe(\"Context content blocks (text, image, etc.).\"),structuredContent:T(d(),E().describe(\"Structured content for machine-readable context data.\")).optional().describe(\"Structured content for machine-readable context data.\")})});h({method:p(\"ui/initialize\"),params:h({appInfo:Ut.describe(\"App identification (name and version).\"),appCapabilities:qh.describe(\"Features and capabilities this app provides.\"),protocolVersion:d().describe(\"Protocol version this app supports.\")})});var Fh=h({protocolVersion:d().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:Ut.describe(\"Host application identification and version.\"),hostCapabilities:Mh.describe(\"Features and capabilities provided by the host.\"),hostContext:Ca.describe(\"Rich context about the host environment.\")}).passthrough(),Jh={target:\"draft-2020-12\"};async function Ho(e,t){let n=e[\"~standard\"];if(n.jsonSchema)return n.jsonSchema[t](Jh);if(n.vendor===\"zod\"){let{z:o}=await Fa(()=>import(\"./index-Cw3_bWK5.js\"),void 0);return o.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Uo(e,t,n=\"\"){let o=await e[\"~standard\"].validate(t);if(o.issues){let r=o.issues.map(s=>{let i=s.path?.map(a=>typeof a==\"object\"?a.key:a).join(\".\");return i?`${i}: ${s.message}`:s.message}).join(\"; \");throw Error(n+r)}return o.value}function Bh(e){let t=document.documentElement;t.setAttribute(\"data-theme\",e),t.style.colorScheme=e}function Vh(e,t=document.documentElement){for(let[n,o]of Object.entries(e))o!==void 0&&t.style.setProperty(n,o)}class ho extends kh{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(t){if(this._initializedSent)return;let n=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(n);console.warn(`${n}. This will throw in a future release.`)}eventSchemas={toolinput:Rh,toolinputpartial:Ch,toolresult:Hh,toolcancelled:Nh,hostcontextchanged:Uh};static ONE_SHOT_EVENTS=new Set([\"toolinput\",\"toolinputpartial\",\"toolresult\",\"toolcancelled\"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!ho.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] \"${String(t)}\" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(t,n){n&&this._assertHandlerTiming(t),super.setEventHandler(t,n)}addEventListener(t,n){this._assertHandlerTiming(t),super.addEventListener(t,n)}onEventDispatch(t,n){t===\"hostcontextchanged\"&&(this._hostContext={...this._hostContext,...n})}constructor(t,n={},o={autoResize:!0}){super(o),this._appInfo=t,this._capabilities=n,this.options=o,o.allowUnsafeEval||G({jitless:!0}),this.setRequestHandler(Ft,r=>(console.log(\"Received ping:\",r.params),{})),this.setEventHandler(\"hostcontextchanged\",void 0)}registerCapabilities(t){if(this.transport)throw Error(\"Cannot register capabilities after transport is established\");this._capabilities=wh(this._capabilities,t)}registerTool(t,n,o){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let r=this,s=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},i=n.inputSchema!==void 0,a={title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,annotations:n.annotations,_meta:n._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(c){Object.assign(this,c),s()},remove(){r._registeredTools[t]===a&&(delete r._registeredTools[t],s())},handler:async(c,u)=>{if(!a.enabled)throw Error(`Tool ${t} is disabled`);let f;if(i){let g=a.inputSchema,_=g?await Uo(g,c??{},`Invalid input for tool ${t}: `):c??{};f=await o(_,u)}else f=await o(u);return a.outputSchema&&!f.isError&&(f.structuredContent=await Uo(a.outputSchema,f.structuredContent,`Invalid output for tool ${t}: `)),f}};return this._registeredTools[t]=a,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),a}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,n)=>{let o=this._registeredTools[t.name];if(!o)throw Error(`Tool ${t.name} not found`);return o.handler(t.arguments,n)},this.onlisttools=async(t,n)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([o,r])=>r.enabled).map(async([o,r])=>{let s={name:o,title:r.title,description:r.description,inputSchema:r.inputSchema?await Ho(r.inputSchema,\"input\"):{type:\"object\",properties:{}}};return r.outputSchema&&(s.outputSchema=await Ho(r.outputSchema,\"output\")),r.annotations&&(s.annotations=r.annotations),r._meta&&(s._meta=r._meta),s}))}))}async sendToolListChanged(t={}){this._assertInitialized(\"sendToolListChanged\"),await this.notification({method:\"notifications/tools/list_changed\",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(\"toolinput\")}set ontoolinput(t){this.setEventHandler(\"toolinput\",t)}get ontoolinputpartial(){return this.getEventHandler(\"toolinputpartial\")}set ontoolinputpartial(t){this.setEventHandler(\"toolinputpartial\",t)}get ontoolresult(){return this.getEventHandler(\"toolresult\")}set ontoolresult(t){this.setEventHandler(\"toolresult\",t)}get ontoolcancelled(){return this.getEventHandler(\"toolcancelled\")}set ontoolcancelled(t){this.setEventHandler(\"toolcancelled\",t)}get onhostcontextchanged(){return this.getEventHandler(\"hostcontextchanged\")}set onhostcontextchanged(t){this.setEventHandler(\"hostcontextchanged\",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced(\"onteardown\",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler(jh,(n,o)=>{if(!this._onteardown)throw Error(\"No onteardown handler set\");return this._onteardown(n.params,o)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced(\"oncalltool\",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler(Ia,(n,o)=>{if(!this._oncalltool)throw Error(\"No oncalltool handler set\");return this._oncalltool(n.params,o)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced(\"onlisttools\",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler(Pa,(n,o)=>{if(!this._onlisttools)throw Error(\"No onlisttools handler set\");return this._onlisttools(n.params,o)})}assertCapabilityForMethod(t){switch(t){case\"sampling/createMessage\":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case\"tools/call\":case\"tools/list\":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;case\"ping\":case\"ui/resource-teardown\":return;default:throw Error(`No handler for method ${t} registered`)}}assertNotificationCapability(t){}assertTaskCapability(t){throw Error(\"Tasks are not supported in MCP Apps\")}assertTaskHandlerCapability(t){throw Error(\"Task handlers are not supported in MCP Apps\")}async callServerTool(t,n){if(this._assertInitialized(\"callServerTool\"),typeof t==\"string\")throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${t}\"). Did you mean: callServerTool({ name: \"${t}\", arguments: { ... } })?`);return await this.request({method:\"tools/call\",params:t},Jt,{onprogress:()=>{},resetTimeoutOnProgress:!0,...n})}async readServerResource(t,n){return this._assertInitialized(\"readServerResource\"),await this.request({method:\"resources/read\",params:t},Ta,n)}async listServerResources(t,n){return this._assertInitialized(\"listServerResources\"),await this.request({method:\"resources/list\",params:t},za,n)}async createSamplingMessage(t,n){this._assertInitialized(\"createSamplingMessage\");let o=t.tools?Ra:xa;return await this.request({method:\"sampling/createMessage\",params:t},o,n)}sendMessage(t,n){return this._assertInitialized(\"sendMessage\"),this.request({method:\"ui/message\",params:t},xh,n)}sendLog(t){return this.notification({method:\"notifications/message\",params:t})}updateModelContext(t,n){return this._assertInitialized(\"updateModelContext\"),this.request({method:\"ui/update-model-context\",params:t},Wn,n)}openLink(t,n){return this._assertInitialized(\"openLink\"),this.request({method:\"ui/open-link\",params:t},Ih,n)}sendOpenLink=this.openLink;downloadFile(t,n){return this._assertInitialized(\"downloadFile\"),this.request({method:\"ui/download-file\",params:t},Zh,n)}requestTeardown(t={}){return this.notification({method:\"ui/notifications/request-teardown\",params:t})}requestDisplayMode(t,n){return this._assertInitialized(\"requestDisplayMode\"),this.request({method:\"ui/request-display-mode\",params:t},Lh,n)}sendSizeChanged(t){return this.notification({method:\"ui/notifications/size-changed\",params:t})}setupSizeChangedNotifications(){let t=!1,n=0,o=0,r=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let i=document.documentElement,a=i.style.height;i.style.height=\"max-content\";let c=Math.ceil(i.getBoundingClientRect().height);i.style.height=a;let u=Math.ceil(window.innerWidth);(u!==n||c!==o)&&(n=u,o=c,this.sendSizeChanged({width:u,height:c}))}))};r();let s=new ResizeObserver(r);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new Th(window.parent,window.parent),n){if(this.transport)throw Error(\"App is already connected. Call close() before connecting again.\");this._initializedSent=!1,await super.connect(t);try{let o=await this.request({method:\"ui/initialize\",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Sh}},Fh,n);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:\"ui/notifications/initialized\"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}const Kh=45e3;function fe(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}async function Wh(e){let t;const n=new Promise((o,r)=>{t=setTimeout(()=>{r(new Error(\"host did not answer the tool call\"))},Kh)});try{return await Promise.race([e,n])}finally{clearTimeout(t)}}function Gh(e){const t=e.content;return Array.isArray(t)?t.filter(n=>fe(n)&&typeof n.text==\"string\").map(n=>n.text).join(`\n`):\"\"}function Na(e){if(!fe(e))return{structuredContent:null,source:\"missing\",text:\"\",isError:!1};const t=e.structuredContent,n=t!=null;return{structuredContent:n?t:null,source:n?\"toolresult\":\"missing\",text:Gh(e),isError:e.isError===!0}}function Qh(e){if(!fe(e))return null;const t=e.openai;if(!fe(t))return null;const n=t.toolOutput;return n===void 0?null:n}function Yh(e,t=globalThis){const n=Na(e);if(n.source===\"toolresult\"||n.isError)return n;const o=Qh(t);return o===null?n:{...n,structuredContent:o,source:\"host-global\"}}function Fo(e){if(!fe(e))return;const t=e.theme;(t===\"light\"||t===\"dark\")&&Bh(t);const n=e.styles;fe(n)&&fe(n.variables)&&Vh(n.variables)}function Jo(e){return fe(e)&&e.isError===!0}async function Xh(e,t=new ho({name:\"ris-mcp-trefferliste\",version:\"1.0.0\"})){return t.addEventListener(\"toolresult\",n=>{e.onToolResult(Yh(n))}),t.addEventListener(\"hostcontextchanged\",Fo),await t.connect(),Fo(t.getHostContext()),{async callTool(n){return Na(await Wh(t.callServerTool(n)))},async openLink(n){try{return!Jo(await t.openLink({url:n}))}catch{return!1}},async sendPrompt(n){try{return!Jo(await t.sendMessage({role:\"user\",content:[{type:\"text\",text:n}]}))}catch{return!1}}}}const K={loading:\"Suche läuft …\",emptyTitle:\"Keine Treffer\",emptyDetail:\"Die Suche hat keine Dokumente geliefert. Andere Suchworte könnten helfen.\",degradedTitle:\"Keine strukturierten Daten erhalten.\",invalidPayloadTitle:\"Unerwartete Daten erhalten.\",toolErrorTitle:\"Die Suche ist fehlgeschlagen.\",connectFailedTitle:\"Die Trefferliste konnte nicht geladen werden.\",answerInChat:\"Die vollständige Antwort steht im Chat.\",pageUnchanged:\"Die angezeigte Seite bleibt unverändert.\",sessionExpired:\"Verbindung abgelaufen — Suche im Chat erneut ausführen.\",linkRefused:\"Der Link konnte nicht geöffnet werden.\",promptRefused:\"Die Nachricht konnte nicht gesendet werden.\"};function de(e,t,n){const o=document.createElement(e);return o.className=t,n!==void 0&&(o.textContent=n),o}function Oa(e=3){const t=de(\"div\",\"ris-skeleton\");t.setAttribute(\"role\",\"status\"),t.setAttribute(\"aria-busy\",\"true\"),t.append(de(\"p\",\"ris-skeleton-label\",K.loading));for(let n=0;n<e;n+=1){const o=de(\"div\",\"ris-skeleton-row\");o.setAttribute(\"aria-hidden\",\"true\"),o.append(de(\"span\",\"ris-skeleton-line ris-skeleton-line-title\")),o.append(de(\"span\",\"ris-skeleton-line ris-skeleton-line-meta\")),t.append(o)}return t}function Se(e,t,n){const o=de(\"div\",`ris-notice ris-notice-${e}`);return o.setAttribute(\"role\",e===\"error\"?\"alert\":\"status\"),o.append(de(\"p\",\"ris-notice-title\",t)),n&&o.append(de(\"p\",\"ris-notice-detail\",n)),o}const Aa=\"risTrefferliste\",ja=1,em=64e3;function Ne(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}function Ma(e){if(!Ne(e))return null;const t=e.openai;return Ne(t)?t:null}function tm(e,t=globalThis){const n=Ma(t);if(typeof n?.setWidgetState!=\"function\")return!1;const o={[Aa]:{version:ja,payload:e}};try{const r=JSON.stringify(o).length<=em;return n.setWidgetState(r?{privateContent:o}:{}),r}catch{return!1}}function nm(e=globalThis){const t=Ma(e)?.widgetState;if(!Ne(t))return null;const o=(Ne(t.privateContent)?t.privateContent:t)[Aa];return!Ne(o)||o.version!==ja?null:o.payload??null}const om={ris_bundesrecht:\"Bundesrecht\",ris_landesrecht:\"Landesrecht\",ris_judikatur:\"Judikatur\",ris_bundesgesetzblatt:\"Bundesgesetzblatt\",ris_landesgesetzblatt:\"Landesgesetzblatt\",ris_regierungsvorlagen:\"Regierungsvorlagen\",ris_bezirke:\"Bezirksverwaltung\",ris_gemeinden:\"Gemeinderecht\",ris_sonstige:\"Sonstige\",ris_history:\"Änderungshistorie\",ris_verordnungen:\"Verordnungen\"},rm={BrKons:\"Bundesrecht\",LrKons:\"Landesrecht\",Erv:\"Engl. Übersetzung\",Justiz:\"Justiz\",Vwgh:\"VwGH\",Vfgh:\"VfGH\",Bvwg:\"BVwG\",Lvwg:\"LVwG\",BgblAuth:\"BGBl. authentisch\",BgblAlt:\"BGBl. 1945–2003\",BgblPdf:\"BGBl. PDF\",LgblAuth:\"LGBl. authentisch\",Lgbl:\"LGBl.\",RegV:\"Regierungsvorlage\"},sm=[\"suchworte\",\"titel\",\"paragraph\",\"geschaeftszahl\",\"dokumentnummer\"],Bt=\"seite\";function it(e){return typeof e==\"object\"&&e!==null&&!Array.isArray(e)}function ct(e){return typeof e==\"number\"&&Number.isFinite(e)}function V(e){return typeof e==\"string\"?e.trim():\"\"}function at(e){return Math.trunc(e).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g,\".\")}function Vt(e){const t=/^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(e);return t?`${t[3]}.${t[2]}.${t[1]}`:e}function im(e){return V(e).split(\";\").map(t=>t.trim()).filter(t=>t.length>0)}function am(e){return`Bitte lade das Dokument ${e} mit ris_dokument.`}function qa(e){if(!it(e))return null;const{total_hits:t,page:n,page_size:o,has_more:r,documents:s}=e;return!ct(t)||!ct(n)||!ct(o)||typeof r!=\"boolean\"||!Array.isArray(s)?null:s.every(a=>it(a)&&typeof a.dokumentnummer==\"string\"&&typeof a.applikation==\"string\"&&it(a.content_urls)&&it(a.citation))?e:null}function cm(e){return om[e]??e.replace(/^ris_/,\"\")}function um(e){if(!e)return\"\";for(const t of sm){const n=V(e[t]);if(n)return n}return\"\"}function lm(e){const t=[],n=r=>r,o=(r,s,i=n)=>{const a=V(s);a&&t.push({label:r,value:i(a)})};return\"gericht\"in e?(o(\"Gericht\",e.gericht),o(\"Entscheidungsdatum\",e.entscheidungsdatum,Vt),o(\"Geschäftszahl\",e.geschaeftszahl),o(\"Rechtssatznummer\",e.rechtssatznummer)):(o(\"In Kraft seit\",e.citation.inkrafttreten,Vt),o(\"Außer Kraft seit\",e.citation.ausserkrafttreten,Vt)),o(\"Dokumentnummer\",e.dokumentnummer),t}function dm(e,t){if(\"gericht\"in e&&t.length>0)return t[0];const n=V(e.citation_display);return n&&n!==e.dokumentnummer?n:t[0]||V(e.titel)||V(e.kurztitel)||e.dokumentnummer}function pm(e,t){const n=V(e.kurztitel)||V(e.titel);return n===t||n===V(e.geschaeftszahl)?\"\":n}function fm(e){const t=im(e.geschaeftszahl),n=dm(e,t);return{id:e.dokumentnummer,title:n,subtitle:pm(e,n),badge:rm[e.applikation]??e.applikation,meta:lm(e),caseNumbers:t,risUrl:V(e.content_urls.html)||V(e.dokument_url)||null,pdfUrl:V(e.content_urls.pdf)||null}}function tn(e,t){if(!e)return null;const n=V(e.tool);if(!n)return null;const r=(ct(e[Bt])?e[Bt]:1)+t;if(r<1)return null;const{tool:s,...i}=e;return{name:n,arguments:{...i,[Bt]:r}}}function hm(e){const t=e.documents.map(fm),n=Math.max(0,e.page-1)*Math.max(0,e.page_size)+1,o=n+t.length-1;return{toolLabel:e.query?cm(V(e.query.tool)):\"\",queryLabel:um(e.query),hitsLabel:`${at(e.total_hits)} Treffer`,rangeLabel:t.length===0?\"\":`${at(n)}–${at(o)} von ${at(e.total_hits)}`,isEmpty:t.length===0,hasPrev:tn(e.query,-1)!==null,hasNext:e.has_more&&tn(e.query,1)!==null,rows:t}}function D(e,t,n){const o=document.createElement(e);return t&&(o.className=t),n!==void 0&&(o.textContent=n),o}function Oe(e,t,n){const o=document.createElement(\"button\");return o.type=\"button\",o.className=e,o.textContent=t,o.addEventListener(\"click\",n),o}function mm(e,t){const n=t===\"mount\"?K.answerInChat:K.pageUnchanged;if(e.isError)return{kind:\"notice\",node:Se(\"error\",K.toolErrorTitle,e.text)};if(e.source===\"missing\")return{kind:\"notice\",node:Se(\"info\",K.degradedTitle,n)};const o=qa(e.structuredContent);return o?{kind:\"result\",result:o}:{kind:\"notice\",node:Se(\"info\",K.invalidPayloadTitle,n)}}function gm(e){const t=D(\"header\",\"ris-header\");return e.toolLabel&&t.append(D(\"span\",\"ris-tool-badge\",e.toolLabel)),e.queryLabel&&t.append(D(\"span\",\"ris-query\",e.queryLabel)),t.append(D(\"span\",\"ris-hits\",e.hitsLabel)),t}function _m(e){const t=D(\"dl\",\"ris-meta\");for(const n of e.meta)t.append(D(\"dt\",void 0,n.label)),t.append(D(\"dd\",void 0,n.value));return t}function bm(e,t){const n=D(\"div\",\"ris-actions\");return e.risUrl&&n.append(Oe(\"ris-action\",\"Im RIS öffnen\",()=>t.onOpen(e))),e.pdfUrl&&n.append(Oe(\"ris-action\",\"PDF\",()=>t.onPdf(e))),n.append(Oe(\"ris-action\",\"Volltext in den Chat\",()=>t.onFullText(e))),n}function vm(e,t,n){const o=D(\"li\",\"ris-row\"),r=`ris-detail-${t}`,s=document.createElement(\"button\");s.type=\"button\",s.className=\"ris-row-toggle\",s.setAttribute(\"aria-expanded\",\"false\"),s.setAttribute(\"aria-controls\",r);const i=D(\"span\",\"ris-row-heading\");i.append(D(\"span\",\"ris-row-title\",e.title)),e.caseNumbers.length>1&&i.append(D(\"span\",\"ris-row-more\",`+${e.caseNumbers.length-1} weitere`)),s.append(i),e.subtitle&&s.append(D(\"span\",\"ris-row-subtitle\",e.subtitle)),s.append(D(\"span\",\"ris-row-badge\",e.badge));const a=D(\"div\",\"ris-row-detail\");return a.id=r,a.hidden=!0,a.append(_m(e),bm(e,n)),s.addEventListener(\"click\",()=>{const c=s.getAttribute(\"aria-expanded\")===\"true\";s.setAttribute(\"aria-expanded\",String(!c)),a.hidden=c}),o.append(s,a),o}function ym(e,t){const n=D(\"footer\",\"ris-footer\"),o=Oe(\"ris-page ris-page-prev\",\"‹ Zurück\",()=>t.onPage(-1));o.setAttribute(\"aria-label\",\"Vorherige Seite\"),o.disabled=!e.hasPrev;const r=Oe(\"ris-page ris-page-next\",\"Weiter ›\",()=>t.onPage(1));return r.setAttribute(\"aria-label\",\"Nächste Seite\"),r.disabled=!e.hasNext,n.append(o,D(\"span\",\"ris-range\",e.rangeLabel),r),n}function wm(e,t,n){const o=gm(t);if(t.isEmpty){e.replaceChildren(o,Se(\"info\",K.emptyTitle,K.emptyDetail));return}const r=D(\"ul\",\"ris-rows\");t.rows.forEach((s,i)=>r.append(vm(s,i,n))),e.replaceChildren(o,r,ym(t,n))}function km(e,t){const n=e.querySelector(t===1?\".ris-page-next\":\".ris-page-prev\");if(n&&!n.disabled){n.focus();return}e.querySelector(\".ris-page:not(:disabled)\")?.focus()}function mo(e){const t=document.getElementById(e);if(!t)throw new Error(`Trefferliste: #${e} fehlt im HTML-Shell`);return t}const Sm=mo(\"nojs-marker\"),Pe=mo(\"ris-view\"),St=mo(\"ris-status\");let re=null,ve=null,Kt=!1,go=!1;function _o(e,t,n,o){const r=Se(e,n,o);r.dataset.source=t,St.replaceChildren(r)}function Ie(e){const t=St.firstElementChild;e&&t instanceof HTMLElement&&t.dataset.source!==e||St.replaceChildren()}function zt(){re&&wm(Pe,hm(re),Em)}function zm(e,t){if(e.kind===\"result\"){re=e.result,go=!1,tm(re),Ie(),zt();return}if(t&&re){zt(),St.replaceChildren(e.node);return}Ie(),Pe.replaceChildren(e.node)}async function Bo(e){!e||!ve||(await ve.openLink(e)?Ie(\"link\"):_o(\"error\",\"link\",K.linkRefused))}async function Tm(e){ve&&(await ve.sendPrompt(am(e))?Ie(\"prompt\"):_o(\"error\",\"prompt\",K.promptRefused))}async function $m(e){const t=tn(re?.query,e);if(!(!t||!ve||Kt)){Kt=!0,Ie(),Pe.replaceChildren(Oa(re?.documents.length));try{La(await ve.callTool(t))}catch{zt(),_o(\"error\",\"pagination\",K.sessionExpired)}finally{Kt=!1,km(Pe,e)}}}const Em={onOpen:e=>{Bo(e.risUrl)},onPdf:e=>{Bo(e.pdfUrl)},onFullText:e=>{Tm(e.id)},onPage:e=>{$m(e)}};function La(e){const t=re!==null;zm(mm(e,t?\"follow-up\":\"mount\"),t)}function Pm(e){go&&e.source===\"missing\"&&!e.isError||La(e)}function Im(){if(re)return;const e=qa(nm());e&&(re=e,go=!0,Ie(),zt())}Sm.hidden=!0;Pe.replaceChildren(Oa());Xh({onToolResult:Pm}).then(e=>{ve=e,Im()}).catch(()=>{re||Pe.replaceChildren(Se(\"error\",K.connectFailedTitle,K.answerInChat))});export{qu as $,ns as A,Qc as B,Vc as C,Fc as D,ou as E,Kc as F,Jc as G,Dc as H,Hc as I,ru as J,nu as K,Gc as L,Bc as M,eu as N,Ct as O,Yc as P,ps as Q,_l as R,Cu as S,Uu as T,sl as U,Ku as V,Zu as W,uu as X,du as Y,nn as Z,Xu as _,x as a,Is as a$,dr as a0,ol as a1,tl as a2,hl as a3,au as a4,ku as a5,Su as a6,vu as a7,bu as a8,wu as a9,Yu as aA,Nt as aB,R as aC,cl as aD,Au as aE,fl as aF,nl as aG,ls as aH,y as aI,mu as aJ,lu as aK,cu as aL,ju as aM,cn as aN,Lu as aO,Hu as aP,gu as aQ,Vu as aR,Rm as aS,l as aT,Jm as aU,Fm as aV,su as aW,xm as aX,Vm as aY,ql as aZ,od as a_,yu as aa,Wu as ab,Ru as ac,_u as ad,gl as ae,el as af,zu as ag,Qu as ah,ll as ai,pu as aj,Du as ak,al,Mu as am,rl as an,ss as ao,Nu as ap,Ju as aq,Bu as ar,ds as as,dl as at,il as au,ml as av,pl as aw,Y as ax,Gu as ay,bl as az,Oo as b,Xm as b$,Zs as b0,Cl as b1,Rl as b2,yg as b3,cd as b4,Es as b5,Ps as b6,Gm as b7,Wm as b8,Qm as b9,Nl as bA,ig as bB,Ts as bC,$s as bD,Sl as bE,kl as bF,Tl as bG,zl as bH,Rs as bI,zs as bJ,zg as bK,Os as bL,fg as bM,Bl as bN,Ae as bO,pe as bP,wl as bQ,ug as bR,Ns as bS,ln as bT,Ql as bU,pt as bV,Me as bW,Xt as bX,Fl as bY,vs as bZ,pg as b_,Km as ba,Bm as bb,ys as bc,ws as bd,sd as be,Ul as bf,hr as bg,gr as bh,_g as bi,sg as bj,xs as bk,fs as bl,bs as bm,fr as bn,mr as bo,Gl as bp,dg as bq,rd as br,Pl as bs,Il as bt,je as bu,se as bv,Yt as bw,Kl as bx,El as by,Zl as bz,Fu as c,ud as c$,Dl as c0,tg as c1,bg as c2,eg as c3,Yl as c4,Ml as c5,gg as c6,$l as c7,mg as c8,Ze as c9,Sg as cA,ed as cB,td as cC,hg as cD,Xl as cE,ag as cF,xl as cG,Ol as cH,ks as cI,jl as cJ,og as cK,Ll as cL,Vl as cM,un as cN,hs as cO,ms as cP,gs as cQ,_s as cR,Hl as cS,Ss as cT,rg as cU,ae as cV,G as cW,gt as cX,pd as cY,jm as cZ,qm as c_,It as ca,Zt as cb,wg as cc,Ym as cd,Tg as ce,ng as cf,kg as cg,cg as ch,id as ci,Jl as cj,br as ck,yr as cl,_r as cm,vr as cn,xt as co,Rt as cp,lg as cq,Cs as cr,nd as cs,Wl as ct,yl as cu,Ot as cv,dd as cw,vg as cx,ad as cy,Al as cz,ke as d,Si as d$,Am as d0,Mm as d1,pc as d2,fc as d3,Wt as d4,ce as d5,rs as d6,Pu as d7,xu as d8,ld as d9,In as dA,Zn as dB,An as dC,En as dD,Pn as dE,yn as dF,wn as dG,oa as dH,Fn as dI,Dt as dJ,Je as dK,Qi as dL,qi as dM,xn as dN,_n as dO,bn as dP,Le as dQ,Pg as dR,Ki as dS,Bi as dT,pa as dU,_t as dV,Tn as dW,$n as dX,wi as dY,yi as dZ,Ti as d_,yo as da,wo as db,Om as dc,Lc as dd,vl as de,Dm as df,Um as dg,Lm as dh,Hm as di,pr as dj,mc as dk,hc as dl,$g as dm,Nm as dn,Cm as dp,iu as dq,Ig as dr,Eg as ds,gn as dt,Cn as du,Nn as dv,On as dw,Ai as dx,Ri as dy,ji as dz,ht as e,Ad as e$,Li as e0,Rn as e1,zn as e2,ua as e3,Ji as e4,Pi as e5,Ui as e6,sa as e7,vn as e8,Ni as e9,Oi as eA,Sn as eB,Mi as eC,mn as eD,Yi as eE,Ao as eF,Mn as eG,v as eH,Kd as eI,Wd as eJ,ip as eK,I as eL,ra as eM,Ep as eN,Bd as eO,Vd as eP,zp as eQ,Md as eR,qd as eS,fa as eT,dp as eU,wd as eV,Sd as eW,Pp as eX,qn as eY,Gd as eZ,Pd as e_,Hn as ea,xi as eb,Gi as ec,xe as ed,jt as ee,Dn as ef,Un as eg,Xi as eh,da as ei,ia as ej,X as ek,Lt as el,Fi as em,C as en,na as eo,Ii as ep,ca as eq,Vi as er,Di as es,k as et,kn as eu,At as ev,ue as ew,Zi as ex,Mt as ey,Ci as ez,mt as f,ma as f$,yd as f0,kd as f1,B as f2,Wi as f3,yp as f4,np as f5,op as f6,Id as f7,tp as f8,ep as f9,vt as fA,wp as fB,w as fC,h as fD,O as fE,gd as fF,_d as fG,mp as fH,yt as fI,ea as fJ,Jn as fK,$p as fL,aa as fM,T as fN,ha as fO,Td as fP,Ed as fQ,zd as fR,$d as fS,bd as fT,vd as fU,bp as fV,fp as fW,d as fX,Yd as fY,xp as fZ,kp as f_,Xd as fa,Od as fb,Zp as fc,en as fd,rp as fe,ap as ff,qt as fg,Ud as fh,Jd as fi,Rp as fj,Qd as fk,pp as fl,Hd as fm,la as fn,p as fo,J as fp,gp as fq,Fd as fr,_p as fs,Ip as ft,Sp as fu,jd as fv,vp as fw,qe as fx,ta as fy,jn as fz,Eu as g,up as g0,Tp as g1,Ln as g2,Hi as g3,sp as g4,cp as g5,Ld as g6,bt as g7,z as g8,E as g9,Nd as ga,Zd as gb,xd as gc,Rd as gd,Cd as ge,lp as gf,Dd as gg,hp as gh,Iu as h,ft as i,Ga as j,as as k,Ou as l,is as m,Tu as n,$u as o,sc as p,fu as q,hu as r,Qo as s,ul as t,A as u,Uc as v,tu as w,os as x,Xc as y,Wc as z};</script>\n <style rel=\"stylesheet\" crossorigin>:root{color-scheme:light dark;--ris-bg: var(--color-background-primary, #ffffff);--ris-bg-raised: var(--color-background-secondary, #f7f7f8);--ris-bg-hover: var(--color-background-tertiary, #efeff1);--ris-fg: var(--color-text-primary, #18181b);--ris-fg-muted: var(--color-text-secondary, #52525b);--ris-fg-subtle: var(--color-text-tertiary, #71717a);--ris-border: var(--color-border-primary, #e0e0e3);--ris-border-strong: var(--color-border-secondary, #c8c8cd);--ris-ring: var(--color-ring-primary, #2563eb);--ris-danger-fg: var(--color-text-danger, #b42318);--ris-danger-bg: var(--color-background-danger, #fef3f2);--ris-danger-border: var(--color-border-danger, #f5c6c1);--ris-font: var( --font-sans, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif );--ris-font-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);--ris-text-xs: var(--font-text-xs-size, .75rem);--ris-text-sm: var(--font-text-sm-size, .8125rem);--ris-text-md: var(--font-text-md-size, .875rem);--ris-text-lg: var(--font-text-lg-size, 1rem);--ris-weight-medium: var(--font-weight-medium, 500);--ris-weight-semibold: var(--font-weight-semibold, 600);--ris-radius-sm: var(--border-radius-sm, 4px);--ris-radius-md: var(--border-radius-md, 8px);--ris-radius-full: var(--border-radius-full, 999px)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--ris-bg: var(--color-background-primary, #1b1b1f);--ris-bg-raised: var(--color-background-secondary, #242429);--ris-bg-hover: var(--color-background-tertiary, #2e2e34);--ris-fg: var(--color-text-primary, #ededf0);--ris-fg-muted: var(--color-text-secondary, #b4b4bb);--ris-fg-subtle: var(--color-text-tertiary, #8e8e96);--ris-border: var(--color-border-primary, #35353c);--ris-border-strong: var(--color-border-secondary, #4a4a53);--ris-ring: var(--color-ring-primary, #7aa2f7);--ris-danger-fg: var(--color-text-danger, #ff9c92);--ris-danger-bg: var(--color-background-danger, #3a1f1d);--ris-danger-border: var(--color-border-danger, #5c2f2b)}}:root[data-theme=dark]{color-scheme:dark;--ris-bg: var(--color-background-primary, #1b1b1f);--ris-bg-raised: var(--color-background-secondary, #242429);--ris-bg-hover: var(--color-background-tertiary, #2e2e34);--ris-fg: var(--color-text-primary, #ededf0);--ris-fg-muted: var(--color-text-secondary, #b4b4bb);--ris-fg-subtle: var(--color-text-tertiary, #8e8e96);--ris-border: var(--color-border-primary, #35353c);--ris-border-strong: var(--color-border-secondary, #4a4a53);--ris-ring: var(--color-ring-primary, #7aa2f7);--ris-danger-fg: var(--color-text-danger, #ff9c92);--ris-danger-bg: var(--color-background-danger, #3a1f1d);--ris-danger-border: var(--color-border-danger, #5c2f2b)}:root[data-theme=light]{color-scheme:light}body{margin:0;padding:12px;font-family:var(--ris-font);font-size:var(--ris-text-md);line-height:1.5;color:var(--ris-fg);background:var(--ris-bg);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;cursor:pointer}:focus-visible{outline:2px solid var(--ris-ring);outline-offset:2px;border-radius:var(--ris-radius-sm)}.ris-notice{padding:12px 14px;border:1px solid var(--ris-border);border-radius:var(--ris-radius-md);background:var(--ris-bg-raised)}.ris-notice-error{color:var(--ris-danger-fg);border-color:var(--ris-danger-border);background:var(--ris-danger-bg)}.ris-notice-title{margin:0;font-weight:var(--ris-weight-semibold)}.ris-notice-detail{margin:4px 0 0;font-size:var(--ris-text-sm);color:var(--ris-fg-muted);white-space:pre-wrap}.ris-notice-error .ris-notice-detail{color:inherit}.ris-skeleton-label{margin:0 0 10px;font-size:var(--ris-text-sm);color:var(--ris-fg-subtle)}.ris-skeleton-row{padding:12px 0;border-top:1px solid var(--ris-border)}.ris-skeleton-line{display:block;height:10px;border-radius:var(--ris-radius-sm);background:var(--ris-bg-hover)}.ris-skeleton-line-title{width:62%}.ris-skeleton-line-meta{width:38%;margin-top:8px;height:8px}@media(prefers-reduced-motion:no-preference){.ris-skeleton-line{animation:ris-pulse 1.4s ease-in-out infinite}}@keyframes ris-pulse{50%{opacity:.45}}.ris-header{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;padding-bottom:10px}.ris-tool-badge{padding:2px 8px;font-size:var(--ris-text-xs);font-weight:var(--ris-weight-semibold);color:var(--ris-fg-muted);background:var(--ris-bg-hover);border-radius:var(--ris-radius-full)}.ris-query{font-weight:var(--ris-weight-semibold);font-size:var(--ris-text-lg);overflow-wrap:anywhere}.ris-hits{margin-left:auto;font-size:var(--ris-text-sm);color:var(--ris-fg-subtle);white-space:nowrap}.ris-rows{margin:0;padding:0;list-style:none;border-top:1px solid var(--ris-border)}.ris-row{border-bottom:1px solid var(--ris-border)}.ris-row-toggle{display:grid;grid-template-columns:1fr auto auto;align-items:start;gap:4px 10px;width:100%;padding:10px 2px;text-align:left;background:none;border:0;border-radius:var(--ris-radius-sm)}.ris-row-toggle:hover{background:var(--ris-bg-hover)}.ris-row-heading{grid-column:1;display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;font-weight:var(--ris-weight-medium);overflow-wrap:anywhere}.ris-row-more{font-size:var(--ris-text-xs);font-weight:var(--font-weight-normal, 400);color:var(--ris-fg-subtle);white-space:nowrap}.ris-row-subtitle{grid-column:1;grid-row:2;font-size:var(--ris-text-sm);color:var(--ris-fg-muted);overflow-wrap:anywhere}.ris-row-badge{grid-column:2;grid-row:1;padding:1px 7px;font-size:var(--ris-text-xs);color:var(--ris-fg-muted);border:1px solid var(--ris-border-strong);border-radius:var(--ris-radius-full);white-space:nowrap}.ris-row-toggle:after{content:\"\";grid-column:3;grid-row:1;align-self:center;width:6px;height:6px;border-right:1.5px solid var(--ris-fg-subtle);border-bottom:1.5px solid var(--ris-fg-subtle);transform:rotate(45deg) translate(-2px,-2px)}.ris-row-toggle[aria-expanded=true]:after{transform:rotate(-135deg) translate(-2px,-2px)}.ris-row-detail{padding:2px 2px 14px}.ris-meta{display:grid;grid-template-columns:minmax(6rem,max-content) 1fr;gap:2px 12px;margin:0 0 12px;font-size:var(--ris-text-sm)}.ris-meta dt{color:var(--ris-fg-subtle)}.ris-meta dd{margin:0;overflow-wrap:anywhere}.ris-actions{display:flex;flex-wrap:wrap;gap:8px}.ris-action{padding:5px 11px;font-size:var(--ris-text-sm);font-weight:var(--ris-weight-medium);background:var(--ris-bg-raised);border:1px solid var(--ris-border-strong);border-radius:var(--ris-radius-md)}.ris-action:hover{background:var(--ris-bg-hover)}.ris-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:12px}.ris-page{padding:5px 11px;font-size:var(--ris-text-sm);background:var(--ris-bg-raised);border:1px solid var(--ris-border-strong);border-radius:var(--ris-radius-md)}.ris-page:hover:not(:disabled){background:var(--ris-bg-hover)}.ris-page:disabled{color:var(--color-text-disabled, var(--ris-fg-subtle));cursor:default;opacity:.55}.ris-range{font-size:var(--ris-text-sm);color:var(--ris-fg-subtle);white-space:nowrap}#ris-status:not(:empty){padding-top:12px}</style>\n </head>\n <body>\n <!--\n Visible only when the bundle never executes; main.ts hides it as its first\n act, so a still-visible marker means \"the script never ran\" rather than\n \"the widget mounted and found nothing\".\n -->\n <p id=\"nojs-marker\" class=\"ris-notice ris-notice-error\">\n Die Trefferliste konnte nicht geladen werden — die vollständige Antwort steht im Chat.\n </p>\n <main id=\"ris-view\"></main>\n <div id=\"ris-status\"></div>\n </body>\n</html>\n";
3
3
  //# sourceMappingURL=trefferliste-html.js.map