@typescape-ai/mcp 1.9.25 → 1.9.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -11
- package/dist/mcp.js +219 -74
- package/package.json +1 -1
package/dist/mcp.js
CHANGED
|
@@ -1,46 +1,184 @@
|
|
|
1
|
-
import{createRequire as QX}from"node:module";var _X=Object.create;var{getPrototypeOf:bX,defineProperty:t_,getOwnPropertyNames:UX}=Object;var kX=Object.prototype.hasOwnProperty;function lX(n){return this[n]}var DX,JX,y0=(n,i,$)=>{var g=n!=null&&typeof n==="object";if(g){var v=i?DX??=new WeakMap:JX??=new WeakMap,w=v.get(n);if(w)return w}$=n!=null?_X(bX(n)):{};let _=i||!n||!n.__esModule?t_($,"default",{value:n,enumerable:!0}):$;for(let U of UX(n))if(!kX.call(_,U))t_(_,U,{get:lX.bind(n,U),enumerable:!0});if(g)v.set(n,_);return _};var XX=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var GX=(n)=>n;function tX(n,i){this[n]=GX.bind(null,i)}var Nn=(n,i)=>{for(var $ in i)t_(n,$,{get:i[$],enumerable:!0,configurable:!0,set:tX.bind(i,$)})};var d0=QX(import.meta.url);var Q_=XX((eY,WX)=>{WX.exports={name:"@typescape-ai/mcp",version:"1.9.25",description:"Typescape MCP server for review, finding, and rules workflows in external agent harnesses",type:"module",bin:{"typescape-mcp":"./bin/typescape-mcp"},files:["bin","dist","README.md"],exports:{".":"./dist/mcp.js"},publishConfig:{access:"public"},scripts:{build:"bun build src/index.ts --outfile=dist/mcp.js --target=node --bundle --minify",dev:"bun run --watch src/index.ts",test:"bun test",typecheck:"tsc --noEmit",lint:"eslint src",prepublishOnly:"bun run build"},dependencies:{},devDependencies:{"@modelcontextprotocol/sdk":"1.0.4","@types/bun":"1.3.8","@typescape/schemas":"workspace:*",zod:"4.3.0"},engines:{node:">=18.17.0",bun:">=1.0.0"},keywords:["typescape","mcp","mcp-server","model-context-protocol","agent","automation","review","finding","rules","cursor","windsurf","bun"],repository:{type:"git",url:"https://github.com/voidserf/typescape-docs.git",directory:"apps/mcp"},license:"MIT"}});function e0(){let n=new Map;return{register(i,$){n.set(i.name,{definition:i,handler:$})},getTools(){return Array.from(n.values()).map((i)=>i.definition)},getHandler(i){return n.get(i)?.handler}}}var YX=await Promise.resolve().then(() => y0(Q_(),1)),IX=`typescape-mcp/${YX.version}`;class D extends Error{status;code;requestId;details;fixHint;constructor(n,i,$,g,v,w){super($);this.status=n;this.code=i;this.requestId=g;this.details=v;this.fixHint=w;this.name="ApiError"}}var Bw=30000;function W_(n,i,$,g){let v=`${n}${i}${$}`;if(g&&Object.keys(g).length>0){let w=new URLSearchParams(g);v+=`?${w.toString()}`}return v}function Y_(n,i){return{Authorization:`Bearer ${n}`,Accept:"application/json","User-Agent":IX,...i}}function s0(n){let i=n.headers.get("X-Request-Id");if(typeof i!=="string"||i.trim().length===0)return null;return i}function n2(){return"missing_request_id"}function v2(n,i){if(typeof n.request_id==="string"&&n.request_id.trim().length>0)return n.request_id;let $=s0(i);if($!==null)return $;return n2()}function p0(n){let i=s0(n);if(i!==null)return i;return n2()}async function a0(n,i,$){let g;try{g=await fetch(n,{...i,signal:AbortSignal.timeout($)})}catch(U){if(U instanceof DOMException&&(U.name==="TimeoutError"||U.name==="AbortError")){let J=Math.round($/1000);throw new D(0,"request_timeout",`Request timed out after ${J}s. Check your network connection and server URL.`,"unknown")}let l=U instanceof Error?U.message:String(U);throw new D(0,"network_error",`Network error: ${l}`,"unknown")}let v=g.headers.get("Content-Type");if(v===null)throw new D(g.status,"invalid_response","Response missing Content-Type header","unknown");if(!v.includes("application/json"))throw new D(g.status,"invalid_response",`Unexpected Content-Type: ${v}`,"unknown");let w;try{w=await g.json()}catch(U){throw new D(g.status,"invalid_response",`Failed to parse JSON response: ${U instanceof Error?U.message:String(U)}`,"unknown")}let _=v2(w,g);if(typeof _!=="string"||_.trim().length===0)throw new D(g.status,"invalid_response","Response missing request_id","unknown");if(!g.ok){let U=w,k=U.error?.code;if(typeof k!=="string"||k.trim().length===0)throw new D(g.status,"invalid_response","Error response missing error.code",_);let l=U.error?.message;if(typeof l!=="string"||l.trim().length===0)throw new D(g.status,"invalid_response","Error response missing error.message",_);throw new D(g.status,k,l,_,U.error?.details,U.error?.fix_hint)}return{status:g.status,body:w,requestId:_}}async function jX(n,i,$){let g;try{g=await fetch(n,{...i,signal:AbortSignal.timeout($)})}catch(_){if(_ instanceof DOMException&&(_.name==="TimeoutError"||_.name==="AbortError")){let l=Math.round($/1000);throw new D(0,"request_timeout",`Request timed out after ${l}s. Check your network connection and server URL.`,"unknown")}let k=_ instanceof Error?_.message:String(_);throw new D(0,"network_error",`Network error: ${k}`,"unknown")}let v=g.headers.get("Content-Type");if(v===null)throw new D(g.status,"invalid_response","Response missing Content-Type header","unknown");if(v.includes("application/json")){let _;try{_=await g.json()}catch(k){throw new D(g.status,"invalid_response",`Failed to parse JSON response: ${k instanceof Error?k.message:String(k)}`,"unknown")}let U=v2(_,g);if(!g.ok){let k=_.error?.code,l=_.error?.message;if(typeof k!=="string"||k.trim().length===0||typeof l!=="string"||l.trim().length===0)throw new D(g.status,"invalid_response","Error response missing error.code or error.message",U);throw new D(g.status,k,l,U,_.error?.details,_.error?.fix_hint)}throw new D(g.status,"invalid_response","Expected text response but received JSON payload",U)}let w;try{w=await g.text()}catch(_){throw new D(g.status,"invalid_response",`Failed to read text response: ${_ instanceof Error?_.message:String(_)}`,p0(g))}return{status:g.status,body:w,requestId:p0(g)}}function i2(n,i,$=Bw){let v=n.replace(/\/$/,"");async function w(_,U,k={}){let l=W_(v,"/v1",U,k.query),J=Y_(i,k.headers);if(k.body!==void 0)J["Content-Type"]="application/json";return a0(l,{method:_,headers:J,body:k.body!==void 0?JSON.stringify(k.body):void 0},$)}return{async get(_,U){return w("GET",_,U)},async getText(_,U){let k=W_(v,"/v1",_,U?.query),l=Y_(i,{Accept:"text/plain, application/json",...U?.headers});return jX(k,{method:"GET",headers:l},$)},async post(_,U){return w("POST",_,U)},async patch(_,U){return w("PATCH",_,U)},async postFormData(_,U,k){let l=W_(v,"/v1",_,k?.query),J=Y_(i,k?.headers);return a0(l,{method:"POST",headers:J,body:U},$)},request:w}}var Z;(function(n){n.assertEqual=(v)=>v;function i(v){}n.assertIs=i;function $(v){throw Error()}n.assertNever=$,n.arrayToEnum=(v)=>{let w={};for(let _ of v)w[_]=_;return w},n.getValidEnumValues=(v)=>{let w=n.objectKeys(v).filter((U)=>typeof v[v[U]]!=="number"),_={};for(let U of w)_[U]=v[U];return n.objectValues(_)},n.objectValues=(v)=>{return n.objectKeys(v).map(function(w){return v[w]})},n.objectKeys=typeof Object.keys==="function"?(v)=>Object.keys(v):(v)=>{let w=[];for(let _ in v)if(Object.prototype.hasOwnProperty.call(v,_))w.push(_);return w},n.find=(v,w)=>{for(let _ of v)if(w(_))return _;return},n.isInteger=typeof Number.isInteger==="function"?(v)=>Number.isInteger(v):(v)=>typeof v==="number"&&isFinite(v)&&Math.floor(v)===v;function g(v,w=" | "){return v.map((_)=>typeof _==="string"?`'${_}'`:_).join(w)}n.joinValues=g,n.jsonStringifyReplacer=(v,w)=>{if(typeof w==="bigint")return w.toString();return w}})(Z||(Z={}));var j_;(function(n){n.mergeShapes=(i,$)=>{return{...i,...$}}})(j_||(j_={}));var c=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vv=(n)=>{switch(typeof n){case"undefined":return c.undefined;case"string":return c.string;case"number":return isNaN(n)?c.nan:c.number;case"boolean":return c.boolean;case"function":return c.function;case"bigint":return c.bigint;case"symbol":return c.symbol;case"object":if(Array.isArray(n))return c.array;if(n===null)return c.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return c.promise;if(typeof Map<"u"&&n instanceof Map)return c.map;if(typeof Set<"u"&&n instanceof Set)return c.set;if(typeof Date<"u"&&n instanceof Date)return c.date;return c.object;default:return c.unknown}},q=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),uX=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class In extends Error{get errors(){return this.issues}constructor(n){super();this.issues=[],this.addIssue=($)=>{this.issues=[...this.issues,$]},this.addIssues=($=[])=>{this.issues=[...this.issues,...$]};let i=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,i);else this.__proto__=i;this.name="ZodError",this.issues=n}format(n){let i=n||function(v){return v.message},$={_errors:[]},g=(v)=>{for(let w of v.issues)if(w.code==="invalid_union")w.unionErrors.map(g);else if(w.code==="invalid_return_type")g(w.returnTypeError);else if(w.code==="invalid_arguments")g(w.argumentsError);else if(w.path.length===0)$._errors.push(i(w));else{let _=$,U=0;while(U<w.path.length){let k=w.path[U];if(U!==w.path.length-1)_[k]=_[k]||{_errors:[]};else _[k]=_[k]||{_errors:[]},_[k]._errors.push(i(w));_=_[k],U++}}};return g(this),$}static assert(n){if(!(n instanceof In))throw Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(i)=>i.message){let i={},$=[];for(let g of this.issues)if(g.path.length>0)i[g.path[0]]=i[g.path[0]]||[],i[g.path[0]].push(n(g));else $.push(n(g));return{formErrors:$,fieldErrors:i}}get formErrors(){return this.flatten()}}In.create=(n)=>{return new In(n)};var fi=(n,i)=>{let $;switch(n.code){case q.invalid_type:if(n.received===c.undefined)$="Required";else $=`Expected ${n.expected}, received ${n.received}`;break;case q.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(n.expected,Z.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:$=`Unrecognized key(s) in object: ${Z.joinValues(n.keys,", ")}`;break;case q.invalid_union:$="Invalid input";break;case q.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${Z.joinValues(n.options)}`;break;case q.invalid_enum_value:$=`Invalid enum value. Expected ${Z.joinValues(n.options)}, received '${n.received}'`;break;case q.invalid_arguments:$="Invalid function arguments";break;case q.invalid_return_type:$="Invalid function return type";break;case q.invalid_date:$="Invalid date";break;case q.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if($=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")$=`${$} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)$=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)$=`Invalid input: must end with "${n.validation.endsWith}"`;else Z.assertNever(n.validation);else if(n.validation!=="regex")$=`Invalid ${n.validation}`;else $="Invalid";break;case q.too_small:if(n.type==="array")$=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")$=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")$=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")$=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else $="Invalid input";break;case q.too_big:if(n.type==="array")$=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")$=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")$=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")$=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")$=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else $="Invalid input";break;case q.custom:$="Invalid input";break;case q.invalid_intersection_types:$="Intersection results could not be merged";break;case q.not_multiple_of:$=`Number must be a multiple of ${n.multipleOf}`;break;case q.not_finite:$="Number must be finite";break;default:$=i.defaultError,Z.assertNever(n)}return{message:$}},w2=fi;function HX(n){w2=n}function Fw(){return w2}var Nw=(n)=>{let{data:i,path:$,errorMaps:g,issueData:v}=n,w=[...$,...v.path||[]],_={...v,path:w};if(v.message!==void 0)return{...v,path:w,message:v.message};let U="",k=g.filter((l)=>!!l).slice().reverse();for(let l of k)U=l(_,{data:i,defaultError:U}).message;return{...v,path:w,message:U}},VX=[];function F(n,i){let $=Fw(),g=Nw({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,$,$===fi?void 0:fi].filter((v)=>!!v)});n.common.issues.push(g)}class kn{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,i){let $=[];for(let g of i){if(g.status==="aborted")return z;if(g.status==="dirty")n.dirty();$.push(g.value)}return{status:n.value,value:$}}static async mergeObjectAsync(n,i){let $=[];for(let g of i){let v=await g.key,w=await g.value;$.push({key:v,value:w})}return kn.mergeObjectSync(n,$)}static mergeObjectSync(n,i){let $={};for(let g of i){let{key:v,value:w}=g;if(v.status==="aborted")return z;if(w.status==="aborted")return z;if(v.status==="dirty")n.dirty();if(w.status==="dirty")n.dirty();if(v.value!=="__proto__"&&(typeof w.value<"u"||g.alwaysSet))$[v.value]=w.value}return{status:n.value,value:$}}}var z=Object.freeze({status:"aborted"}),Hi=(n)=>({status:"dirty",value:n}),Jn=(n)=>({status:"valid",value:n}),u_=(n)=>n.status==="aborted",H_=(n)=>n.status==="dirty",dv=(n)=>n.status==="valid",E$=(n)=>typeof Promise<"u"&&n instanceof Promise;function cw(n,i,$,g){if($==="a"&&!g)throw TypeError("Private accessor was defined without a getter");if(typeof i==="function"?n!==i||!g:!i.has(n))throw TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?g:$==="a"?g.call(n):g?g.value:i.get(n)}function _2(n,i,$,g,v){if(g==="m")throw TypeError("Private method is not writable");if(g==="a"&&!v)throw TypeError("Private accessor was defined without a setter");if(typeof i==="function"?n!==i||!v:!i.has(n))throw TypeError("Cannot write private member to an object whose class did not declare it");return g==="a"?v.call(n,$):v?v.value=$:i.set(n,$),$}var P;(function(n){n.errToObj=(i)=>typeof i==="string"?{message:i}:i||{},n.toString=(i)=>typeof i==="string"?i:i===null||i===void 0?void 0:i.message})(P||(P={}));var h$,C$;class zn{constructor(n,i,$,g){this._cachedPath=[],this.parent=n,this.data=i,this._path=$,this._key=g}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var $2=(n,i)=>{if(dv(i))return{success:!0,data:i.value};else{if(!n.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let $=new In(n.common.issues);return this._error=$,this._error}}}};function A(n){if(!n)return{};let{errorMap:i,invalid_type_error:$,required_error:g,description:v}=n;if(i&&($||g))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(i)return{errorMap:i,description:v};return{errorMap:(_,U)=>{var k,l;let{message:J}=n;if(_.code==="invalid_enum_value")return{message:J!==null&&J!==void 0?J:U.defaultError};if(typeof U.data>"u")return{message:(k=J!==null&&J!==void 0?J:g)!==null&&k!==void 0?k:U.defaultError};if(_.code!=="invalid_type")return{message:U.defaultError};return{message:(l=J!==null&&J!==void 0?J:$)!==null&&l!==void 0?l:U.defaultError}},description:v}}class x{get description(){return this._def.description}_getType(n){return vv(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:vv(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new kn,ctx:{common:n.parent.common,data:n.data,parsedType:vv(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(E$(i))throw Error("Synchronous parse encountered promise.");return i}_parseAsync(n){let i=this._parse(n);return Promise.resolve(i)}parse(n,i){let $=this.safeParse(n,i);if($.success)return $.data;throw $.error}safeParse(n,i){var $;let g={common:{issues:[],async:($=i===null||i===void 0?void 0:i.async)!==null&&$!==void 0?$:!1,contextualErrorMap:i===null||i===void 0?void 0:i.errorMap},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:vv(n)},v=this._parseSync({data:n,path:g.path,parent:g});return $2(g,v)}"~validate"(n){var i,$;let g={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:vv(n)};if(!this["~standard"].async)try{let v=this._parseSync({data:n,path:[],parent:g});return dv(v)?{value:v.value}:{issues:g.common.issues}}catch(v){if(($=(i=v===null||v===void 0?void 0:v.message)===null||i===void 0?void 0:i.toLowerCase())===null||$===void 0?void 0:$.includes("encountered"))this["~standard"].async=!0;g.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:g}).then((v)=>dv(v)?{value:v.value}:{issues:g.common.issues})}async parseAsync(n,i){let $=await this.safeParseAsync(n,i);if($.success)return $.data;throw $.error}async safeParseAsync(n,i){let $={common:{issues:[],contextualErrorMap:i===null||i===void 0?void 0:i.errorMap,async:!0},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:vv(n)},g=this._parse({data:n,path:$.path,parent:$}),v=await(E$(g)?g:Promise.resolve(g));return $2($,v)}refine(n,i){let $=(g)=>{if(typeof i==="string"||typeof i>"u")return{message:i};else if(typeof i==="function")return i(g);else return i};return this._refinement((g,v)=>{let w=n(g),_=()=>v.addIssue({code:q.custom,...$(g)});if(typeof Promise<"u"&&w instanceof Promise)return w.then((U)=>{if(!U)return _(),!1;else return!0});if(!w)return _(),!1;else return!0})}refinement(n,i){return this._refinement(($,g)=>{if(!n($))return g.addIssue(typeof i==="function"?i($,g):i),!1;else return!0})}_refinement(n){return new Vn({schema:this,typeName:S.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(i)=>this["~validate"](i)}}optional(){return Sn.create(this,this._def)}nullable(){return iv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pn.create(this)}promise(){return sv.create(this,this._def)}or(n){return Oi.create([this,n],this._def)}and(n){return Bi.create(this,n,this._def)}transform(n){return new Vn({...A(this._def),schema:this,typeName:S.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new Pi({...A(this._def),innerType:this,defaultValue:i,typeName:S.ZodDefault})}brand(){return new Sw({typeName:S.ZodBranded,type:this,...A(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new Si({...A(this._def),innerType:this,catchValue:i,typeName:S.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return y$.create(this,n)}readonly(){return zi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var fX=/^c[^\s-]{8,}$/i,qX=/^[0-9a-z]+$/,LX=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,OX=/^[a-z0-9_-]{21}$/i,BX=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FX=/^[-+]?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)?)??$/,NX=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cX="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",I_,PX=/^(?:(?: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])$/,SX=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,zX=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,MX=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,RX=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AX=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,b2="((\\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])))",xX=new RegExp(`^${b2}$`);function U2(n){let i="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(n.precision)i=`${i}\\.\\d{${n.precision}}`;else if(n.precision==null)i=`${i}(\\.\\d+)?`;return i}function hX(n){return new RegExp(`^${U2(n)}$`)}function k2(n){let i=`${b2}T${U2(n)}`,$=[];if($.push(n.local?"Z?":"Z"),n.offset)$.push("([+-]\\d{2}:?\\d{2})");return i=`${i}(${$.join("|")})`,new RegExp(`^${i}$`)}function CX(n,i){if((i==="v4"||!i)&&PX.test(n))return!0;if((i==="v6"||!i)&&zX.test(n))return!0;return!1}function EX(n,i){if(!BX.test(n))return!1;try{let[$]=n.split("."),g=$.replace(/-/g,"+").replace(/_/g,"/").padEnd($.length+(4-$.length%4)%4,"="),v=JSON.parse(atob(g));if(typeof v!=="object"||v===null)return!1;if(!v.typ||!v.alg)return!1;if(i&&v.alg!==i)return!1;return!0}catch($){return!1}}function oX(n,i){if((i==="v4"||!i)&&SX.test(n))return!0;if((i==="v6"||!i)&&MX.test(n))return!0;return!1}class cn extends x{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==c.string){let v=this._getOrReturnCtx(n);return F(v,{code:q.invalid_type,expected:c.string,received:v.parsedType}),z}let $=new kn,g=void 0;for(let v of this._def.checks)if(v.kind==="min"){if(n.data.length<v.value)g=this._getOrReturnCtx(n,g),F(g,{code:q.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),$.dirty()}else if(v.kind==="max"){if(n.data.length>v.value)g=this._getOrReturnCtx(n,g),F(g,{code:q.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),$.dirty()}else if(v.kind==="length"){let w=n.data.length>v.value,_=n.data.length<v.value;if(w||_){if(g=this._getOrReturnCtx(n,g),w)F(g,{code:q.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message});else if(_)F(g,{code:q.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message});$.dirty()}}else if(v.kind==="email"){if(!NX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"email",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="emoji"){if(!I_)I_=new RegExp(cX,"u");if(!I_.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"emoji",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="uuid"){if(!KX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"uuid",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="nanoid"){if(!OX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"nanoid",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="cuid"){if(!fX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"cuid",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="cuid2"){if(!qX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"cuid2",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="ulid"){if(!LX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"ulid",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="url")try{new URL(n.data)}catch(w){g=this._getOrReturnCtx(n,g),F(g,{validation:"url",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="regex"){if(v.regex.lastIndex=0,!v.regex.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"regex",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="trim")n.data=n.data.trim();else if(v.kind==="includes"){if(!n.data.includes(v.value,v.position))g=this._getOrReturnCtx(n,g),F(g,{code:q.invalid_string,validation:{includes:v.value,position:v.position},message:v.message}),$.dirty()}else if(v.kind==="toLowerCase")n.data=n.data.toLowerCase();else if(v.kind==="toUpperCase")n.data=n.data.toUpperCase();else if(v.kind==="startsWith"){if(!n.data.startsWith(v.value))g=this._getOrReturnCtx(n,g),F(g,{code:q.invalid_string,validation:{startsWith:v.value},message:v.message}),$.dirty()}else if(v.kind==="endsWith"){if(!n.data.endsWith(v.value))g=this._getOrReturnCtx(n,g),F(g,{code:q.invalid_string,validation:{endsWith:v.value},message:v.message}),$.dirty()}else if(v.kind==="datetime"){if(!k2(v).test(n.data))g=this._getOrReturnCtx(n,g),F(g,{code:q.invalid_string,validation:"datetime",message:v.message}),$.dirty()}else if(v.kind==="date"){if(!xX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{code:q.invalid_string,validation:"date",message:v.message}),$.dirty()}else if(v.kind==="time"){if(!hX(v).test(n.data))g=this._getOrReturnCtx(n,g),F(g,{code:q.invalid_string,validation:"time",message:v.message}),$.dirty()}else if(v.kind==="duration"){if(!FX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"duration",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="ip"){if(!CX(n.data,v.version))g=this._getOrReturnCtx(n,g),F(g,{validation:"ip",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="jwt"){if(!EX(n.data,v.alg))g=this._getOrReturnCtx(n,g),F(g,{validation:"jwt",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="cidr"){if(!oX(n.data,v.version))g=this._getOrReturnCtx(n,g),F(g,{validation:"cidr",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="base64"){if(!RX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"base64",code:q.invalid_string,message:v.message}),$.dirty()}else if(v.kind==="base64url"){if(!AX.test(n.data))g=this._getOrReturnCtx(n,g),F(g,{validation:"base64url",code:q.invalid_string,message:v.message}),$.dirty()}else Z.assertNever(v);return{status:$.value,value:n.data}}_regex(n,i,$){return this.refinement((g)=>n.test(g),{validation:i,code:q.invalid_string,...P.errToObj($)})}_addCheck(n){return new cn({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...P.errToObj(n)})}url(n){return this._addCheck({kind:"url",...P.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...P.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...P.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...P.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...P.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...P.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...P.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...P.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...P.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...P.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...P.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...P.errToObj(n)})}datetime(n){var i,$;if(typeof n==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n});return this._addCheck({kind:"datetime",precision:typeof(n===null||n===void 0?void 0:n.precision)>"u"?null:n===null||n===void 0?void 0:n.precision,offset:(i=n===null||n===void 0?void 0:n.offset)!==null&&i!==void 0?i:!1,local:($=n===null||n===void 0?void 0:n.local)!==null&&$!==void 0?$:!1,...P.errToObj(n===null||n===void 0?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){if(typeof n==="string")return this._addCheck({kind:"time",precision:null,message:n});return this._addCheck({kind:"time",precision:typeof(n===null||n===void 0?void 0:n.precision)>"u"?null:n===null||n===void 0?void 0:n.precision,...P.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...P.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...P.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...P.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...P.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...P.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...P.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...P.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...P.errToObj(i)})}nonempty(n){return this.min(1,P.errToObj(n))}trim(){return new cn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((n)=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find((n)=>n.kind==="date")}get isTime(){return!!this._def.checks.find((n)=>n.kind==="time")}get isDuration(){return!!this._def.checks.find((n)=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find((n)=>n.kind==="email")}get isURL(){return!!this._def.checks.find((n)=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find((n)=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find((n)=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((n)=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((n)=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((n)=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find((n)=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find((n)=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find((n)=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find((n)=>n.kind==="base64url")}get minLength(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxLength(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}cn.create=(n)=>{var i;return new cn({checks:[],typeName:S.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...A(n)})};function TX(n,i){let $=(n.toString().split(".")[1]||"").length,g=(i.toString().split(".")[1]||"").length,v=$>g?$:g,w=parseInt(n.toFixed(v).replace(".","")),_=parseInt(i.toFixed(v).replace(".",""));return w%_/Math.pow(10,v)}class Wv extends x{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce)n.data=Number(n.data);if(this._getType(n)!==c.number){let v=this._getOrReturnCtx(n);return F(v,{code:q.invalid_type,expected:c.number,received:v.parsedType}),z}let $=void 0,g=new kn;for(let v of this._def.checks)if(v.kind==="int"){if(!Z.isInteger(n.data))$=this._getOrReturnCtx(n,$),F($,{code:q.invalid_type,expected:"integer",received:"float",message:v.message}),g.dirty()}else if(v.kind==="min"){if(v.inclusive?n.data<v.value:n.data<=v.value)$=this._getOrReturnCtx(n,$),F($,{code:q.too_small,minimum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),g.dirty()}else if(v.kind==="max"){if(v.inclusive?n.data>v.value:n.data>=v.value)$=this._getOrReturnCtx(n,$),F($,{code:q.too_big,maximum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),g.dirty()}else if(v.kind==="multipleOf"){if(TX(n.data,v.value)!==0)$=this._getOrReturnCtx(n,$),F($,{code:q.not_multiple_of,multipleOf:v.value,message:v.message}),g.dirty()}else if(v.kind==="finite"){if(!Number.isFinite(n.data))$=this._getOrReturnCtx(n,$),F($,{code:q.not_finite,message:v.message}),g.dirty()}else Z.assertNever(v);return{status:g.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,P.toString(i))}gt(n,i){return this.setLimit("min",n,!1,P.toString(i))}lte(n,i){return this.setLimit("max",n,!0,P.toString(i))}lt(n,i){return this.setLimit("max",n,!1,P.toString(i))}setLimit(n,i,$,g){return new Wv({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:$,message:P.toString(g)}]})}_addCheck(n){return new Wv({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:P.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:P.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:P.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.toString(n)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}get isInt(){return!!this._def.checks.find((n)=>n.kind==="int"||n.kind==="multipleOf"&&Z.isInteger(n.value))}get isFinite(){let n=null,i=null;for(let $ of this._def.checks)if($.kind==="finite"||$.kind==="int"||$.kind==="multipleOf")return!0;else if($.kind==="min"){if(i===null||$.value>i)i=$.value}else if($.kind==="max"){if(n===null||$.value<n)n=$.value}return Number.isFinite(i)&&Number.isFinite(n)}}Wv.create=(n)=>{return new Wv({checks:[],typeName:S.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...A(n)})};class Yv extends x{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch(v){return this._getInvalidInput(n)}if(this._getType(n)!==c.bigint)return this._getInvalidInput(n);let $=void 0,g=new kn;for(let v of this._def.checks)if(v.kind==="min"){if(v.inclusive?n.data<v.value:n.data<=v.value)$=this._getOrReturnCtx(n,$),F($,{code:q.too_small,type:"bigint",minimum:v.value,inclusive:v.inclusive,message:v.message}),g.dirty()}else if(v.kind==="max"){if(v.inclusive?n.data>v.value:n.data>=v.value)$=this._getOrReturnCtx(n,$),F($,{code:q.too_big,type:"bigint",maximum:v.value,inclusive:v.inclusive,message:v.message}),g.dirty()}else if(v.kind==="multipleOf"){if(n.data%v.value!==BigInt(0))$=this._getOrReturnCtx(n,$),F($,{code:q.not_multiple_of,multipleOf:v.value,message:v.message}),g.dirty()}else Z.assertNever(v);return{status:g.value,value:n.data}}_getInvalidInput(n){let i=this._getOrReturnCtx(n);return F(i,{code:q.invalid_type,expected:c.bigint,received:i.parsedType}),z}gte(n,i){return this.setLimit("min",n,!0,P.toString(i))}gt(n,i){return this.setLimit("min",n,!1,P.toString(i))}lte(n,i){return this.setLimit("max",n,!0,P.toString(i))}lt(n,i){return this.setLimit("max",n,!1,P.toString(i))}setLimit(n,i,$,g){return new Yv({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:$,message:P.toString(g)}]})}_addCheck(n){return new Yv({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:P.toString(i)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Yv.create=(n)=>{var i;return new Yv({checks:[],typeName:S.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...A(n)})};class qi extends x{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==c.boolean){let $=this._getOrReturnCtx(n);return F($,{code:q.invalid_type,expected:c.boolean,received:$.parsedType}),z}return Jn(n.data)}}qi.create=(n)=>{return new qi({typeName:S.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...A(n)})};class ev extends x{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==c.date){let v=this._getOrReturnCtx(n);return F(v,{code:q.invalid_type,expected:c.date,received:v.parsedType}),z}if(isNaN(n.data.getTime())){let v=this._getOrReturnCtx(n);return F(v,{code:q.invalid_date}),z}let $=new kn,g=void 0;for(let v of this._def.checks)if(v.kind==="min"){if(n.data.getTime()<v.value)g=this._getOrReturnCtx(n,g),F(g,{code:q.too_small,message:v.message,inclusive:!0,exact:!1,minimum:v.value,type:"date"}),$.dirty()}else if(v.kind==="max"){if(n.data.getTime()>v.value)g=this._getOrReturnCtx(n,g),F(g,{code:q.too_big,message:v.message,inclusive:!0,exact:!1,maximum:v.value,type:"date"}),$.dirty()}else Z.assertNever(v);return{status:$.value,value:new Date(n.data.getTime())}}_addCheck(n){return new ev({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:P.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:P.toString(i)})}get minDate(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n!=null?new Date(n):null}get maxDate(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n!=null?new Date(n):null}}ev.create=(n)=>{return new ev({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:S.ZodDate,...A(n)})};class o$ extends x{_parse(n){if(this._getType(n)!==c.symbol){let $=this._getOrReturnCtx(n);return F($,{code:q.invalid_type,expected:c.symbol,received:$.parsedType}),z}return Jn(n.data)}}o$.create=(n)=>{return new o$({typeName:S.ZodSymbol,...A(n)})};class Li extends x{_parse(n){if(this._getType(n)!==c.undefined){let $=this._getOrReturnCtx(n);return F($,{code:q.invalid_type,expected:c.undefined,received:$.parsedType}),z}return Jn(n.data)}}Li.create=(n)=>{return new Li({typeName:S.ZodUndefined,...A(n)})};class Ki extends x{_parse(n){if(this._getType(n)!==c.null){let $=this._getOrReturnCtx(n);return F($,{code:q.invalid_type,expected:c.null,received:$.parsedType}),z}return Jn(n.data)}}Ki.create=(n)=>{return new Ki({typeName:S.ZodNull,...A(n)})};class pv extends x{constructor(){super(...arguments);this._any=!0}_parse(n){return Jn(n.data)}}pv.create=(n)=>{return new pv({typeName:S.ZodAny,...A(n)})};class Qv extends x{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Jn(n.data)}}Qv.create=(n)=>{return new Qv({typeName:S.ZodUnknown,...A(n)})};class Tn extends x{_parse(n){let i=this._getOrReturnCtx(n);return F(i,{code:q.invalid_type,expected:c.never,received:i.parsedType}),z}}Tn.create=(n)=>{return new Tn({typeName:S.ZodNever,...A(n)})};class T$ extends x{_parse(n){if(this._getType(n)!==c.undefined){let $=this._getOrReturnCtx(n);return F($,{code:q.invalid_type,expected:c.void,received:$.parsedType}),z}return Jn(n.data)}}T$.create=(n)=>{return new T$({typeName:S.ZodVoid,...A(n)})};class Pn extends x{_parse(n){let{ctx:i,status:$}=this._processInputParams(n),g=this._def;if(i.parsedType!==c.array)return F(i,{code:q.invalid_type,expected:c.array,received:i.parsedType}),z;if(g.exactLength!==null){let w=i.data.length>g.exactLength.value,_=i.data.length<g.exactLength.value;if(w||_)F(i,{code:w?q.too_big:q.too_small,minimum:_?g.exactLength.value:void 0,maximum:w?g.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:g.exactLength.message}),$.dirty()}if(g.minLength!==null){if(i.data.length<g.minLength.value)F(i,{code:q.too_small,minimum:g.minLength.value,type:"array",inclusive:!0,exact:!1,message:g.minLength.message}),$.dirty()}if(g.maxLength!==null){if(i.data.length>g.maxLength.value)F(i,{code:q.too_big,maximum:g.maxLength.value,type:"array",inclusive:!0,exact:!1,message:g.maxLength.message}),$.dirty()}if(i.common.async)return Promise.all([...i.data].map((w,_)=>{return g.type._parseAsync(new zn(i,w,i.path,_))})).then((w)=>{return kn.mergeArray($,w)});let v=[...i.data].map((w,_)=>{return g.type._parseSync(new zn(i,w,i.path,_))});return kn.mergeArray($,v)}get element(){return this._def.type}min(n,i){return new Pn({...this._def,minLength:{value:n,message:P.toString(i)}})}max(n,i){return new Pn({...this._def,maxLength:{value:n,message:P.toString(i)}})}length(n,i){return new Pn({...this._def,exactLength:{value:n,message:P.toString(i)}})}nonempty(n){return this.min(1,n)}}Pn.create=(n,i)=>{return new Pn({type:n,minLength:null,maxLength:null,exactLength:null,typeName:S.ZodArray,...A(i)})};function ui(n){if(n instanceof nn){let i={};for(let $ in n.shape){let g=n.shape[$];i[$]=Sn.create(ui(g))}return new nn({...n._def,shape:()=>i})}else if(n instanceof Pn)return new Pn({...n._def,type:ui(n.element)});else if(n instanceof Sn)return Sn.create(ui(n.unwrap()));else if(n instanceof iv)return iv.create(ui(n.unwrap()));else if(n instanceof Zn)return Zn.create(n.items.map((i)=>ui(i)));else return n}class nn extends x{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let n=this._def.shape(),i=Z.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==c.object){let k=this._getOrReturnCtx(n);return F(k,{code:q.invalid_type,expected:c.object,received:k.parsedType}),z}let{status:$,ctx:g}=this._processInputParams(n),{shape:v,keys:w}=this._getCached(),_=[];if(!(this._def.catchall instanceof Tn&&this._def.unknownKeys==="strip")){for(let k in g.data)if(!w.includes(k))_.push(k)}let U=[];for(let k of w){let l=v[k],J=g.data[k];U.push({key:{status:"valid",value:k},value:l._parse(new zn(g,J,g.path,k)),alwaysSet:k in g.data})}if(this._def.catchall instanceof Tn){let k=this._def.unknownKeys;if(k==="passthrough")for(let l of _)U.push({key:{status:"valid",value:l},value:{status:"valid",value:g.data[l]}});else if(k==="strict"){if(_.length>0)F(g,{code:q.unrecognized_keys,keys:_}),$.dirty()}else if(k==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let k=this._def.catchall;for(let l of _){let J=g.data[l];U.push({key:{status:"valid",value:l},value:k._parse(new zn(g,J,g.path,l)),alwaysSet:l in g.data})}}if(g.common.async)return Promise.resolve().then(async()=>{let k=[];for(let l of U){let J=await l.key,Q=await l.value;k.push({key:J,value:Q,alwaysSet:l.alwaysSet})}return k}).then((k)=>{return kn.mergeObjectSync($,k)});else return kn.mergeObjectSync($,U)}get shape(){return this._def.shape()}strict(n){return P.errToObj,new nn({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,$)=>{var g,v,w,_;let U=(w=(v=(g=this._def).errorMap)===null||v===void 0?void 0:v.call(g,i,$).message)!==null&&w!==void 0?w:$.defaultError;if(i.code==="unrecognized_keys")return{message:(_=P.errToObj(n).message)!==null&&_!==void 0?_:U};return{message:U}}}:{}})}strip(){return new nn({...this._def,unknownKeys:"strip"})}passthrough(){return new nn({...this._def,unknownKeys:"passthrough"})}extend(n){return new nn({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new nn({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:S.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new nn({...this._def,catchall:n})}pick(n){let i={};return Z.objectKeys(n).forEach(($)=>{if(n[$]&&this.shape[$])i[$]=this.shape[$]}),new nn({...this._def,shape:()=>i})}omit(n){let i={};return Z.objectKeys(this.shape).forEach(($)=>{if(!n[$])i[$]=this.shape[$]}),new nn({...this._def,shape:()=>i})}deepPartial(){return ui(this)}partial(n){let i={};return Z.objectKeys(this.shape).forEach(($)=>{let g=this.shape[$];if(n&&!n[$])i[$]=g;else i[$]=g.optional()}),new nn({...this._def,shape:()=>i})}required(n){let i={};return Z.objectKeys(this.shape).forEach(($)=>{if(n&&!n[$])i[$]=this.shape[$];else{let v=this.shape[$];while(v instanceof Sn)v=v._def.innerType;i[$]=v}}),new nn({...this._def,shape:()=>i})}keyof(){return l2(Z.objectKeys(this.shape))}}nn.create=(n,i)=>{return new nn({shape:()=>n,unknownKeys:"strip",catchall:Tn.create(),typeName:S.ZodObject,...A(i)})};nn.strictCreate=(n,i)=>{return new nn({shape:()=>n,unknownKeys:"strict",catchall:Tn.create(),typeName:S.ZodObject,...A(i)})};nn.lazycreate=(n,i)=>{return new nn({shape:n,unknownKeys:"strip",catchall:Tn.create(),typeName:S.ZodObject,...A(i)})};class Oi extends x{_parse(n){let{ctx:i}=this._processInputParams(n),$=this._def.options;function g(v){for(let _ of v)if(_.result.status==="valid")return _.result;for(let _ of v)if(_.result.status==="dirty")return i.common.issues.push(..._.ctx.common.issues),_.result;let w=v.map((_)=>new In(_.ctx.common.issues));return F(i,{code:q.invalid_union,unionErrors:w}),z}if(i.common.async)return Promise.all($.map(async(v)=>{let w={...i,common:{...i.common,issues:[]},parent:null};return{result:await v._parseAsync({data:i.data,path:i.path,parent:w}),ctx:w}})).then(g);else{let v=void 0,w=[];for(let U of $){let k={...i,common:{...i.common,issues:[]},parent:null},l=U._parseSync({data:i.data,path:i.path,parent:k});if(l.status==="valid")return l;else if(l.status==="dirty"&&!v)v={result:l,ctx:k};if(k.common.issues.length)w.push(k.common.issues)}if(v)return i.common.issues.push(...v.ctx.common.issues),v.result;let _=w.map((U)=>new In(U));return F(i,{code:q.invalid_union,unionErrors:_}),z}}get options(){return this._def.options}}Oi.create=(n,i)=>{return new Oi({options:n,typeName:S.ZodUnion,...A(i)})};var nv=(n)=>{if(n instanceof Fi)return nv(n.schema);else if(n instanceof Vn)return nv(n.innerType());else if(n instanceof Ni)return[n.value];else if(n instanceof Iv)return n.options;else if(n instanceof ci)return Z.objectValues(n.enum);else if(n instanceof Pi)return nv(n._def.innerType);else if(n instanceof Li)return[void 0];else if(n instanceof Ki)return[null];else if(n instanceof Sn)return[void 0,...nv(n.unwrap())];else if(n instanceof iv)return[null,...nv(n.unwrap())];else if(n instanceof Sw)return nv(n.unwrap());else if(n instanceof zi)return nv(n.unwrap());else if(n instanceof Si)return nv(n._def.innerType);else return[]};class Pw extends x{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==c.object)return F(i,{code:q.invalid_type,expected:c.object,received:i.parsedType}),z;let $=this.discriminator,g=i.data[$],v=this.optionsMap.get(g);if(!v)return F(i,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[$]}),z;if(i.common.async)return v._parseAsync({data:i.data,path:i.path,parent:i});else return v._parseSync({data:i.data,path:i.path,parent:i})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,$){let g=new Map;for(let v of i){let w=nv(v.shape[n]);if(!w.length)throw Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let _ of w){if(g.has(_))throw Error(`Discriminator property ${String(n)} has duplicate value ${String(_)}`);g.set(_,v)}}return new Pw({typeName:S.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:g,...A($)})}}function V_(n,i){let $=vv(n),g=vv(i);if(n===i)return{valid:!0,data:n};else if($===c.object&&g===c.object){let v=Z.objectKeys(i),w=Z.objectKeys(n).filter((U)=>v.indexOf(U)!==-1),_={...n,...i};for(let U of w){let k=V_(n[U],i[U]);if(!k.valid)return{valid:!1};_[U]=k.data}return{valid:!0,data:_}}else if($===c.array&&g===c.array){if(n.length!==i.length)return{valid:!1};let v=[];for(let w=0;w<n.length;w++){let _=n[w],U=i[w],k=V_(_,U);if(!k.valid)return{valid:!1};v.push(k.data)}return{valid:!0,data:v}}else if($===c.date&&g===c.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class Bi extends x{_parse(n){let{status:i,ctx:$}=this._processInputParams(n),g=(v,w)=>{if(u_(v)||u_(w))return z;let _=V_(v.value,w.value);if(!_.valid)return F($,{code:q.invalid_intersection_types}),z;if(H_(v)||H_(w))i.dirty();return{status:i.value,value:_.data}};if($.common.async)return Promise.all([this._def.left._parseAsync({data:$.data,path:$.path,parent:$}),this._def.right._parseAsync({data:$.data,path:$.path,parent:$})]).then(([v,w])=>g(v,w));else return g(this._def.left._parseSync({data:$.data,path:$.path,parent:$}),this._def.right._parseSync({data:$.data,path:$.path,parent:$}))}}Bi.create=(n,i,$)=>{return new Bi({left:n,right:i,typeName:S.ZodIntersection,...A($)})};class Zn extends x{_parse(n){let{status:i,ctx:$}=this._processInputParams(n);if($.parsedType!==c.array)return F($,{code:q.invalid_type,expected:c.array,received:$.parsedType}),z;if($.data.length<this._def.items.length)return F($,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z;if(!this._def.rest&&$.data.length>this._def.items.length)F($,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let v=[...$.data].map((w,_)=>{let U=this._def.items[_]||this._def.rest;if(!U)return null;return U._parse(new zn($,w,$.path,_))}).filter((w)=>!!w);if($.common.async)return Promise.all(v).then((w)=>{return kn.mergeArray(i,w)});else return kn.mergeArray(i,v)}get items(){return this._def.items}rest(n){return new Zn({...this._def,rest:n})}}Zn.create=(n,i)=>{if(!Array.isArray(n))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zn({items:n,typeName:S.ZodTuple,rest:null,...A(i)})};class Z$ extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:$}=this._processInputParams(n);if($.parsedType!==c.object)return F($,{code:q.invalid_type,expected:c.object,received:$.parsedType}),z;let g=[],v=this._def.keyType,w=this._def.valueType;for(let _ in $.data)g.push({key:v._parse(new zn($,_,$.path,_)),value:w._parse(new zn($,$.data[_],$.path,_)),alwaysSet:_ in $.data});if($.common.async)return kn.mergeObjectAsync(i,g);else return kn.mergeObjectSync(i,g)}get element(){return this._def.valueType}static create(n,i,$){if(i instanceof x)return new Z$({keyType:n,valueType:i,typeName:S.ZodRecord,...A($)});return new Z$({keyType:cn.create(),valueType:n,typeName:S.ZodRecord,...A(i)})}}class r$ extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:$}=this._processInputParams(n);if($.parsedType!==c.map)return F($,{code:q.invalid_type,expected:c.map,received:$.parsedType}),z;let g=this._def.keyType,v=this._def.valueType,w=[...$.data.entries()].map(([_,U],k)=>{return{key:g._parse(new zn($,_,$.path,[k,"key"])),value:v._parse(new zn($,U,$.path,[k,"value"]))}});if($.common.async){let _=new Map;return Promise.resolve().then(async()=>{for(let U of w){let k=await U.key,l=await U.value;if(k.status==="aborted"||l.status==="aborted")return z;if(k.status==="dirty"||l.status==="dirty")i.dirty();_.set(k.value,l.value)}return{status:i.value,value:_}})}else{let _=new Map;for(let U of w){let{key:k,value:l}=U;if(k.status==="aborted"||l.status==="aborted")return z;if(k.status==="dirty"||l.status==="dirty")i.dirty();_.set(k.value,l.value)}return{status:i.value,value:_}}}}r$.create=(n,i,$)=>{return new r$({valueType:i,keyType:n,typeName:S.ZodMap,...A($)})};class av extends x{_parse(n){let{status:i,ctx:$}=this._processInputParams(n);if($.parsedType!==c.set)return F($,{code:q.invalid_type,expected:c.set,received:$.parsedType}),z;let g=this._def;if(g.minSize!==null){if($.data.size<g.minSize.value)F($,{code:q.too_small,minimum:g.minSize.value,type:"set",inclusive:!0,exact:!1,message:g.minSize.message}),i.dirty()}if(g.maxSize!==null){if($.data.size>g.maxSize.value)F($,{code:q.too_big,maximum:g.maxSize.value,type:"set",inclusive:!0,exact:!1,message:g.maxSize.message}),i.dirty()}let v=this._def.valueType;function w(U){let k=new Set;for(let l of U){if(l.status==="aborted")return z;if(l.status==="dirty")i.dirty();k.add(l.value)}return{status:i.value,value:k}}let _=[...$.data.values()].map((U,k)=>v._parse(new zn($,U,$.path,k)));if($.common.async)return Promise.all(_).then((U)=>w(U));else return w(_)}min(n,i){return new av({...this._def,minSize:{value:n,message:P.toString(i)}})}max(n,i){return new av({...this._def,maxSize:{value:n,message:P.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}av.create=(n,i)=>{return new av({valueType:n,minSize:null,maxSize:null,typeName:S.ZodSet,...A(i)})};class Vi extends x{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==c.function)return F(i,{code:q.invalid_type,expected:c.function,received:i.parsedType}),z;function $(_,U){return Nw({data:_,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Fw(),fi].filter((k)=>!!k),issueData:{code:q.invalid_arguments,argumentsError:U}})}function g(_,U){return Nw({data:_,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Fw(),fi].filter((k)=>!!k),issueData:{code:q.invalid_return_type,returnTypeError:U}})}let v={errorMap:i.common.contextualErrorMap},w=i.data;if(this._def.returns instanceof sv){let _=this;return Jn(async function(...U){let k=new In([]),l=await _._def.args.parseAsync(U,v).catch((j)=>{throw k.addIssue($(U,j)),k}),J=await Reflect.apply(w,this,l);return await _._def.returns._def.type.parseAsync(J,v).catch((j)=>{throw k.addIssue(g(J,j)),k})})}else{let _=this;return Jn(function(...U){let k=_._def.args.safeParse(U,v);if(!k.success)throw new In([$(U,k.error)]);let l=Reflect.apply(w,this,k.data),J=_._def.returns.safeParse(l,v);if(!J.success)throw new In([g(l,J.error)]);return J.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new Vi({...this._def,args:Zn.create(n).rest(Qv.create())})}returns(n){return new Vi({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,$){return new Vi({args:n?n:Zn.create([]).rest(Qv.create()),returns:i||Qv.create(),typeName:S.ZodFunction,...A($)})}}class Fi extends x{get schema(){return this._def.getter()}_parse(n){let{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Fi.create=(n,i)=>{return new Fi({getter:n,typeName:S.ZodLazy,...A(i)})};class Ni extends x{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return F(i,{received:i.data,code:q.invalid_literal,expected:this._def.value}),z}return{status:"valid",value:n.data}}get value(){return this._def.value}}Ni.create=(n,i)=>{return new Ni({value:n,typeName:S.ZodLiteral,...A(i)})};function l2(n,i){return new Iv({values:n,typeName:S.ZodEnum,...A(i)})}class Iv extends x{constructor(){super(...arguments);h$.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),$=this._def.values;return F(i,{expected:Z.joinValues($),received:i.parsedType,code:q.invalid_type}),z}if(!cw(this,h$,"f"))_2(this,h$,new Set(this._def.values),"f");if(!cw(this,h$,"f").has(n.data)){let i=this._getOrReturnCtx(n),$=this._def.values;return F(i,{received:i.data,code:q.invalid_enum_value,options:$}),z}return Jn(n.data)}get options(){return this._def.values}get enum(){let n={};for(let i of this._def.values)n[i]=i;return n}get Values(){let n={};for(let i of this._def.values)n[i]=i;return n}get Enum(){let n={};for(let i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return Iv.create(n,{...this._def,...i})}exclude(n,i=this._def){return Iv.create(this.options.filter(($)=>!n.includes($)),{...this._def,...i})}}h$=new WeakMap;Iv.create=l2;class ci extends x{constructor(){super(...arguments);C$.set(this,void 0)}_parse(n){let i=Z.getValidEnumValues(this._def.values),$=this._getOrReturnCtx(n);if($.parsedType!==c.string&&$.parsedType!==c.number){let g=Z.objectValues(i);return F($,{expected:Z.joinValues(g),received:$.parsedType,code:q.invalid_type}),z}if(!cw(this,C$,"f"))_2(this,C$,new Set(Z.getValidEnumValues(this._def.values)),"f");if(!cw(this,C$,"f").has(n.data)){let g=Z.objectValues(i);return F($,{received:$.data,code:q.invalid_enum_value,options:g}),z}return Jn(n.data)}get enum(){return this._def.values}}C$=new WeakMap;ci.create=(n,i)=>{return new ci({values:n,typeName:S.ZodNativeEnum,...A(i)})};class sv extends x{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==c.promise&&i.common.async===!1)return F(i,{code:q.invalid_type,expected:c.promise,received:i.parsedType}),z;let $=i.parsedType===c.promise?i.data:Promise.resolve(i.data);return Jn($.then((g)=>{return this._def.type.parseAsync(g,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}sv.create=(n,i)=>{return new sv({type:n,typeName:S.ZodPromise,...A(i)})};class Vn extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===S.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){let{status:i,ctx:$}=this._processInputParams(n),g=this._def.effect||null,v={addIssue:(w)=>{if(F($,w),w.fatal)i.abort();else i.dirty()},get path(){return $.path}};if(v.addIssue=v.addIssue.bind(v),g.type==="preprocess"){let w=g.transform($.data,v);if($.common.async)return Promise.resolve(w).then(async(_)=>{if(i.value==="aborted")return z;let U=await this._def.schema._parseAsync({data:_,path:$.path,parent:$});if(U.status==="aborted")return z;if(U.status==="dirty")return Hi(U.value);if(i.value==="dirty")return Hi(U.value);return U});else{if(i.value==="aborted")return z;let _=this._def.schema._parseSync({data:w,path:$.path,parent:$});if(_.status==="aborted")return z;if(_.status==="dirty")return Hi(_.value);if(i.value==="dirty")return Hi(_.value);return _}}if(g.type==="refinement"){let w=(_)=>{let U=g.refinement(_,v);if($.common.async)return Promise.resolve(U);if(U instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return _};if($.common.async===!1){let _=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(_.status==="aborted")return z;if(_.status==="dirty")i.dirty();return w(_.value),{status:i.value,value:_.value}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((_)=>{if(_.status==="aborted")return z;if(_.status==="dirty")i.dirty();return w(_.value).then(()=>{return{status:i.value,value:_.value}})})}if(g.type==="transform")if($.common.async===!1){let w=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(!dv(w))return w;let _=g.transform(w.value,v);if(_ instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:_}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((w)=>{if(!dv(w))return w;return Promise.resolve(g.transform(w.value,v)).then((_)=>({status:i.value,value:_}))});Z.assertNever(g)}}Vn.create=(n,i,$)=>{return new Vn({schema:n,typeName:S.ZodEffects,effect:i,...A($)})};Vn.createWithPreprocess=(n,i,$)=>{return new Vn({schema:i,effect:{type:"preprocess",transform:n},typeName:S.ZodEffects,...A($)})};class Sn extends x{_parse(n){if(this._getType(n)===c.undefined)return Jn(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Sn.create=(n,i)=>{return new Sn({innerType:n,typeName:S.ZodOptional,...A(i)})};class iv extends x{_parse(n){if(this._getType(n)===c.null)return Jn(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}iv.create=(n,i)=>{return new iv({innerType:n,typeName:S.ZodNullable,...A(i)})};class Pi extends x{_parse(n){let{ctx:i}=this._processInputParams(n),$=i.data;if(i.parsedType===c.undefined)$=this._def.defaultValue();return this._def.innerType._parse({data:$,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}Pi.create=(n,i)=>{return new Pi({innerType:n,typeName:S.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...A(i)})};class Si extends x{_parse(n){let{ctx:i}=this._processInputParams(n),$={...i,common:{...i.common,issues:[]}},g=this._def.innerType._parse({data:$.data,path:$.path,parent:{...$}});if(E$(g))return g.then((v)=>{return{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new In($.common.issues)},input:$.data})}});else return{status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new In($.common.issues)},input:$.data})}}removeCatch(){return this._def.innerType}}Si.create=(n,i)=>{return new Si({innerType:n,typeName:S.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...A(i)})};class m$ extends x{_parse(n){if(this._getType(n)!==c.nan){let $=this._getOrReturnCtx(n);return F($,{code:q.invalid_type,expected:c.nan,received:$.parsedType}),z}return{status:"valid",value:n.data}}}m$.create=(n)=>{return new m$({typeName:S.ZodNaN,...A(n)})};var ZX=Symbol("zod_brand");class Sw extends x{_parse(n){let{ctx:i}=this._processInputParams(n),$=i.data;return this._def.type._parse({data:$,path:i.path,parent:i})}unwrap(){return this._def.type}}class y$ extends x{_parse(n){let{status:i,ctx:$}=this._processInputParams(n);if($.common.async)return(async()=>{let v=await this._def.in._parseAsync({data:$.data,path:$.path,parent:$});if(v.status==="aborted")return z;if(v.status==="dirty")return i.dirty(),Hi(v.value);else return this._def.out._parseAsync({data:v.value,path:$.path,parent:$})})();else{let g=this._def.in._parseSync({data:$.data,path:$.path,parent:$});if(g.status==="aborted")return z;if(g.status==="dirty")return i.dirty(),{status:"dirty",value:g.value};else return this._def.out._parseSync({data:g.value,path:$.path,parent:$})}}static create(n,i){return new y$({in:n,out:i,typeName:S.ZodPipeline})}}class zi extends x{_parse(n){let i=this._def.innerType._parse(n),$=(g)=>{if(dv(g))g.value=Object.freeze(g.value);return g};return E$(i)?i.then((g)=>$(g)):$(i)}unwrap(){return this._def.innerType}}zi.create=(n,i)=>{return new zi({innerType:n,typeName:S.ZodReadonly,...A(i)})};function D2(n,i={},$){if(n)return pv.create().superRefine((g,v)=>{var w,_;if(!n(g)){let U=typeof i==="function"?i(g):typeof i==="string"?{message:i}:i,k=(_=(w=U.fatal)!==null&&w!==void 0?w:$)!==null&&_!==void 0?_:!0,l=typeof U==="string"?{message:U}:U;v.addIssue({code:"custom",...l,fatal:k})}});return pv.create()}var rX={object:nn.lazycreate},S;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(S||(S={}));var mX=(n,i={message:`Input not instance of ${n.name}`})=>D2(($)=>$ instanceof n,i),J2=cn.create,X2=Wv.create,yX=m$.create,dX=Yv.create,G2=qi.create,eX=ev.create,pX=o$.create,aX=Li.create,sX=Ki.create,nG=pv.create,vG=Qv.create,iG=Tn.create,$G=T$.create,gG=Pn.create,wG=nn.create,_G=nn.strictCreate,bG=Oi.create,UG=Pw.create,kG=Bi.create,lG=Zn.create,DG=Z$.create,JG=r$.create,XG=av.create,GG=Vi.create,tG=Fi.create,QG=Ni.create,WG=Iv.create,YG=ci.create,IG=sv.create,g2=Vn.create,jG=Sn.create,uG=iv.create,HG=Vn.createWithPreprocess,VG=y$.create,fG=()=>J2().optional(),qG=()=>X2().optional(),LG=()=>G2().optional(),KG={string:(n)=>cn.create({...n,coerce:!0}),number:(n)=>Wv.create({...n,coerce:!0}),boolean:(n)=>qi.create({...n,coerce:!0}),bigint:(n)=>Yv.create({...n,coerce:!0}),date:(n)=>ev.create({...n,coerce:!0})},OG=z,X=Object.freeze({__proto__:null,defaultErrorMap:fi,setErrorMap:HX,getErrorMap:Fw,makeIssue:Nw,EMPTY_PATH:VX,addIssueToContext:F,ParseStatus:kn,INVALID:z,DIRTY:Hi,OK:Jn,isAborted:u_,isDirty:H_,isValid:dv,isAsync:E$,get util(){return Z},get objectUtil(){return j_},ZodParsedType:c,getParsedType:vv,ZodType:x,datetimeRegex:k2,ZodString:cn,ZodNumber:Wv,ZodBigInt:Yv,ZodBoolean:qi,ZodDate:ev,ZodSymbol:o$,ZodUndefined:Li,ZodNull:Ki,ZodAny:pv,ZodUnknown:Qv,ZodNever:Tn,ZodVoid:T$,ZodArray:Pn,ZodObject:nn,ZodUnion:Oi,ZodDiscriminatedUnion:Pw,ZodIntersection:Bi,ZodTuple:Zn,ZodRecord:Z$,ZodMap:r$,ZodSet:av,ZodFunction:Vi,ZodLazy:Fi,ZodLiteral:Ni,ZodEnum:Iv,ZodNativeEnum:ci,ZodPromise:sv,ZodEffects:Vn,ZodTransformer:Vn,ZodOptional:Sn,ZodNullable:iv,ZodDefault:Pi,ZodCatch:Si,ZodNaN:m$,BRAND:ZX,ZodBranded:Sw,ZodPipeline:y$,ZodReadonly:zi,custom:D2,Schema:x,ZodSchema:x,late:rX,get ZodFirstPartyTypeKind(){return S},coerce:KG,any:nG,array:gG,bigint:dX,boolean:G2,date:eX,discriminatedUnion:UG,effect:g2,enum:WG,function:GG,instanceof:mX,intersection:kG,lazy:tG,literal:QG,map:JG,nan:yX,nativeEnum:YG,never:iG,null:sX,nullable:uG,number:X2,object:wG,oboolean:LG,onumber:qG,optional:jG,ostring:fG,pipeline:VG,preprocess:HG,promise:IG,record:DG,set:XG,strictObject:_G,string:J2,symbol:pX,transformer:g2,tuple:lG,undefined:aX,union:bG,unknown:vG,void:$G,NEVER:OG,ZodIssueCode:q,quotelessJson:uX,ZodError:In});var f_="2024-11-05",t2=[f_,"2024-10-07"],zw="2.0",Q2=X.union([X.string(),X.number().int()]),W2=X.string(),Mn=X.object({_meta:X.optional(X.object({progressToken:X.optional(Q2)}).passthrough())}).passthrough(),jn=X.object({method:X.string(),params:X.optional(Mn)}),d$=X.object({_meta:X.optional(X.object({}).passthrough())}).passthrough(),rn=X.object({method:X.string(),params:X.optional(d$)}),Rn=X.object({_meta:X.optional(X.object({}).passthrough())}).passthrough(),Mw=X.union([X.string(),X.number().int()]),BG=X.object({jsonrpc:X.literal(zw),id:Mw}).merge(jn).strict(),FG=X.object({jsonrpc:X.literal(zw)}).merge(rn).strict(),NG=X.object({jsonrpc:X.literal(zw),id:Mw,result:Rn}).strict(),ni;(function(n){n[n.ConnectionClosed=-1]="ConnectionClosed",n[n.RequestTimeout=-2]="RequestTimeout",n[n.ParseError=-32700]="ParseError",n[n.InvalidRequest=-32600]="InvalidRequest",n[n.MethodNotFound=-32601]="MethodNotFound",n[n.InvalidParams=-32602]="InvalidParams",n[n.InternalError=-32603]="InternalError"})(ni||(ni={}));var cG=X.object({jsonrpc:X.literal(zw),id:Mw,error:X.object({code:X.number().int(),message:X.string(),data:X.optional(X.unknown())})}).strict(),Y2=X.union([BG,FG,NG,cG]),Rw=Rn.strict(),Aw=rn.extend({method:X.literal("notifications/cancelled"),params:d$.extend({requestId:Mw,reason:X.string().optional()})}),I2=X.object({name:X.string(),version:X.string()}).passthrough(),PG=X.object({experimental:X.optional(X.object({}).passthrough()),sampling:X.optional(X.object({}).passthrough()),roots:X.optional(X.object({listChanged:X.optional(X.boolean())}).passthrough())}).passthrough(),q_=jn.extend({method:X.literal("initialize"),params:Mn.extend({protocolVersion:X.string(),capabilities:PG,clientInfo:I2})}),SG=X.object({experimental:X.optional(X.object({}).passthrough()),logging:X.optional(X.object({}).passthrough()),prompts:X.optional(X.object({listChanged:X.optional(X.boolean())}).passthrough()),resources:X.optional(X.object({subscribe:X.optional(X.boolean()),listChanged:X.optional(X.boolean())}).passthrough()),tools:X.optional(X.object({listChanged:X.optional(X.boolean())}).passthrough())}).passthrough(),zG=Rn.extend({protocolVersion:X.string(),capabilities:SG,serverInfo:I2}),L_=rn.extend({method:X.literal("notifications/initialized")}),xw=jn.extend({method:X.literal("ping")}),MG=X.object({progress:X.number(),total:X.optional(X.number())}).passthrough(),hw=rn.extend({method:X.literal("notifications/progress"),params:d$.merge(MG).extend({progressToken:Q2})}),Cw=jn.extend({params:Mn.extend({cursor:X.optional(W2)}).optional()}),Ew=Rn.extend({nextCursor:X.optional(W2)}),j2=X.object({uri:X.string(),mimeType:X.optional(X.string())}).passthrough(),u2=j2.extend({text:X.string()}),H2=j2.extend({blob:X.string().base64()}),RG=X.object({uri:X.string(),name:X.string(),description:X.optional(X.string()),mimeType:X.optional(X.string())}).passthrough(),AG=X.object({uriTemplate:X.string(),name:X.string(),description:X.optional(X.string()),mimeType:X.optional(X.string())}).passthrough(),xG=Cw.extend({method:X.literal("resources/list")}),hG=Ew.extend({resources:X.array(RG)}),CG=Cw.extend({method:X.literal("resources/templates/list")}),EG=Ew.extend({resourceTemplates:X.array(AG)}),oG=jn.extend({method:X.literal("resources/read"),params:Mn.extend({uri:X.string()})}),TG=Rn.extend({contents:X.array(X.union([u2,H2]))}),ZG=rn.extend({method:X.literal("notifications/resources/list_changed")}),rG=jn.extend({method:X.literal("resources/subscribe"),params:Mn.extend({uri:X.string()})}),mG=jn.extend({method:X.literal("resources/unsubscribe"),params:Mn.extend({uri:X.string()})}),yG=rn.extend({method:X.literal("notifications/resources/updated"),params:d$.extend({uri:X.string()})}),dG=X.object({name:X.string(),description:X.optional(X.string()),required:X.optional(X.boolean())}).passthrough(),eG=X.object({name:X.string(),description:X.optional(X.string()),arguments:X.optional(X.array(dG))}).passthrough(),pG=Cw.extend({method:X.literal("prompts/list")}),aG=Ew.extend({prompts:X.array(eG)}),sG=jn.extend({method:X.literal("prompts/get"),params:Mn.extend({name:X.string(),arguments:X.optional(X.record(X.string()))})}),ow=X.object({type:X.literal("text"),text:X.string()}).passthrough(),Tw=X.object({type:X.literal("image"),data:X.string().base64(),mimeType:X.string()}).passthrough(),V2=X.object({type:X.literal("resource"),resource:X.union([u2,H2])}).passthrough(),nt=X.object({role:X.enum(["user","assistant"]),content:X.union([ow,Tw,V2])}).passthrough(),vt=Rn.extend({description:X.optional(X.string()),messages:X.array(nt)}),it=rn.extend({method:X.literal("notifications/prompts/list_changed")}),$t=X.object({name:X.string(),description:X.optional(X.string()),inputSchema:X.object({type:X.literal("object"),properties:X.optional(X.object({}).passthrough())}).passthrough()}).passthrough(),K_=Cw.extend({method:X.literal("tools/list")}),gt=Ew.extend({tools:X.array($t)}),f2=Rn.extend({content:X.array(X.union([ow,Tw,V2])),isError:X.boolean().default(!1).optional()}),nI=f2.or(Rn.extend({toolResult:X.unknown()})),O_=jn.extend({method:X.literal("tools/call"),params:Mn.extend({name:X.string(),arguments:X.optional(X.record(X.unknown()))})}),wt=rn.extend({method:X.literal("notifications/tools/list_changed")}),q2=X.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),_t=jn.extend({method:X.literal("logging/setLevel"),params:Mn.extend({level:q2})}),bt=rn.extend({method:X.literal("notifications/message"),params:d$.extend({level:q2,logger:X.optional(X.string()),data:X.unknown()})}),Ut=X.object({name:X.string().optional()}).passthrough(),kt=X.object({hints:X.optional(X.array(Ut)),costPriority:X.optional(X.number().min(0).max(1)),speedPriority:X.optional(X.number().min(0).max(1)),intelligencePriority:X.optional(X.number().min(0).max(1))}).passthrough(),lt=X.object({role:X.enum(["user","assistant"]),content:X.union([ow,Tw])}).passthrough(),Dt=jn.extend({method:X.literal("sampling/createMessage"),params:Mn.extend({messages:X.array(lt),systemPrompt:X.optional(X.string()),includeContext:X.optional(X.enum(["none","thisServer","allServers"])),temperature:X.optional(X.number()),maxTokens:X.number().int(),stopSequences:X.optional(X.array(X.string())),metadata:X.optional(X.object({}).passthrough()),modelPreferences:X.optional(kt)})}),B_=Rn.extend({model:X.string(),stopReason:X.optional(X.enum(["endTurn","stopSequence","maxTokens"]).or(X.string())),role:X.enum(["user","assistant"]),content:X.discriminatedUnion("type",[ow,Tw])}),Jt=X.object({type:X.literal("ref/resource"),uri:X.string()}).passthrough(),Xt=X.object({type:X.literal("ref/prompt"),name:X.string()}).passthrough(),Gt=jn.extend({method:X.literal("completion/complete"),params:Mn.extend({ref:X.union([Xt,Jt]),argument:X.object({name:X.string(),value:X.string()}).passthrough()})}),tt=Rn.extend({completion:X.object({values:X.array(X.string()).max(100),total:X.optional(X.number().int()),hasMore:X.optional(X.boolean())}).passthrough()}),Qt=X.object({uri:X.string().startsWith("file://"),name:X.optional(X.string())}).passthrough(),Wt=jn.extend({method:X.literal("roots/list")}),F_=Rn.extend({roots:X.array(Qt)}),Yt=rn.extend({method:X.literal("notifications/roots/list_changed")}),vI=X.union([xw,q_,Gt,_t,sG,pG,xG,CG,oG,rG,mG,O_,K_]),iI=X.union([Aw,hw,L_,Yt]),$I=X.union([Rw,B_,F_]),gI=X.union([xw,Dt,Wt]),wI=X.union([Aw,hw,bt,yG,ZG,wt,it]),_I=X.union([Rw,zG,tt,vt,aG,hG,EG,TG,f2,gt]);class e$ extends Error{constructor(n,i,$){super(`MCP error ${n}: ${i}`);this.code=n,this.data=$}}var It=60000;class N_{constructor(n){this._options=n,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this.setNotificationHandler(Aw,(i)=>{let $=this._requestHandlerAbortControllers.get(i.params.requestId);$===null||$===void 0||$.abort(i.params.reason)}),this.setNotificationHandler(hw,(i)=>{this._onprogress(i)}),this.setRequestHandler(xw,(i)=>({}))}async connect(n){this._transport=n,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=(i)=>{this._onerror(i)},this._transport.onmessage=(i)=>{if(!("method"in i))this._onresponse(i);else if("id"in i)this._onrequest(i);else this._onnotification(i)},await this._transport.start()}_onclose(){var n;let i=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,(n=this.onclose)===null||n===void 0||n.call(this);let $=new e$(ni.ConnectionClosed,"Connection closed");for(let g of i.values())g($)}_onerror(n){var i;(i=this.onerror)===null||i===void 0||i.call(this,n)}_onnotification(n){var i;let $=(i=this._notificationHandlers.get(n.method))!==null&&i!==void 0?i:this.fallbackNotificationHandler;if($===void 0)return;Promise.resolve().then(()=>$(n)).catch((g)=>this._onerror(Error(`Uncaught error in notification handler: ${g}`)))}_onrequest(n){var i,$;let g=(i=this._requestHandlers.get(n.method))!==null&&i!==void 0?i:this.fallbackRequestHandler;if(g===void 0){($=this._transport)===null||$===void 0||$.send({jsonrpc:"2.0",id:n.id,error:{code:ni.MethodNotFound,message:"Method not found"}}).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)));return}let v=new AbortController;this._requestHandlerAbortControllers.set(n.id,v),Promise.resolve().then(()=>g(n,{signal:v.signal})).then((w)=>{var _;if(v.signal.aborted)return;return(_=this._transport)===null||_===void 0?void 0:_.send({result:w,jsonrpc:"2.0",id:n.id})},(w)=>{var _,U;if(v.signal.aborted)return;return(_=this._transport)===null||_===void 0?void 0:_.send({jsonrpc:"2.0",id:n.id,error:{code:Number.isSafeInteger(w.code)?w.code:ni.InternalError,message:(U=w.message)!==null&&U!==void 0?U:"Internal error"}})}).catch((w)=>this._onerror(Error(`Failed to send response: ${w}`))).finally(()=>{this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(n){let{progressToken:i,...$}=n.params,g=this._progressHandlers.get(Number(i));if(g===void 0){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(n)}`));return}g($)}_onresponse(n){let i=n.id,$=this._responseHandlers.get(Number(i));if($===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(n)}`));return}if(this._responseHandlers.delete(Number(i)),this._progressHandlers.delete(Number(i)),"result"in n)$(n);else{let g=new e$(n.error.code,n.error.message,n.error.data);$(g)}}get transport(){return this._transport}async close(){var n;await((n=this._transport)===null||n===void 0?void 0:n.close())}request(n,i,$){return new Promise((g,v)=>{var w,_,U,k;if(!this._transport){v(Error("Not connected"));return}if(((w=this._options)===null||w===void 0?void 0:w.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod(n.method);(_=$===null||$===void 0?void 0:$.signal)===null||_===void 0||_.throwIfAborted();let l=this._requestMessageId++,J={...n,jsonrpc:"2.0",id:l};if($===null||$===void 0?void 0:$.onprogress)this._progressHandlers.set(l,$.onprogress),J.params={...n.params,_meta:{progressToken:l}};let Q=void 0;this._responseHandlers.set(l,(W)=>{var Y;if(Q!==void 0)clearTimeout(Q);if((Y=$===null||$===void 0?void 0:$.signal)===null||Y===void 0?void 0:Y.aborted)return;if(W instanceof Error)return v(W);try{let B=i.parse(W.result);g(B)}catch(B){v(B)}});let j=(W)=>{var Y;this._responseHandlers.delete(l),this._progressHandlers.delete(l),(Y=this._transport)===null||Y===void 0||Y.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:l,reason:String(W)}}).catch((B)=>this._onerror(Error(`Failed to send cancellation: ${B}`))),v(W)};(U=$===null||$===void 0?void 0:$.signal)===null||U===void 0||U.addEventListener("abort",()=>{var W;if(Q!==void 0)clearTimeout(Q);j((W=$===null||$===void 0?void 0:$.signal)===null||W===void 0?void 0:W.reason)});let u=(k=$===null||$===void 0?void 0:$.timeout)!==null&&k!==void 0?k:It;Q=setTimeout(()=>j(new e$(ni.RequestTimeout,"Request timed out",{timeout:u})),u),this._transport.send(J).catch((W)=>{if(Q!==void 0)clearTimeout(Q);v(W)})})}async notification(n){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(n.method);let i={...n,jsonrpc:"2.0"};await this._transport.send(i)}setRequestHandler(n,i){let $=n.shape.method.value;this.assertRequestHandlerCapability($),this._requestHandlers.set($,(g,v)=>Promise.resolve(i(n.parse(g),v)))}removeRequestHandler(n){this._requestHandlers.delete(n)}setNotificationHandler(n,i){this._notificationHandlers.set(n.shape.method.value,($)=>Promise.resolve(i(n.parse($))))}removeNotificationHandler(n){this._notificationHandlers.delete(n)}}class c_ extends N_{constructor(n,i){super(i);this._serverInfo=n,this._capabilities=i.capabilities,this.setRequestHandler(q_,($)=>this._oninitialize($)),this.setNotificationHandler(L_,()=>{var $;return($=this.oninitialized)===null||$===void 0?void 0:$.call(this)})}assertCapabilityForMethod(n){var i,$;switch(n){case"sampling/createMessage":if(!((i=this._clientCapabilities)===null||i===void 0?void 0:i.sampling))throw Error(`Client does not support sampling (required for ${n})`);break;case"roots/list":if(!(($=this._clientCapabilities)===null||$===void 0?void 0:$.roots))throw Error(`Client does not support listing roots (required for ${n})`);break;case"ping":break}}assertNotificationCapability(n){switch(n){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${n})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${n})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${n})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${n})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(n){switch(n){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Server does not support sampling (required for ${n})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${n})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${n})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${n})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${n})`);break;case"ping":case"initialize":break}}async _oninitialize(n){let i=n.params.protocolVersion;return this._clientCapabilities=n.params.capabilities,this._clientVersion=n.params.clientInfo,{protocolVersion:t2.includes(i)?i:f_,capabilities:this.getCapabilities(),serverInfo:this._serverInfo}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Rw)}async createMessage(n,i){return this.request({method:"sampling/createMessage",params:n},B_,i)}async listRoots(n,i){return this.request({method:"roots/list",params:n},F_,i)}async sendLoggingMessage(n){return this.notification({method:"notifications/message",params:n})}async sendResourceUpdated(n){return this.notification({method:"notifications/resources/updated",params:n})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}import K2 from"node:process";class P_{append(n){this._buffer=this._buffer?Buffer.concat([this._buffer,n]):n}readMessage(){if(!this._buffer)return null;let n=this._buffer.indexOf(`
|
|
2
|
-
`);if(
|
|
3
|
-
`}class S_{constructor(n=K2.stdin,i=K2.stdout){this._stdin=n,this._stdout=i,this._readBuffer=new P_,this._started=!1,this._ondata=($)=>{this._readBuffer.append($),this.processReadBuffer()},this._onerror=($)=>{var g;(g=this.onerror)===null||g===void 0||g.call(this,$)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var n,i;while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;(n=this.onmessage)===null||n===void 0||n.call(this,$)}catch($){(i=this.onerror)===null||i===void 0||i.call(this,$)}}async close(){var n;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._readBuffer.clear(),(n=this.onclose)===null||n===void 0||n.call(this)}send(n){return new Promise((i)=>{let $=L2(n);if(this._stdout.write($))i();else this._stdout.once("drain",i)})}}function Ri(n,i){var $={};for(var g in n)if(Object.prototype.hasOwnProperty.call(n,g)&&i.indexOf(g)<0)$[g]=n[g];if(n!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var v=0,g=Object.getOwnPropertySymbols(n);v<g.length;v++)if(i.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(n,g[v]))$[g[v]]=n[g[v]]}return $}var ut={ZodAny:"any",ZodArray:"array",ZodBigInt:"bigint",ZodBoolean:"boolean",ZodDefault:"default",ZodPrefault:"prefault",ZodTransform:"transform",ZodEnum:"enum",ZodIntersection:"intersection",ZodLazy:"lazy",ZodLiteral:"literal",ZodNever:"never",ZodNull:"null",ZodNullable:"nullable",ZodNumber:"number",ZodNonOptional:"nonoptional",ZodObject:"object",ZodOptional:"optional",ZodPipe:"pipe",ZodReadonly:"readonly",ZodRecord:"record",ZodString:"string",ZodTuple:"tuple",ZodType:"type",ZodUnion:"union",ZodDiscriminatedUnion:"union",ZodUnknown:"unknown",ZodVoid:"void",ZodDate:"date",ZodTemplateLiteral:"template_literal"};function gv(n,i){return(Array.isArray(i)?i:[i]).some((g)=>{var v;let w=((v=n===null||n===void 0?void 0:n.def)===null||v===void 0?void 0:v.type)===ut[g];if(g==="ZodDiscriminatedUnion")return w&&"discriminator"in n.def;return w})}function Mi(n){return n&&"def"in n}class B2{constructor(){this._map=new Map,this._idmap=new Map}add(n,...i){let $=i[0];if(this._map.set(n,$),$&&typeof $==="object"&&"id"in $){if(this._idmap.has($.id))throw Error(`ID ${$.id} already exists in the registry`);this._idmap.set($.id,n)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(n){let i=this._map.get(n);if(i&&typeof i==="object"&&"id"in i)this._idmap.delete(i.id);return this._map.delete(n),this}get(n){let i=n._zod.parent;if(i){let $={...this.get(i)??{}};return delete $.id,{...$,...this._map.get(n)}}return this._map.get(n)}has(n){return this._map.has(n)}}function Ht(){return new B2}function z_(n){return n===void 0}function Vt(n,i){let $={};return Object.entries(n).forEach(([g,v])=>{if(!i.some((w)=>w===g))$[g]=v}),$}function M_(n,i){let $={};return Object.entries(n).forEach(([g,v])=>{if(!i(v,g))$[g]=v}),$}var O2=Ht();class wv{static collectMetadata(n,i){let $=this.getMetadataFromRegistry(n),g=Object.assign(Object.assign({},$===null||$===void 0?void 0:$._internal),i===null||i===void 0?void 0:i._internal),v=Object.assign(Object.assign({},$===null||$===void 0?void 0:$.param),i===null||i===void 0?void 0:i.param),w=Object.assign(Object.assign(Object.assign(Object.assign({},Object.keys(g).length>0?{_internal:g}:{}),$),i),Object.keys(v).length>0?{param:v}:{});if(gv(n,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&Mi(n._zod.def.innerType))return this.collectMetadata(n._zod.def.innerType,w);if(gv(n,"ZodPipe")){let _=n._zod.def.in,U=n._zod.def.out;if(gv(_,"ZodTransform")&&Mi(U))return this.collectMetadata(U,w);if(Mi(_))return this.collectMetadata(_,w)}return w}static getMetadata(n){return this.collectMetadata(n)}static getOpenApiMetadata(n){let i=this.collectMetadata(n);return Ri(i!==null&&i!==void 0?i:{},["_internal"])}static getInternalMetadata(n){var i;return(i=this.collectMetadata(n))===null||i===void 0?void 0:i._internal}static getParamMetadata(n){let i=this.collectMetadata(n);return Object.assign(Object.assign({},i),{param:Object.assign(Object.assign({},(i===null||i===void 0?void 0:i.description)?{description:i.description}:{}),i===null||i===void 0?void 0:i.param)})}static buildSchemaMetadata(n){return M_(Vt(n,["param","_internal"]),z_)}static buildParameterMetadata(n){return M_(n,z_)}static applySchemaMetadata(n,i){return M_(Object.assign(Object.assign({},n),this.buildSchemaMetadata(i)),z_)}static getRefId(n){var i;return(i=this.getInternalMetadata(n))===null||i===void 0?void 0:i.refId}static unwrapChained(n){return this.unwrapUntil(n)}static getDefaultValue(n){var i;let $=(i=this.unwrapUntil(n,"ZodDefault"))!==null&&i!==void 0?i:this.unwrapUntil(n,"ZodPrefault");return $===null||$===void 0?void 0:$._zod.def.defaultValue}static unwrapUntil(n,i){if(i&&gv(n,i))return n;if(gv(n,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&Mi(n._zod.def.innerType))return this.unwrapUntil(n._zod.def.innerType,i);if(gv(n,"ZodPipe")){let $=n._zod.def.in,g=n._zod.def.out;if(gv($,"ZodTransform")&&Mi(g))return this.unwrapUntil(g,i);if(Mi($))return this.unwrapUntil($,i)}return i?void 0:n}static getMetadataFromInternalRegistry(n){return O2.get(n)}static getMetadataFromRegistry(n){let i=this.getMetadataFromInternalRegistry(n),$=n.meta();if(!i)return $;let{_internal:g}=i,v=Ri(i,["_internal"]),w=$!==null&&$!==void 0?$:{},{id:_,title:U}=w,k=Ri(w,["id","title"]);return Object.assign(Object.assign(Object.assign({_internal:Object.assign(Object.assign({},_?{refId:_}:{}),g)},v),U?{description:U}:{}),k)}static setMetadataInRegistry(n,i){O2.add(n,i)}}function $v(n,i){let $=n[i];if(typeof $!=="function")return;n[i]=function(...g){let v=$.apply(this,g),w=wv.getMetadataFromRegistry(this);if(w)wv.setMetadataInRegistry(v,w);return v}}function ft(n){if(typeof n.ZodType.prototype.openapi<"u")return;n.ZodType.prototype.openapi=function(...i){let{refId:$,metadata:g,options:v}=qt(...i),w=g!==null&&g!==void 0?g:{},{param:_}=w,U=Ri(w,["param"]),k=wv.getMetadataFromRegistry(this),l=k!==null&&k!==void 0?k:{},{_internal:J}=l,Q=Ri(l,["_internal"]),j=Object.assign(Object.assign(Object.assign({},J),v),$?{refId:$}:void 0),u=Object.assign(Object.assign(Object.assign({},Q),U),(Q===null||Q===void 0?void 0:Q.param)||_?{param:Object.assign(Object.assign({},Q===null||Q===void 0?void 0:Q.param),_)}:void 0),W=new this.constructor(this._def);function Y(O){wv.setMetadataInRegistry(O,Object.assign(Object.assign({},Object.keys(j).length>0?{_internal:j}:void 0),u))}if(Y(W),gv(W,"ZodLazy"))Y(this);if(gv(W,"ZodObject")){let O=wv.getMetadataFromRegistry(W),E=W.extend;W.extend=function(...T){let a=E.apply(W,T),s=O!==null&&O!==void 0?O:{},{_internal:r}=s,gn=Ri(s,["_internal"]);return wv.setMetadataInRegistry(a,{_internal:{extendedFrom:(r===null||r===void 0?void 0:r.refId)?{refId:r.refId,schema:W}:r===null||r===void 0?void 0:r.extendedFrom}}),a.openapi(gn)},$v(W,"catchall")}$v(W,"optional"),$v(W,"nullable"),$v(W,"default"),$v(W,"transform"),$v(W,"refine"),$v(W,"length"),$v(W,"min"),$v(W,"max");let B=W.meta;return W.meta=function(...O){let E=B.apply(this,O);if(O[0]){let T=wv.getMetadataFromInternalRegistry(this);if(T)wv.setMetadataInRegistry(E,Object.assign(Object.assign({},T),O[0]))}return E},W}}function qt(n,i,$){if(typeof n==="string")return{refId:n,metadata:i,options:$};return{refId:void 0,metadata:n,options:i}}var R_=ft;var b={};Nn(b,{z:()=>h,xor:()=>B6,xid:()=>s4,void:()=>f6,uuidv7:()=>Z4,uuidv6:()=>T4,uuidv4:()=>o4,uuid:()=>E4,util:()=>f,url:()=>r4,uppercase:()=>Lv,unknown:()=>tn,union:()=>K$,undefined:()=>H6,ulid:()=>a4,uint64:()=>j6,uint32:()=>W6,tuple:()=>pg,trim:()=>cv,treeifyError:()=>_g,transform:()=>B$,toUpperCase:()=>Sv,toLowerCase:()=>Pv,toJSONSchema:()=>i$,templateLiteral:()=>h6,symbol:()=>u6,superRefine:()=>Vw,success:()=>R6,stringbool:()=>y6,stringFormat:()=>l6,string:()=>o,strictObject:()=>K6,startsWith:()=>Ov,slugify:()=>zv,size:()=>bv,setErrorMap:()=>I0,set:()=>P6,safeParseAsync:()=>Kg,safeParse:()=>Lg,safeEncodeAsync:()=>Sg,safeEncode:()=>cg,safeDecodeAsync:()=>zg,safeDecode:()=>Pg,registry:()=>yi,regexes:()=>Yn,regex:()=>fv,refine:()=>Hw,record:()=>pn,readonly:()=>Qw,property:()=>si,promise:()=>C6,prettifyError:()=>bg,preprocess:()=>e6,prefault:()=>kw,positive:()=>di,pipe:()=>Di,partialRecord:()=>F6,parseAsync:()=>qg,parse:()=>fg,overwrite:()=>Hn,optional:()=>ki,object:()=>$n,number:()=>Tv,nullish:()=>M6,nullable:()=>li,null:()=>hg,normalize:()=>Nv,nonpositive:()=>pi,nonoptional:()=>lw,nonnegative:()=>ai,never:()=>L$,negative:()=>ei,nativeEnum:()=>S6,nanoid:()=>d4,nan:()=>A6,multipleOf:()=>yn,minSize:()=>Kn,minLength:()=>An,mime:()=>Fv,meta:()=>r6,maxSize:()=>dn,maxLength:()=>Uv,map:()=>c6,mac:()=>i6,lte:()=>Xn,lt:()=>qn,lowercase:()=>qv,looseRecord:()=>N6,looseObject:()=>O6,locales:()=>bi,literal:()=>Cn,length:()=>kv,lazy:()=>Iw,ksuid:()=>n6,keyof:()=>L6,jwt:()=>k6,json:()=>d6,iso:()=>xv,ipv6:()=>$6,ipv4:()=>v6,intersection:()=>dg,int64:()=>I6,int32:()=>Q6,int:()=>b$,instanceof:()=>m6,includes:()=>Kv,httpUrl:()=>m4,hostname:()=>D6,hex:()=>J6,hash:()=>X6,guid:()=>C4,gte:()=>Un,gt:()=>Ln,globalRegistry:()=>wn,getErrorMap:()=>j0,function:()=>E6,fromJSONSchema:()=>p6,formatError:()=>gi,float64:()=>t6,float32:()=>G6,flattenError:()=>$i,file:()=>z6,exactOptional:()=>gw,enum:()=>O$,endsWith:()=>Bv,encodeAsync:()=>Fg,encode:()=>Og,emoji:()=>y4,email:()=>h4,e164:()=>U6,discriminatedUnion:()=>Qi,describe:()=>Z6,decodeAsync:()=>Ng,decode:()=>Bg,date:()=>q6,custom:()=>T6,cuid2:()=>p4,cuid:()=>e4,core:()=>xn,config:()=>vn,coerce:()=>Ii,codec:()=>x6,clone:()=>bn,cidrv6:()=>w6,cidrv4:()=>g6,check:()=>o6,catch:()=>Xw,boolean:()=>en,bigint:()=>Y6,base64url:()=>b6,base64:()=>_6,array:()=>hn,any:()=>V6,_function:()=>E6,_default:()=>bw,_ZodString:()=>U$,ZodXor:()=>rg,ZodXID:()=>t$,ZodVoid:()=>Tg,ZodUnknown:()=>Eg,ZodUnion:()=>ti,ZodUndefined:()=>Ag,ZodUUID:()=>On,ZodURL:()=>Ji,ZodULID:()=>G$,ZodType:()=>R,ZodTuple:()=>eg,ZodTransform:()=>iw,ZodTemplateLiteral:()=>Ww,ZodSymbol:()=>Rg,ZodSuccess:()=>Dw,ZodStringFormat:()=>m,ZodString:()=>Cv,ZodSet:()=>sg,ZodRecord:()=>Wi,ZodRealError:()=>ln,ZodReadonly:()=>tw,ZodPromise:()=>jw,ZodPrefault:()=>Uw,ZodPipe:()=>c$,ZodOptional:()=>F$,ZodObject:()=>Gi,ZodNumberFormat:()=>lv,ZodNumber:()=>ov,ZodNullable:()=>ww,ZodNull:()=>xg,ZodNonOptional:()=>N$,ZodNever:()=>og,ZodNanoID:()=>D$,ZodNaN:()=>Gw,ZodMap:()=>ag,ZodMAC:()=>Mg,ZodLiteral:()=>nw,ZodLazy:()=>Yw,ZodKSUID:()=>Q$,ZodJWT:()=>f$,ZodIssueCode:()=>Dv,ZodIntersection:()=>yg,ZodISOTime:()=>w$,ZodISODuration:()=>_$,ZodISODateTime:()=>$$,ZodISODate:()=>g$,ZodIPv6:()=>Y$,ZodIPv4:()=>W$,ZodGUID:()=>Ui,ZodFunction:()=>uw,ZodFirstPartyTypeKind:()=>fw,ZodFile:()=>vw,ZodExactOptional:()=>$w,ZodError:()=>Y0,ZodEnum:()=>hv,ZodEmoji:()=>l$,ZodEmail:()=>k$,ZodE164:()=>V$,ZodDiscriminatedUnion:()=>mg,ZodDefault:()=>_w,ZodDate:()=>Xi,ZodCustomStringFormat:()=>Ev,ZodCustom:()=>Yi,ZodCodec:()=>P$,ZodCatch:()=>Jw,ZodCUID2:()=>X$,ZodCUID:()=>J$,ZodCIDRv6:()=>j$,ZodCIDRv4:()=>I$,ZodBoolean:()=>Zv,ZodBigIntFormat:()=>q$,ZodBigInt:()=>rv,ZodBase64URL:()=>H$,ZodBase64:()=>u$,ZodArray:()=>Zg,ZodAny:()=>Cg,TimePrecision:()=>Hg,NEVER:()=>a$,$output:()=>Yg,$input:()=>Ig,$brand:()=>s$});var u0={};Nn(u0,{z:()=>S$,xor:()=>B6,xid:()=>s4,void:()=>f6,uuidv7:()=>Z4,uuidv6:()=>T4,uuidv4:()=>o4,uuid:()=>E4,util:()=>f,url:()=>r4,uppercase:()=>Lv,unknown:()=>tn,union:()=>K$,undefined:()=>H6,ulid:()=>a4,uint64:()=>j6,uint32:()=>W6,tuple:()=>pg,trim:()=>cv,treeifyError:()=>_g,transform:()=>B$,toUpperCase:()=>Sv,toLowerCase:()=>Pv,toJSONSchema:()=>i$,templateLiteral:()=>h6,symbol:()=>u6,superRefine:()=>Vw,success:()=>R6,stringbool:()=>y6,stringFormat:()=>l6,string:()=>o,strictObject:()=>K6,startsWith:()=>Ov,slugify:()=>zv,size:()=>bv,setErrorMap:()=>I0,set:()=>P6,safeParseAsync:()=>Kg,safeParse:()=>Lg,safeEncodeAsync:()=>Sg,safeEncode:()=>cg,safeDecodeAsync:()=>zg,safeDecode:()=>Pg,registry:()=>yi,regexes:()=>Yn,regex:()=>fv,refine:()=>Hw,record:()=>pn,readonly:()=>Qw,property:()=>si,promise:()=>C6,prettifyError:()=>bg,preprocess:()=>e6,prefault:()=>kw,positive:()=>di,pipe:()=>Di,partialRecord:()=>F6,parseAsync:()=>qg,parse:()=>fg,overwrite:()=>Hn,optional:()=>ki,object:()=>$n,number:()=>Tv,nullish:()=>M6,nullable:()=>li,null:()=>hg,normalize:()=>Nv,nonpositive:()=>pi,nonoptional:()=>lw,nonnegative:()=>ai,never:()=>L$,negative:()=>ei,nativeEnum:()=>S6,nanoid:()=>d4,nan:()=>A6,multipleOf:()=>yn,minSize:()=>Kn,minLength:()=>An,mime:()=>Fv,meta:()=>r6,maxSize:()=>dn,maxLength:()=>Uv,map:()=>c6,mac:()=>i6,lte:()=>Xn,lt:()=>qn,lowercase:()=>qv,looseRecord:()=>N6,looseObject:()=>O6,locales:()=>bi,literal:()=>Cn,length:()=>kv,lazy:()=>Iw,ksuid:()=>n6,keyof:()=>L6,jwt:()=>k6,json:()=>d6,iso:()=>xv,ipv6:()=>$6,ipv4:()=>v6,intersection:()=>dg,int64:()=>I6,int32:()=>Q6,int:()=>b$,instanceof:()=>m6,includes:()=>Kv,httpUrl:()=>m4,hostname:()=>D6,hex:()=>J6,hash:()=>X6,guid:()=>C4,gte:()=>Un,gt:()=>Ln,globalRegistry:()=>wn,getErrorMap:()=>j0,function:()=>E6,fromJSONSchema:()=>p6,formatError:()=>gi,float64:()=>t6,float32:()=>G6,flattenError:()=>$i,file:()=>z6,exactOptional:()=>gw,enum:()=>O$,endsWith:()=>Bv,encodeAsync:()=>Fg,encode:()=>Og,emoji:()=>y4,email:()=>h4,e164:()=>U6,discriminatedUnion:()=>Qi,describe:()=>Z6,default:()=>U3,decodeAsync:()=>Ng,decode:()=>Bg,date:()=>q6,custom:()=>T6,cuid2:()=>p4,cuid:()=>e4,core:()=>xn,config:()=>vn,coerce:()=>Ii,codec:()=>x6,clone:()=>bn,cidrv6:()=>w6,cidrv4:()=>g6,check:()=>o6,catch:()=>Xw,boolean:()=>en,bigint:()=>Y6,base64url:()=>b6,base64:()=>_6,array:()=>hn,any:()=>V6,_function:()=>E6,_default:()=>bw,_ZodString:()=>U$,ZodXor:()=>rg,ZodXID:()=>t$,ZodVoid:()=>Tg,ZodUnknown:()=>Eg,ZodUnion:()=>ti,ZodUndefined:()=>Ag,ZodUUID:()=>On,ZodURL:()=>Ji,ZodULID:()=>G$,ZodType:()=>R,ZodTuple:()=>eg,ZodTransform:()=>iw,ZodTemplateLiteral:()=>Ww,ZodSymbol:()=>Rg,ZodSuccess:()=>Dw,ZodStringFormat:()=>m,ZodString:()=>Cv,ZodSet:()=>sg,ZodRecord:()=>Wi,ZodRealError:()=>ln,ZodReadonly:()=>tw,ZodPromise:()=>jw,ZodPrefault:()=>Uw,ZodPipe:()=>c$,ZodOptional:()=>F$,ZodObject:()=>Gi,ZodNumberFormat:()=>lv,ZodNumber:()=>ov,ZodNullable:()=>ww,ZodNull:()=>xg,ZodNonOptional:()=>N$,ZodNever:()=>og,ZodNanoID:()=>D$,ZodNaN:()=>Gw,ZodMap:()=>ag,ZodMAC:()=>Mg,ZodLiteral:()=>nw,ZodLazy:()=>Yw,ZodKSUID:()=>Q$,ZodJWT:()=>f$,ZodIssueCode:()=>Dv,ZodIntersection:()=>yg,ZodISOTime:()=>w$,ZodISODuration:()=>_$,ZodISODateTime:()=>$$,ZodISODate:()=>g$,ZodIPv6:()=>Y$,ZodIPv4:()=>W$,ZodGUID:()=>Ui,ZodFunction:()=>uw,ZodFirstPartyTypeKind:()=>fw,ZodFile:()=>vw,ZodExactOptional:()=>$w,ZodError:()=>Y0,ZodEnum:()=>hv,ZodEmoji:()=>l$,ZodEmail:()=>k$,ZodE164:()=>V$,ZodDiscriminatedUnion:()=>mg,ZodDefault:()=>_w,ZodDate:()=>Xi,ZodCustomStringFormat:()=>Ev,ZodCustom:()=>Yi,ZodCodec:()=>P$,ZodCatch:()=>Jw,ZodCUID2:()=>X$,ZodCUID:()=>J$,ZodCIDRv6:()=>j$,ZodCIDRv4:()=>I$,ZodBoolean:()=>Zv,ZodBigIntFormat:()=>q$,ZodBigInt:()=>rv,ZodBase64URL:()=>H$,ZodBase64:()=>u$,ZodArray:()=>Zg,ZodAny:()=>Cg,TimePrecision:()=>Hg,NEVER:()=>a$,$output:()=>Yg,$input:()=>Ig,$brand:()=>s$});var S$={};Nn(S$,{xor:()=>B6,xid:()=>s4,void:()=>f6,uuidv7:()=>Z4,uuidv6:()=>T4,uuidv4:()=>o4,uuid:()=>E4,util:()=>f,url:()=>r4,uppercase:()=>Lv,unknown:()=>tn,union:()=>K$,undefined:()=>H6,ulid:()=>a4,uint64:()=>j6,uint32:()=>W6,tuple:()=>pg,trim:()=>cv,treeifyError:()=>_g,transform:()=>B$,toUpperCase:()=>Sv,toLowerCase:()=>Pv,toJSONSchema:()=>i$,templateLiteral:()=>h6,symbol:()=>u6,superRefine:()=>Vw,success:()=>R6,stringbool:()=>y6,stringFormat:()=>l6,string:()=>o,strictObject:()=>K6,startsWith:()=>Ov,slugify:()=>zv,size:()=>bv,setErrorMap:()=>I0,set:()=>P6,safeParseAsync:()=>Kg,safeParse:()=>Lg,safeEncodeAsync:()=>Sg,safeEncode:()=>cg,safeDecodeAsync:()=>zg,safeDecode:()=>Pg,registry:()=>yi,regexes:()=>Yn,regex:()=>fv,refine:()=>Hw,record:()=>pn,readonly:()=>Qw,property:()=>si,promise:()=>C6,prettifyError:()=>bg,preprocess:()=>e6,prefault:()=>kw,positive:()=>di,pipe:()=>Di,partialRecord:()=>F6,parseAsync:()=>qg,parse:()=>fg,overwrite:()=>Hn,optional:()=>ki,object:()=>$n,number:()=>Tv,nullish:()=>M6,nullable:()=>li,null:()=>hg,normalize:()=>Nv,nonpositive:()=>pi,nonoptional:()=>lw,nonnegative:()=>ai,never:()=>L$,negative:()=>ei,nativeEnum:()=>S6,nanoid:()=>d4,nan:()=>A6,multipleOf:()=>yn,minSize:()=>Kn,minLength:()=>An,mime:()=>Fv,meta:()=>r6,maxSize:()=>dn,maxLength:()=>Uv,map:()=>c6,mac:()=>i6,lte:()=>Xn,lt:()=>qn,lowercase:()=>qv,looseRecord:()=>N6,looseObject:()=>O6,locales:()=>bi,literal:()=>Cn,length:()=>kv,lazy:()=>Iw,ksuid:()=>n6,keyof:()=>L6,jwt:()=>k6,json:()=>d6,iso:()=>xv,ipv6:()=>$6,ipv4:()=>v6,intersection:()=>dg,int64:()=>I6,int32:()=>Q6,int:()=>b$,instanceof:()=>m6,includes:()=>Kv,httpUrl:()=>m4,hostname:()=>D6,hex:()=>J6,hash:()=>X6,guid:()=>C4,gte:()=>Un,gt:()=>Ln,globalRegistry:()=>wn,getErrorMap:()=>j0,function:()=>E6,fromJSONSchema:()=>p6,formatError:()=>gi,float64:()=>t6,float32:()=>G6,flattenError:()=>$i,file:()=>z6,exactOptional:()=>gw,enum:()=>O$,endsWith:()=>Bv,encodeAsync:()=>Fg,encode:()=>Og,emoji:()=>y4,email:()=>h4,e164:()=>U6,discriminatedUnion:()=>Qi,describe:()=>Z6,decodeAsync:()=>Ng,decode:()=>Bg,date:()=>q6,custom:()=>T6,cuid2:()=>p4,cuid:()=>e4,core:()=>xn,config:()=>vn,coerce:()=>Ii,codec:()=>x6,clone:()=>bn,cidrv6:()=>w6,cidrv4:()=>g6,check:()=>o6,catch:()=>Xw,boolean:()=>en,bigint:()=>Y6,base64url:()=>b6,base64:()=>_6,array:()=>hn,any:()=>V6,_function:()=>E6,_default:()=>bw,_ZodString:()=>U$,ZodXor:()=>rg,ZodXID:()=>t$,ZodVoid:()=>Tg,ZodUnknown:()=>Eg,ZodUnion:()=>ti,ZodUndefined:()=>Ag,ZodUUID:()=>On,ZodURL:()=>Ji,ZodULID:()=>G$,ZodType:()=>R,ZodTuple:()=>eg,ZodTransform:()=>iw,ZodTemplateLiteral:()=>Ww,ZodSymbol:()=>Rg,ZodSuccess:()=>Dw,ZodStringFormat:()=>m,ZodString:()=>Cv,ZodSet:()=>sg,ZodRecord:()=>Wi,ZodRealError:()=>ln,ZodReadonly:()=>tw,ZodPromise:()=>jw,ZodPrefault:()=>Uw,ZodPipe:()=>c$,ZodOptional:()=>F$,ZodObject:()=>Gi,ZodNumberFormat:()=>lv,ZodNumber:()=>ov,ZodNullable:()=>ww,ZodNull:()=>xg,ZodNonOptional:()=>N$,ZodNever:()=>og,ZodNanoID:()=>D$,ZodNaN:()=>Gw,ZodMap:()=>ag,ZodMAC:()=>Mg,ZodLiteral:()=>nw,ZodLazy:()=>Yw,ZodKSUID:()=>Q$,ZodJWT:()=>f$,ZodIssueCode:()=>Dv,ZodIntersection:()=>yg,ZodISOTime:()=>w$,ZodISODuration:()=>_$,ZodISODateTime:()=>$$,ZodISODate:()=>g$,ZodIPv6:()=>Y$,ZodIPv4:()=>W$,ZodGUID:()=>Ui,ZodFunction:()=>uw,ZodFirstPartyTypeKind:()=>fw,ZodFile:()=>vw,ZodExactOptional:()=>$w,ZodError:()=>Y0,ZodEnum:()=>hv,ZodEmoji:()=>l$,ZodEmail:()=>k$,ZodE164:()=>V$,ZodDiscriminatedUnion:()=>mg,ZodDefault:()=>_w,ZodDate:()=>Xi,ZodCustomStringFormat:()=>Ev,ZodCustom:()=>Yi,ZodCodec:()=>P$,ZodCatch:()=>Jw,ZodCUID2:()=>X$,ZodCUID:()=>J$,ZodCIDRv6:()=>j$,ZodCIDRv4:()=>I$,ZodBoolean:()=>Zv,ZodBigIntFormat:()=>q$,ZodBigInt:()=>rv,ZodBase64URL:()=>H$,ZodBase64:()=>u$,ZodArray:()=>Zg,ZodAny:()=>Cg,TimePrecision:()=>Hg,NEVER:()=>a$,$output:()=>Yg,$input:()=>Ig,$brand:()=>s$});var xn={};Nn(xn,{version:()=>Cb,util:()=>f,treeifyError:()=>_g,toJSONSchema:()=>i$,toDotPath:()=>z2,safeParseAsync:()=>y_,safeParse:()=>m_,safeEncodeAsync:()=>gQ,safeEncode:()=>iQ,safeDecodeAsync:()=>wQ,safeDecode:()=>$Q,registry:()=>yi,regexes:()=>Yn,process:()=>y,prettifyError:()=>bg,parseAsync:()=>yw,parse:()=>mw,meta:()=>Kk,locales:()=>bi,isValidJWT:()=>nl,isValidBase64URL:()=>s2,isValidBase64:()=>kU,initializeContext:()=>Mv,globalRegistry:()=>wn,globalConfig:()=>p$,formatError:()=>gi,flattenError:()=>$i,finalize:()=>Av,extractDefs:()=>Rv,encodeAsync:()=>nQ,encode:()=>at,describe:()=>Lk,decodeAsync:()=>vQ,decode:()=>st,createToJSONSchemaMethod:()=>Bk,createStandardJSONSchemaMethod:()=>v$,config:()=>vn,clone:()=>bn,_xor:()=>B9,_xid:()=>L4,_void:()=>Wk,_uuidv7:()=>j4,_uuidv6:()=>I4,_uuidv4:()=>Y4,_uuid:()=>W4,_url:()=>ug,_uppercase:()=>Lv,_unknown:()=>tk,_union:()=>O9,_undefined:()=>Jk,_ulid:()=>q4,_uint64:()=>lk,_uint32:()=>gk,_tuple:()=>c9,_trim:()=>cv,_transform:()=>x9,_toUpperCase:()=>Sv,_toLowerCase:()=>Pv,_templateLiteral:()=>y9,_symbol:()=>Dk,_superRefine:()=>qk,_success:()=>T9,_stringbool:()=>Ok,_stringFormat:()=>n$,_string:()=>Z1,_startsWith:()=>Ov,_slugify:()=>zv,_size:()=>bv,_set:()=>z9,_safeParseAsync:()=>Zi,_safeParse:()=>Ti,_safeEncodeAsync:()=>v4,_safeEncode:()=>sw,_safeDecodeAsync:()=>i4,_safeDecode:()=>n4,_regex:()=>fv,_refine:()=>fk,_record:()=>P9,_readonly:()=>m9,_property:()=>si,_promise:()=>e9,_positive:()=>di,_pipe:()=>r9,_parseAsync:()=>oi,_parse:()=>Ei,_overwrite:()=>Hn,_optional:()=>h9,_number:()=>a1,_nullable:()=>C9,_null:()=>Xk,_normalize:()=>Nv,_nonpositive:()=>pi,_nonoptional:()=>o9,_nonnegative:()=>ai,_never:()=>Qk,_negative:()=>ei,_nativeEnum:()=>R9,_nanoid:()=>H4,_nan:()=>jk,_multipleOf:()=>yn,_minSize:()=>Kn,_minLength:()=>An,_min:()=>Un,_mime:()=>Fv,_maxSize:()=>dn,_maxLength:()=>Uv,_max:()=>Xn,_map:()=>S9,_mac:()=>m1,_lte:()=>Xn,_lt:()=>qn,_lowercase:()=>qv,_literal:()=>A9,_length:()=>kv,_lazy:()=>d9,_ksuid:()=>K4,_jwt:()=>z4,_isoTime:()=>e1,_isoDuration:()=>p1,_isoDateTime:()=>y1,_isoDate:()=>d1,_ipv6:()=>B4,_ipv4:()=>O4,_intersection:()=>N9,_int64:()=>kk,_int32:()=>$k,_int:()=>nk,_includes:()=>Kv,_guid:()=>jg,_gte:()=>Un,_gt:()=>Ln,_float64:()=>ik,_float32:()=>vk,_file:()=>Hk,_enum:()=>M9,_endsWith:()=>Bv,_encodeAsync:()=>pw,_encode:()=>dw,_emoji:()=>u4,_email:()=>Q4,_e164:()=>S4,_discriminatedUnion:()=>F9,_default:()=>E9,_decodeAsync:()=>aw,_decode:()=>ew,_date:()=>Yk,_custom:()=>Vk,_cuid2:()=>f4,_cuid:()=>V4,_coercedString:()=>r1,_coercedNumber:()=>s1,_coercedDate:()=>Ik,_coercedBoolean:()=>_k,_coercedBigint:()=>Uk,_cidrv6:()=>N4,_cidrv4:()=>F4,_check:()=>kl,_catch:()=>Z9,_boolean:()=>wk,_bigint:()=>bk,_base64url:()=>P4,_base64:()=>c4,_array:()=>uk,_any:()=>Gk,TimePrecision:()=>Hg,NEVER:()=>a$,JSONSchemaGenerator:()=>X0,JSONSchema:()=>ll,Doc:()=>_4,$output:()=>Yg,$input:()=>Ig,$constructor:()=>t,$brand:()=>s$,$ZodXor:()=>KU,$ZodXID:()=>ab,$ZodVoid:()=>VU,$ZodUnknown:()=>uU,$ZodUnion:()=>Jg,$ZodUndefined:()=>YU,$ZodUUID:()=>Tb,$ZodURL:()=>rb,$ZodULID:()=>pb,$ZodType:()=>M,$ZodTuple:()=>G4,$ZodTransform:()=>MU,$ZodTemplateLiteral:()=>mU,$ZodSymbol:()=>WU,$ZodSuccess:()=>EU,$ZodStringFormat:()=>e,$ZodString:()=>_i,$ZodSet:()=>cU,$ZodRegistry:()=>T1,$ZodRecord:()=>FU,$ZodRealError:()=>Wn,$ZodReadonly:()=>rU,$ZodPromise:()=>dU,$ZodPrefault:()=>hU,$ZodPipe:()=>ZU,$ZodOptional:()=>t4,$ZodObjectJIT:()=>LU,$ZodObject:()=>$l,$ZodNumberFormat:()=>tU,$ZodNumber:()=>J4,$ZodNullable:()=>AU,$ZodNull:()=>IU,$ZodNonOptional:()=>CU,$ZodNever:()=>HU,$ZodNanoID:()=>yb,$ZodNaN:()=>TU,$ZodMap:()=>NU,$ZodMAC:()=>_U,$ZodLiteral:()=>SU,$ZodLazy:()=>eU,$ZodKSUID:()=>sb,$ZodJWT:()=>XU,$ZodIntersection:()=>BU,$ZodISOTime:()=>iU,$ZodISODuration:()=>$U,$ZodISODateTime:()=>nU,$ZodISODate:()=>vU,$ZodIPv6:()=>wU,$ZodIPv4:()=>gU,$ZodGUID:()=>ob,$ZodFunction:()=>yU,$ZodFile:()=>zU,$ZodExactOptional:()=>RU,$ZodError:()=>wg,$ZodEnum:()=>PU,$ZodEncodeError:()=>vi,$ZodEmoji:()=>mb,$ZodEmail:()=>Zb,$ZodE164:()=>JU,$ZodDiscriminatedUnion:()=>OU,$ZodDefault:()=>xU,$ZodDate:()=>fU,$ZodCustomStringFormat:()=>GU,$ZodCustom:()=>pU,$ZodCodec:()=>Xg,$ZodCheckUpperCase:()=>Sb,$ZodCheckStringFormat:()=>ri,$ZodCheckStartsWith:()=>Mb,$ZodCheckSizeEquals:()=>Ob,$ZodCheckRegex:()=>cb,$ZodCheckProperty:()=>Ab,$ZodCheckOverwrite:()=>hb,$ZodCheckNumberFormat:()=>fb,$ZodCheckMultipleOf:()=>Vb,$ZodCheckMinSize:()=>Kb,$ZodCheckMinLength:()=>Fb,$ZodCheckMimeType:()=>xb,$ZodCheckMaxSize:()=>Lb,$ZodCheckMaxLength:()=>Bb,$ZodCheckLowerCase:()=>Pb,$ZodCheckLessThan:()=>g4,$ZodCheckLengthEquals:()=>Nb,$ZodCheckIncludes:()=>zb,$ZodCheckGreaterThan:()=>w4,$ZodCheckEndsWith:()=>Rb,$ZodCheckBigIntFormat:()=>qb,$ZodCheck:()=>p,$ZodCatch:()=>oU,$ZodCUID2:()=>eb,$ZodCUID:()=>db,$ZodCIDRv6:()=>UU,$ZodCIDRv4:()=>bU,$ZodBoolean:()=>Dg,$ZodBigIntFormat:()=>QU,$ZodBigInt:()=>X4,$ZodBase64URL:()=>DU,$ZodBase64:()=>lU,$ZodAsyncError:()=>mn,$ZodArray:()=>qU,$ZodAny:()=>jU});var a$=Object.freeze({status:"aborted"});function t(n,i,$){function g(U,k){if(!U._zod)Object.defineProperty(U,"_zod",{value:{def:k,constr:_,traits:new Set},enumerable:!1});if(U._zod.traits.has(n))return;U._zod.traits.add(n),i(U,k);let l=_.prototype,J=Object.keys(l);for(let Q=0;Q<J.length;Q++){let j=J[Q];if(!(j in U))U[j]=l[j].bind(U)}}let v=$?.Parent??Object;class w extends v{}Object.defineProperty(w,"name",{value:n});function _(U){var k;let l=$?.Parent?new w:this;g(l,U),(k=l._zod).deferred??(k.deferred=[]);for(let J of l._zod.deferred)J();return l}return Object.defineProperty(_,"init",{value:g}),Object.defineProperty(_,Symbol.hasInstance,{value:(U)=>{if($?.Parent&&U instanceof $.Parent)return!0;return U?._zod?.traits?.has(n)}}),Object.defineProperty(_,"name",{value:n}),_}var s$=Symbol("zod_brand");class mn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vi extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`);this.name="ZodEncodeError"}}var p$={};function vn(n){if(n)Object.assign(p$,n);return p$}var f={};Nn(f,{unwrapMessage:()=>ng,uint8ArrayToHex:()=>et,uint8ArrayToBase64url:()=>yt,uint8ArrayToBase64:()=>c2,stringifyPrimitive:()=>V,slugify:()=>h_,shallowClone:()=>E_,safeExtend:()=>Et,required:()=>Zt,randomString:()=>zt,propertyKeyTypes:()=>ig,promiseAllObject:()=>St,primitiveTypes:()=>o_,prefixIssues:()=>un,pick:()=>xt,partial:()=>Tt,parsedType:()=>L,optionalKeys:()=>T_,omit:()=>ht,objectClone:()=>Nt,numKeys:()=>Mt,nullish:()=>jv,normalizeParams:()=>K,mergeDefs:()=>_v,merge:()=>ot,jsonStringifyReplacer:()=>xi,joinValues:()=>I,issue:()=>Ci,isPlainObject:()=>Hv,isObject:()=>ii,hexToUint8Array:()=>dt,getSizableOrigin:()=>$g,getParsedType:()=>Rt,getLengthableOrigin:()=>gg,getEnumValues:()=>Ai,getElementAtPath:()=>Pt,floatSafeRemainder:()=>x_,finalizeIssue:()=>Qn,extend:()=>Ct,escapeRegex:()=>fn,esc:()=>Zw,defineLazy:()=>C,createTransparentProxy:()=>At,cloneDef:()=>ct,clone:()=>bn,cleanRegex:()=>vg,cleanEnum:()=>rt,captureStackTrace:()=>rw,cached:()=>hi,base64urlToUint8Array:()=>mt,base64ToUint8Array:()=>N2,assignProp:()=>uv,assertNotEqual:()=>Kt,assertNever:()=>Bt,assertIs:()=>Ot,assertEqual:()=>Lt,assert:()=>Ft,allowsEval:()=>C_,aborted:()=>Vv,NUMBER_FORMAT_RANGES:()=>Z_,Class:()=>P2,BIGINT_FORMAT_RANGES:()=>r_});function Lt(n){return n}function Kt(n){return n}function Ot(n){}function Bt(n){throw Error("Unexpected value in exhaustive check")}function Ft(n){}function Ai(n){let i=Object.values(n).filter((g)=>typeof g==="number");return Object.entries(n).filter(([g,v])=>i.indexOf(+g)===-1).map(([g,v])=>v)}function I(n,i="|"){return n.map(($)=>V($)).join(i)}function xi(n,i){if(typeof i==="bigint")return i.toString();return i}function hi(n){return{get value(){{let $=n();return Object.defineProperty(this,"value",{value:$}),$}throw Error("cached value already set")}}}function jv(n){return n===null||n===void 0}function vg(n){let i=n.startsWith("^")?1:0,$=n.endsWith("$")?n.length-1:n.length;return n.slice(i,$)}function x_(n,i){let $=(n.toString().split(".")[1]||"").length,g=i.toString(),v=(g.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(g)){let k=g.match(/\d?e-(\d?)/);if(k?.[1])v=Number.parseInt(k[1])}let w=$>v?$:v,_=Number.parseInt(n.toFixed(w).replace(".","")),U=Number.parseInt(i.toFixed(w).replace(".",""));return _%U/10**w}var F2=Symbol("evaluating");function C(n,i,$){let g=void 0;Object.defineProperty(n,i,{get(){if(g===F2)return;if(g===void 0)g=F2,g=$();return g},set(v){Object.defineProperty(n,i,{value:v})},configurable:!0})}function Nt(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function uv(n,i,$){Object.defineProperty(n,i,{value:$,writable:!0,enumerable:!0,configurable:!0})}function _v(...n){let i={};for(let $ of n){let g=Object.getOwnPropertyDescriptors($);Object.assign(i,g)}return Object.defineProperties({},i)}function ct(n){return _v(n._zod.def)}function Pt(n,i){if(!i)return n;return i.reduce(($,g)=>$?.[g],n)}function St(n){let i=Object.keys(n),$=i.map((g)=>n[g]);return Promise.all($).then((g)=>{let v={};for(let w=0;w<i.length;w++)v[i[w]]=g[w];return v})}function zt(n=10){let $="";for(let g=0;g<n;g++)$+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return $}function Zw(n){return JSON.stringify(n)}function h_(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var rw="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function ii(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}var C_=hi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function Hv(n){if(ii(n)===!1)return!1;let i=n.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let $=i.prototype;if(ii($)===!1)return!1;if(Object.prototype.hasOwnProperty.call($,"isPrototypeOf")===!1)return!1;return!0}function E_(n){if(Hv(n))return{...n};if(Array.isArray(n))return[...n];return n}function Mt(n){let i=0;for(let $ in n)if(Object.prototype.hasOwnProperty.call(n,$))i++;return i}var Rt=(n)=>{let i=typeof n;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(n))return"array";if(n===null)return"null";if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return"promise";if(typeof Map<"u"&&n instanceof Map)return"map";if(typeof Set<"u"&&n instanceof Set)return"set";if(typeof Date<"u"&&n instanceof Date)return"date";if(typeof File<"u"&&n instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},ig=new Set(["string","number","symbol"]),o_=new Set(["string","number","bigint","boolean","symbol","undefined"]);function fn(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bn(n,i,$){let g=new n._zod.constr(i??n._zod.def);if(!i||$?.parent)g._zod.parent=n;return g}function K(n){let i=n;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function At(n){let i;return new Proxy({},{get($,g,v){return i??(i=n()),Reflect.get(i,g,v)},set($,g,v,w){return i??(i=n()),Reflect.set(i,g,v,w)},has($,g){return i??(i=n()),Reflect.has(i,g)},deleteProperty($,g){return i??(i=n()),Reflect.deleteProperty(i,g)},ownKeys($){return i??(i=n()),Reflect.ownKeys(i)},getOwnPropertyDescriptor($,g){return i??(i=n()),Reflect.getOwnPropertyDescriptor(i,g)},defineProperty($,g,v){return i??(i=n()),Reflect.defineProperty(i,g,v)}})}function V(n){if(typeof n==="bigint")return n.toString()+"n";if(typeof n==="string")return`"${n}"`;return`${n}`}function T_(n){return Object.keys(n).filter((i)=>{return n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional"})}var Z_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},r_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xt(n,i){let $=n._zod.def,g=$.checks;if(g&&g.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let w=_v(n._zod.def,{get shape(){let _={};for(let U in i){if(!(U in $.shape))throw Error(`Unrecognized key: "${U}"`);if(!i[U])continue;_[U]=$.shape[U]}return uv(this,"shape",_),_},checks:[]});return bn(n,w)}function ht(n,i){let $=n._zod.def,g=$.checks;if(g&&g.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let w=_v(n._zod.def,{get shape(){let _={...n._zod.def.shape};for(let U in i){if(!(U in $.shape))throw Error(`Unrecognized key: "${U}"`);if(!i[U])continue;delete _[U]}return uv(this,"shape",_),_},checks:[]});return bn(n,w)}function Ct(n,i){if(!Hv(i))throw Error("Invalid input to extend: expected a plain object");let $=n._zod.def.checks;if($&&$.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let v=_v(n._zod.def,{get shape(){let w={...n._zod.def.shape,...i};return uv(this,"shape",w),w},checks:[]});return bn(n,v)}function Et(n,i){if(!Hv(i))throw Error("Invalid input to safeExtend: expected a plain object");let $=_v(n._zod.def,{get shape(){let g={...n._zod.def.shape,...i};return uv(this,"shape",g),g}});return bn(n,$)}function ot(n,i){let $=_v(n._zod.def,{get shape(){let g={...n._zod.def.shape,...i._zod.def.shape};return uv(this,"shape",g),g},get catchall(){return i._zod.def.catchall},checks:[]});return bn(n,$)}function Tt(n,i,$){let v=i._zod.def.checks;if(v&&v.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let _=_v(i._zod.def,{get shape(){let U=i._zod.def.shape,k={...U};if($)for(let l in $){if(!(l in U))throw Error(`Unrecognized key: "${l}"`);if(!$[l])continue;k[l]=n?new n({type:"optional",innerType:U[l]}):U[l]}else for(let l in U)k[l]=n?new n({type:"optional",innerType:U[l]}):U[l];return uv(this,"shape",k),k},checks:[]});return bn(i,_)}function Zt(n,i,$){let g=_v(i._zod.def,{get shape(){let v=i._zod.def.shape,w={...v};if($)for(let _ in $){if(!(_ in w))throw Error(`Unrecognized key: "${_}"`);if(!$[_])continue;w[_]=new n({type:"nonoptional",innerType:v[_]})}else for(let _ in v)w[_]=new n({type:"nonoptional",innerType:v[_]});return uv(this,"shape",w),w}});return bn(i,g)}function Vv(n,i=0){if(n.aborted===!0)return!0;for(let $=i;$<n.issues.length;$++)if(n.issues[$]?.continue!==!0)return!0;return!1}function un(n,i){return i.map(($)=>{var g;return(g=$).path??(g.path=[]),$.path.unshift(n),$})}function ng(n){return typeof n==="string"?n:n?.message}function Qn(n,i,$){let g={...n,path:n.path??[]};if(!n.message){let v=ng(n.inst?._zod.def?.error?.(n))??ng(i?.error?.(n))??ng($.customError?.(n))??ng($.localeError?.(n))??"Invalid input";g.message=v}if(delete g.inst,delete g.continue,!i?.reportInput)delete g.input;return g}function $g(n){if(n instanceof Set)return"set";if(n instanceof Map)return"map";if(n instanceof File)return"file";return"unknown"}function gg(n){if(Array.isArray(n))return"array";if(typeof n==="string")return"string";return"unknown"}function L(n){let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let $=n;if($&&Object.getPrototypeOf($)!==Object.prototype&&"constructor"in $&&$.constructor)return $.constructor.name}}return i}function Ci(...n){let[i,$,g]=n;if(typeof i==="string")return{message:i,code:"custom",input:$,inst:g};return{...i}}function rt(n){return Object.entries(n).filter(([i,$])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function N2(n){let i=atob(n),$=new Uint8Array(i.length);for(let g=0;g<i.length;g++)$[g]=i.charCodeAt(g);return $}function c2(n){let i="";for(let $=0;$<n.length;$++)i+=String.fromCharCode(n[$]);return btoa(i)}function mt(n){let i=n.replace(/-/g,"+").replace(/_/g,"/"),$="=".repeat((4-i.length%4)%4);return N2(i+$)}function yt(n){return c2(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function dt(n){let i=n.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let $=new Uint8Array(i.length/2);for(let g=0;g<i.length;g+=2)$[g/2]=Number.parseInt(i.slice(g,g+2),16);return $}function et(n){return Array.from(n).map((i)=>i.toString(16).padStart(2,"0")).join("")}class P2{constructor(...n){}}var S2=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,xi,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},wg=t("$ZodError",S2),Wn=t("$ZodError",S2,{Parent:Error});function $i(n,i=($)=>$.message){let $={},g=[];for(let v of n.issues)if(v.path.length>0)$[v.path[0]]=$[v.path[0]]||[],$[v.path[0]].push(i(v));else g.push(i(v));return{formErrors:g,fieldErrors:$}}function gi(n,i=($)=>$.message){let $={_errors:[]},g=(v)=>{for(let w of v.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map((_)=>g({issues:_}));else if(w.code==="invalid_key")g({issues:w.issues});else if(w.code==="invalid_element")g({issues:w.issues});else if(w.path.length===0)$._errors.push(i(w));else{let _=$,U=0;while(U<w.path.length){let k=w.path[U];if(U!==w.path.length-1)_[k]=_[k]||{_errors:[]};else _[k]=_[k]||{_errors:[]},_[k]._errors.push(i(w));_=_[k],U++}}};return g(n),$}function _g(n,i=($)=>$.message){let $={errors:[]},g=(v,w=[])=>{var _,U;for(let k of v.issues)if(k.code==="invalid_union"&&k.errors.length)k.errors.map((l)=>g({issues:l},k.path));else if(k.code==="invalid_key")g({issues:k.issues},k.path);else if(k.code==="invalid_element")g({issues:k.issues},k.path);else{let l=[...w,...k.path];if(l.length===0){$.errors.push(i(k));continue}let J=$,Q=0;while(Q<l.length){let j=l[Q],u=Q===l.length-1;if(typeof j==="string")J.properties??(J.properties={}),(_=J.properties)[j]??(_[j]={errors:[]}),J=J.properties[j];else J.items??(J.items=[]),(U=J.items)[j]??(U[j]={errors:[]}),J=J.items[j];if(u)J.errors.push(i(k));Q++}}};return g(n),$}function z2(n){let i=[],$=n.map((g)=>typeof g==="object"?g.key:g);for(let g of $)if(typeof g==="number")i.push(`[${g}]`);else if(typeof g==="symbol")i.push(`[${JSON.stringify(String(g))}]`);else if(/[^\w$]/.test(g))i.push(`[${JSON.stringify(g)}]`);else{if(i.length)i.push(".");i.push(g)}return i.join("")}function bg(n){let i=[],$=[...n.issues].sort((g,v)=>(g.path??[]).length-(v.path??[]).length);for(let g of $)if(i.push(`✖ ${g.message}`),g.path?.length)i.push(` → at ${z2(g.path)}`);return i.join(`
|
|
4
|
-
`)}var Ei=(n)=>(i,$,g,v)=>{let w=g?Object.assign(g,{async:!1}):{async:!1},_=i._zod.run({value:$,issues:[]},w);if(_ instanceof Promise)throw new mn;if(_.issues.length){let U=new(v?.Err??n)(_.issues.map((k)=>Qn(k,w,vn())));throw rw(U,v?.callee),U}return _.value},mw=Ei(Wn),oi=(n)=>async(i,$,g,v)=>{let w=g?Object.assign(g,{async:!0}):{async:!0},_=i._zod.run({value:$,issues:[]},w);if(_ instanceof Promise)_=await _;if(_.issues.length){let U=new(v?.Err??n)(_.issues.map((k)=>Qn(k,w,vn())));throw rw(U,v?.callee),U}return _.value},yw=oi(Wn),Ti=(n)=>(i,$,g)=>{let v=g?{...g,async:!1}:{async:!1},w=i._zod.run({value:$,issues:[]},v);if(w instanceof Promise)throw new mn;return w.issues.length?{success:!1,error:new(n??wg)(w.issues.map((_)=>Qn(_,v,vn())))}:{success:!0,data:w.value}},m_=Ti(Wn),Zi=(n)=>async(i,$,g)=>{let v=g?Object.assign(g,{async:!0}):{async:!0},w=i._zod.run({value:$,issues:[]},v);if(w instanceof Promise)w=await w;return w.issues.length?{success:!1,error:new n(w.issues.map((_)=>Qn(_,v,vn())))}:{success:!0,data:w.value}},y_=Zi(Wn),dw=(n)=>(i,$,g)=>{let v=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Ei(n)(i,$,v)},at=dw(Wn),ew=(n)=>(i,$,g)=>{return Ei(n)(i,$,g)},st=ew(Wn),pw=(n)=>async(i,$,g)=>{let v=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return oi(n)(i,$,v)},nQ=pw(Wn),aw=(n)=>async(i,$,g)=>{return oi(n)(i,$,g)},vQ=aw(Wn),sw=(n)=>(i,$,g)=>{let v=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Ti(n)(i,$,v)},iQ=sw(Wn),n4=(n)=>(i,$,g)=>{return Ti(n)(i,$,g)},$Q=n4(Wn),v4=(n)=>async(i,$,g)=>{let v=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Zi(n)(i,$,v)},gQ=v4(Wn),i4=(n)=>async(i,$,g)=>{return Zi(n)(i,$,g)},wQ=i4(Wn);var Yn={};Nn(Yn,{xid:()=>a_,uuid7:()=>kQ,uuid6:()=>UQ,uuid4:()=>bQ,uuid:()=>wi,uppercase:()=>Hb,unicodeEmail:()=>M2,undefined:()=>jb,ulid:()=>p_,time:()=>Xb,string:()=>tb,sha512_hex:()=>FQ,sha512_base64url:()=>cQ,sha512_base64:()=>NQ,sha384_hex:()=>KQ,sha384_base64url:()=>BQ,sha384_base64:()=>OQ,sha256_hex:()=>fQ,sha256_base64url:()=>LQ,sha256_base64:()=>qQ,sha1_hex:()=>uQ,sha1_base64url:()=>VQ,sha1_base64:()=>HQ,rfc5322Email:()=>DQ,number:()=>Ug,null:()=>Ib,nanoid:()=>nb,md5_hex:()=>YQ,md5_base64url:()=>jQ,md5_base64:()=>IQ,mac:()=>bb,lowercase:()=>ub,ksuid:()=>s_,ipv6:()=>_b,ipv4:()=>wb,integer:()=>Wb,idnEmail:()=>JQ,html5Email:()=>lQ,hostname:()=>tQ,hex:()=>WQ,guid:()=>ib,extendedDuration:()=>_Q,emoji:()=>gb,email:()=>$b,e164:()=>Db,duration:()=>vb,domain:()=>QQ,datetime:()=>Gb,date:()=>Jb,cuid2:()=>e_,cuid:()=>d_,cidrv6:()=>kb,cidrv4:()=>Ub,browserEmail:()=>XQ,boolean:()=>Yb,bigint:()=>Qb,base64url:()=>$4,base64:()=>lb});var d_=/^[cC][^\s-]{8,}$/,e_=/^[0-9a-z]+$/,p_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,a_=/^[0-9a-vA-V]{20}$/,s_=/^[A-Za-z0-9]{27}$/,nb=/^[a-zA-Z0-9_-]{21}$/,vb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_Q=/^[-+]?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)?)??$/,ib=/^([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})$/,wi=(n)=>{if(!n)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},bQ=wi(4),UQ=wi(6),kQ=wi(7),$b=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lQ=/^[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])?)*$/,DQ=/^(([^<>()\[\]\\.,;:\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,}))$/,M2=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,JQ=M2,XQ=/^[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])?)*$/,GQ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function gb(){return new RegExp(GQ,"u")}var wb=/^(?:(?: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])$/,_b=/^(([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}|:))$/,bb=(n)=>{let i=fn(n??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},Ub=/^((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])$/,kb=/^(([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])$/,lb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$4=/^[A-Za-z0-9_-]*$/,tQ=/^(?=.{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])?)*\.?$/,QQ=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Db=/^\+[1-9]\d{6,14}$/,R2="(?:(?:\\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])))",Jb=new RegExp(`^${R2}$`);function A2(n){return typeof n.precision==="number"?n.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":n.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${n.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Xb(n){return new RegExp(`^${A2(n)}$`)}function Gb(n){let i=A2({precision:n.precision}),$=["Z"];if(n.local)$.push("");if(n.offset)$.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let g=`${i}(?:${$.join("|")})`;return new RegExp(`^${R2}T(?:${g})$`)}var tb=(n)=>{let i=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},Qb=/^-?\d+n?$/,Wb=/^-?\d+$/,Ug=/^-?\d+(?:\.\d+)?$/,Yb=/^(?:true|false)$/i,Ib=/^null$/i;var jb=/^undefined$/i;var ub=/^[^A-Z]*$/,Hb=/^[^a-z]*$/,WQ=/^[0-9a-fA-F]*$/;function kg(n,i){return new RegExp(`^[A-Za-z0-9+/]{${n}}${i}$`)}function lg(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var YQ=/^[0-9a-fA-F]{32}$/,IQ=kg(22,"=="),jQ=lg(22),uQ=/^[0-9a-fA-F]{40}$/,HQ=kg(27,"="),VQ=lg(27),fQ=/^[0-9a-fA-F]{64}$/,qQ=kg(43,"="),LQ=lg(43),KQ=/^[0-9a-fA-F]{96}$/,OQ=kg(64,""),BQ=lg(64),FQ=/^[0-9a-fA-F]{128}$/,NQ=kg(86,"=="),cQ=lg(86);var p=t("$ZodCheck",(n,i)=>{var $;n._zod??(n._zod={}),n._zod.def=i,($=n._zod).onattach??($.onattach=[])}),h2={number:"number",bigint:"bigint",object:"date"},g4=t("$ZodCheckLessThan",(n,i)=>{p.init(n,i);let $=h2[typeof i.value];n._zod.onattach.push((g)=>{let v=g._zod.bag,w=(i.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(i.value<w)if(i.inclusive)v.maximum=i.value;else v.exclusiveMaximum=i.value}),n._zod.check=(g)=>{if(i.inclusive?g.value<=i.value:g.value<i.value)return;g.issues.push({origin:$,code:"too_big",maximum:typeof i.value==="object"?i.value.getTime():i.value,input:g.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),w4=t("$ZodCheckGreaterThan",(n,i)=>{p.init(n,i);let $=h2[typeof i.value];n._zod.onattach.push((g)=>{let v=g._zod.bag,w=(i.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(i.value>w)if(i.inclusive)v.minimum=i.value;else v.exclusiveMinimum=i.value}),n._zod.check=(g)=>{if(i.inclusive?g.value>=i.value:g.value>i.value)return;g.issues.push({origin:$,code:"too_small",minimum:typeof i.value==="object"?i.value.getTime():i.value,input:g.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),Vb=t("$ZodCheckMultipleOf",(n,i)=>{p.init(n,i),n._zod.onattach.push(($)=>{var g;(g=$._zod.bag).multipleOf??(g.multipleOf=i.value)}),n._zod.check=($)=>{if(typeof $.value!==typeof i.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof $.value==="bigint"?$.value%i.value===BigInt(0):x_($.value,i.value)===0)return;$.issues.push({origin:typeof $.value,code:"not_multiple_of",divisor:i.value,input:$.value,inst:n,continue:!i.abort})}}),fb=t("$ZodCheckNumberFormat",(n,i)=>{p.init(n,i),i.format=i.format||"float64";let $=i.format?.includes("int"),g=$?"int":"number",[v,w]=Z_[i.format];n._zod.onattach.push((_)=>{let U=_._zod.bag;if(U.format=i.format,U.minimum=v,U.maximum=w,$)U.pattern=Wb}),n._zod.check=(_)=>{let U=_.value;if($){if(!Number.isInteger(U)){_.issues.push({expected:g,format:i.format,code:"invalid_type",continue:!1,input:U,inst:n});return}if(!Number.isSafeInteger(U)){if(U>0)_.issues.push({input:U,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:g,inclusive:!0,continue:!i.abort});else _.issues.push({input:U,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:g,inclusive:!0,continue:!i.abort});return}}if(U<v)_.issues.push({origin:"number",input:U,code:"too_small",minimum:v,inclusive:!0,inst:n,continue:!i.abort});if(U>w)_.issues.push({origin:"number",input:U,code:"too_big",maximum:w,inclusive:!0,inst:n,continue:!i.abort})}}),qb=t("$ZodCheckBigIntFormat",(n,i)=>{p.init(n,i);let[$,g]=r_[i.format];n._zod.onattach.push((v)=>{let w=v._zod.bag;w.format=i.format,w.minimum=$,w.maximum=g}),n._zod.check=(v)=>{let w=v.value;if(w<$)v.issues.push({origin:"bigint",input:w,code:"too_small",minimum:$,inclusive:!0,inst:n,continue:!i.abort});if(w>g)v.issues.push({origin:"bigint",input:w,code:"too_big",maximum:g,inclusive:!0,inst:n,continue:!i.abort})}}),Lb=t("$ZodCheckMaxSize",(n,i)=>{var $;p.init(n,i),($=n._zod.def).when??($.when=(g)=>{let v=g.value;return!jv(v)&&v.size!==void 0}),n._zod.onattach.push((g)=>{let v=g._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<v)g._zod.bag.maximum=i.maximum}),n._zod.check=(g)=>{let v=g.value;if(v.size<=i.maximum)return;g.issues.push({origin:$g(v),code:"too_big",maximum:i.maximum,inclusive:!0,input:v,inst:n,continue:!i.abort})}}),Kb=t("$ZodCheckMinSize",(n,i)=>{var $;p.init(n,i),($=n._zod.def).when??($.when=(g)=>{let v=g.value;return!jv(v)&&v.size!==void 0}),n._zod.onattach.push((g)=>{let v=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>v)g._zod.bag.minimum=i.minimum}),n._zod.check=(g)=>{let v=g.value;if(v.size>=i.minimum)return;g.issues.push({origin:$g(v),code:"too_small",minimum:i.minimum,inclusive:!0,input:v,inst:n,continue:!i.abort})}}),Ob=t("$ZodCheckSizeEquals",(n,i)=>{var $;p.init(n,i),($=n._zod.def).when??($.when=(g)=>{let v=g.value;return!jv(v)&&v.size!==void 0}),n._zod.onattach.push((g)=>{let v=g._zod.bag;v.minimum=i.size,v.maximum=i.size,v.size=i.size}),n._zod.check=(g)=>{let v=g.value,w=v.size;if(w===i.size)return;let _=w>i.size;g.issues.push({origin:$g(v),..._?{code:"too_big",maximum:i.size}:{code:"too_small",minimum:i.size},inclusive:!0,exact:!0,input:g.value,inst:n,continue:!i.abort})}}),Bb=t("$ZodCheckMaxLength",(n,i)=>{var $;p.init(n,i),($=n._zod.def).when??($.when=(g)=>{let v=g.value;return!jv(v)&&v.length!==void 0}),n._zod.onattach.push((g)=>{let v=g._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<v)g._zod.bag.maximum=i.maximum}),n._zod.check=(g)=>{let v=g.value;if(v.length<=i.maximum)return;let _=gg(v);g.issues.push({origin:_,code:"too_big",maximum:i.maximum,inclusive:!0,input:v,inst:n,continue:!i.abort})}}),Fb=t("$ZodCheckMinLength",(n,i)=>{var $;p.init(n,i),($=n._zod.def).when??($.when=(g)=>{let v=g.value;return!jv(v)&&v.length!==void 0}),n._zod.onattach.push((g)=>{let v=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>v)g._zod.bag.minimum=i.minimum}),n._zod.check=(g)=>{let v=g.value;if(v.length>=i.minimum)return;let _=gg(v);g.issues.push({origin:_,code:"too_small",minimum:i.minimum,inclusive:!0,input:v,inst:n,continue:!i.abort})}}),Nb=t("$ZodCheckLengthEquals",(n,i)=>{var $;p.init(n,i),($=n._zod.def).when??($.when=(g)=>{let v=g.value;return!jv(v)&&v.length!==void 0}),n._zod.onattach.push((g)=>{let v=g._zod.bag;v.minimum=i.length,v.maximum=i.length,v.length=i.length}),n._zod.check=(g)=>{let v=g.value,w=v.length;if(w===i.length)return;let _=gg(v),U=w>i.length;g.issues.push({origin:_,...U?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:g.value,inst:n,continue:!i.abort})}}),ri=t("$ZodCheckStringFormat",(n,i)=>{var $,g;if(p.init(n,i),n._zod.onattach.push((v)=>{let w=v._zod.bag;if(w.format=i.format,i.pattern)w.patterns??(w.patterns=new Set),w.patterns.add(i.pattern)}),i.pattern)($=n._zod).check??($.check=(v)=>{if(i.pattern.lastIndex=0,i.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:i.format,input:v.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})});else(g=n._zod).check??(g.check=()=>{})}),cb=t("$ZodCheckRegex",(n,i)=>{ri.init(n,i),n._zod.check=($)=>{if(i.pattern.lastIndex=0,i.pattern.test($.value))return;$.issues.push({origin:"string",code:"invalid_format",format:"regex",input:$.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),Pb=t("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=ub),ri.init(n,i)}),Sb=t("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=Hb),ri.init(n,i)}),zb=t("$ZodCheckIncludes",(n,i)=>{p.init(n,i);let $=fn(i.includes),g=new RegExp(typeof i.position==="number"?`^.{${i.position}}${$}`:$);i.pattern=g,n._zod.onattach.push((v)=>{let w=v._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(g)}),n._zod.check=(v)=>{if(v.value.includes(i.includes,i.position))return;v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:v.value,inst:n,continue:!i.abort})}}),Mb=t("$ZodCheckStartsWith",(n,i)=>{p.init(n,i);let $=new RegExp(`^${fn(i.prefix)}.*`);i.pattern??(i.pattern=$),n._zod.onattach.push((g)=>{let v=g._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add($)}),n._zod.check=(g)=>{if(g.value.startsWith(i.prefix))return;g.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:g.value,inst:n,continue:!i.abort})}}),Rb=t("$ZodCheckEndsWith",(n,i)=>{p.init(n,i);let $=new RegExp(`.*${fn(i.suffix)}$`);i.pattern??(i.pattern=$),n._zod.onattach.push((g)=>{let v=g._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add($)}),n._zod.check=(g)=>{if(g.value.endsWith(i.suffix))return;g.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:g.value,inst:n,continue:!i.abort})}});function x2(n,i,$){if(n.issues.length)i.issues.push(...un($,n.issues))}var Ab=t("$ZodCheckProperty",(n,i)=>{p.init(n,i),n._zod.check=($)=>{let g=i.schema._zod.run({value:$.value[i.property],issues:[]},{});if(g instanceof Promise)return g.then((v)=>x2(v,$,i.property));x2(g,$,i.property);return}}),xb=t("$ZodCheckMimeType",(n,i)=>{p.init(n,i);let $=new Set(i.mime);n._zod.onattach.push((g)=>{g._zod.bag.mime=i.mime}),n._zod.check=(g)=>{if($.has(g.value.type))return;g.issues.push({code:"invalid_value",values:i.mime,input:g.value.type,inst:n,continue:!i.abort})}}),hb=t("$ZodCheckOverwrite",(n,i)=>{p.init(n,i),n._zod.check=($)=>{$.value=i.tx($.value)}});class _4{constructor(n=[]){if(this.content=[],this.indent=0,this)this.args=n}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n==="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let $=n.split(`
|
|
5
|
-
|
|
6
|
-
`))}}var Cb={major:4,minor:3,patch:0};var M=t("$ZodType",(n,i)=>{var $;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=Cb;let g=[...n._zod.def.checks??[]];if(n._zod.traits.has("$ZodCheck"))g.unshift(n);for(let v of g)for(let w of v._zod.onattach)w(n);if(g.length===0)($=n._zod).deferred??($.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let v=(_,U,k)=>{let l=Vv(_),J;for(let Q of U){if(Q._zod.def.when){if(!Q._zod.def.when(_))continue}else if(l)continue;let j=_.issues.length,u=Q._zod.check(_);if(u instanceof Promise&&k?.async===!1)throw new mn;if(J||u instanceof Promise)J=(J??Promise.resolve()).then(async()=>{if(await u,_.issues.length===j)return;if(!l)l=Vv(_,j)});else{if(_.issues.length===j)continue;if(!l)l=Vv(_,j)}}if(J)return J.then(()=>{return _});return _},w=(_,U,k)=>{if(Vv(_))return _.aborted=!0,_;let l=v(U,g,k);if(l instanceof Promise){if(k.async===!1)throw new mn;return l.then((J)=>n._zod.parse(J,k))}return n._zod.parse(l,k)};n._zod.run=(_,U)=>{if(U.skipChecks)return n._zod.parse(_,U);if(U.direction==="backward"){let l=n._zod.parse({value:_.value,issues:[]},{...U,skipChecks:!0});if(l instanceof Promise)return l.then((J)=>{return w(J,_,U)});return w(l,_,U)}let k=n._zod.parse(_,U);if(k instanceof Promise){if(U.async===!1)throw new mn;return k.then((l)=>v(l,g,U))}return v(k,g,U)}}C(n,"~standard",()=>({validate:(v)=>{try{let w=m_(n,v);return w.success?{value:w.data}:{issues:w.error?.issues}}catch(w){return y_(n,v).then((_)=>_.success?{value:_.data}:{issues:_.error?.issues})}},vendor:"zod",version:1}))}),_i=t("$ZodString",(n,i)=>{M.init(n,i),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??tb(n._zod.bag),n._zod.parse=($,g)=>{if(i.coerce)try{$.value=String($.value)}catch(v){}if(typeof $.value==="string")return $;return $.issues.push({expected:"string",code:"invalid_type",input:$.value,inst:n}),$}}),e=t("$ZodStringFormat",(n,i)=>{ri.init(n,i),_i.init(n,i)}),ob=t("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=ib),e.init(n,i)}),Tb=t("$ZodUUID",(n,i)=>{if(i.version){let g={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(g===void 0)throw Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=wi(g))}else i.pattern??(i.pattern=wi());e.init(n,i)}),Zb=t("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=$b),e.init(n,i)}),rb=t("$ZodURL",(n,i)=>{e.init(n,i),n._zod.check=($)=>{try{let g=$.value.trim(),v=new URL(g);if(i.hostname){if(i.hostname.lastIndex=0,!i.hostname.test(v.hostname))$.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:$.value,inst:n,continue:!i.abort})}if(i.protocol){if(i.protocol.lastIndex=0,!i.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol))$.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:$.value,inst:n,continue:!i.abort})}if(i.normalize)$.value=v.href;else $.value=g;return}catch(g){$.issues.push({code:"invalid_format",format:"url",input:$.value,inst:n,continue:!i.abort})}}}),mb=t("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=gb()),e.init(n,i)}),yb=t("$ZodNanoID",(n,i)=>{i.pattern??(i.pattern=nb),e.init(n,i)}),db=t("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=d_),e.init(n,i)}),eb=t("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=e_),e.init(n,i)}),pb=t("$ZodULID",(n,i)=>{i.pattern??(i.pattern=p_),e.init(n,i)}),ab=t("$ZodXID",(n,i)=>{i.pattern??(i.pattern=a_),e.init(n,i)}),sb=t("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=s_),e.init(n,i)}),nU=t("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=Gb(i)),e.init(n,i)}),vU=t("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=Jb),e.init(n,i)}),iU=t("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=Xb(i)),e.init(n,i)}),$U=t("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=vb),e.init(n,i)}),gU=t("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=wb),e.init(n,i),n._zod.bag.format="ipv4"}),wU=t("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=_b),e.init(n,i),n._zod.bag.format="ipv6",n._zod.check=($)=>{try{new URL(`http://[${$.value}]`)}catch{$.issues.push({code:"invalid_format",format:"ipv6",input:$.value,inst:n,continue:!i.abort})}}}),_U=t("$ZodMAC",(n,i)=>{i.pattern??(i.pattern=bb(i.delimiter)),e.init(n,i),n._zod.bag.format="mac"}),bU=t("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=Ub),e.init(n,i)}),UU=t("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=kb),e.init(n,i),n._zod.check=($)=>{let g=$.value.split("/");try{if(g.length!==2)throw Error();let[v,w]=g;if(!w)throw Error();let _=Number(w);if(`${_}`!==w)throw Error();if(_<0||_>128)throw Error();new URL(`http://[${v}]`)}catch{$.issues.push({code:"invalid_format",format:"cidrv6",input:$.value,inst:n,continue:!i.abort})}}});function kU(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var lU=t("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=lb),e.init(n,i),n._zod.bag.contentEncoding="base64",n._zod.check=($)=>{if(kU($.value))return;$.issues.push({code:"invalid_format",format:"base64",input:$.value,inst:n,continue:!i.abort})}});function s2(n){if(!$4.test(n))return!1;let i=n.replace(/[-_]/g,(g)=>g==="-"?"+":"/"),$=i.padEnd(Math.ceil(i.length/4)*4,"=");return kU($)}var DU=t("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=$4),e.init(n,i),n._zod.bag.contentEncoding="base64url",n._zod.check=($)=>{if(s2($.value))return;$.issues.push({code:"invalid_format",format:"base64url",input:$.value,inst:n,continue:!i.abort})}}),JU=t("$ZodE164",(n,i)=>{i.pattern??(i.pattern=Db),e.init(n,i)});function nl(n,i=null){try{let $=n.split(".");if($.length!==3)return!1;let[g]=$;if(!g)return!1;let v=JSON.parse(atob(g));if("typ"in v&&v?.typ!=="JWT")return!1;if(!v.alg)return!1;if(i&&(!("alg"in v)||v.alg!==i))return!1;return!0}catch{return!1}}var XU=t("$ZodJWT",(n,i)=>{e.init(n,i),n._zod.check=($)=>{if(nl($.value,i.alg))return;$.issues.push({code:"invalid_format",format:"jwt",input:$.value,inst:n,continue:!i.abort})}}),GU=t("$ZodCustomStringFormat",(n,i)=>{e.init(n,i),n._zod.check=($)=>{if(i.fn($.value))return;$.issues.push({code:"invalid_format",format:i.format,input:$.value,inst:n,continue:!i.abort})}}),J4=t("$ZodNumber",(n,i)=>{M.init(n,i),n._zod.pattern=n._zod.bag.pattern??Ug,n._zod.parse=($,g)=>{if(i.coerce)try{$.value=Number($.value)}catch(_){}let v=$.value;if(typeof v==="number"&&!Number.isNaN(v)&&Number.isFinite(v))return $;let w=typeof v==="number"?Number.isNaN(v)?"NaN":!Number.isFinite(v)?"Infinity":void 0:void 0;return $.issues.push({expected:"number",code:"invalid_type",input:v,inst:n,...w?{received:w}:{}}),$}}),tU=t("$ZodNumberFormat",(n,i)=>{fb.init(n,i),J4.init(n,i)}),Dg=t("$ZodBoolean",(n,i)=>{M.init(n,i),n._zod.pattern=Yb,n._zod.parse=($,g)=>{if(i.coerce)try{$.value=Boolean($.value)}catch(w){}let v=$.value;if(typeof v==="boolean")return $;return $.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:n}),$}}),X4=t("$ZodBigInt",(n,i)=>{M.init(n,i),n._zod.pattern=Qb,n._zod.parse=($,g)=>{if(i.coerce)try{$.value=BigInt($.value)}catch(v){}if(typeof $.value==="bigint")return $;return $.issues.push({expected:"bigint",code:"invalid_type",input:$.value,inst:n}),$}}),QU=t("$ZodBigIntFormat",(n,i)=>{qb.init(n,i),X4.init(n,i)}),WU=t("$ZodSymbol",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value;if(typeof v==="symbol")return $;return $.issues.push({expected:"symbol",code:"invalid_type",input:v,inst:n}),$}}),YU=t("$ZodUndefined",(n,i)=>{M.init(n,i),n._zod.pattern=jb,n._zod.values=new Set([void 0]),n._zod.optin="optional",n._zod.optout="optional",n._zod.parse=($,g)=>{let v=$.value;if(typeof v>"u")return $;return $.issues.push({expected:"undefined",code:"invalid_type",input:v,inst:n}),$}}),IU=t("$ZodNull",(n,i)=>{M.init(n,i),n._zod.pattern=Ib,n._zod.values=new Set([null]),n._zod.parse=($,g)=>{let v=$.value;if(v===null)return $;return $.issues.push({expected:"null",code:"invalid_type",input:v,inst:n}),$}}),jU=t("$ZodAny",(n,i)=>{M.init(n,i),n._zod.parse=($)=>$}),uU=t("$ZodUnknown",(n,i)=>{M.init(n,i),n._zod.parse=($)=>$}),HU=t("$ZodNever",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{return $.issues.push({expected:"never",code:"invalid_type",input:$.value,inst:n}),$}}),VU=t("$ZodVoid",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value;if(typeof v>"u")return $;return $.issues.push({expected:"void",code:"invalid_type",input:v,inst:n}),$}}),fU=t("$ZodDate",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{if(i.coerce)try{$.value=new Date($.value)}catch(U){}let v=$.value,w=v instanceof Date;if(w&&!Number.isNaN(v.getTime()))return $;return $.issues.push({expected:"date",code:"invalid_type",input:v,...w?{received:"Invalid Date"}:{},inst:n}),$}});function E2(n,i,$){if(n.issues.length)i.issues.push(...un($,n.issues));i.value[$]=n.value}var qU=t("$ZodArray",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value;if(!Array.isArray(v))return $.issues.push({expected:"array",code:"invalid_type",input:v,inst:n}),$;$.value=Array(v.length);let w=[];for(let _=0;_<v.length;_++){let U=v[_],k=i.element._zod.run({value:U,issues:[]},g);if(k instanceof Promise)w.push(k.then((l)=>E2(l,$,_)));else E2(k,$,_)}if(w.length)return Promise.all(w).then(()=>$);return $}});function D4(n,i,$,g,v){if(n.issues.length){if(v&&!($ in g))return;i.issues.push(...un($,n.issues))}if(n.value===void 0){if($ in g)i.value[$]=void 0}else i.value[$]=n.value}function vl(n){let i=Object.keys(n.shape);for(let g of i)if(!n.shape?.[g]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${g}": expected a Zod schema`);let $=T_(n.shape);return{...n,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set($)}}function il(n,i,$,g,v,w){let _=[],U=v.keySet,k=v.catchall._zod,l=k.def.type,J=k.optout==="optional";for(let Q in i){if(U.has(Q))continue;if(l==="never"){_.push(Q);continue}let j=k.run({value:i[Q],issues:[]},g);if(j instanceof Promise)n.push(j.then((u)=>D4(u,$,Q,i,J)));else D4(j,$,Q,i,J)}if(_.length)$.issues.push({code:"unrecognized_keys",keys:_,input:i,inst:w});if(!n.length)return $;return Promise.all(n).then(()=>{return $})}var $l=t("$ZodObject",(n,i)=>{if(M.init(n,i),!Object.getOwnPropertyDescriptor(i,"shape")?.get){let U=i.shape;Object.defineProperty(i,"shape",{get:()=>{let k={...U};return Object.defineProperty(i,"shape",{value:k}),k}})}let g=hi(()=>vl(i));C(n._zod,"propValues",()=>{let U=i.shape,k={};for(let l in U){let J=U[l]._zod;if(J.values){k[l]??(k[l]=new Set);for(let Q of J.values)k[l].add(Q)}}return k});let v=ii,w=i.catchall,_;n._zod.parse=(U,k)=>{_??(_=g.value);let l=U.value;if(!v(l))return U.issues.push({expected:"object",code:"invalid_type",input:l,inst:n}),U;U.value={};let J=[],Q=_.shape;for(let j of _.keys){let u=Q[j],W=u._zod.optout==="optional",Y=u._zod.run({value:l[j],issues:[]},k);if(Y instanceof Promise)J.push(Y.then((B)=>D4(B,U,j,l,W)));else D4(Y,U,j,l,W)}if(!w)return J.length?Promise.all(J).then(()=>U):U;return il(J,l,U,k,g.value,n)}}),LU=t("$ZodObjectJIT",(n,i)=>{$l.init(n,i);let $=n._zod.parse,g=hi(()=>vl(i)),v=(j)=>{let u=new _4(["shape","payload","ctx"]),W=g.value,Y=(T)=>{let a=Zw(T);return`shape[${a}]._zod.run({ value: input[${a}], issues: [] }, ctx)`};u.write("const input = payload.value;");let B=Object.create(null),O=0;for(let T of W.keys)B[T]=`key_${O++}`;u.write("const newResult = {};");for(let T of W.keys){let a=B[T],s=Zw(T),gn=j[T]?._zod?.optout==="optional";if(u.write(`const ${a} = ${Y(T)};`),gn)u.write(`
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import{createRequire as Eq}from"node:module";var zq=Object.create;var{getPrototypeOf:fq,defineProperty:y0,getOwnPropertyNames:Aq}=Object;var Sq=Object.prototype.hasOwnProperty;function iq($){return this[$]}var Tq,Rq,$8=($,w,g)=>{var _=$!=null&&typeof $==="object";if(_){var v=w?Tq??=new WeakMap:Rq??=new WeakMap,U=v.get($);if(U)return U}g=$!=null?zq(fq($)):{};let G=w||!$||!$.__esModule?y0(g,"default",{value:$,enumerable:!0}):g;for(let D of Aq($))if(!Sq.call(G,D))y0(G,D,{get:iq.bind($,D),enumerable:!0});if(_)v.set($,G);return G};var E=($,w)=>()=>(w||$((w={exports:{}}).exports,w),w.exports);var Cq=($)=>$;function uq($,w){this[$]=Cq.bind(null,w)}var p$=($,w)=>{for(var g in w)y0($,g,{get:w[g],enumerable:!0,configurable:!0,set:uq.bind(w,g)})};var J4=Eq(import.meta.url);var m0=E((JR,Zq)=>{Zq.exports={name:"@typescape-ai/mcp",version:"1.9.30",description:"Typescape MCP server for review, finding, and rules workflows in external agent harnesses",type:"module",bin:{"typescape-mcp":"./bin/typescape-mcp"},files:["bin","dist","README.md"],exports:{".":"./dist/mcp.js"},publishConfig:{access:"public"},scripts:{build:"bun build src/index.ts --outfile=dist/mcp.js --target=node --bundle --minify",dev:"bun run --watch src/index.ts",test:"bun test",typecheck:"tsc --noEmit",lint:"eslint src",prepublishOnly:"bun run build"},dependencies:{},devDependencies:{"@modelcontextprotocol/sdk":"1.0.4","@types/bun":"1.3.8","@typescape/schemas":"workspace:*",zod:"4.3.0"},engines:{node:">=18.17.0",bun:">=1.0.0"},keywords:["typescape","mcp","mcp-server","model-context-protocol","agent","automation","review","finding","rules","cursor","windsurf","bun"],repository:{type:"git",url:"https://github.com/voidserf/typescape-docs.git",directory:"apps/mcp"},license:"MIT"}});var $$=E((AV)=>{var T9=Symbol.for("yaml.alias"),GQ=Symbol.for("yaml.document"),J1=Symbol.for("yaml.map"),DQ=Symbol.for("yaml.pair"),R9=Symbol.for("yaml.scalar"),X1=Symbol.for("yaml.seq"),Aw=Symbol.for("yaml.node.type"),NV=($)=>!!$&&typeof $==="object"&&$[Aw]===T9,PV=($)=>!!$&&typeof $==="object"&&$[Aw]===GQ,kV=($)=>!!$&&typeof $==="object"&&$[Aw]===J1,nV=($)=>!!$&&typeof $==="object"&&$[Aw]===DQ,JQ=($)=>!!$&&typeof $==="object"&&$[Aw]===R9,MV=($)=>!!$&&typeof $==="object"&&$[Aw]===X1;function XQ($){if($&&typeof $==="object")switch($[Aw]){case J1:case X1:return!0}return!1}function zV($){if($&&typeof $==="object")switch($[Aw]){case T9:case J1:case R9:case X1:return!0}return!1}var fV=($)=>(JQ($)||XQ($))&&!!$.anchor;AV.ALIAS=T9;AV.DOC=GQ;AV.MAP=J1;AV.NODE_TYPE=Aw;AV.PAIR=DQ;AV.SCALAR=R9;AV.SEQ=X1;AV.hasAnchor=fV;AV.isAlias=NV;AV.isCollection=XQ;AV.isDocument=PV;AV.isMap=kV;AV.isNode=zV;AV.isPair=nV;AV.isScalar=JQ;AV.isSeq=MV});var Q_=E((oV)=>{var L$=$$(),T$=Symbol("break visit"),QQ=Symbol("skip children"),Iw=Symbol("remove node");function Q1($,w){let g=YQ(w);if(L$.isDocument($)){if(b6(null,$.contents,g,Object.freeze([$]))===Iw)$.contents=null}else b6(null,$,g,Object.freeze([]))}Q1.BREAK=T$;Q1.SKIP=QQ;Q1.REMOVE=Iw;function b6($,w,g,_){let v=WQ($,w,g,_);if(L$.isNode(v)||L$.isPair(v))return HQ($,_,v),b6($,v,g,_);if(typeof v!=="symbol"){if(L$.isCollection(w)){_=Object.freeze(_.concat(w));for(let U=0;U<w.items.length;++U){let G=b6(U,w.items[U],g,_);if(typeof G==="number")U=G-1;else if(G===T$)return T$;else if(G===Iw)w.items.splice(U,1),U-=1}}else if(L$.isPair(w)){_=Object.freeze(_.concat(w));let U=b6("key",w.key,g,_);if(U===T$)return T$;else if(U===Iw)w.key=null;let G=b6("value",w.value,g,_);if(G===T$)return T$;else if(G===Iw)w.value=null}}return v}async function Y1($,w){let g=YQ(w);if(L$.isDocument($)){if(await G6(null,$.contents,g,Object.freeze([$]))===Iw)$.contents=null}else await G6(null,$,g,Object.freeze([]))}Y1.BREAK=T$;Y1.SKIP=QQ;Y1.REMOVE=Iw;async function G6($,w,g,_){let v=await WQ($,w,g,_);if(L$.isNode(v)||L$.isPair(v))return HQ($,_,v),G6($,v,g,_);if(typeof v!=="symbol"){if(L$.isCollection(w)){_=Object.freeze(_.concat(w));for(let U=0;U<w.items.length;++U){let G=await G6(U,w.items[U],g,_);if(typeof G==="number")U=G-1;else if(G===T$)return T$;else if(G===Iw)w.items.splice(U,1),U-=1}}else if(L$.isPair(w)){_=Object.freeze(_.concat(w));let U=await G6("key",w.key,g,_);if(U===T$)return T$;else if(U===Iw)w.key=null;let G=await G6("value",w.value,g,_);if(G===T$)return T$;else if(G===Iw)w.value=null}}return v}function YQ($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function WQ($,w,g,_){if(typeof g==="function")return g($,w,_);if(L$.isMap(w))return g.Map?.($,w,_);if(L$.isSeq(w))return g.Seq?.($,w,_);if(L$.isPair(w))return g.Pair?.($,w,_);if(L$.isScalar(w))return g.Scalar?.($,w,_);if(L$.isAlias(w))return g.Alias?.($,w,_);return}function HQ($,w,g){let _=w[w.length-1];if(L$.isCollection(_))_.items[$]=g;else if(L$.isPair(_))if($==="key")_.key=g;else _.value=g;else if(L$.isDocument(_))_.contents=g;else{let v=L$.isAlias(_)?"alias":"scalar";throw Error(`Cannot replace node with ${v} parent`)}}oV.visit=Q1;oV.visitAsync=Y1});var C9=E(($F)=>{var qQ=$$(),eV=Q_(),aV={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sV=($)=>$.replace(/[!,[\]{}]/g,(w)=>aV[w]);class t${constructor($,w){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t$.defaultYaml,$),this.tags=Object.assign({},t$.defaultTags,w)}clone(){let $=new t$(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new t$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t$.defaultTags);break}return $}add($,w){if(this.atNextDocument)this.yaml={explicit:t$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t$.defaultTags),this.atNextDocument=!1;let g=$.trim().split(/[ \t]+/),_=g.shift();switch(_){case"%TAG":{if(g.length!==2){if(w(0,"%TAG directive should contain exactly two parts"),g.length<2)return!1}let[v,U]=g;return this.tags[v]=U,!0}case"%YAML":{if(this.yaml.explicit=!0,g.length!==1)return w(0,"%YAML directive should contain exactly one part"),!1;let[v]=g;if(v==="1.1"||v==="1.2")return this.yaml.version=v,!0;else{let U=/^\d+\.\d+$/.test(v);return w(6,`Unsupported YAML version ${v}`,U),!1}}default:return w(0,`Unknown directive ${_}`,!0),!1}}tagName($,w){if($==="!")return"!";if($[0]!=="!")return w(`Not a valid tag: ${$}`),null;if($[1]==="<"){let U=$.slice(2,-1);if(U==="!"||U==="!!")return w(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")w("Verbatim tags must end with a >");return U}let[,g,_]=$.match(/^(.*!)([^!]*)$/s);if(!_)w(`The ${$} tag has no suffix`);let v=this.tags[g];if(v)try{return v+decodeURIComponent(_)}catch(U){return w(String(U)),null}if(g==="!")return $;return w(`Could not resolve tag: ${$}`),null}tagString($){for(let[w,g]of Object.entries(this.tags))if($.startsWith(g))return w+sV($.substring(g.length));return $[0]==="!"?$:`!<${$}>`}toString($){let w=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],g=Object.entries(this.tags),_;if($&&g.length>0&&qQ.isNode($.contents)){let v={};eV.visit($.contents,(U,G)=>{if(qQ.isNode(G)&&G.tag)v[G.tag]=!0}),_=Object.keys(v)}else _=[];for(let[v,U]of g){if(v==="!!"&&U==="tag:yaml.org,2002:")continue;if(!$||_.some((G)=>G.startsWith(U)))w.push(`%TAG ${v} ${U}`)}return w.join(`
|
|
2
|
+
`)}}t$.defaultYaml={explicit:!1,version:"1.2"};t$.defaultTags={"!!":"tag:yaml.org,2002:"};$F.Directives=t$});var W1=E((UF)=>{var BQ=$$(),vF=Q_();function gF($){if(/[\x00-\x19\s,[\]{}]/.test($)){let g=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(g)}return!0}function IQ($){let w=new Set;return vF.visit($,{Value(g,_){if(_.anchor)w.add(_.anchor)}}),w}function LQ($,w){for(let g=1;;++g){let _=`${$}${g}`;if(!w.has(_))return _}}function _F($,w){let g=[],_=new Map,v=null;return{onAnchor:(U)=>{g.push(U),v??(v=IQ($));let G=LQ(w,v);return v.add(G),G},setAnchors:()=>{for(let U of g){let G=_.get(U);if(typeof G==="object"&&G.anchor&&(BQ.isScalar(G.node)||BQ.isCollection(G.node)))G.node.anchor=G.anchor;else{let D=Error("Failed to resolve repeated object (this should not happen)");throw D.source=U,D}}},sourceObjects:_}}UF.anchorIsValid=gF;UF.anchorNames=IQ;UF.createNodeAnchors=_F;UF.findNewAnchor=LQ});var u9=E((XF)=>{function Y_($,w,g,_){if(_&&typeof _==="object")if(Array.isArray(_))for(let v=0,U=_.length;v<U;++v){let G=_[v],D=Y_($,_,String(v),G);if(D===void 0)delete _[v];else if(D!==G)_[v]=D}else if(_ instanceof Map)for(let v of Array.from(_.keys())){let U=_.get(v),G=Y_($,_,v,U);if(G===void 0)_.delete(v);else if(G!==U)_.set(v,G)}else if(_ instanceof Set)for(let v of Array.from(_)){let U=Y_($,_,v,v);if(U===void 0)_.delete(v);else if(U!==v)_.delete(v),_.add(U)}else for(let[v,U]of Object.entries(_)){let G=Y_($,_,v,U);if(G===void 0)delete _[v];else if(G!==U)_[v]=G}return $.call(w,g,_)}XF.applyReviver=Y_});var Bv=E((WF)=>{var YF=$$();function VQ($,w,g){if(Array.isArray($))return $.map((_,v)=>VQ(_,String(v),g));if($&&typeof $.toJSON==="function"){if(!g||!YF.hasAnchor($))return $.toJSON(w,g);let _={aliasCount:0,count:1,res:void 0};g.anchors.set($,_),g.onCreate=(U)=>{_.res=U,delete g.onCreate};let v=$.toJSON(w,g);if(g.onCreate)g.onCreate(v);return v}if(typeof $==="bigint"&&!g?.keep)return Number($);return $}WF.toJS=VQ});var H1=E((IF)=>{var qF=u9(),FQ=$$(),BF=Bv();class jQ{constructor($){Object.defineProperty(this,FQ.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:w,maxAliasCount:g,onAnchor:_,reviver:v}={}){if(!FQ.isDocument($))throw TypeError("A document argument is required");let U={anchors:new Map,doc:$,keep:!0,mapAsMap:w===!0,mapKeyWarned:!1,maxAliasCount:typeof g==="number"?g:100},G=BF.toJS(this,"",U);if(typeof _==="function")for(let{count:D,res:J}of U.anchors.values())_(J,D);return typeof v==="function"?qF.applyReviver(v,{"":G},"",G):G}}IF.NodeBase=jQ});var W_=E((OF)=>{var VF=W1(),FF=Q_(),D6=$$(),jF=H1(),KF=Bv();class KQ extends jF.NodeBase{constructor($){super(D6.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,w){let g;if(w?.aliasResolveCache)g=w.aliasResolveCache;else if(g=[],FF.visit($,{Node:(v,U)=>{if(D6.isAlias(U)||D6.hasAnchor(U))g.push(U)}}),w)w.aliasResolveCache=g;let _=void 0;for(let v of g){if(v===this)break;if(v.anchor===this.source)_=v}return _}toJSON($,w){if(!w)return{source:this.source};let{anchors:g,doc:_,maxAliasCount:v}=w,U=this.resolve(_,w);if(!U){let D=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(D)}let G=g.get(U);if(!G)KF.toJS(U,null,w),G=g.get(U);if(G?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(v>=0){if(G.count+=1,G.aliasCount===0)G.aliasCount=q1(_,U,g);if(G.count*G.aliasCount>v)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return G.res}toString($,w,g){let _=`*${this.source}`;if($){if(VF.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let v=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(v)}if($.implicitKey)return`${_} `}return _}}function q1($,w,g){if(D6.isAlias(w)){let _=w.resolve($),v=g&&_&&g.get(_);return v?v.count*v.aliasCount:0}else if(D6.isCollection(w)){let _=0;for(let v of w.items){let U=q1($,v,g);if(U>_)_=U}return _}else if(D6.isPair(w)){let _=q1($,w.key,g),v=q1($,w.value,g);return Math.max(_,v)}return 1}OF.Alias=KQ});var q$=E((zF)=>{var PF=$$(),kF=H1(),nF=Bv(),MF=($)=>!$||typeof $!=="function"&&typeof $!=="object";class dv extends kF.NodeBase{constructor($){super(PF.SCALAR);this.value=$}toJSON($,w){return w?.keep?this.value:nF.toJS(this.value,$,w)}toString(){return String(this.value)}}dv.BLOCK_FOLDED="BLOCK_FOLDED";dv.BLOCK_LITERAL="BLOCK_LITERAL";dv.PLAIN="PLAIN";dv.QUOTE_DOUBLE="QUOTE_DOUBLE";dv.QUOTE_SINGLE="QUOTE_SINGLE";zF.Scalar=dv;zF.isScalarValue=MF});var H_=E((CF)=>{var SF=W_(),ov=$$(),OQ=q$(),iF="tag:yaml.org,2002:";function TF($,w,g){if(w){let _=g.filter((U)=>U.tag===w),v=_.find((U)=>!U.format)??_[0];if(!v)throw Error(`Tag ${w} not found`);return v}return g.find((_)=>_.identify?.($)&&!_.format)}function RF($,w,g){if(ov.isDocument($))$=$.contents;if(ov.isNode($))return $;if(ov.isPair($)){let Y=g.schema[ov.MAP].createNode?.(g.schema,null,g);return Y.items.push($),Y}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:_,onAnchor:v,onTagObj:U,schema:G,sourceObjects:D}=g,J=void 0;if(_&&$&&typeof $==="object")if(J=D.get($),J)return J.anchor??(J.anchor=v($)),new SF.Alias(J.anchor);else J={anchor:null,node:null},D.set($,J);if(w?.startsWith("!!"))w=iF+w.slice(2);let X=TF($,w,G.tags);if(!X){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let Y=new OQ.Scalar($);if(J)J.node=Y;return Y}X=$ instanceof Map?G[ov.MAP]:(Symbol.iterator in Object($))?G[ov.SEQ]:G[ov.MAP]}if(U)U(X),delete g.onTagObj;let Q=X?.createNode?X.createNode(g.schema,$,g):typeof X?.nodeClass?.from==="function"?X.nodeClass.from(g.schema,$,g):new OQ.Scalar($);if(w)Q.tag=w;else if(!X.default)Q.tag=X.tag;if(J)J.node=Q;return Q}CF.createNode=RF});var B1=E((xF)=>{var EF=H_(),Lw=$$(),ZF=H1();function E9($,w,g){let _=g;for(let v=w.length-1;v>=0;--v){let U=w[v];if(typeof U==="number"&&Number.isInteger(U)&&U>=0){let G=[];G[U]=_,_=G}else _=new Map([[U,_]])}return EF.createNode(_,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var NQ=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class PQ extends ZF.NodeBase{constructor($,w){super($);Object.defineProperty(this,"schema",{value:w,configurable:!0,enumerable:!1,writable:!0})}clone($){let w=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)w.schema=$;if(w.items=w.items.map((g)=>Lw.isNode(g)||Lw.isPair(g)?g.clone($):g),this.range)w.range=this.range.slice();return w}addIn($,w){if(NQ($))this.add(w);else{let[g,..._]=$,v=this.get(g,!0);if(Lw.isCollection(v))v.addIn(_,w);else if(v===void 0&&this.schema)this.set(g,E9(this.schema,_,w));else throw Error(`Expected YAML collection at ${g}. Remaining path: ${_}`)}}deleteIn($){let[w,...g]=$;if(g.length===0)return this.delete(w);let _=this.get(w,!0);if(Lw.isCollection(_))return _.deleteIn(g);else throw Error(`Expected YAML collection at ${w}. Remaining path: ${g}`)}getIn($,w){let[g,..._]=$,v=this.get(g,!0);if(_.length===0)return!w&&Lw.isScalar(v)?v.value:v;else return Lw.isCollection(v)?v.getIn(_,w):void 0}hasAllNullValues($){return this.items.every((w)=>{if(!Lw.isPair(w))return!1;let g=w.value;return g==null||$&&Lw.isScalar(g)&&g.value==null&&!g.commentBefore&&!g.comment&&!g.tag})}hasIn($){let[w,...g]=$;if(g.length===0)return this.has(w);let _=this.get(w,!0);return Lw.isCollection(_)?_.hasIn(g):!1}setIn($,w){let[g,..._]=$;if(_.length===0)this.set(g,w);else{let v=this.get(g,!0);if(Lw.isCollection(v))v.setIn(_,w);else if(v===void 0&&this.schema)this.set(g,E9(this.schema,_,w));else throw Error(`Expected YAML collection at ${g}. Remaining path: ${_}`)}}}xF.Collection=PQ;xF.collectionFromPath=E9;xF.isEmptyPath=NQ});var q_=E((tF)=>{var yF=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Z9($,w){if(/^\n+$/.test($))return $.substring(1);return w?$.replace(/^(?! *$)/gm,w):$}var mF=($,w,g)=>$.endsWith(`
|
|
3
|
+
`)?Z9(g,w):g.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+Z9(g,w):($.endsWith(" ")?"":" ")+g;tF.indentComment=Z9;tF.lineComment=mF;tF.stringifyComment=yF});var nQ=E((eF)=>{function pF($,w,g="flow",{indentAtStart:_,lineWidth:v=80,minContentWidth:U=20,onFold:G,onOverflow:D}={}){if(!v||v<0)return $;if(v<U)U=0;let J=Math.max(1+U,1+v-w.length);if($.length<=J)return $;let X=[],Q={},Y=v-w.length;if(typeof _==="number")if(_>v-Math.max(2,U))X.push(0);else Y=v-_;let q=void 0,L=void 0,F=!1,H=-1,V=-1,K=-1;if(g==="block"){if(H=kQ($,H,w.length),H!==-1)Y=H+J}for(let S;S=$[H+=1];){if(g==="quoted"&&S==="\\"){switch(V=H,$[H+1]){case"x":H+=3;break;case"u":H+=5;break;case"U":H+=9;break;default:H+=1}K=H}if(S===`
|
|
6
|
+
`){if(g==="block")H=kQ($,H,w.length);Y=H+w.length+J,q=void 0}else{if(S===" "&&L&&L!==" "&&L!==`
|
|
7
|
+
`&&L!=="\t"){let u=$[H+1];if(u&&u!==" "&&u!==`
|
|
8
|
+
`&&u!=="\t")q=H}if(H>=Y)if(q)X.push(q),Y=q+J,q=void 0;else if(g==="quoted"){while(L===" "||L==="\t")L=S,S=$[H+=1],F=!0;let u=H>K+1?H-2:V-1;if(Q[u])return $;X.push(u),Q[u]=!0,Y=u+J,q=void 0}else F=!0}L=S}if(F&&D)D();if(X.length===0)return $;if(G)G();let f=$.slice(0,X[0]);for(let S=0;S<X.length;++S){let u=X[S],Z=X[S+1]||$.length;if(u===0)f=`
|
|
9
|
+
${w}${$.slice(0,Z)}`;else{if(g==="quoted"&&Q[u])f+=`${$[u]}\\`;f+=`
|
|
10
|
+
${w}${$.slice(u+1,Z)}`}}return f}function kQ($,w,g){let _=w,v=w+1,U=$[v];while(U===" "||U==="\t")if(w<v+g)U=$[++w];else{do U=$[++w];while(U&&U!==`
|
|
11
|
+
`);_=w,v=w+1,U=$[v]}return _}eF.FOLD_BLOCK="block";eF.FOLD_FLOW="flow";eF.FOLD_QUOTED="quoted";eF.foldFlowLines=pF});var I_=E((Uj)=>{var ww=q$(),Iv=nQ(),L1=($,w)=>({indentAtStart:w?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),V1=($)=>/^(%|---|\.\.\.)/m.test($);function vj($,w,g){if(!w||w<0)return!1;let _=w-g,v=$.length;if(v<=_)return!1;for(let U=0,G=0;U<v;++U)if($[U]===`
|
|
12
|
+
`){if(U-G>_)return!0;if(G=U+1,v-G<=_)return!1}return!0}function B_($,w){let g=JSON.stringify($);if(w.options.doubleQuotedAsJSON)return g;let{implicitKey:_}=w,v=w.options.doubleQuotedMinMultiLineLength,U=w.indent||(V1($)?" ":""),G="",D=0;for(let J=0,X=g[J];X;X=g[++J]){if(X===" "&&g[J+1]==="\\"&&g[J+2]==="n")G+=g.slice(D,J)+"\\ ",J+=1,D=J,X="\\";if(X==="\\")switch(g[J+1]){case"u":{G+=g.slice(D,J);let Q=g.substr(J+2,4);switch(Q){case"0000":G+="\\0";break;case"0007":G+="\\a";break;case"000b":G+="\\v";break;case"001b":G+="\\e";break;case"0085":G+="\\N";break;case"00a0":G+="\\_";break;case"2028":G+="\\L";break;case"2029":G+="\\P";break;default:if(Q.substr(0,2)==="00")G+="\\x"+Q.substr(2);else G+=g.substr(J,6)}J+=5,D=J+1}break;case"n":if(_||g[J+2]==='"'||g.length<v)J+=1;else{G+=g.slice(D,J)+`
|
|
13
|
+
|
|
14
|
+
`;while(g[J+2]==="\\"&&g[J+3]==="n"&&g[J+4]!=='"')G+=`
|
|
15
|
+
`,J+=2;if(G+=U,g[J+2]===" ")G+="\\";J+=1,D=J+1}break;default:J+=1}}return G=D?G+g.slice(D):g,_?G:Iv.foldFlowLines(G,U,Iv.FOLD_QUOTED,L1(w,!1))}function x9($,w){if(w.options.singleQuote===!1||w.implicitKey&&$.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test($))return B_($,w);let g=w.indent||(V1($)?" ":""),_="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${g}`)+"'";return w.implicitKey?_:Iv.foldFlowLines(_,g,Iv.FOLD_FLOW,L1(w,!1))}function J6($,w){let{singleQuote:g}=w.options,_;if(g===!1)_=B_;else{let v=$.includes('"'),U=$.includes("'");if(v&&!U)_=x9;else if(U&&!v)_=B_;else _=g?x9:B_}return _($,w)}var h9;try{h9=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{h9=/\n+(?!\n|$)/g}function I1({comment:$,type:w,value:g},_,v,U){let{blockQuote:G,commentString:D,lineWidth:J}=_.options;if(!G||/\n[\t ]+$/.test(g))return J6(g,_);let X=_.indent||(_.forceBlockIndent||V1(g)?" ":""),Q=G==="literal"?!0:G==="folded"||w===ww.Scalar.BLOCK_FOLDED?!1:w===ww.Scalar.BLOCK_LITERAL?!0:!vj(g,J,X.length);if(!g)return Q?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let Y,q;for(q=g.length;q>0;--q){let Z=g[q-1];if(Z!==`
|
|
23
|
+
`&&Z!=="\t"&&Z!==" ")break}let L=g.substring(q),F=L.indexOf(`
|
|
24
|
+
`);if(F===-1)Y="-";else if(g===L||F!==L.length-1){if(Y="+",U)U()}else Y="";if(L){if(g=g.slice(0,-L.length),L[L.length-1]===`
|
|
25
|
+
`)L=L.slice(0,-1);L=L.replace(h9,`$&${X}`)}let H=!1,V,K=-1;for(V=0;V<g.length;++V){let Z=g[V];if(Z===" ")H=!0;else if(Z===`
|
|
26
|
+
`)K=V;else break}let f=g.substring(0,K<V?K+1:V);if(f)g=g.substring(f.length),f=f.replace(/\n+/g,`$&${X}`);let u=(H?X?"2":"1":"")+Y;if($){if(u+=" "+D($.replace(/ ?[\r\n]+/g," ")),v)v()}if(!Q){let Z=g.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${X}`),i=!1,c=L1(_,!0);if(G!=="folded"&&w!==ww.Scalar.BLOCK_FOLDED)c.onOverflow=()=>{i=!0};let x=Iv.foldFlowLines(`${f}${Z}${L}`,X,Iv.FOLD_BLOCK,c);if(!i)return`>${u}
|
|
28
|
+
${X}${x}`}return g=g.replace(/\n+/g,`$&${X}`),`|${u}
|
|
29
|
+
${X}${f}${g}${L}`}function gj($,w,g,_){let{type:v,value:U}=$,{actualString:G,implicitKey:D,indent:J,indentStep:X,inFlow:Q}=w;if(D&&U.includes(`
|
|
30
|
+
`)||Q&&/[[\]{},]/.test(U))return J6(U,w);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(U))return D||Q||!U.includes(`
|
|
31
|
+
`)?J6(U,w):I1($,w,g,_);if(!D&&!Q&&v!==ww.Scalar.PLAIN&&U.includes(`
|
|
32
|
+
`))return I1($,w,g,_);if(V1(U)){if(J==="")return w.forceBlockIndent=!0,I1($,w,g,_);else if(D&&J===X)return J6(U,w)}let Y=U.replace(/\n+/g,`$&
|
|
33
|
+
${J}`);if(G){let q=(H)=>H.default&&H.tag!=="tag:yaml.org,2002:str"&&H.test?.test(Y),{compat:L,tags:F}=w.doc.schema;if(F.some(q)||L?.some(q))return J6(U,w)}return D?Y:Iv.foldFlowLines(Y,J,Iv.FOLD_FLOW,L1(w,!1))}function _j($,w,g,_){let{implicitKey:v,inFlow:U}=w,G=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:D}=$;if(D!==ww.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(G.value))D=ww.Scalar.QUOTE_DOUBLE}let J=(Q)=>{switch(Q){case ww.Scalar.BLOCK_FOLDED:case ww.Scalar.BLOCK_LITERAL:return v||U?J6(G.value,w):I1(G,w,g,_);case ww.Scalar.QUOTE_DOUBLE:return B_(G.value,w);case ww.Scalar.QUOTE_SINGLE:return x9(G.value,w);case ww.Scalar.PLAIN:return gj(G,w,g,_);default:return null}},X=J(D);if(X===null){let{defaultKeyType:Q,defaultStringType:Y}=w.options,q=v&&Q||Y;if(X=J(q),X===null)throw Error(`Unsupported default string type ${q}`)}return X}Uj.stringifyString=_j});var L_=E((Hj)=>{var Gj=W1(),Lv=$$(),Dj=q_(),Jj=I_();function Xj($,w){let g=Object.assign({blockQuote:!0,commentString:Dj.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,w),_;switch(g.collectionStyle){case"block":_=!1;break;case"flow":_=!0;break;default:_=null}return{anchors:new Set,doc:$,flowCollectionPadding:g.flowCollectionPadding?" ":"",indent:"",indentStep:typeof g.indent==="number"?" ".repeat(g.indent):" ",inFlow:_,options:g}}function Qj($,w){if(w.tag){let v=$.filter((U)=>U.tag===w.tag);if(v.length>0)return v.find((U)=>U.format===w.format)??v[0]}let g=void 0,_;if(Lv.isScalar(w)){_=w.value;let v=$.filter((U)=>U.identify?.(_));if(v.length>1){let U=v.filter((G)=>G.test);if(U.length>0)v=U}g=v.find((U)=>U.format===w.format)??v.find((U)=>!U.format)}else _=w,g=$.find((v)=>v.nodeClass&&_ instanceof v.nodeClass);if(!g){let v=_?.constructor?.name??(_===null?"null":typeof _);throw Error(`Tag not resolved for ${v} value`)}return g}function Yj($,w,{anchors:g,doc:_}){if(!_.directives)return"";let v=[],U=(Lv.isScalar($)||Lv.isCollection($))&&$.anchor;if(U&&Gj.anchorIsValid(U))g.add(U),v.push(`&${U}`);let G=$.tag??(w.default?null:w.tag);if(G)v.push(_.directives.tagString(G));return v.join(" ")}function Wj($,w,g,_){if(Lv.isPair($))return $.toString(w,g,_);if(Lv.isAlias($)){if(w.doc.directives)return $.toString(w);if(w.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(w.resolvedAliases)w.resolvedAliases.add($);else w.resolvedAliases=new Set([$]);$=$.resolve(w.doc)}}let v=void 0,U=Lv.isNode($)?$:w.doc.createNode($,{onTagObj:(J)=>v=J});v??(v=Qj(w.doc.schema.tags,U));let G=Yj(U,v,w);if(G.length>0)w.indentAtStart=(w.indentAtStart??0)+G.length+1;let D=typeof v.stringify==="function"?v.stringify(U,w,g,_):Lv.isScalar(U)?Jj.stringifyString(U,w,g,_):U.toString(w,g,_);if(!G)return D;return Lv.isScalar(U)||D[0]==="{"||D[0]==="["?`${G} ${D}`:`${G}
|
|
34
|
+
${w.indent}${D}`}Hj.createStringifyContext=Xj;Hj.stringify=Wj});var fQ=E((Lj)=>{var Sw=$$(),MQ=q$(),zQ=L_(),V_=q_();function Ij({key:$,value:w},g,_,v){let{allNullValues:U,doc:G,indent:D,indentStep:J,options:{commentString:X,indentSeq:Q,simpleKeys:Y}}=g,q=Sw.isNode($)&&$.comment||null;if(Y){if(q)throw Error("With simple keys, key nodes cannot have comments");if(Sw.isCollection($)||!Sw.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let L=!Y&&(!$||q&&w==null&&!g.inFlow||Sw.isCollection($)||(Sw.isScalar($)?$.type===MQ.Scalar.BLOCK_FOLDED||$.type===MQ.Scalar.BLOCK_LITERAL:typeof $==="object"));g=Object.assign({},g,{allNullValues:!1,implicitKey:!L&&(Y||!U),indent:D+J});let F=!1,H=!1,V=zQ.stringify($,g,()=>F=!0,()=>H=!0);if(!L&&!g.inFlow&&V.length>1024){if(Y)throw Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(g.inFlow){if(U||w==null){if(F&&_)_();return V===""?"?":L?`? ${V}`:V}}else if(U&&!Y||w==null&&L){if(V=`? ${V}`,q&&!F)V+=V_.lineComment(V,g.indent,X(q));else if(H&&v)v();return V}if(F)q=null;if(L){if(q)V+=V_.lineComment(V,g.indent,X(q));V=`? ${V}
|
|
35
|
+
${D}:`}else if(V=`${V}:`,q)V+=V_.lineComment(V,g.indent,X(q));let K,f,S;if(Sw.isNode(w))K=!!w.spaceBefore,f=w.commentBefore,S=w.comment;else if(K=!1,f=null,S=null,w&&typeof w==="object")w=G.createNode(w);if(g.implicitKey=!1,!L&&!q&&Sw.isScalar(w))g.indentAtStart=V.length+1;if(H=!1,!Q&&J.length>=2&&!g.inFlow&&!L&&Sw.isSeq(w)&&!w.flow&&!w.tag&&!w.anchor)g.indent=g.indent.substring(2);let u=!1,Z=zQ.stringify(w,g,()=>u=!0,()=>H=!0),i=" ";if(q||K||f){if(i=K?`
|
|
36
|
+
`:"",f){let c=X(f);i+=`
|
|
37
|
+
${V_.indentComment(c,g.indent)}`}if(Z===""&&!g.inFlow){if(i===`
|
|
38
|
+
`&&S)i=`
|
|
39
|
+
|
|
40
|
+
`}else i+=`
|
|
41
|
+
${g.indent}`}else if(!L&&Sw.isCollection(w)){let c=Z[0],x=Z.indexOf(`
|
|
42
|
+
`),G$=x!==-1,r$=g.inFlow??w.flow??w.items.length===0;if(G$||!r$){let D4=!1;if(G$&&(c==="&"||c==="!")){let B$=Z.indexOf(" ");if(c==="&"&&B$!==-1&&B$<x&&Z[B$+1]==="!")B$=Z.indexOf(" ",B$+1);if(B$===-1||x<B$)D4=!0}if(!D4)i=`
|
|
43
|
+
${g.indent}`}}else if(Z===""||Z[0]===`
|
|
44
|
+
`)i="";if(V+=i+Z,g.inFlow){if(u&&_)_()}else if(S&&!u)V+=V_.lineComment(V,g.indent,X(S));else if(H&&v)v();return V}Lj.stringifyPair=Ij});var l9=E((Kj)=>{var AQ=J4("process");function Fj($,...w){if($==="debug")console.log(...w)}function jj($,w){if($==="debug"||$==="warn")if(typeof AQ.emitWarning==="function")AQ.emitWarning(w);else console.warn(w)}Kj.debug=Fj;Kj.warn=jj});var K1=E((kj)=>{var F_=$$(),SQ=q$(),F1="<<",j1={identify:($)=>$===F1||typeof $==="symbol"&&$.description===F1,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new SQ.Scalar(Symbol(F1)),{addToJSMap:iQ}),stringify:()=>F1},Pj=($,w)=>(j1.identify(w)||F_.isScalar(w)&&(!w.type||w.type===SQ.Scalar.PLAIN)&&j1.identify(w.value))&&$?.doc.schema.tags.some((g)=>g.tag===j1.tag&&g.default);function iQ($,w,g){if(g=$&&F_.isAlias(g)?g.resolve($.doc):g,F_.isSeq(g))for(let _ of g.items)c9($,w,_);else if(Array.isArray(g))for(let _ of g)c9($,w,_);else c9($,w,g)}function c9($,w,g){let _=$&&F_.isAlias(g)?g.resolve($.doc):g;if(!F_.isMap(_))throw Error("Merge sources must be maps or map aliases");let v=_.toJSON(null,$,Map);for(let[U,G]of v)if(w instanceof Map){if(!w.has(U))w.set(U,G)}else if(w instanceof Set)w.add(U);else if(!Object.prototype.hasOwnProperty.call(w,U))Object.defineProperty(w,U,{value:G,writable:!0,enumerable:!0,configurable:!0});return w}kj.addMergeToJSMap=iQ;kj.isMergeKey=Pj;kj.merge=j1});var m9=E((Tj)=>{var fj=l9(),TQ=K1(),Aj=L_(),RQ=$$(),y9=Bv();function Sj($,w,{key:g,value:_}){if(RQ.isNode(g)&&g.addToJSMap)g.addToJSMap($,w,_);else if(TQ.isMergeKey($,g))TQ.addMergeToJSMap($,w,_);else{let v=y9.toJS(g,"",$);if(w instanceof Map)w.set(v,y9.toJS(_,v,$));else if(w instanceof Set)w.add(v);else{let U=ij(g,v,$),G=y9.toJS(_,U,$);if(U in w)Object.defineProperty(w,U,{value:G,writable:!0,enumerable:!0,configurable:!0});else w[U]=G}}return w}function ij($,w,g){if(w===null)return"";if(typeof w!=="object")return String(w);if(RQ.isNode($)&&g?.doc){let _=Aj.createStringifyContext(g.doc,{});_.anchors=new Set;for(let U of g.anchors.keys())_.anchors.add(U.anchor);_.inFlow=!0,_.inStringifyKey=!0;let v=$.toString(_);if(!g.mapKeyWarned){let U=JSON.stringify(v);if(U.length>40)U=U.substring(0,36)+'..."';fj.warn(g.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${U}. Set mapAsMap: true to use object keys.`),g.mapKeyWarned=!0}return v}return JSON.stringify(w)}Tj.addPairToJSMap=Sj});var Vv=E((Zj)=>{var CQ=H_(),Cj=fQ(),uj=m9(),O1=$$();function Ej($,w,g){let _=CQ.createNode($,void 0,g),v=CQ.createNode(w,void 0,g);return new N1(_,v)}class N1{constructor($,w=null){Object.defineProperty(this,O1.NODE_TYPE,{value:O1.PAIR}),this.key=$,this.value=w}clone($){let{key:w,value:g}=this;if(O1.isNode(w))w=w.clone($);if(O1.isNode(g))g=g.clone($);return new N1(w,g)}toJSON($,w){let g=w?.mapAsMap?new Map:{};return uj.addPairToJSMap(w,g,this)}toString($,w,g){return $?.doc?Cj.stringifyPair(this,$,w,g):JSON.stringify(this)}}Zj.Pair=N1;Zj.createPair=Ej});var t9=E((mj)=>{var rv=$$(),uQ=L_(),P1=q_();function lj($,w,g){return(w.inFlow??$.flow?yj:cj)($,w,g)}function cj({comment:$,items:w},g,{blockItemPrefix:_,flowChars:v,itemIndent:U,onChompKeep:G,onComment:D}){let{indent:J,options:{commentString:X}}=g,Q=Object.assign({},g,{indent:U,type:null}),Y=!1,q=[];for(let F=0;F<w.length;++F){let H=w[F],V=null;if(rv.isNode(H)){if(!Y&&H.spaceBefore)q.push("");if(k1(g,q,H.commentBefore,Y),H.comment)V=H.comment}else if(rv.isPair(H)){let f=rv.isNode(H.key)?H.key:null;if(f){if(!Y&&f.spaceBefore)q.push("");k1(g,q,f.commentBefore,Y)}}Y=!1;let K=uQ.stringify(H,Q,()=>V=null,()=>Y=!0);if(V)K+=P1.lineComment(K,U,X(V));if(Y&&V)Y=!1;q.push(_+K)}let L;if(q.length===0)L=v.start+v.end;else{L=q[0];for(let F=1;F<q.length;++F){let H=q[F];L+=H?`
|
|
45
|
+
${J}${H}`:`
|
|
46
|
+
`}}if($){if(L+=`
|
|
47
|
+
`+P1.indentComment(X($),J),D)D()}else if(Y&&G)G();return L}function yj({items:$},w,{flowChars:g,itemIndent:_}){let{indent:v,indentStep:U,flowCollectionPadding:G,options:{commentString:D}}=w;_+=U;let J=Object.assign({},w,{indent:_,inFlow:!0,type:null}),X=!1,Q=0,Y=[];for(let F=0;F<$.length;++F){let H=$[F],V=null;if(rv.isNode(H)){if(H.spaceBefore)Y.push("");if(k1(w,Y,H.commentBefore,!1),H.comment)V=H.comment}else if(rv.isPair(H)){let f=rv.isNode(H.key)?H.key:null;if(f){if(f.spaceBefore)Y.push("");if(k1(w,Y,f.commentBefore,!1),f.comment)X=!0}let S=rv.isNode(H.value)?H.value:null;if(S){if(S.comment)V=S.comment;if(S.commentBefore)X=!0}else if(H.value==null&&f?.comment)V=f.comment}if(V)X=!0;let K=uQ.stringify(H,J,()=>V=null);if(F<$.length-1)K+=",";if(V)K+=P1.lineComment(K,_,D(V));if(!X&&(Y.length>Q||K.includes(`
|
|
48
|
+
`)))X=!0;Y.push(K),Q=Y.length}let{start:q,end:L}=g;if(Y.length===0)return q+L;else{if(!X){let F=Y.reduce((H,V)=>H+V.length+2,2);X=w.options.lineWidth>0&&F>w.options.lineWidth}if(X){let F=q;for(let H of Y)F+=H?`
|
|
49
|
+
${U}${v}${H}`:`
|
|
50
|
+
`;return`${F}
|
|
51
|
+
${v}${L}`}else return`${q}${G}${Y.join(" ")}${G}${L}`}}function k1({indent:$,options:{commentString:w}},g,_,v){if(_&&v)_=_.replace(/^\n+/,"");if(_){let U=P1.indentComment(w(_),$);g.push(U.trimStart())}}mj.stringifyCollection=lj});var jv=E((ej)=>{var dj=t9(),oj=m9(),rj=B1(),Fv=$$(),n1=Vv(),pj=q$();function j_($,w){let g=Fv.isScalar(w)?w.value:w;for(let _ of $)if(Fv.isPair(_)){if(_.key===w||_.key===g)return _;if(Fv.isScalar(_.key)&&_.key.value===g)return _}return}class EQ extends rj.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(Fv.MAP,$);this.items=[]}static from($,w,g){let{keepUndefined:_,replacer:v}=g,U=new this($),G=(D,J)=>{if(typeof v==="function")J=v.call(w,D,J);else if(Array.isArray(v)&&!v.includes(D))return;if(J!==void 0||_)U.items.push(n1.createPair(D,J,g))};if(w instanceof Map)for(let[D,J]of w)G(D,J);else if(w&&typeof w==="object")for(let D of Object.keys(w))G(D,w[D]);if(typeof $.sortMapEntries==="function")U.items.sort($.sortMapEntries);return U}add($,w){let g;if(Fv.isPair($))g=$;else if(!$||typeof $!=="object"||!("key"in $))g=new n1.Pair($,$?.value);else g=new n1.Pair($.key,$.value);let _=j_(this.items,g.key),v=this.schema?.sortMapEntries;if(_){if(!w)throw Error(`Key ${g.key} already set`);if(Fv.isScalar(_.value)&&pj.isScalarValue(g.value))_.value.value=g.value;else _.value=g.value}else if(v){let U=this.items.findIndex((G)=>v(g,G)<0);if(U===-1)this.items.push(g);else this.items.splice(U,0,g)}else this.items.push(g)}delete($){let w=j_(this.items,$);if(!w)return!1;return this.items.splice(this.items.indexOf(w),1).length>0}get($,w){let _=j_(this.items,$)?.value;return(!w&&Fv.isScalar(_)?_.value:_)??void 0}has($){return!!j_(this.items,$)}set($,w){this.add(new n1.Pair($,w),!0)}toJSON($,w,g){let _=g?new g:w?.mapAsMap?new Map:{};if(w?.onCreate)w.onCreate(_);for(let v of this.items)oj.addPairToJSMap(w,_,v);return _}toString($,w,g){if(!$)return JSON.stringify(this);for(let _ of this.items)if(!Fv.isPair(_))throw Error(`Map items must all be pairs; found ${JSON.stringify(_)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return dj.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:g,onComment:w})}}ej.YAMLMap=EQ;ej.findPair=j_});var X6=E((vK)=>{var $K=$$(),ZQ=jv(),wK={collection:"map",default:!0,nodeClass:ZQ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,w){if(!$K.isMap($))w("Expected a mapping for this tag");return $},createNode:($,w,g)=>ZQ.YAMLMap.from($,w,g)};vK.map=wK});var Kv=E((JK)=>{var _K=H_(),UK=t9(),bK=B1(),z1=$$(),GK=q$(),DK=Bv();class xQ extends bK.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(z1.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let w=M1($);if(typeof w!=="number")return!1;return this.items.splice(w,1).length>0}get($,w){let g=M1($);if(typeof g!=="number")return;let _=this.items[g];return!w&&z1.isScalar(_)?_.value:_}has($){let w=M1($);return typeof w==="number"&&w<this.items.length}set($,w){let g=M1($);if(typeof g!=="number")throw Error(`Expected a valid index, not ${$}.`);let _=this.items[g];if(z1.isScalar(_)&&GK.isScalarValue(w))_.value=w;else this.items[g]=w}toJSON($,w){let g=[];if(w?.onCreate)w.onCreate(g);let _=0;for(let v of this.items)g.push(DK.toJS(v,String(_++),w));return g}toString($,w,g){if(!$)return JSON.stringify(this);return UK.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:g,onComment:w})}static from($,w,g){let{replacer:_}=g,v=new this($);if(w&&Symbol.iterator in Object(w)){let U=0;for(let G of w){if(typeof _==="function"){let D=w instanceof Set?G:String(U++);G=_.call(w,D,G)}v.items.push(_K.createNode(G,void 0,g))}}return v}}function M1($){let w=z1.isScalar($)?$.value:$;if(w&&typeof w==="string")w=Number(w);return typeof w==="number"&&Number.isInteger(w)&&w>=0?w:null}JK.YAMLSeq=xQ});var Q6=E((WK)=>{var QK=$$(),hQ=Kv(),YK={collection:"seq",default:!0,nodeClass:hQ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,w){if(!QK.isSeq($))w("Expected a sequence for this tag");return $},createNode:($,w,g)=>hQ.YAMLSeq.from($,w,g)};WK.seq=YK});var K_=E((IK)=>{var qK=I_(),BK={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,w,g,_){return w=Object.assign({actualString:!0},w),qK.stringifyString($,w,g,_)}};IK.string=BK});var f1=E((VK)=>{var lQ=q$(),cQ={identify:($)=>$==null,createNode:()=>new lQ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new lQ.Scalar(null),stringify:({source:$},w)=>typeof $==="string"&&cQ.test.test($)?$:w.options.nullStr};VK.nullTag=cQ});var d9=E((KK)=>{var jK=q$(),yQ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new jK.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:w},g){if($&&yQ.test.test($)){let _=$[0]==="t"||$[0]==="T";if(w===_)return $}return w?g.options.trueStr:g.options.falseStr}};KK.boolTag=yQ});var Y6=E((PK)=>{function NK({format:$,minFractionDigits:w,tag:g,value:_}){if(typeof _==="bigint")return String(_);let v=typeof _==="number"?_:Number(_);if(!isFinite(v))return isNaN(v)?".nan":v<0?"-.inf":".inf";let U=Object.is(_,-0)?"-0":JSON.stringify(_);if(!$&&w&&(!g||g==="tag:yaml.org,2002:float")&&/^\d/.test(U)){let G=U.indexOf(".");if(G<0)G=U.length,U+=".";let D=w-(U.length-G-1);while(D-- >0)U+="0"}return U}PK.stringifyNumber=NK});var r9=E((AK)=>{var nK=q$(),o9=Y6(),MK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:o9.stringifyNumber},zK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let w=Number($.value);return isFinite(w)?w.toExponential():o9.stringifyNumber($)}},fK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let w=new nK.Scalar(parseFloat($)),g=$.indexOf(".");if(g!==-1&&$[$.length-1]==="0")w.minFractionDigits=$.length-g-1;return w},stringify:o9.stringifyNumber};AK.float=fK;AK.floatExp=zK;AK.floatNaN=MK});var e9=E((EK)=>{var mQ=Y6(),A1=($)=>typeof $==="bigint"||Number.isInteger($),p9=($,w,g,{intAsBigInt:_})=>_?BigInt($):parseInt($.substring(w),g);function tQ($,w,g){let{value:_}=$;if(A1(_)&&_>=0)return g+_.toString(w);return mQ.stringifyNumber($)}var RK={identify:($)=>A1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,w,g)=>p9($,2,8,g),stringify:($)=>tQ($,8,"0o")},CK={identify:A1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,w,g)=>p9($,0,10,g),stringify:mQ.stringifyNumber},uK={identify:($)=>A1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,w,g)=>p9($,2,16,g),stringify:($)=>tQ($,16,"0x")};EK.int=CK;EK.intHex=uK;EK.intOct=RK});var dQ=E((oK)=>{var lK=X6(),cK=f1(),yK=Q6(),mK=K_(),tK=d9(),a9=r9(),s9=e9(),dK=[lK.map,yK.seq,mK.string,cK.nullTag,tK.boolTag,s9.intOct,s9.int,s9.intHex,a9.floatNaN,a9.floatExp,a9.float];oK.schema=dK});var rQ=E((vO)=>{var pK=q$(),eK=X6(),aK=Q6();function oQ($){return typeof $==="bigint"||Number.isInteger($)}var S1=({value:$})=>JSON.stringify($),sK=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:S1},{identify:($)=>$==null,createNode:()=>new pK.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:S1},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:S1},{identify:oQ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,w,{intAsBigInt:g})=>g?BigInt($):parseInt($,10),stringify:({value:$})=>oQ($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:S1}],$O={default:!0,tag:"",test:/^/,resolve($,w){return w(`Unresolved plain scalar ${JSON.stringify($)}`),$}},wO=[eK.map,aK.seq].concat(sK,$O);vO.schema=wO});var w3=E((bO)=>{var O_=J4("buffer"),$3=q$(),_O=I_(),UO={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,w){if(typeof O_.Buffer==="function")return O_.Buffer.from($,"base64");else if(typeof atob==="function"){let g=atob($.replace(/[\n\r]/g,"")),_=new Uint8Array(g.length);for(let v=0;v<g.length;++v)_[v]=g.charCodeAt(v);return _}else return w("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:w,value:g},_,v,U){if(!g)return"";let G=g,D;if(typeof O_.Buffer==="function")D=G instanceof O_.Buffer?G.toString("base64"):O_.Buffer.from(G.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let X=0;X<G.length;++X)J+=String.fromCharCode(G[X]);D=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(w??(w=$3.Scalar.BLOCK_LITERAL),w!==$3.Scalar.QUOTE_DOUBLE){let J=Math.max(_.options.lineWidth-_.indent.length,_.options.minContentWidth),X=Math.ceil(D.length/J),Q=Array(X);for(let Y=0,q=0;Y<X;++Y,q+=J)Q[Y]=D.substr(q,J);D=Q.join(w===$3.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return _O.stringifyString({comment:$,type:w,value:D},_,v,U)}};bO.binary=UO});var T1=E((QO)=>{var i1=$$(),v3=Vv(),DO=q$(),JO=Kv();function pQ($,w){if(i1.isSeq($))for(let g=0;g<$.items.length;++g){let _=$.items[g];if(i1.isPair(_))continue;else if(i1.isMap(_)){if(_.items.length>1)w("Each pair must have its own sequence indicator");let v=_.items[0]||new v3.Pair(new DO.Scalar(null));if(_.commentBefore)v.key.commentBefore=v.key.commentBefore?`${_.commentBefore}
|
|
53
|
+
${v.key.commentBefore}`:_.commentBefore;if(_.comment){let U=v.value??v.key;U.comment=U.comment?`${_.comment}
|
|
54
|
+
${U.comment}`:_.comment}_=v}$.items[g]=i1.isPair(_)?_:new v3.Pair(_)}else w("Expected a sequence for this tag");return $}function eQ($,w,g){let{replacer:_}=g,v=new JO.YAMLSeq($);v.tag="tag:yaml.org,2002:pairs";let U=0;if(w&&Symbol.iterator in Object(w))for(let G of w){if(typeof _==="function")G=_.call(w,String(U++),G);let D,J;if(Array.isArray(G))if(G.length===2)D=G[0],J=G[1];else throw TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let X=Object.keys(G);if(X.length===1)D=X[0],J=G[D];else throw TypeError(`Expected tuple with one key, not ${X.length} keys`)}else D=G;v.items.push(v3.createPair(D,J,g))}return v}var XO={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:pQ,createNode:eQ};QO.createPairs=eQ;QO.pairs=XO;QO.resolvePairs=pQ});var _3=E((IO)=>{var aQ=$$(),g3=Bv(),N_=jv(),qO=Kv(),sQ=T1();class pv extends qO.YAMLSeq{constructor(){super();this.add=N_.YAMLMap.prototype.add.bind(this),this.delete=N_.YAMLMap.prototype.delete.bind(this),this.get=N_.YAMLMap.prototype.get.bind(this),this.has=N_.YAMLMap.prototype.has.bind(this),this.set=N_.YAMLMap.prototype.set.bind(this),this.tag=pv.tag}toJSON($,w){if(!w)return super.toJSON($);let g=new Map;if(w?.onCreate)w.onCreate(g);for(let _ of this.items){let v,U;if(aQ.isPair(_))v=g3.toJS(_.key,"",w),U=g3.toJS(_.value,v,w);else v=g3.toJS(_,"",w);if(g.has(v))throw Error("Ordered maps must not include duplicate keys");g.set(v,U)}return g}static from($,w,g){let _=sQ.createPairs($,w,g),v=new this;return v.items=_.items,v}}pv.tag="tag:yaml.org,2002:omap";var BO={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:pv,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,w){let g=sQ.resolvePairs($,w),_=[];for(let{key:v}of g.items)if(aQ.isScalar(v))if(_.includes(v.value))w(`Ordered maps must not include duplicate keys: ${v.value}`);else _.push(v.value);return Object.assign(new pv,g)},createNode:($,w,g)=>pv.from($,w,g)};IO.YAMLOMap=pv;IO.omap=BO});var _5=E((FO)=>{var $5=q$();function w5({value:$,source:w},g){if(w&&($?v5:g5).test.test(w))return w;return $?g.options.trueStr:g.options.falseStr}var v5={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $5.Scalar(!0),stringify:w5},g5={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $5.Scalar(!1),stringify:w5};FO.falseTag=g5;FO.trueTag=v5});var U5=E((nO)=>{var OO=q$(),U3=Y6(),NO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:U3.stringifyNumber},PO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let w=Number($.value);return isFinite(w)?w.toExponential():U3.stringifyNumber($)}},kO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let w=new OO.Scalar(parseFloat($.replace(/_/g,""))),g=$.indexOf(".");if(g!==-1){let _=$.substring(g+1).replace(/_/g,"");if(_[_.length-1]==="0")w.minFractionDigits=_.length}return w},stringify:U3.stringifyNumber};nO.float=kO;nO.floatExp=PO;nO.floatNaN=NO});var G5=E((RO)=>{var b5=Y6(),P_=($)=>typeof $==="bigint"||Number.isInteger($);function R1($,w,g,{intAsBigInt:_}){let v=$[0];if(v==="-"||v==="+")w+=1;if($=$.substring(w).replace(/_/g,""),_){switch(g){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let G=BigInt($);return v==="-"?BigInt(-1)*G:G}let U=parseInt($,g);return v==="-"?-1*U:U}function b3($,w,g){let{value:_}=$;if(P_(_)){let v=_.toString(w);return _<0?"-"+g+v.substr(1):g+v}return b5.stringifyNumber($)}var AO={identify:P_,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,w,g)=>R1($,2,2,g),stringify:($)=>b3($,2,"0b")},SO={identify:P_,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,w,g)=>R1($,1,8,g),stringify:($)=>b3($,8,"0")},iO={identify:P_,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,w,g)=>R1($,0,10,g),stringify:b5.stringifyNumber},TO={identify:P_,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,w,g)=>R1($,2,16,g),stringify:($)=>b3($,16,"0x")};RO.int=iO;RO.intBin=AO;RO.intHex=TO;RO.intOct=SO});var G3=E((hO)=>{var E1=$$(),C1=Vv(),u1=jv();class ev extends u1.YAMLMap{constructor($){super($);this.tag=ev.tag}add($){let w;if(E1.isPair($))w=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)w=new C1.Pair($.key,null);else w=new C1.Pair($,null);if(!u1.findPair(this.items,w.key))this.items.push(w)}get($,w){let g=u1.findPair(this.items,$);return!w&&E1.isPair(g)?E1.isScalar(g.key)?g.key.value:g.key:g}set($,w){if(typeof w!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof w}`);let g=u1.findPair(this.items,$);if(g&&!w)this.items.splice(this.items.indexOf(g),1);else if(!g&&w)this.items.push(new C1.Pair($))}toJSON($,w){return super.toJSON($,w,Set)}toString($,w,g){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),w,g);else throw Error("Set items must all have null values")}static from($,w,g){let{replacer:_}=g,v=new this($);if(w&&Symbol.iterator in Object(w))for(let U of w){if(typeof _==="function")U=_.call(w,U,U);v.items.push(C1.createPair(U,null,g))}return v}}ev.tag="tag:yaml.org,2002:set";var xO={collection:"map",identify:($)=>$ instanceof Set,nodeClass:ev,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,w,g)=>ev.from($,w,g),resolve($,w){if(E1.isMap($))if($.hasAllNullValues(!0))return Object.assign(new ev,$);else w("Set items must all have null values");else w("Expected a mapping for this tag");return $}};hO.YAMLSet=ev;hO.set=xO});var J3=E((dO)=>{var yO=Y6();function D3($,w){let g=$[0],_=g==="-"||g==="+"?$.substring(1):$,v=(G)=>w?BigInt(G):Number(G),U=_.replace(/_/g,"").split(":").reduce((G,D)=>G*v(60)+v(D),v(0));return g==="-"?v(-1)*U:U}function D5($){let{value:w}=$,g=(G)=>G;if(typeof w==="bigint")g=(G)=>BigInt(G);else if(isNaN(w)||!isFinite(w))return yO.stringifyNumber($);let _="";if(w<0)_="-",w*=g(-1);let v=g(60),U=[w%v];if(w<60)U.unshift(0);else if(w=(w-U[0])/v,U.unshift(w%v),w>=60)w=(w-U[0])/v,U.unshift(w);return _+U.map((G)=>String(G).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var mO={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,w,{intAsBigInt:g})=>D3($,g),stringify:D5},tO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>D3($,!1),stringify:D5},J5={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let w=$.match(J5.test);if(!w)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,g,_,v,U,G,D]=w.map(Number),J=w[7]?Number((w[7]+"00").substr(1,3)):0,X=Date.UTC(g,_-1,v,U||0,G||0,D||0,J),Q=w[8];if(Q&&Q!=="Z"){let Y=D3(Q,!1);if(Math.abs(Y)<30)Y*=60;X-=60000*Y}return new Date(X)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};dO.floatTime=tO;dO.intTime=mO;dO.timestamp=J5});var Q5=E((GN)=>{var eO=X6(),aO=f1(),sO=Q6(),$N=K_(),wN=w3(),X5=_5(),X3=U5(),Z1=G5(),vN=K1(),gN=_3(),_N=T1(),UN=G3(),Q3=J3(),bN=[eO.map,sO.seq,$N.string,aO.nullTag,X5.trueTag,X5.falseTag,Z1.intBin,Z1.intOct,Z1.int,Z1.intHex,X3.floatNaN,X3.floatExp,X3.float,wN.binary,vN.merge,gN.omap,_N.pairs,UN.set,Q3.intTime,Q3.floatTime,Q3.timestamp];GN.schema=bN});var j5=E((BN)=>{var q5=X6(),JN=f1(),B5=Q6(),XN=K_(),QN=d9(),Y3=r9(),W3=e9(),YN=dQ(),WN=rQ(),I5=w3(),k_=K1(),L5=_3(),V5=T1(),Y5=Q5(),F5=G3(),x1=J3(),W5=new Map([["core",YN.schema],["failsafe",[q5.map,B5.seq,XN.string]],["json",WN.schema],["yaml11",Y5.schema],["yaml-1.1",Y5.schema]]),H5={binary:I5.binary,bool:QN.boolTag,float:Y3.float,floatExp:Y3.floatExp,floatNaN:Y3.floatNaN,floatTime:x1.floatTime,int:W3.int,intHex:W3.intHex,intOct:W3.intOct,intTime:x1.intTime,map:q5.map,merge:k_.merge,null:JN.nullTag,omap:L5.omap,pairs:V5.pairs,seq:B5.seq,set:F5.set,timestamp:x1.timestamp},HN={"tag:yaml.org,2002:binary":I5.binary,"tag:yaml.org,2002:merge":k_.merge,"tag:yaml.org,2002:omap":L5.omap,"tag:yaml.org,2002:pairs":V5.pairs,"tag:yaml.org,2002:set":F5.set,"tag:yaml.org,2002:timestamp":x1.timestamp};function qN($,w,g){let _=W5.get(w);if(_&&!$)return g&&!_.includes(k_.merge)?_.concat(k_.merge):_.slice();let v=_;if(!v)if(Array.isArray($))v=[];else{let U=Array.from(W5.keys()).filter((G)=>G!=="yaml11").map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown schema "${w}"; use one of ${U} or define customTags array`)}if(Array.isArray($))for(let U of $)v=v.concat(U);else if(typeof $==="function")v=$(v.slice());if(g)v=v.concat(k_.merge);return v.reduce((U,G)=>{let D=typeof G==="string"?H5[G]:G;if(!D){let J=JSON.stringify(G),X=Object.keys(H5).map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${X}`)}if(!U.includes(D))U.push(D);return U},[])}BN.coreKnownTags=HN;BN.getTags=qN});var B3=E((ON)=>{var H3=$$(),VN=X6(),FN=Q6(),jN=K_(),h1=j5(),KN=($,w)=>$.key<w.key?-1:$.key>w.key?1:0;class q3{constructor({compat:$,customTags:w,merge:g,resolveKnownTags:_,schema:v,sortMapEntries:U,toStringDefaults:G}){this.compat=Array.isArray($)?h1.getTags($,"compat"):$?h1.getTags(null,$):null,this.name=typeof v==="string"&&v||"core",this.knownTags=_?h1.coreKnownTags:{},this.tags=h1.getTags(w,this.name,g),this.toStringOptions=G??null,Object.defineProperty(this,H3.MAP,{value:VN.map}),Object.defineProperty(this,H3.SCALAR,{value:jN.string}),Object.defineProperty(this,H3.SEQ,{value:FN.seq}),this.sortMapEntries=typeof U==="function"?U:U===!0?KN:null}clone(){let $=Object.create(q3.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}ON.Schema=q3});var K5=E((nN)=>{var PN=$$(),I3=L_(),n_=q_();function kN($,w){let g=[],_=w.directives===!0;if(w.directives!==!1&&$.directives){let J=$.directives.toString($);if(J)g.push(J),_=!0;else if($.directives.docStart)_=!0}if(_)g.push("---");let v=I3.createStringifyContext($,w),{commentString:U}=v.options;if($.commentBefore){if(g.length!==1)g.unshift("");let J=U($.commentBefore);g.unshift(n_.indentComment(J,""))}let G=!1,D=null;if($.contents){if(PN.isNode($.contents)){if($.contents.spaceBefore&&_)g.push("");if($.contents.commentBefore){let Q=U($.contents.commentBefore);g.push(n_.indentComment(Q,""))}v.forceBlockIndent=!!$.comment,D=$.contents.comment}let J=D?void 0:()=>G=!0,X=I3.stringify($.contents,v,()=>D=null,J);if(D)X+=n_.lineComment(X,"",U(D));if((X[0]==="|"||X[0]===">")&&g[g.length-1]==="---")g[g.length-1]=`--- ${X}`;else g.push(X)}else g.push(I3.stringify($.contents,v));if($.directives?.docEnd)if($.comment){let J=U($.comment);if(J.includes(`
|
|
55
|
+
`))g.push("..."),g.push(n_.indentComment(J,""));else g.push(`... ${J}`)}else g.push("...");else{let J=$.comment;if(J&&G)J=J.replace(/^\n+/,"");if(J){if((!G||D)&&g[g.length-1]!=="")g.push("");g.push(n_.indentComment(U(J),""))}}return g.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}nN.stringifyDocument=kN});var M_=E((CN)=>{var zN=W_(),W6=B1(),d$=$$(),fN=Vv(),AN=Bv(),SN=B3(),iN=K5(),L3=W1(),TN=u9(),RN=H_(),V3=C9();class F3{constructor($,w,g){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,d$.NODE_TYPE,{value:d$.DOC});let _=null;if(typeof w==="function"||Array.isArray(w))_=w;else if(g===void 0&&w)g=w,w=void 0;let v=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},g);this.options=v;let{version:U}=v;if(g?._directives){if(this.directives=g._directives.atDocument(),this.directives.yaml.explicit)U=this.directives.yaml.version}else this.directives=new V3.Directives({version:U});this.setSchema(U,g),this.contents=$===void 0?null:this.createNode($,_,g)}clone(){let $=Object.create(F3.prototype,{[d$.NODE_TYPE]:{value:d$.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=d$.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(H6(this.contents))this.contents.add($)}addIn($,w){if(H6(this.contents))this.contents.addIn($,w)}createAlias($,w){if(!$.anchor){let g=L3.anchorNames(this);$.anchor=!w||g.has(w)?L3.findNewAnchor(w||"a",g):w}return new zN.Alias($.anchor)}createNode($,w,g){let _=void 0;if(typeof w==="function")$=w.call({"":$},"",$),_=w;else if(Array.isArray(w)){let H=(K)=>typeof K==="number"||K instanceof String||K instanceof Number,V=w.filter(H).map(String);if(V.length>0)w=w.concat(V);_=w}else if(g===void 0&&w)g=w,w=void 0;let{aliasDuplicateObjects:v,anchorPrefix:U,flow:G,keepUndefined:D,onTagObj:J,tag:X}=g??{},{onAnchor:Q,setAnchors:Y,sourceObjects:q}=L3.createNodeAnchors(this,U||"a"),L={aliasDuplicateObjects:v??!0,keepUndefined:D??!1,onAnchor:Q,onTagObj:J,replacer:_,schema:this.schema,sourceObjects:q},F=RN.createNode($,X,L);if(G&&d$.isCollection(F))F.flow=!0;return Y(),F}createPair($,w,g={}){let _=this.createNode($,null,g),v=this.createNode(w,null,g);return new fN.Pair(_,v)}delete($){return H6(this.contents)?this.contents.delete($):!1}deleteIn($){if(W6.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return H6(this.contents)?this.contents.deleteIn($):!1}get($,w){return d$.isCollection(this.contents)?this.contents.get($,w):void 0}getIn($,w){if(W6.isEmptyPath($))return!w&&d$.isScalar(this.contents)?this.contents.value:this.contents;return d$.isCollection(this.contents)?this.contents.getIn($,w):void 0}has($){return d$.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(W6.isEmptyPath($))return this.contents!==void 0;return d$.isCollection(this.contents)?this.contents.hasIn($):!1}set($,w){if(this.contents==null)this.contents=W6.collectionFromPath(this.schema,[$],w);else if(H6(this.contents))this.contents.set($,w)}setIn($,w){if(W6.isEmptyPath($))this.contents=w;else if(this.contents==null)this.contents=W6.collectionFromPath(this.schema,Array.from($),w);else if(H6(this.contents))this.contents.setIn($,w)}setSchema($,w={}){if(typeof $==="number")$=String($);let g;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new V3.Directives({version:"1.1"});g={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new V3.Directives({version:$});g={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;g=null;break;default:{let _=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${_}`)}}if(w.schema instanceof Object)this.schema=w.schema;else if(g)this.schema=new SN.Schema(Object.assign(g,w));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:w,mapAsMap:g,maxAliasCount:_,onAnchor:v,reviver:U}={}){let G={anchors:new Map,doc:this,keep:!$,mapAsMap:g===!0,mapKeyWarned:!1,maxAliasCount:typeof _==="number"?_:100},D=AN.toJS(this.contents,w??"",G);if(typeof v==="function")for(let{count:J,res:X}of G.anchors.values())v(X,J);return typeof U==="function"?TN.applyReviver(U,{"":D},"",D):D}toJSON($,w){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:w})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let w=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${w}`)}return iN.stringifyDocument(this,$)}}function H6($){if(d$.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}CN.Document=F3});var z_=E((ZN)=>{class l1 extends Error{constructor($,w,g,_){super();this.name=$,this.code=g,this.message=_,this.pos=w}}class O5 extends l1{constructor($,w,g){super("YAMLParseError",$,w,g)}}class N5 extends l1{constructor($,w,g){super("YAMLWarning",$,w,g)}}var EN=($,w)=>(g)=>{if(g.pos[0]===-1)return;g.linePos=g.pos.map((D)=>w.linePos(D));let{line:_,col:v}=g.linePos[0];g.message+=` at line ${_}, column ${v}`;let U=v-1,G=$.substring(w.lineStarts[_-1],w.lineStarts[_]).replace(/[\n\r]+$/,"");if(U>=60&&G.length>80){let D=Math.min(U-39,G.length-79);G="…"+G.substring(D),U-=D-1}if(G.length>80)G=G.substring(0,79)+"…";if(_>1&&/^ *$/.test(G.substring(0,U))){let D=$.substring(w.lineStarts[_-2],w.lineStarts[_-1]);if(D.length>80)D=D.substring(0,79)+`…
|
|
58
|
+
`;G=D+G}if(/[^ ]/.test(G)){let D=1,J=g.linePos[1];if(J?.line===_&&J.col>v)D=Math.max(1,Math.min(J.col-v,80-U));let X=" ".repeat(U)+"^".repeat(D);g.message+=`:
|
|
59
|
+
|
|
60
|
+
${G}
|
|
61
|
+
${X}
|
|
62
|
+
`}};ZN.YAMLError=l1;ZN.YAMLParseError=O5;ZN.YAMLWarning=N5;ZN.prettifyError=EN});var f_=E((mN)=>{function yN($,{flow:w,indicator:g,next:_,offset:v,onError:U,parentIndent:G,startOnNewline:D}){let J=!1,X=D,Q=D,Y="",q="",L=!1,F=!1,H=null,V=null,K=null,f=null,S=null,u=null,Z=null;for(let x of $){if(F){if(x.type!=="space"&&x.type!=="newline"&&x.type!=="comma")U(x.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");F=!1}if(H){if(X&&x.type!=="comment"&&x.type!=="newline")U(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");H=null}switch(x.type){case"space":if(!w&&(g!=="doc-start"||_?.type!=="flow-collection")&&x.source.includes("\t"))H=x;Q=!0;break;case"comment":{if(!Q)U(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G$=x.source.substring(1)||" ";if(!Y)Y=G$;else Y+=q+G$;q="",X=!1;break}case"newline":if(X){if(Y)Y+=x.source;else if(!u||g!=="seq-item-ind")J=!0}else q+=x.source;if(X=!0,L=!0,V||K)f=x;Q=!0;break;case"anchor":if(V)U(x,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(x.source.endsWith(":"))U(x.offset+x.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);V=x,Z??(Z=x.offset),X=!1,Q=!1,F=!0;break;case"tag":{if(K)U(x,"MULTIPLE_TAGS","A node can have at most one tag");K=x,Z??(Z=x.offset),X=!1,Q=!1,F=!0;break}case g:if(V||K)U(x,"BAD_PROP_ORDER",`Anchors and tags must be after the ${x.source} indicator`);if(u)U(x,"UNEXPECTED_TOKEN",`Unexpected ${x.source} in ${w??"collection"}`);u=x,X=g==="seq-item-ind"||g==="explicit-key-ind",Q=!1;break;case"comma":if(w){if(S)U(x,"UNEXPECTED_TOKEN",`Unexpected , in ${w}`);S=x,X=!1,Q=!1;break}default:U(x,"UNEXPECTED_TOKEN",`Unexpected ${x.type} token`),X=!1,Q=!1}}let i=$[$.length-1],c=i?i.offset+i.source.length:v;if(F&&_&&_.type!=="space"&&_.type!=="newline"&&_.type!=="comma"&&(_.type!=="scalar"||_.source!==""))U(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(H&&(X&&H.indent<=G||_?.type==="block-map"||_?.type==="block-seq"))U(H,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:S,found:u,spaceBefore:J,comment:Y,hasNewline:L,anchor:V,tag:K,newlineAfterProp:f,end:c,start:Z??c}}mN.resolveProps=yN});var c1=E((dN)=>{function j3($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
|
|
63
|
+
`))return!0;if($.end){for(let w of $.end)if(w.type==="newline")return!0}return!1;case"flow-collection":for(let w of $.items){for(let g of w.start)if(g.type==="newline")return!0;if(w.sep){for(let g of w.sep)if(g.type==="newline")return!0}if(j3(w.key)||j3(w.value))return!0}return!1;default:return!0}}dN.containsNewline=j3});var K3=E((eN)=>{var rN=c1();function pN($,w,g){if(w?.type==="flow-collection"){let _=w.end[0];if(_.indent===$&&(_.source==="]"||_.source==="}")&&rN.containsNewline(w))g(_,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}eN.flowIndentCheck=pN});var O3=E(($P)=>{var P5=$$();function sN($,w,g){let{uniqueKeys:_}=$.options;if(_===!1)return!1;let v=typeof _==="function"?_:(U,G)=>U===G||P5.isScalar(U)&&P5.isScalar(G)&&U.value===G.value;return w.some((U)=>v(U.key,g))}$P.mapIncludes=sN});var f5=E((bP)=>{var k5=Vv(),vP=jv(),n5=f_(),gP=c1(),M5=K3(),_P=O3(),z5="All mapping items must start at the same column";function UP({composeNode:$,composeEmptyNode:w},g,_,v,U){let D=new(U?.nodeClass??vP.YAMLMap)(g.schema);if(g.atRoot)g.atRoot=!1;let J=_.offset,X=null;for(let Q of _.items){let{start:Y,key:q,sep:L,value:F}=Q,H=n5.resolveProps(Y,{indicator:"explicit-key-ind",next:q??L?.[0],offset:J,onError:v,parentIndent:_.indent,startOnNewline:!0}),V=!H.found;if(V){if(q){if(q.type==="block-seq")v(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in q&&q.indent!==_.indent)v(J,"BAD_INDENT",z5)}if(!H.anchor&&!H.tag&&!L){if(X=H.end,H.comment)if(D.comment)D.comment+=`
|
|
64
|
+
`+H.comment;else D.comment=H.comment;continue}if(H.newlineAfterProp||gP.containsNewline(q))v(q??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(H.found?.indent!==_.indent)v(J,"BAD_INDENT",z5);g.atKey=!0;let K=H.end,f=q?$(g,q,H,v):w(g,K,Y,null,H,v);if(g.schema.compat)M5.flowIndentCheck(_.indent,q,v);if(g.atKey=!1,_P.mapIncludes(g,D.items,f))v(K,"DUPLICATE_KEY","Map keys must be unique");let S=n5.resolveProps(L??[],{indicator:"map-value-ind",next:F,offset:f.range[2],onError:v,parentIndent:_.indent,startOnNewline:!q||q.type==="block-scalar"});if(J=S.end,S.found){if(V){if(F?.type==="block-map"&&!S.hasNewline)v(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(g.options.strict&&H.start<S.found.offset-1024)v(f.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let u=F?$(g,F,S,v):w(g,J,L,null,S,v);if(g.schema.compat)M5.flowIndentCheck(_.indent,F,v);J=u.range[2];let Z=new k5.Pair(f,u);if(g.options.keepSourceTokens)Z.srcToken=Q;D.items.push(Z)}else{if(V)v(f.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(S.comment)if(f.comment)f.comment+=`
|
|
65
|
+
`+S.comment;else f.comment=S.comment;let u=new k5.Pair(f);if(g.options.keepSourceTokens)u.srcToken=Q;D.items.push(u)}}if(X&&X<J)v(X,"IMPOSSIBLE","Map comment with trailing content");return D.range=[_.offset,J,X??J],D}bP.resolveBlockMap=UP});var A5=E((YP)=>{var DP=Kv(),JP=f_(),XP=K3();function QP({composeNode:$,composeEmptyNode:w},g,_,v,U){let D=new(U?.nodeClass??DP.YAMLSeq)(g.schema);if(g.atRoot)g.atRoot=!1;if(g.atKey)g.atKey=!1;let J=_.offset,X=null;for(let{start:Q,value:Y}of _.items){let q=JP.resolveProps(Q,{indicator:"seq-item-ind",next:Y,offset:J,onError:v,parentIndent:_.indent,startOnNewline:!0});if(!q.found)if(q.anchor||q.tag||Y)if(Y?.type==="block-seq")v(q.end,"BAD_INDENT","All sequence items must start at the same column");else v(J,"MISSING_CHAR","Sequence item without - indicator");else{if(X=q.end,q.comment)D.comment=q.comment;continue}let L=Y?$(g,Y,q,v):w(g,q.end,Q,null,q,v);if(g.schema.compat)XP.flowIndentCheck(_.indent,Y,v);J=L.range[2],D.items.push(L)}return D.range=[_.offset,J,X??J],D}YP.resolveBlockSeq=QP});var q6=E((qP)=>{function HP($,w,g,_){let v="";if($){let U=!1,G="";for(let D of $){let{source:J,type:X}=D;switch(X){case"space":U=!0;break;case"comment":{if(g&&!U)_(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Q=J.substring(1)||" ";if(!v)v=Q;else v+=G+Q;G="";break}case"newline":if(v)G+=J;U=!0;break;default:_(D,"UNEXPECTED_TOKEN",`Unexpected ${X} at node end`)}w+=J.length}}return{comment:v,offset:w}}qP.resolveEnd=HP});var T5=E((NP)=>{var IP=$$(),LP=Vv(),S5=jv(),VP=Kv(),FP=q6(),i5=f_(),jP=c1(),KP=O3(),N3="Block collections are not allowed within flow collections",P3=($)=>$&&($.type==="block-map"||$.type==="block-seq");function OP({composeNode:$,composeEmptyNode:w},g,_,v,U){let G=_.start.source==="{",D=G?"flow map":"flow sequence",X=new(U?.nodeClass??(G?S5.YAMLMap:VP.YAMLSeq))(g.schema);X.flow=!0;let Q=g.atRoot;if(Q)g.atRoot=!1;if(g.atKey)g.atKey=!1;let Y=_.offset+_.start.source.length;for(let V=0;V<_.items.length;++V){let K=_.items[V],{start:f,key:S,sep:u,value:Z}=K,i=i5.resolveProps(f,{flow:D,indicator:"explicit-key-ind",next:S??u?.[0],offset:Y,onError:v,parentIndent:_.indent,startOnNewline:!1});if(!i.found){if(!i.anchor&&!i.tag&&!u&&!Z){if(V===0&&i.comma)v(i.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${D}`);else if(V<_.items.length-1)v(i.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${D}`);if(i.comment)if(X.comment)X.comment+=`
|
|
66
|
+
`+i.comment;else X.comment=i.comment;Y=i.end;continue}if(!G&&g.options.strict&&jP.containsNewline(S))v(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(V===0){if(i.comma)v(i.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${D}`)}else{if(!i.comma)v(i.start,"MISSING_CHAR",`Missing , between ${D} items`);if(i.comment){let c="";$:for(let x of f)switch(x.type){case"comma":case"space":break;case"comment":c=x.source.substring(1);break $;default:break $}if(c){let x=X.items[X.items.length-1];if(IP.isPair(x))x=x.value??x.key;if(x.comment)x.comment+=`
|
|
67
|
+
`+c;else x.comment=c;i.comment=i.comment.substring(c.length+1)}}}if(!G&&!u&&!i.found){let c=Z?$(g,Z,i,v):w(g,i.end,u,null,i,v);if(X.items.push(c),Y=c.range[2],P3(Z))v(c.range,"BLOCK_IN_FLOW",N3)}else{g.atKey=!0;let c=i.end,x=S?$(g,S,i,v):w(g,c,f,null,i,v);if(P3(S))v(x.range,"BLOCK_IN_FLOW",N3);g.atKey=!1;let G$=i5.resolveProps(u??[],{flow:D,indicator:"map-value-ind",next:Z,offset:x.range[2],onError:v,parentIndent:_.indent,startOnNewline:!1});if(G$.found){if(!G&&!i.found&&g.options.strict){if(u)for(let B$ of u){if(B$===G$.found)break;if(B$.type==="newline"){v(B$,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(i.start<G$.found.offset-1024)v(G$.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(Z)if("source"in Z&&Z.source?.[0]===":")v(Z,"MISSING_CHAR",`Missing space after : in ${D}`);else v(G$.start,"MISSING_CHAR",`Missing , or : between ${D} items`);let r$=Z?$(g,Z,G$,v):G$.found?w(g,G$.end,u,null,G$,v):null;if(r$){if(P3(Z))v(r$.range,"BLOCK_IN_FLOW",N3)}else if(G$.comment)if(x.comment)x.comment+=`
|
|
68
|
+
`+G$.comment;else x.comment=G$.comment;let D4=new LP.Pair(x,r$);if(g.options.keepSourceTokens)D4.srcToken=K;if(G){let B$=X;if(KP.mapIncludes(g,B$.items,x))v(c,"DUPLICATE_KEY","Map keys must be unique");B$.items.push(D4)}else{let B$=new S5.YAMLMap(g.schema);B$.flow=!0,B$.items.push(D4);let sX=(r$??x).range;B$.range=[x.range[0],sX[1],sX[2]],X.items.push(B$)}Y=r$?r$.range[2]:G$.end}}let q=G?"}":"]",[L,...F]=_.end,H=Y;if(L?.source===q)H=L.offset+L.source.length;else{let V=D[0].toUpperCase()+D.substring(1),K=Q?`${V} must end with a ${q}`:`${V} in block collection must be sufficiently indented and end with a ${q}`;if(v(Y,Q?"MISSING_CHAR":"BAD_INDENT",K),L&&L.source.length!==1)F.unshift(L)}if(F.length>0){let V=FP.resolveEnd(F,H,g.options.strict,v);if(V.comment)if(X.comment)X.comment+=`
|
|
69
|
+
`+V.comment;else X.comment=V.comment;X.range=[_.offset,H,V.offset]}else X.range=[_.offset,H,H];return X}NP.resolveFlowCollection=OP});var R5=E((TP)=>{var kP=$$(),nP=q$(),MP=jv(),zP=Kv(),fP=f5(),AP=A5(),SP=T5();function k3($,w,g,_,v,U){let G=g.type==="block-map"?fP.resolveBlockMap($,w,g,_,U):g.type==="block-seq"?AP.resolveBlockSeq($,w,g,_,U):SP.resolveFlowCollection($,w,g,_,U),D=G.constructor;if(v==="!"||v===D.tagName)return G.tag=D.tagName,G;if(v)G.tag=v;return G}function iP($,w,g,_,v){let U=_.tag,G=!U?null:w.directives.tagName(U.source,(q)=>v(U,"TAG_RESOLVE_FAILED",q));if(g.type==="block-seq"){let{anchor:q,newlineAfterProp:L}=_,F=q&&U?q.offset>U.offset?q:U:q??U;if(F&&(!L||L.offset<F.offset))v(F,"MISSING_CHAR","Missing newline after block sequence props")}let D=g.type==="block-map"?"map":g.type==="block-seq"?"seq":g.start.source==="{"?"map":"seq";if(!U||!G||G==="!"||G===MP.YAMLMap.tagName&&D==="map"||G===zP.YAMLSeq.tagName&&D==="seq")return k3($,w,g,v,G);let J=w.schema.tags.find((q)=>q.tag===G&&q.collection===D);if(!J){let q=w.schema.knownTags[G];if(q?.collection===D)w.schema.tags.push(Object.assign({},q,{default:!1})),J=q;else{if(q)v(U,"BAD_COLLECTION_TYPE",`${q.tag} used for ${D} collection, but expects ${q.collection??"scalar"}`,!0);else v(U,"TAG_RESOLVE_FAILED",`Unresolved tag: ${G}`,!0);return k3($,w,g,v,G)}}let X=k3($,w,g,v,G,J),Q=J.resolve?.(X,(q)=>v(U,"TAG_RESOLVE_FAILED",q),w.options)??X,Y=kP.isNode(Q)?Q:new nP.Scalar(Q);if(Y.range=X.range,Y.tag=G,J?.format)Y.format=J.format;return Y}TP.composeCollection=iP});var M3=E((ZP)=>{var n3=q$();function CP($,w,g){let _=w.offset,v=uP(w,$.options.strict,g);if(!v)return{value:"",type:null,comment:"",range:[_,_,_]};let U=v.mode===">"?n3.Scalar.BLOCK_FOLDED:n3.Scalar.BLOCK_LITERAL,G=w.source?EP(w.source):[],D=G.length;for(let H=G.length-1;H>=0;--H){let V=G[H][1];if(V===""||V==="\r")D=H;else break}if(D===0){let H=v.chomp==="+"&&G.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,G.length-1)):"",V=_+v.length;if(w.source)V+=w.source.length;return{value:H,type:U,comment:v.comment,range:[_,V,V]}}let J=w.indent+v.indent,X=w.offset+v.length,Q=0;for(let H=0;H<D;++H){let[V,K]=G[H];if(K===""||K==="\r"){if(v.indent===0&&V.length>J)J=V.length}else{if(V.length<J)g(X+V.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(v.indent===0)J=V.length;if(Q=H,J===0&&!$.atRoot)g(X,"BAD_INDENT","Block scalar values in collections must be indented");break}X+=V.length+K.length+1}for(let H=G.length-1;H>=D;--H)if(G[H][0].length>J)D=H+1;let Y="",q="",L=!1;for(let H=0;H<Q;++H)Y+=G[H][0].slice(J)+`
|
|
71
|
+
`;for(let H=Q;H<D;++H){let[V,K]=G[H];X+=V.length+K.length+1;let f=K[K.length-1]==="\r";if(f)K=K.slice(0,-1);if(K&&V.length<J){let u=`Block scalar lines must not be less indented than their ${v.indent?"explicit indentation indicator":"first line"}`;g(X-K.length-(f?2:1),"BAD_INDENT",u),V=""}if(U===n3.Scalar.BLOCK_LITERAL)Y+=q+V.slice(J)+K,q=`
|
|
72
|
+
`;else if(V.length>J||K[0]==="\t"){if(q===" ")q=`
|
|
73
|
+
`;else if(!L&&q===`
|
|
74
|
+
`)q=`
|
|
75
|
+
|
|
76
|
+
`;Y+=q+V.slice(J)+K,q=`
|
|
77
|
+
`,L=!0}else if(K==="")if(q===`
|
|
78
|
+
`)Y+=`
|
|
79
|
+
`;else q=`
|
|
80
|
+
`;else Y+=q+K,q=" ",L=!1}switch(v.chomp){case"-":break;case"+":for(let H=D;H<G.length;++H)Y+=`
|
|
81
|
+
`+G[H][0].slice(J);if(Y[Y.length-1]!==`
|
|
82
|
+
`)Y+=`
|
|
83
|
+
`;break;default:Y+=`
|
|
84
|
+
`}let F=_+v.length+w.source.length;return{value:Y,type:U,comment:v.comment,range:[_,F,F]}}function uP({offset:$,props:w},g,_){if(w[0].type!=="block-scalar-header")return _(w[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:v}=w[0],U=v[0],G=0,D="",J=-1;for(let q=1;q<v.length;++q){let L=v[q];if(!D&&(L==="-"||L==="+"))D=L;else{let F=Number(L);if(!G&&F)G=F;else if(J===-1)J=$+q}}if(J!==-1)_(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${v}`);let X=!1,Q="",Y=v.length;for(let q=1;q<w.length;++q){let L=w[q];switch(L.type){case"space":X=!0;case"newline":Y+=L.source.length;break;case"comment":if(g&&!X)_(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=L.source.length,Q=L.source.substring(1);break;case"error":_(L,"UNEXPECTED_TOKEN",L.message),Y+=L.source.length;break;default:{let F=`Unexpected token in block scalar header: ${L.type}`;_(L,"UNEXPECTED_TOKEN",F);let H=L.source;if(H&&typeof H==="string")Y+=H.length}}}return{mode:U,indent:G,chomp:D,comment:Q,length:Y}}function EP($){let w=$.split(/\n( *)/),g=w[0],_=g.match(/^( *)/),U=[_?.[1]?[_[1],g.slice(_[1].length)]:["",g]];for(let G=1;G<w.length;G+=2)U.push([w[G],w[G+1]]);return U}ZP.resolveBlockScalar=CP});var f3=E((rP)=>{var z3=q$(),hP=q6();function lP($,w,g){let{offset:_,type:v,source:U,end:G}=$,D,J,X=(q,L,F)=>g(_+q,L,F);switch(v){case"scalar":D=z3.Scalar.PLAIN,J=cP(U,X);break;case"single-quoted-scalar":D=z3.Scalar.QUOTE_SINGLE,J=yP(U,X);break;case"double-quoted-scalar":D=z3.Scalar.QUOTE_DOUBLE,J=mP(U,X);break;default:return g($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${v}`),{value:"",type:null,comment:"",range:[_,_+U.length,_+U.length]}}let Q=_+U.length,Y=hP.resolveEnd(G,Q,w,g);return{value:J,type:D,comment:Y.comment,range:[_,Q,Y.offset]}}function cP($,w){let g="";switch($[0]){case"\t":g="a tab character";break;case",":g="flow indicator character ,";break;case"%":g="directive indicator character %";break;case"|":case">":{g=`block scalar indicator ${$[0]}`;break}case"@":case"`":{g=`reserved character ${$[0]}`;break}}if(g)w(0,"BAD_SCALAR_START",`Plain value cannot start with ${g}`);return C5($)}function yP($,w){if($[$.length-1]!=="'"||$.length===1)w($.length,"MISSING_CHAR","Missing closing 'quote");return C5($.slice(1,-1)).replace(/''/g,"'")}function C5($){let w,g;try{w=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),g=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{w=/(.*?)[ \t]*\r?\n/sy,g=/[ \t]*(.*?)[ \t]*\r?\n/sy}let _=w.exec($);if(!_)return $;let v=_[1],U=" ",G=w.lastIndex;g.lastIndex=G;while(_=g.exec($)){if(_[1]==="")if(U===`
|
|
87
|
+
`)v+=U;else U=`
|
|
88
|
+
`;else v+=U+_[1],U=" ";G=g.lastIndex}let D=/[ \t]*(.*)/sy;return D.lastIndex=G,_=D.exec($),v+U+(_?.[1]??"")}function mP($,w){let g="";for(let _=1;_<$.length-1;++_){let v=$[_];if(v==="\r"&&$[_+1]===`
|
|
89
|
+
`)continue;if(v===`
|
|
90
|
+
`){let{fold:U,offset:G}=tP($,_);g+=U,_=G}else if(v==="\\"){let U=$[++_],G=dP[U];if(G)g+=G;else if(U===`
|
|
91
|
+
`){U=$[_+1];while(U===" "||U==="\t")U=$[++_+1]}else if(U==="\r"&&$[_+1]===`
|
|
92
|
+
`){U=$[++_+1];while(U===" "||U==="\t")U=$[++_+1]}else if(U==="x"||U==="u"||U==="U"){let D={x:2,u:4,U:8}[U];g+=oP($,_+1,D,w),_+=D}else{let D=$.substr(_-1,2);w(_-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${D}`),g+=D}}else if(v===" "||v==="\t"){let U=_,G=$[_+1];while(G===" "||G==="\t")G=$[++_+1];if(G!==`
|
|
93
|
+
`&&!(G==="\r"&&$[_+2]===`
|
|
94
|
+
`))g+=_>U?$.slice(U,_+1):v}else g+=v}if($[$.length-1]!=='"'||$.length===1)w($.length,"MISSING_CHAR",'Missing closing "quote');return g}function tP($,w){let g="",_=$[w+1];while(_===" "||_==="\t"||_===`
|
|
95
|
+
`||_==="\r"){if(_==="\r"&&$[w+2]!==`
|
|
96
|
+
`)break;if(_===`
|
|
97
|
+
`)g+=`
|
|
98
|
+
`;w+=1,_=$[w+1]}if(!g)g=" ";return{fold:g,offset:w}}var dP={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function oP($,w,g,_){let v=$.substr(w,g),G=v.length===g&&/^[0-9a-fA-F]+$/.test(v)?parseInt(v,16):NaN;if(isNaN(G)){let D=$.substr(w-2,g+2);return _(w-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${D}`),D}return String.fromCodePoint(G)}rP.resolveFlowScalar=lP});var E5=E((vk)=>{var av=$$(),u5=q$(),eP=M3(),aP=f3();function sP($,w,g,_){let{value:v,type:U,comment:G,range:D}=w.type==="block-scalar"?eP.resolveBlockScalar($,w,_):aP.resolveFlowScalar(w,$.options.strict,_),J=g?$.directives.tagName(g.source,(Y)=>_(g,"TAG_RESOLVE_FAILED",Y)):null,X;if($.options.stringKeys&&$.atKey)X=$.schema[av.SCALAR];else if(J)X=$k($.schema,v,J,g,_);else if(w.type==="scalar")X=wk($,v,w,_);else X=$.schema[av.SCALAR];let Q;try{let Y=X.resolve(v,(q)=>_(g??w,"TAG_RESOLVE_FAILED",q),$.options);Q=av.isScalar(Y)?Y:new u5.Scalar(Y)}catch(Y){let q=Y instanceof Error?Y.message:String(Y);_(g??w,"TAG_RESOLVE_FAILED",q),Q=new u5.Scalar(v)}if(Q.range=D,Q.source=v,U)Q.type=U;if(J)Q.tag=J;if(X.format)Q.format=X.format;if(G)Q.comment=G;return Q}function $k($,w,g,_,v){if(g==="!")return $[av.SCALAR];let U=[];for(let D of $.tags)if(!D.collection&&D.tag===g)if(D.default&&D.test)U.push(D);else return D;for(let D of U)if(D.test?.test(w))return D;let G=$.knownTags[g];if(G&&!G.collection)return $.tags.push(Object.assign({},G,{default:!1,test:void 0})),G;return v(_,"TAG_RESOLVE_FAILED",`Unresolved tag: ${g}`,g!=="tag:yaml.org,2002:str"),$[av.SCALAR]}function wk({atKey:$,directives:w,schema:g},_,v,U){let G=g.tags.find((D)=>(D.default===!0||$&&D.default==="key")&&D.test?.test(_))||g[av.SCALAR];if(g.compat){let D=g.compat.find((J)=>J.default&&J.test?.test(_))??g[av.SCALAR];if(G.tag!==D.tag){let J=w.tagString(G.tag),X=w.tagString(D.tag),Q=`Value may be parsed as either ${J} or ${X}`;U(v,"TAG_RESOLVE_FAILED",Q,!0)}}return G}vk.composeScalar=sP});var Z5=E((Uk)=>{function _k($,w,g){if(w){g??(g=w.length);for(let _=g-1;_>=0;--_){let v=w[_];switch(v.type){case"space":case"comment":case"newline":$-=v.source.length;continue}v=w[++_];while(v?.type==="space")$+=v.source.length,v=w[++_];break}}return $}Uk.emptyScalarPosition=_k});var l5=E((Hk)=>{var Gk=W_(),Dk=$$(),Jk=R5(),x5=E5(),Xk=q6(),Qk=Z5(),Yk={composeNode:h5,composeEmptyNode:A3};function h5($,w,g,_){let v=$.atKey,{spaceBefore:U,comment:G,anchor:D,tag:J}=g,X,Q=!0;switch(w.type){case"alias":if(X=Wk($,w,_),D||J)_(w,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(X=x5.composeScalar($,w,J,_),D)X.anchor=D.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(X=Jk.composeCollection(Yk,$,w,g,_),D)X.anchor=D.source.substring(1);break;default:{let Y=w.type==="error"?w.message:`Unsupported token (type: ${w.type})`;_(w,"UNEXPECTED_TOKEN",Y),X=A3($,w.offset,void 0,null,g,_),Q=!1}}if(D&&X.anchor==="")_(D,"BAD_ALIAS","Anchor cannot be an empty string");if(v&&$.options.stringKeys&&(!Dk.isScalar(X)||typeof X.value!=="string"||X.tag&&X.tag!=="tag:yaml.org,2002:str"))_(J??w,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(U)X.spaceBefore=!0;if(G)if(w.type==="scalar"&&w.source==="")X.comment=G;else X.commentBefore=G;if($.options.keepSourceTokens&&Q)X.srcToken=w;return X}function A3($,w,g,_,{spaceBefore:v,comment:U,anchor:G,tag:D,end:J},X){let Q={type:"scalar",offset:Qk.emptyScalarPosition(w,g,_),indent:-1,source:""},Y=x5.composeScalar($,Q,D,X);if(G){if(Y.anchor=G.source.substring(1),Y.anchor==="")X(G,"BAD_ALIAS","Anchor cannot be an empty string")}if(v)Y.spaceBefore=!0;if(U)Y.comment=U,Y.range[2]=J;return Y}function Wk({options:$},{offset:w,source:g,end:_},v){let U=new Gk.Alias(g.substring(1));if(U.source==="")v(w,"BAD_ALIAS","Alias cannot be an empty string");if(U.source.endsWith(":"))v(w+g.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let G=w+g.length,D=Xk.resolveEnd(_,G,$.strict,v);if(U.range=[w,G,D.offset],D.comment)U.comment=D.comment;return U}Hk.composeEmptyNode=A3;Hk.composeNode=h5});var y5=E((jk)=>{var Ik=M_(),c5=l5(),Lk=q6(),Vk=f_();function Fk($,w,{offset:g,start:_,value:v,end:U},G){let D=Object.assign({_directives:w},$),J=new Ik.Document(void 0,D),X={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},Q=Vk.resolveProps(_,{indicator:"doc-start",next:v??U?.[0],offset:g,onError:G,parentIndent:0,startOnNewline:!0});if(Q.found){if(J.directives.docStart=!0,v&&(v.type==="block-map"||v.type==="block-seq")&&!Q.hasNewline)G(Q.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=v?c5.composeNode(X,v,Q,G):c5.composeEmptyNode(X,Q.end,_,null,Q,G);let Y=J.contents.range[2],q=Lk.resolveEnd(U,Y,!1,G);if(q.comment)J.comment=q.comment;return J.range=[g,Y,q.offset],J}jk.composeDoc=Fk});var S3=E((Mk)=>{var Ok=J4("process"),Nk=C9(),Pk=M_(),A_=z_(),m5=$$(),kk=y5(),nk=q6();function S_($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:w,source:g}=$;return[w,w+(typeof g==="string"?g.length:1)]}function t5($){let w="",g=!1,_=!1;for(let v=0;v<$.length;++v){let U=$[v];switch(U[0]){case"#":w+=(w===""?"":_?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(U.substring(1)||" "),g=!0,_=!1;break;case"%":if($[v+1]?.[0]!=="#")v+=1;g=!1;break;default:if(!g)_=!0;g=!1}}return{comment:w,afterEmptyLine:_}}class d5{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(w,g,_,v)=>{let U=S_(w);if(v)this.warnings.push(new A_.YAMLWarning(U,g,_));else this.errors.push(new A_.YAMLParseError(U,g,_))},this.directives=new Nk.Directives({version:$.version||"1.2"}),this.options=$}decorate($,w){let{comment:g,afterEmptyLine:_}=t5(this.prelude);if(g){let v=$.contents;if(w)$.comment=$.comment?`${$.comment}
|
|
103
|
+
${g}`:g;else if(_||$.directives.docStart||!v)$.commentBefore=g;else if(m5.isCollection(v)&&!v.flow&&v.items.length>0){let U=v.items[0];if(m5.isPair(U))U=U.key;let G=U.commentBefore;U.commentBefore=G?`${g}
|
|
104
|
+
${G}`:g}else{let U=v.commentBefore;v.commentBefore=U?`${g}
|
|
105
|
+
${U}`:g}}if(w)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:t5(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,w=!1,g=-1){for(let _ of $)yield*this.next(_);yield*this.end(w,g)}*next($){if(Ok.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(w,g,_)=>{let v=S_($);v[0]+=w,this.onError(v,"BAD_DIRECTIVE",g,_)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let w=kk.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!w.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(w,!1),this.doc)yield this.doc;this.doc=w,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let w=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,g=new A_.YAMLParseError(S_($),"UNEXPECTED_TOKEN",w);if(this.atDirectives||!this.doc)this.errors.push(g);else this.doc.errors.push(g);break}case"doc-end":{if(!this.doc){this.errors.push(new A_.YAMLParseError(S_($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let w=nk.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),w.comment){let g=this.doc.comment;this.doc.comment=g?`${g}
|
|
106
|
+
${w.comment}`:w.comment}this.doc.range[2]=w.offset;break}default:this.errors.push(new A_.YAMLParseError(S_($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,w=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let g=Object.assign({_directives:this.directives},this.options),_=new Pk.Document(void 0,g);if(this.atDirectives)this.onError(w,"MISSING_CHAR","Missing directives-end indicator line");_.range=[0,w,w],this.decorate(_,!1),yield _}}}Mk.Composer=d5});var p5=E((uk)=>{var fk=M3(),Ak=f3(),Sk=z_(),o5=I_();function ik($,w=!0,g){if($){let _=(v,U,G)=>{let D=typeof v==="number"?v:Array.isArray(v)?v[0]:v.offset;if(g)g(D,U,G);else throw new Sk.YAMLParseError([D,D+1],U,G)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ak.resolveFlowScalar($,w,_);case"block-scalar":return fk.resolveBlockScalar({options:{strict:w}},$,_)}}return null}function Tk($,w){let{implicitKey:g=!1,indent:_,inFlow:v=!1,offset:U=-1,type:G="PLAIN"}=w,D=o5.stringifyString({type:G,value:$},{implicitKey:g,indent:_>0?" ".repeat(_):"",inFlow:v,options:{blockQuote:!0,lineWidth:-1}}),J=w.end??[{type:"newline",offset:-1,indent:_,source:`
|
|
107
|
+
`}];switch(D[0]){case"|":case">":{let X=D.indexOf(`
|
|
108
|
+
`),Q=D.substring(0,X),Y=D.substring(X+1)+`
|
|
109
|
+
`,q=[{type:"block-scalar-header",offset:U,indent:_,source:Q}];if(!r5(q,J))q.push({type:"newline",offset:-1,indent:_,source:`
|
|
110
|
+
`});return{type:"block-scalar",offset:U,indent:_,props:q,source:Y}}case'"':return{type:"double-quoted-scalar",offset:U,indent:_,source:D,end:J};case"'":return{type:"single-quoted-scalar",offset:U,indent:_,source:D,end:J};default:return{type:"scalar",offset:U,indent:_,source:D,end:J}}}function Rk($,w,g={}){let{afterKey:_=!1,implicitKey:v=!1,inFlow:U=!1,type:G}=g,D="indent"in $?$.indent:null;if(_&&typeof D==="number")D+=2;if(!G)switch($.type){case"single-quoted-scalar":G="QUOTE_SINGLE";break;case"double-quoted-scalar":G="QUOTE_DOUBLE";break;case"block-scalar":{let X=$.props[0];if(X.type!=="block-scalar-header")throw Error("Invalid block scalar header");G=X.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:G="PLAIN"}let J=o5.stringifyString({type:G,value:w},{implicitKey:v||D===null,indent:D!==null&&D>0?" ".repeat(D):"",inFlow:U,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":Ck($,J);break;case'"':i3($,J,"double-quoted-scalar");break;case"'":i3($,J,"single-quoted-scalar");break;default:i3($,J,"scalar")}}function Ck($,w){let g=w.indexOf(`
|
|
111
|
+
`),_=w.substring(0,g),v=w.substring(g+1)+`
|
|
112
|
+
`;if($.type==="block-scalar"){let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");U.source=_,$.source=v}else{let{offset:U}=$,G="indent"in $?$.indent:-1,D=[{type:"block-scalar-header",offset:U,indent:G,source:_}];if(!r5(D,"end"in $?$.end:void 0))D.push({type:"newline",offset:-1,indent:G,source:`
|
|
113
|
+
`});for(let J of Object.keys($))if(J!=="type"&&J!=="offset")delete $[J];Object.assign($,{type:"block-scalar",indent:G,props:D,source:v})}}function r5($,w){if(w)for(let g of w)switch(g.type){case"space":case"comment":$.push(g);break;case"newline":return $.push(g),!0}return!1}function i3($,w,g){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=g,$.source=w;break;case"block-scalar":{let _=$.props.slice(1),v=w.length;if($.props[0].type==="block-scalar-header")v-=$.props[0].source.length;for(let U of _)U.offset+=v;delete $.props,Object.assign($,{type:g,source:w,end:_});break}case"block-map":case"block-seq":{let v={type:"newline",offset:$.offset+w.length,indent:$.indent,source:`
|
|
114
|
+
`};delete $.items,Object.assign($,{type:g,source:w,end:[v]});break}default:{let _="indent"in $?$.indent:-1,v="end"in $&&Array.isArray($.end)?$.end.filter((U)=>U.type==="space"||U.type==="comment"||U.type==="newline"):[];for(let U of Object.keys($))if(U!=="type"&&U!=="offset")delete $[U];Object.assign($,{type:g,indent:_,source:w,end:v})}}}uk.createScalarToken=Tk;uk.resolveAsScalar=ik;uk.setScalarValue=Rk});var e5=E((lk)=>{var hk=($)=>("type"in $)?m1($):y1($);function m1($){switch($.type){case"block-scalar":{let w="";for(let g of $.props)w+=m1(g);return w+$.source}case"block-map":case"block-seq":{let w="";for(let g of $.items)w+=y1(g);return w}case"flow-collection":{let w=$.start.source;for(let g of $.items)w+=y1(g);for(let g of $.end)w+=g.source;return w}case"document":{let w=y1($);if($.end)for(let g of $.end)w+=g.source;return w}default:{let w=$.source;if("end"in $&&$.end)for(let g of $.end)w+=g.source;return w}}}function y1({start:$,key:w,sep:g,value:_}){let v="";for(let U of $)v+=U.source;if(w)v+=m1(w);if(g)for(let U of g)v+=U.source;if(_)v+=m1(_);return v}lk.stringify=hk});var $Y=E((mk)=>{var T3=Symbol("break visit"),yk=Symbol("skip children"),a5=Symbol("remove item");function sv($,w){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};s5(Object.freeze([]),$,w)}sv.BREAK=T3;sv.SKIP=yk;sv.REMOVE=a5;sv.itemAtPath=($,w)=>{let g=$;for(let[_,v]of w){let U=g?.[_];if(U&&"items"in U)g=U.items[v];else return}return g};sv.parentCollection=($,w)=>{let g=sv.itemAtPath($,w.slice(0,-1)),_=w[w.length-1][0],v=g?.[_];if(v&&"items"in v)return v;throw Error("Parent collection not found")};function s5($,w,g){let _=g(w,$);if(typeof _==="symbol")return _;for(let v of["key","value"]){let U=w[v];if(U&&"items"in U){for(let G=0;G<U.items.length;++G){let D=s5(Object.freeze($.concat([[v,G]])),U.items[G],g);if(typeof D==="number")G=D-1;else if(D===T3)return T3;else if(D===a5)U.items.splice(G,1),G-=1}if(typeof _==="function"&&v==="key")_=_(w,$)}}return typeof _==="function"?_(w,$):_}mk.visit=sv});var t1=E((sk)=>{var R3=p5(),dk=e5(),ok=$Y(),C3="\uFEFF",u3="\x02",E3="\x18",Z3="\x1F",rk=($)=>!!$&&("items"in $),pk=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function ek($){switch($){case C3:return"<BOM>";case u3:return"<DOC>";case E3:return"<FLOW_END>";case Z3:return"<SCALAR>";default:return JSON.stringify($)}}function ak($){switch($){case C3:return"byte-order-mark";case u3:return"doc-mode";case E3:return"flow-error-end";case Z3:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
|
+
`:case`\r
|
|
116
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}sk.createScalarToken=R3.createScalarToken;sk.resolveAsScalar=R3.resolveAsScalar;sk.setScalarValue=R3.setScalarValue;sk.stringify=dk.stringify;sk.visit=ok.visit;sk.BOM=C3;sk.DOCUMENT=u3;sk.FLOW_END=E3;sk.SCALAR=Z3;sk.isCollection=rk;sk.isScalar=pk;sk.prettyToken=ek;sk.tokenType=ak});var h3=E((qn)=>{var i_=t1();function vw($){switch($){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case"\t":return!0;default:return!1}}var wY=new Set("0123456789ABCDEFabcdef"),Wn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),d1=new Set(",[]{}"),Hn=new Set(` ,[]{}
|
|
118
|
+
\r `),x3=($)=>!$||Hn.has($);class vY{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,w=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!w;let g=this.next??"stream";while(g&&(w||this.hasChars(1)))g=yield*this.parseNext(g)}atLineEnd(){let $=this.pos,w=this.buffer[$];while(w===" "||w==="\t")w=this.buffer[++$];if(!w||w==="#"||w===`
|
|
119
|
+
`)return!0;if(w==="\r")return this.buffer[$+1]===`
|
|
120
|
+
`;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let w=this.buffer[$];if(this.indentNext>0){let g=0;while(w===" ")w=this.buffer[++g+$];if(w==="\r"){let _=this.buffer[g+$+1];if(_===`
|
|
121
|
+
`||!_&&!this.atEnd)return $+g+1}return w===`
|
|
122
|
+
`||g>=this.indentNext||!w&&!this.atEnd?$+g:-1}if(w==="-"||w==="."){let g=this.buffer.substr($,3);if((g==="---"||g==="...")&&vw(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===i_.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let w=$.length,g=$.indexOf("#");while(g!==-1){let v=$[g-1];if(v===" "||v==="\t"){w=g-1;break}else g=$.indexOf("#",g+1)}while(!0){let v=$[w-1];if(v===" "||v==="\t")w-=1;else break}let _=(yield*this.pushCount(w))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-_),this.pushNewline(),"stream"}if(this.atLineEnd()){let w=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-w),yield*this.pushNewline(),"stream"}return yield i_.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let w=this.peek(3);if((w==="---"||w==="...")&&vw(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,w==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!vw(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,w]=this.peek(2);if(!w&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&vw(w)){let g=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=g,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let w=yield*this.pushIndicators();switch($[w]){case"#":yield*this.pushCount($.length-w);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(x3),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return w+=yield*this.parseBlockScalarHeader(),w+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-w),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,w,g=-1;do{if($=yield*this.pushNewline(),$>0)w=yield*this.pushSpaces(!1),this.indentValue=g=w;else w=0;w+=yield*this.pushSpaces(!0)}while($+w>0);let _=this.getLine();if(_===null)return this.setNext("flow");if(g!==-1&&g<this.indentNext&&_[0]!=="#"||g===0&&(_.startsWith("---")||_.startsWith("..."))&&vw(_[3])){if(!(g===this.indentNext-1&&this.flowLevel===1&&(_[0]==="]"||_[0]==="}")))return this.flowLevel=0,yield i_.FLOW_END,yield*this.parseLineStart()}let v=0;while(_[v]===",")v+=yield*this.pushCount(1),v+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(v+=yield*this.pushIndicators(),_[v]){case void 0:return"flow";case"#":return yield*this.pushCount(_.length-v),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(x3),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let U=this.charAt(1);if(this.flowKey||vw(U)||U===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),w=this.buffer.indexOf($,this.pos+1);if($==="'")while(w!==-1&&this.buffer[w+1]==="'")w=this.buffer.indexOf("'",w+2);else while(w!==-1){let v=0;while(this.buffer[w-1-v]==="\\")v+=1;if(v%2===0)break;w=this.buffer.indexOf('"',w+1)}let g=this.buffer.substring(0,w),_=g.indexOf(`
|
|
124
|
+
`,this.pos);if(_!==-1){while(_!==-1){let v=this.continueScalar(_+1);if(v===-1)break;_=g.indexOf(`
|
|
125
|
+
`,v)}if(_!==-1)w=_-(g[_-1]==="\r"?2:1)}if(w===-1){if(!this.atEnd)return this.setNext("quoted-scalar");w=this.buffer.length}return yield*this.pushToIndex(w+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let w=this.buffer[++$];if(w==="+")this.blockScalarKeep=!0;else if(w>"0"&&w<="9")this.blockScalarIndent=Number(w)-1;else if(w!=="-")break}return yield*this.pushUntil((w)=>vw(w)||w==="#")}*parseBlockScalar(){let $=this.pos-1,w=0,g;$:for(let v=this.pos;g=this.buffer[v];++v)switch(g){case" ":w+=1;break;case`
|
|
126
|
+
`:$=v,w=0;break;case"\r":{let U=this.buffer[v+1];if(!U&&!this.atEnd)return this.setNext("block-scalar");if(U===`
|
|
127
|
+
`)break}default:break $}if(!g&&!this.atEnd)return this.setNext("block-scalar");if(w>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=w;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let v=this.continueScalar($+1);if(v===-1)break;$=this.buffer.indexOf(`
|
|
128
|
+
`,v)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let _=$+1;g=this.buffer[_];while(g===" ")g=this.buffer[++_];if(g==="\t"){while(g==="\t"||g===" "||g==="\r"||g===`
|
|
129
|
+
`)g=this.buffer[++_];$=_-1}else if(!this.blockScalarKeep)do{let v=$-1,U=this.buffer[v];if(U==="\r")U=this.buffer[--v];let G=v;while(U===" ")U=this.buffer[--v];if(U===`
|
|
130
|
+
`&&v>=this.pos&&v+1+w>G)$=v;else break}while(!0);return yield i_.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,w=this.pos-1,g=this.pos-1,_;while(_=this.buffer[++g])if(_===":"){let v=this.buffer[g+1];if(vw(v)||$&&d1.has(v))break;w=g}else if(vw(_)){let v=this.buffer[g+1];if(_==="\r")if(v===`
|
|
131
|
+
`)g+=1,_=`
|
|
132
|
+
`,v=this.buffer[g+1];else w=g;if(v==="#"||$&&d1.has(v))break;if(_===`
|
|
133
|
+
`){let U=this.continueScalar(g+1);if(U===-1)break;g=Math.max(g,U-2)}}else{if($&&d1.has(_))break;w=g}if(!_&&!this.atEnd)return this.setNext("plain-scalar");return yield i_.SCALAR,yield*this.pushToIndex(w+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,w){let g=this.buffer.slice(this.pos,$);if(g)return yield g,this.pos+=g.length,g.length;else if(w)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(x3))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,w=this.charAt(1);if(vw(w)||$&&d1.has(w)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,w=this.buffer[$];while(!vw(w)&&w!==">")w=this.buffer[++$];return yield*this.pushToIndex(w===">"?$+1:$,!1)}else{let $=this.pos+1,w=this.buffer[$];while(w)if(Wn.has(w))w=this.buffer[++$];else if(w==="%"&&wY.has(this.buffer[$+1])&&wY.has(this.buffer[$+2]))w=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
|
|
134
|
+
`)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
|
|
135
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces($){let w=this.pos-1,g;do g=this.buffer[++w];while(g===" "||$&&g==="\t");let _=w-this.pos;if(_>0)yield this.buffer.substr(this.pos,_),this.pos=w;return _}*pushUntil($){let w=this.pos,g=this.buffer[w];while(!$(g))g=this.buffer[++w];return yield*this.pushToIndex(w,!1)}}qn.Lexer=vY});var l3=E((In)=>{class gY{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let w=0,g=this.lineStarts.length;while(w<g){let v=w+g>>1;if(this.lineStarts[v]<$)w=v+1;else g=v}if(this.lineStarts[w]===$)return{line:w+1,col:1};if(w===0)return{line:0,col:$};let _=this.lineStarts[w-1];return{line:w,col:$-_+1}}}}In.LineCounter=gY});var c3=E((jn)=>{var Vn=J4("process"),_Y=t1(),Fn=h3();function Ov($,w){for(let g=0;g<$.length;++g)if($[g].type===w)return!0;return!1}function UY($){for(let w=0;w<$.length;++w)switch($[w].type){case"space":case"comment":case"newline":break;default:return w}return-1}function GY($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function o1($){switch($.type){case"document":return $.start;case"block-map":{let w=$.items[$.items.length-1];return w.sep??w.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function B6($){if($.length===0)return[];let w=$.length;$:while(--w>=0)switch($[w].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++w]?.type==="space");return $.splice(w,$.length)}function bY($){if($.start.type==="flow-seq-start"){for(let w of $.items)if(w.sep&&!w.value&&!Ov(w.start,"explicit-key-ind")&&!Ov(w.sep,"map-value-ind")){if(w.key)w.value=w.key;if(delete w.key,GY(w.value))if(w.value.end)Array.prototype.push.apply(w.value.end,w.sep);else w.value.end=w.sep;else Array.prototype.push.apply(w.start,w.sep);delete w.sep}}}class DY{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Fn.Lexer,this.onNewLine=$}*parse($,w=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let g of this.lexer.lex($,w))yield*this.next(g);if(!w)yield*this.end()}*next($){if(this.source=$,Vn.env.LOG_TOKENS)console.log("|",_Y.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let w=_Y.tokenType($);if(!w){let g=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:g,source:$}),this.offset+=$.length}else if(w==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=w,yield*this.step(),w){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let w=$??this.stack.pop();if(!w)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield w;else{let g=this.peek(1);if(w.type==="block-scalar")w.indent="indent"in g?g.indent:0;else if(w.type==="flow-collection"&&g.type==="document")w.indent=0;if(w.type==="flow-collection")bY(w);switch(g.type){case"document":g.value=w;break;case"block-scalar":g.props.push(w);break;case"block-map":{let _=g.items[g.items.length-1];if(_.value){g.items.push({start:[],key:w,sep:[]}),this.onKeyLine=!0;return}else if(_.sep)_.value=w;else{Object.assign(_,{key:w,sep:[]}),this.onKeyLine=!_.explicitKey;return}break}case"block-seq":{let _=g.items[g.items.length-1];if(_.value)g.items.push({start:[],value:w});else _.value=w;break}case"flow-collection":{let _=g.items[g.items.length-1];if(!_||_.value)g.items.push({start:[],key:w,sep:[]});else if(_.sep)_.value=w;else Object.assign(_,{key:w,sep:[]});return}default:yield*this.pop(),yield*this.pop(w)}if((g.type==="document"||g.type==="block-map"||g.type==="block-seq")&&(w.type==="block-map"||w.type==="block-seq")){let _=w.items[w.items.length-1];if(_&&!_.sep&&!_.value&&_.start.length>0&&UY(_.start)===-1&&(w.indent===0||_.start.every((v)=>v.type!=="comment"||v.indent<w.indent))){if(g.type==="document")g.end=_.start;else g.items.push({start:_.start});w.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(UY($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let w=this.startBlockValue($);if(w)this.stack.push(w);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let w=o1(this.peek(2)),g=B6(w),_;if($.end)_=$.end,_.push(this.sourceToken),delete $.end;else _=[this.sourceToken];let v={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:g,key:$,sep:_}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=v}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let w=this.source.indexOf(`
|
|
136
|
+
`)+1;while(w!==0)this.onNewLine(this.offset+w),w=this.source.indexOf(`
|
|
137
|
+
`,w)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let w=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,w.value){let g="end"in w.value?w.value.end:void 0;if((Array.isArray(g)?g[g.length-1]:void 0)?.type==="comment")g?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(w.sep)w.sep.push(this.sourceToken);else w.start.push(this.sourceToken);return;case"space":case"comment":if(w.value)$.items.push({start:[this.sourceToken]});else if(w.sep)w.sep.push(this.sourceToken);else{if(this.atIndentedComment(w.start,$.indent)){let _=$.items[$.items.length-2]?.value?.end;if(Array.isArray(_)){Array.prototype.push.apply(_,w.start),_.push(this.sourceToken),$.items.pop();return}}w.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let g=!this.onKeyLine&&this.indent===$.indent,_=g&&(w.sep||w.explicitKey)&&this.type!=="seq-item-ind",v=[];if(_&&w.sep&&!w.value){let U=[];for(let G=0;G<w.sep.length;++G){let D=w.sep[G];switch(D.type){case"newline":U.push(G);break;case"space":break;case"comment":if(D.indent>$.indent)U.length=0;break;default:U.length=0}}if(U.length>=2)v=w.sep.splice(U[1])}switch(this.type){case"anchor":case"tag":if(_||w.value)v.push(this.sourceToken),$.items.push({start:v}),this.onKeyLine=!0;else if(w.sep)w.sep.push(this.sourceToken);else w.start.push(this.sourceToken);return;case"explicit-key-ind":if(!w.sep&&!w.explicitKey)w.start.push(this.sourceToken),w.explicitKey=!0;else if(_||w.value)v.push(this.sourceToken),$.items.push({start:v,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(w.explicitKey)if(!w.sep)if(Ov(w.start,"newline"))Object.assign(w,{key:null,sep:[this.sourceToken]});else{let U=B6(w.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]})}else if(w.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ov(w.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:v,key:null,sep:[this.sourceToken]}]});else if(GY(w.key)&&!Ov(w.sep,"newline")){let U=B6(w.start),G=w.key,D=w.sep;D.push(this.sourceToken),delete w.key,delete w.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:G,sep:D}]})}else if(v.length>0)w.sep=w.sep.concat(v,this.sourceToken);else w.sep.push(this.sourceToken);else if(!w.sep)Object.assign(w,{key:null,sep:[this.sourceToken]});else if(w.value||_)$.items.push({start:v,key:null,sep:[this.sourceToken]});else if(Ov(w.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else w.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let U=this.flowScalar(this.type);if(_||w.value)$.items.push({start:v,key:U,sep:[]}),this.onKeyLine=!0;else if(w.sep)this.stack.push(U);else Object.assign(w,{key:U,sep:[]}),this.onKeyLine=!0;return}default:{let U=this.startBlockValue($);if(U){if(U.type==="block-seq"){if(!w.explicitKey&&w.sep&&!Ov(w.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(g)$.items.push({start:v});this.stack.push(U);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let w=$.items[$.items.length-1];switch(this.type){case"newline":if(w.value){let g="end"in w.value?w.value.end:void 0;if((Array.isArray(g)?g[g.length-1]:void 0)?.type==="comment")g?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else w.start.push(this.sourceToken);return;case"space":case"comment":if(w.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(w.start,$.indent)){let _=$.items[$.items.length-2]?.value?.end;if(Array.isArray(_)){Array.prototype.push.apply(_,w.start),_.push(this.sourceToken),$.items.pop();return}}w.start.push(this.sourceToken)}return;case"anchor":case"tag":if(w.value||this.indent<=$.indent)break;w.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(w.value||Ov(w.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else w.start.push(this.sourceToken);return}if(this.indent>$.indent){let g=this.startBlockValue($);if(g){this.stack.push(g);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let w=$.items[$.items.length-1];if(this.type==="flow-error-end"){let g;do yield*this.pop(),g=this.peek(1);while(g?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!w||w.sep)$.items.push({start:[this.sourceToken]});else w.start.push(this.sourceToken);return;case"map-value-ind":if(!w||w.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(w.sep)w.sep.push(this.sourceToken);else Object.assign(w,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!w||w.value)$.items.push({start:[this.sourceToken]});else if(w.sep)w.sep.push(this.sourceToken);else w.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let _=this.flowScalar(this.type);if(!w||w.value)$.items.push({start:[],key:_,sep:[]});else if(w.sep)this.stack.push(_);else Object.assign(w,{key:_,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let g=this.startBlockValue($);if(g)this.stack.push(g);else yield*this.pop(),yield*this.step()}else{let g=this.peek(2);if(g.type==="block-map"&&(this.type==="map-value-ind"&&g.indent===$.indent||this.type==="newline"&&!g.items[g.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&g.type!=="flow-collection"){let _=o1(g),v=B6(_);bY($);let U=$.end.splice(1,$.end.length);U.push(this.sourceToken);let G={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:v,key:$,sep:U}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=G}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let w=this.source.indexOf(`
|
|
138
|
+
`)+1;while(w!==0)this.onNewLine(this.offset+w),w=this.source.indexOf(`
|
|
139
|
+
`,w)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let w=o1($),g=B6(w);return g.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:g,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let w=o1($),g=B6(w);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:g,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,w){if(this.type!=="comment")return!1;if(this.indent<=w)return!1;return $.every((g)=>g.type==="newline"||g.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}jn.Parser=DY});var WY=E((fn)=>{var JY=S3(),On=M_(),T_=z_(),Nn=l9(),Pn=$$(),kn=l3(),XY=c3();function QY($){let w=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||w&&new kn.LineCounter||null,prettyErrors:w}}function nn($,w={}){let{lineCounter:g,prettyErrors:_}=QY(w),v=new XY.Parser(g?.addNewLine),U=new JY.Composer(w),G=Array.from(U.compose(v.parse($)));if(_&&g)for(let D of G)D.errors.forEach(T_.prettifyError($,g)),D.warnings.forEach(T_.prettifyError($,g));if(G.length>0)return G;return Object.assign([],{empty:!0},U.streamInfo())}function YY($,w={}){let{lineCounter:g,prettyErrors:_}=QY(w),v=new XY.Parser(g?.addNewLine),U=new JY.Composer(w),G=null;for(let D of U.compose(v.parse($),!0,$.length))if(!G)G=D;else if(G.options.logLevel!=="silent"){G.errors.push(new T_.YAMLParseError(D.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(_&&g)G.errors.forEach(T_.prettifyError($,g)),G.warnings.forEach(T_.prettifyError($,g));return G}function Mn($,w,g){let _=void 0;if(typeof w==="function")_=w;else if(g===void 0&&w&&typeof w==="object")g=w;let v=YY($,g);if(!v)return null;if(v.warnings.forEach((U)=>Nn.warn(v.options.logLevel,U)),v.errors.length>0)if(v.options.logLevel!=="silent")throw v.errors[0];else v.errors=[];return v.toJS(Object.assign({reviver:_},g))}function zn($,w,g){let _=null;if(typeof w==="function"||Array.isArray(w))_=w;else if(g===void 0&&w)g=w;if(typeof g==="string")g=g.length;if(typeof g==="number"){let v=Math.round(g);g=v<1?void 0:v>8?{indent:8}:{indent:v}}if($===void 0){let{keepUndefined:v}=g??w??{};if(!v)return}if(Pn.isDocument($)&&!_)return $.toString(g);return new On.Document($,_,g).toString(g)}fn.parse=Mn;fn.parseAllDocuments=nn;fn.parseDocument=YY;fn.stringify=zn});function w8(){let $=new Map;return{register(w,g){$.set(w.name,{definition:w,handler:g})},getTools(){return Array.from($.values()).map((w)=>w.definition)},getHandler(w){return $.get(w)?.handler}}}var s3=$8(m0(),1);var b={};p$(b,{z:()=>p,xor:()=>xb,xid:()=>Xb,void:()=>Rb,uuidv7:()=>vb,uuidv6:()=>wb,uuidv4:()=>$b,uuid:()=>sU,util:()=>n,url:()=>gb,uppercase:()=>pw,unknown:()=>K$,union:()=>zw,undefined:()=>ib,ulid:()=>Jb,uint64:()=>Ab,uint32:()=>Mb,tuple:()=>yv,trim:()=>vv,treeifyError:()=>d6,transform:()=>s4,toUpperCase:()=>_v,toLowerCase:()=>gv,toJSONSchema:()=>M4,templateLiteral:()=>eb,symbol:()=>Sb,superRefine:()=>J_,success:()=>ob,stringbool:()=>U1,stringFormat:()=>jb,string:()=>O,strictObject:()=>Eb,startsWith:()=>aw,slugify:()=>Uv,size:()=>Pw,setErrorMap:()=>n9,set:()=>yb,safeParseAsync:()=>Hg,safeParse:()=>Wg,safeEncodeAsync:()=>jg,safeEncode:()=>Vg,safeDecodeAsync:()=>Kg,safeDecode:()=>Fg,registry:()=>F4,regexes:()=>i$,regex:()=>ow,refine:()=>D_,record:()=>qw,readonly:()=>v_,property:()=>P4,promise:()=>ab,prettifyError:()=>o6,preprocess:()=>G1,prefault:()=>rg,positive:()=>j4,pipe:()=>Zv,partialRecord:()=>hb,parseAsync:()=>Yg,parse:()=>Qg,overwrite:()=>E$,optional:()=>uv,object:()=>T,number:()=>X$,nullish:()=>db,nullable:()=>Ev,null:()=>ng,normalize:()=>wv,nonpositive:()=>O4,nonoptional:()=>pg,nonnegative:()=>N4,never:()=>a4,negative:()=>K4,nativeEnum:()=>mb,nanoid:()=>bb,nan:()=>rb,multipleOf:()=>Ww,minSize:()=>y$,minLength:()=>e$,mime:()=>$v,meta:()=>g1,maxSize:()=>Hw,maxLength:()=>kw,map:()=>cb,mac:()=>Wb,lte:()=>n$,lt:()=>l$,lowercase:()=>rw,looseRecord:()=>lb,looseObject:()=>Zb,locales:()=>Rv,literal:()=>Y$,length:()=>nw,lazy:()=>U_,ksuid:()=>Qb,keyof:()=>ub,jwt:()=>Fb,json:()=>b1,iso:()=>Jv,ipv6:()=>Hb,ipv4:()=>Yb,intersection:()=>Cg,int64:()=>fb,int32:()=>nb,int:()=>i4,instanceof:()=>_1,includes:()=>ew,httpUrl:()=>_b,hostname:()=>Kb,hex:()=>Ob,hash:()=>Nb,guid:()=>aU,gte:()=>j$,gt:()=>c$,globalRegistry:()=>I$,getErrorMap:()=>M9,function:()=>sb,fromJSONSchema:()=>D1,formatError:()=>Sv,float64:()=>kb,float32:()=>Pb,flattenError:()=>Av,file:()=>tb,exactOptional:()=>yg,enum:()=>s,endsWith:()=>sw,encodeAsync:()=>Ig,encode:()=>qg,emoji:()=>Ub,email:()=>eU,e164:()=>Vb,discriminatedUnion:()=>fw,describe:()=>v1,decodeAsync:()=>Lg,decode:()=>Bg,date:()=>Cb,custom:()=>w1,cuid2:()=>Db,cuid:()=>Gb,core:()=>a$,config:()=>Q$,coerce:()=>s$,codec:()=>pb,clone:()=>F$,cidrv6:()=>Bb,cidrv4:()=>qb,check:()=>$1,catch:()=>sg,boolean:()=>J$,bigint:()=>zb,base64url:()=>Lb,base64:()=>Ib,array:()=>v$,any:()=>Tb,_function:()=>sb,_default:()=>dg,_ZodString:()=>T4,ZodXor:()=>ig,ZodXID:()=>h4,ZodVoid:()=>Ag,ZodUnknown:()=>zg,ZodUnion:()=>cv,ZodUndefined:()=>Pg,ZodUUID:()=>m$,ZodURL:()=>xv,ZodULID:()=>x4,ZodType:()=>d,ZodTuple:()=>ug,ZodTransform:()=>lg,ZodTemplateLiteral:()=>g_,ZodSymbol:()=>Ng,ZodSuccess:()=>eg,ZodStringFormat:()=>g$,ZodString:()=>Qv,ZodSet:()=>Zg,ZodRecord:()=>mv,ZodRealError:()=>O$,ZodReadonly:()=>w_,ZodPromise:()=>b_,ZodPrefault:()=>og,ZodPipe:()=>v6,ZodOptional:()=>$6,ZodObject:()=>lv,ZodNumberFormat:()=>Mw,ZodNumber:()=>Wv,ZodNullable:()=>mg,ZodNull:()=>kg,ZodNonOptional:()=>w6,ZodNever:()=>fg,ZodNanoID:()=>u4,ZodNaN:()=>$_,ZodMap:()=>Eg,ZodMAC:()=>Og,ZodLiteral:()=>xg,ZodLazy:()=>__,ZodKSUID:()=>l4,ZodJWT:()=>p4,ZodIssueCode:()=>z$,ZodIntersection:()=>Rg,ZodISOTime:()=>A4,ZodISODuration:()=>S4,ZodISODateTime:()=>z4,ZodISODate:()=>f4,ZodIPv6:()=>y4,ZodIPv4:()=>c4,ZodGUID:()=>Cv,ZodFunction:()=>G_,ZodFirstPartyTypeKind:()=>X_,ZodFile:()=>hg,ZodExactOptional:()=>cg,ZodError:()=>k9,ZodEnum:()=>Xv,ZodEmoji:()=>C4,ZodEmail:()=>R4,ZodE164:()=>r4,ZodDiscriminatedUnion:()=>Tg,ZodDefault:()=>tg,ZodDate:()=>hv,ZodCustomStringFormat:()=>Yv,ZodCustom:()=>tv,ZodCodec:()=>g6,ZodCatch:()=>ag,ZodCUID2:()=>Z4,ZodCUID:()=>E4,ZodCIDRv6:()=>t4,ZodCIDRv4:()=>m4,ZodBoolean:()=>Hv,ZodBigIntFormat:()=>e4,ZodBigInt:()=>qv,ZodBase64URL:()=>o4,ZodBase64:()=>d4,ZodArray:()=>Sg,ZodAny:()=>Mg,TimePrecision:()=>Jg,NEVER:()=>Z6,$output:()=>Ug,$input:()=>bg,$brand:()=>x6});var z9={};p$(z9,{z:()=>_6,xor:()=>xb,xid:()=>Xb,void:()=>Rb,uuidv7:()=>vb,uuidv6:()=>wb,uuidv4:()=>$b,uuid:()=>sU,util:()=>n,url:()=>gb,uppercase:()=>pw,unknown:()=>K$,union:()=>zw,undefined:()=>ib,ulid:()=>Jb,uint64:()=>Ab,uint32:()=>Mb,tuple:()=>yv,trim:()=>vv,treeifyError:()=>d6,transform:()=>s4,toUpperCase:()=>_v,toLowerCase:()=>gv,toJSONSchema:()=>M4,templateLiteral:()=>eb,symbol:()=>Sb,superRefine:()=>J_,success:()=>ob,stringbool:()=>U1,stringFormat:()=>jb,string:()=>O,strictObject:()=>Eb,startsWith:()=>aw,slugify:()=>Uv,size:()=>Pw,setErrorMap:()=>n9,set:()=>yb,safeParseAsync:()=>Hg,safeParse:()=>Wg,safeEncodeAsync:()=>jg,safeEncode:()=>Vg,safeDecodeAsync:()=>Kg,safeDecode:()=>Fg,registry:()=>F4,regexes:()=>i$,regex:()=>ow,refine:()=>D_,record:()=>qw,readonly:()=>v_,property:()=>P4,promise:()=>ab,prettifyError:()=>o6,preprocess:()=>G1,prefault:()=>rg,positive:()=>j4,pipe:()=>Zv,partialRecord:()=>hb,parseAsync:()=>Yg,parse:()=>Qg,overwrite:()=>E$,optional:()=>uv,object:()=>T,number:()=>X$,nullish:()=>db,nullable:()=>Ev,null:()=>ng,normalize:()=>wv,nonpositive:()=>O4,nonoptional:()=>pg,nonnegative:()=>N4,never:()=>a4,negative:()=>K4,nativeEnum:()=>mb,nanoid:()=>bb,nan:()=>rb,multipleOf:()=>Ww,minSize:()=>y$,minLength:()=>e$,mime:()=>$v,meta:()=>g1,maxSize:()=>Hw,maxLength:()=>kw,map:()=>cb,mac:()=>Wb,lte:()=>n$,lt:()=>l$,lowercase:()=>rw,looseRecord:()=>lb,looseObject:()=>Zb,locales:()=>Rv,literal:()=>Y$,length:()=>nw,lazy:()=>U_,ksuid:()=>Qb,keyof:()=>ub,jwt:()=>Fb,json:()=>b1,iso:()=>Jv,ipv6:()=>Hb,ipv4:()=>Yb,intersection:()=>Cg,int64:()=>fb,int32:()=>nb,int:()=>i4,instanceof:()=>_1,includes:()=>ew,httpUrl:()=>_b,hostname:()=>Kb,hex:()=>Ob,hash:()=>Nb,guid:()=>aU,gte:()=>j$,gt:()=>c$,globalRegistry:()=>I$,getErrorMap:()=>M9,function:()=>sb,fromJSONSchema:()=>D1,formatError:()=>Sv,float64:()=>kb,float32:()=>Pb,flattenError:()=>Av,file:()=>tb,exactOptional:()=>yg,enum:()=>s,endsWith:()=>sw,encodeAsync:()=>Ig,encode:()=>qg,emoji:()=>Ub,email:()=>eU,e164:()=>Vb,discriminatedUnion:()=>fw,describe:()=>v1,default:()=>KL,decodeAsync:()=>Lg,decode:()=>Bg,date:()=>Cb,custom:()=>w1,cuid2:()=>Db,cuid:()=>Gb,core:()=>a$,config:()=>Q$,coerce:()=>s$,codec:()=>pb,clone:()=>F$,cidrv6:()=>Bb,cidrv4:()=>qb,check:()=>$1,catch:()=>sg,boolean:()=>J$,bigint:()=>zb,base64url:()=>Lb,base64:()=>Ib,array:()=>v$,any:()=>Tb,_function:()=>sb,_default:()=>dg,_ZodString:()=>T4,ZodXor:()=>ig,ZodXID:()=>h4,ZodVoid:()=>Ag,ZodUnknown:()=>zg,ZodUnion:()=>cv,ZodUndefined:()=>Pg,ZodUUID:()=>m$,ZodURL:()=>xv,ZodULID:()=>x4,ZodType:()=>d,ZodTuple:()=>ug,ZodTransform:()=>lg,ZodTemplateLiteral:()=>g_,ZodSymbol:()=>Ng,ZodSuccess:()=>eg,ZodStringFormat:()=>g$,ZodString:()=>Qv,ZodSet:()=>Zg,ZodRecord:()=>mv,ZodRealError:()=>O$,ZodReadonly:()=>w_,ZodPromise:()=>b_,ZodPrefault:()=>og,ZodPipe:()=>v6,ZodOptional:()=>$6,ZodObject:()=>lv,ZodNumberFormat:()=>Mw,ZodNumber:()=>Wv,ZodNullable:()=>mg,ZodNull:()=>kg,ZodNonOptional:()=>w6,ZodNever:()=>fg,ZodNanoID:()=>u4,ZodNaN:()=>$_,ZodMap:()=>Eg,ZodMAC:()=>Og,ZodLiteral:()=>xg,ZodLazy:()=>__,ZodKSUID:()=>l4,ZodJWT:()=>p4,ZodIssueCode:()=>z$,ZodIntersection:()=>Rg,ZodISOTime:()=>A4,ZodISODuration:()=>S4,ZodISODateTime:()=>z4,ZodISODate:()=>f4,ZodIPv6:()=>y4,ZodIPv4:()=>c4,ZodGUID:()=>Cv,ZodFunction:()=>G_,ZodFirstPartyTypeKind:()=>X_,ZodFile:()=>hg,ZodExactOptional:()=>cg,ZodError:()=>k9,ZodEnum:()=>Xv,ZodEmoji:()=>C4,ZodEmail:()=>R4,ZodE164:()=>r4,ZodDiscriminatedUnion:()=>Tg,ZodDefault:()=>tg,ZodDate:()=>hv,ZodCustomStringFormat:()=>Yv,ZodCustom:()=>tv,ZodCodec:()=>g6,ZodCatch:()=>ag,ZodCUID2:()=>Z4,ZodCUID:()=>E4,ZodCIDRv6:()=>t4,ZodCIDRv4:()=>m4,ZodBoolean:()=>Hv,ZodBigIntFormat:()=>e4,ZodBigInt:()=>qv,ZodBase64URL:()=>o4,ZodBase64:()=>d4,ZodArray:()=>Sg,ZodAny:()=>Mg,TimePrecision:()=>Jg,NEVER:()=>Z6,$output:()=>Ug,$input:()=>bg,$brand:()=>x6});var _6={};p$(_6,{xor:()=>xb,xid:()=>Xb,void:()=>Rb,uuidv7:()=>vb,uuidv6:()=>wb,uuidv4:()=>$b,uuid:()=>sU,util:()=>n,url:()=>gb,uppercase:()=>pw,unknown:()=>K$,union:()=>zw,undefined:()=>ib,ulid:()=>Jb,uint64:()=>Ab,uint32:()=>Mb,tuple:()=>yv,trim:()=>vv,treeifyError:()=>d6,transform:()=>s4,toUpperCase:()=>_v,toLowerCase:()=>gv,toJSONSchema:()=>M4,templateLiteral:()=>eb,symbol:()=>Sb,superRefine:()=>J_,success:()=>ob,stringbool:()=>U1,stringFormat:()=>jb,string:()=>O,strictObject:()=>Eb,startsWith:()=>aw,slugify:()=>Uv,size:()=>Pw,setErrorMap:()=>n9,set:()=>yb,safeParseAsync:()=>Hg,safeParse:()=>Wg,safeEncodeAsync:()=>jg,safeEncode:()=>Vg,safeDecodeAsync:()=>Kg,safeDecode:()=>Fg,registry:()=>F4,regexes:()=>i$,regex:()=>ow,refine:()=>D_,record:()=>qw,readonly:()=>v_,property:()=>P4,promise:()=>ab,prettifyError:()=>o6,preprocess:()=>G1,prefault:()=>rg,positive:()=>j4,pipe:()=>Zv,partialRecord:()=>hb,parseAsync:()=>Yg,parse:()=>Qg,overwrite:()=>E$,optional:()=>uv,object:()=>T,number:()=>X$,nullish:()=>db,nullable:()=>Ev,null:()=>ng,normalize:()=>wv,nonpositive:()=>O4,nonoptional:()=>pg,nonnegative:()=>N4,never:()=>a4,negative:()=>K4,nativeEnum:()=>mb,nanoid:()=>bb,nan:()=>rb,multipleOf:()=>Ww,minSize:()=>y$,minLength:()=>e$,mime:()=>$v,meta:()=>g1,maxSize:()=>Hw,maxLength:()=>kw,map:()=>cb,mac:()=>Wb,lte:()=>n$,lt:()=>l$,lowercase:()=>rw,looseRecord:()=>lb,looseObject:()=>Zb,locales:()=>Rv,literal:()=>Y$,length:()=>nw,lazy:()=>U_,ksuid:()=>Qb,keyof:()=>ub,jwt:()=>Fb,json:()=>b1,iso:()=>Jv,ipv6:()=>Hb,ipv4:()=>Yb,intersection:()=>Cg,int64:()=>fb,int32:()=>nb,int:()=>i4,instanceof:()=>_1,includes:()=>ew,httpUrl:()=>_b,hostname:()=>Kb,hex:()=>Ob,hash:()=>Nb,guid:()=>aU,gte:()=>j$,gt:()=>c$,globalRegistry:()=>I$,getErrorMap:()=>M9,function:()=>sb,fromJSONSchema:()=>D1,formatError:()=>Sv,float64:()=>kb,float32:()=>Pb,flattenError:()=>Av,file:()=>tb,exactOptional:()=>yg,enum:()=>s,endsWith:()=>sw,encodeAsync:()=>Ig,encode:()=>qg,emoji:()=>Ub,email:()=>eU,e164:()=>Vb,discriminatedUnion:()=>fw,describe:()=>v1,decodeAsync:()=>Lg,decode:()=>Bg,date:()=>Cb,custom:()=>w1,cuid2:()=>Db,cuid:()=>Gb,core:()=>a$,config:()=>Q$,coerce:()=>s$,codec:()=>pb,clone:()=>F$,cidrv6:()=>Bb,cidrv4:()=>qb,check:()=>$1,catch:()=>sg,boolean:()=>J$,bigint:()=>zb,base64url:()=>Lb,base64:()=>Ib,array:()=>v$,any:()=>Tb,_function:()=>sb,_default:()=>dg,_ZodString:()=>T4,ZodXor:()=>ig,ZodXID:()=>h4,ZodVoid:()=>Ag,ZodUnknown:()=>zg,ZodUnion:()=>cv,ZodUndefined:()=>Pg,ZodUUID:()=>m$,ZodURL:()=>xv,ZodULID:()=>x4,ZodType:()=>d,ZodTuple:()=>ug,ZodTransform:()=>lg,ZodTemplateLiteral:()=>g_,ZodSymbol:()=>Ng,ZodSuccess:()=>eg,ZodStringFormat:()=>g$,ZodString:()=>Qv,ZodSet:()=>Zg,ZodRecord:()=>mv,ZodRealError:()=>O$,ZodReadonly:()=>w_,ZodPromise:()=>b_,ZodPrefault:()=>og,ZodPipe:()=>v6,ZodOptional:()=>$6,ZodObject:()=>lv,ZodNumberFormat:()=>Mw,ZodNumber:()=>Wv,ZodNullable:()=>mg,ZodNull:()=>kg,ZodNonOptional:()=>w6,ZodNever:()=>fg,ZodNanoID:()=>u4,ZodNaN:()=>$_,ZodMap:()=>Eg,ZodMAC:()=>Og,ZodLiteral:()=>xg,ZodLazy:()=>__,ZodKSUID:()=>l4,ZodJWT:()=>p4,ZodIssueCode:()=>z$,ZodIntersection:()=>Rg,ZodISOTime:()=>A4,ZodISODuration:()=>S4,ZodISODateTime:()=>z4,ZodISODate:()=>f4,ZodIPv6:()=>y4,ZodIPv4:()=>c4,ZodGUID:()=>Cv,ZodFunction:()=>G_,ZodFirstPartyTypeKind:()=>X_,ZodFile:()=>hg,ZodExactOptional:()=>cg,ZodError:()=>k9,ZodEnum:()=>Xv,ZodEmoji:()=>C4,ZodEmail:()=>R4,ZodE164:()=>r4,ZodDiscriminatedUnion:()=>Tg,ZodDefault:()=>tg,ZodDate:()=>hv,ZodCustomStringFormat:()=>Yv,ZodCustom:()=>tv,ZodCodec:()=>g6,ZodCatch:()=>ag,ZodCUID2:()=>Z4,ZodCUID:()=>E4,ZodCIDRv6:()=>t4,ZodCIDRv4:()=>m4,ZodBoolean:()=>Hv,ZodBigIntFormat:()=>e4,ZodBigInt:()=>qv,ZodBase64URL:()=>o4,ZodBase64:()=>d4,ZodArray:()=>Sg,ZodAny:()=>Mg,TimePrecision:()=>Jg,NEVER:()=>Z6,$output:()=>Ug,$input:()=>bg,$brand:()=>x6});var a$={};p$(a$,{version:()=>r2,util:()=>n,treeifyError:()=>d6,toJSONSchema:()=>M4,toDotPath:()=>G8,safeParseAsync:()=>v2,safeParse:()=>w2,safeEncodeAsync:()=>LB,safeEncode:()=>BB,safeDecodeAsync:()=>VB,safeDecode:()=>IB,registry:()=>F4,regexes:()=>i$,process:()=>_$,prettifyError:()=>o6,parseAsync:()=>UU,parse:()=>_U,meta:()=>RJ,locales:()=>Rv,isValidJWT:()=>k8,isValidBase64URL:()=>P8,isValidBase64:()=>IG,initializeContext:()=>bv,globalRegistry:()=>I$,globalConfig:()=>E6,formatError:()=>Sv,flattenError:()=>Av,finalize:()=>Dv,extractDefs:()=>Gv,encodeAsync:()=>HB,encode:()=>YB,describe:()=>TJ,decodeAsync:()=>qB,decode:()=>WB,createToJSONSchemaMethod:()=>uJ,createStandardJSONSchemaMethod:()=>n4,config:()=>Q$,clone:()=>F$,_xor:()=>cI,_xid:()=>uU,_void:()=>PJ,_uuidv7:()=>AU,_uuidv6:()=>fU,_uuidv4:()=>zU,_uuid:()=>MU,_url:()=>Dg,_uppercase:()=>pw,_unknown:()=>OJ,_union:()=>lI,_undefined:()=>FJ,_ulid:()=>CU,_uint64:()=>LJ,_uint32:()=>YJ,_tuple:()=>tI,_trim:()=>vv,_transform:()=>sI,_toUpperCase:()=>_v,_toLowerCase:()=>gv,_templateLiteral:()=>DL,_symbol:()=>VJ,_superRefine:()=>iJ,_success:()=>_L,_stringbool:()=>CJ,_stringFormat:()=>k4,_string:()=>sD,_startsWith:()=>aw,_slugify:()=>Uv,_size:()=>Pw,_set:()=>rI,_safeParseAsync:()=>I4,_safeParse:()=>B4,_safeEncodeAsync:()=>YU,_safeEncode:()=>XU,_safeDecodeAsync:()=>WU,_safeDecode:()=>QU,_regex:()=>ow,_refine:()=>SJ,_record:()=>dI,_readonly:()=>GL,_property:()=>P4,_promise:()=>XL,_positive:()=>j4,_pipe:()=>bL,_parseAsync:()=>q4,_parse:()=>H4,_overwrite:()=>E$,_optional:()=>$L,_number:()=>bJ,_nullable:()=>wL,_null:()=>jJ,_normalize:()=>wv,_nonpositive:()=>O4,_nonoptional:()=>gL,_nonnegative:()=>N4,_never:()=>NJ,_negative:()=>K4,_nativeEnum:()=>eI,_nanoid:()=>iU,_nan:()=>MJ,_multipleOf:()=>Ww,_minSize:()=>y$,_minLength:()=>e$,_min:()=>j$,_mime:()=>$v,_maxSize:()=>Hw,_maxLength:()=>kw,_max:()=>n$,_map:()=>oI,_mac:()=>wJ,_lte:()=>n$,_lt:()=>l$,_lowercase:()=>rw,_literal:()=>aI,_length:()=>nw,_lazy:()=>JL,_ksuid:()=>EU,_jwt:()=>tU,_isoTime:()=>_J,_isoDuration:()=>UJ,_isoDateTime:()=>vJ,_isoDate:()=>gJ,_ipv6:()=>xU,_ipv4:()=>ZU,_intersection:()=>mI,_int64:()=>IJ,_int32:()=>QJ,_int:()=>DJ,_includes:()=>ew,_guid:()=>Gg,_gte:()=>j$,_gt:()=>c$,_float64:()=>XJ,_float32:()=>JJ,_file:()=>fJ,_enum:()=>pI,_endsWith:()=>sw,_encodeAsync:()=>DU,_encode:()=>bU,_emoji:()=>SU,_email:()=>nU,_e164:()=>mU,_discriminatedUnion:()=>yI,_default:()=>vL,_decodeAsync:()=>JU,_decode:()=>GU,_date:()=>kJ,_custom:()=>AJ,_cuid2:()=>RU,_cuid:()=>TU,_coercedString:()=>$J,_coercedNumber:()=>GJ,_coercedDate:()=>nJ,_coercedBoolean:()=>HJ,_coercedBigint:()=>BJ,_cidrv6:()=>lU,_cidrv4:()=>hU,_check:()=>R8,_catch:()=>UL,_boolean:()=>WJ,_bigint:()=>qJ,_base64url:()=>yU,_base64:()=>cU,_array:()=>zJ,_any:()=>KJ,TimePrecision:()=>Jg,NEVER:()=>Z6,JSONSchemaGenerator:()=>j9,JSONSchema:()=>C8,Doc:()=>IU,$output:()=>Ug,$input:()=>bg,$constructor:()=>j,$brand:()=>x6,$ZodXor:()=>RG,$ZodXID:()=>bG,$ZodVoid:()=>AG,$ZodUnknown:()=>zG,$ZodUnion:()=>s6,$ZodUndefined:()=>kG,$ZodUUID:()=>a2,$ZodURL:()=>$G,$ZodULID:()=>UG,$ZodType:()=>t,$ZodTuple:()=>PU,$ZodTransform:()=>yG,$ZodTemplateLiteral:()=>wD,$ZodSymbol:()=>PG,$ZodSuccess:()=>pG,$ZodStringFormat:()=>b$,$ZodString:()=>Tv,$ZodSet:()=>xG,$ZodRegistry:()=>aD,$ZodRecord:()=>EG,$ZodRealError:()=>S$,$ZodReadonly:()=>$D,$ZodPromise:()=>gD,$ZodPrefault:()=>oG,$ZodPipe:()=>sG,$ZodOptional:()=>kU,$ZodObjectJIT:()=>TG,$ZodObject:()=>z8,$ZodNumberFormat:()=>OG,$ZodNumber:()=>OU,$ZodNullable:()=>tG,$ZodNull:()=>nG,$ZodNonOptional:()=>rG,$ZodNever:()=>fG,$ZodNanoID:()=>vG,$ZodNaN:()=>aG,$ZodMap:()=>ZG,$ZodMAC:()=>HG,$ZodLiteral:()=>lG,$ZodLazy:()=>_D,$ZodKSUID:()=>GG,$ZodJWT:()=>jG,$ZodIntersection:()=>uG,$ZodISOTime:()=>XG,$ZodISODuration:()=>QG,$ZodISODateTime:()=>DG,$ZodISODate:()=>JG,$ZodIPv6:()=>WG,$ZodIPv4:()=>YG,$ZodGUID:()=>e2,$ZodFunction:()=>vD,$ZodFile:()=>cG,$ZodExactOptional:()=>mG,$ZodError:()=>t6,$ZodEnum:()=>hG,$ZodEncodeError:()=>zv,$ZodEmoji:()=>wG,$ZodEmail:()=>s2,$ZodE164:()=>FG,$ZodDiscriminatedUnion:()=>CG,$ZodDefault:()=>dG,$ZodDate:()=>SG,$ZodCustomStringFormat:()=>KG,$ZodCustom:()=>UD,$ZodCodec:()=>$g,$ZodCheckUpperCase:()=>l2,$ZodCheckStringFormat:()=>L4,$ZodCheckStartsWith:()=>y2,$ZodCheckSizeEquals:()=>C2,$ZodCheckRegex:()=>x2,$ZodCheckProperty:()=>t2,$ZodCheckOverwrite:()=>o2,$ZodCheckNumberFormat:()=>S2,$ZodCheckMultipleOf:()=>A2,$ZodCheckMinSize:()=>R2,$ZodCheckMinLength:()=>E2,$ZodCheckMimeType:()=>d2,$ZodCheckMaxSize:()=>T2,$ZodCheckMaxLength:()=>u2,$ZodCheckLowerCase:()=>h2,$ZodCheckLessThan:()=>qU,$ZodCheckLengthEquals:()=>Z2,$ZodCheckIncludes:()=>c2,$ZodCheckGreaterThan:()=>BU,$ZodCheckEndsWith:()=>m2,$ZodCheckBigIntFormat:()=>i2,$ZodCheck:()=>D$,$ZodCatch:()=>eG,$ZodCUID2:()=>_G,$ZodCUID:()=>gG,$ZodCIDRv6:()=>BG,$ZodCIDRv4:()=>qG,$ZodBoolean:()=>a6,$ZodBigIntFormat:()=>NG,$ZodBigInt:()=>NU,$ZodBase64URL:()=>VG,$ZodBase64:()=>LG,$ZodAsyncError:()=>Yw,$ZodArray:()=>iG,$ZodAny:()=>MG});var Z6=Object.freeze({status:"aborted"});function j($,w,g){function _(D,J){if(!D._zod)Object.defineProperty(D,"_zod",{value:{def:J,constr:G,traits:new Set},enumerable:!1});if(D._zod.traits.has($))return;D._zod.traits.add($),w(D,J);let X=G.prototype,Q=Object.keys(X);for(let Y=0;Y<Q.length;Y++){let q=Q[Y];if(!(q in D))D[q]=X[q].bind(D)}}let v=g?.Parent??Object;class U extends v{}Object.defineProperty(U,"name",{value:$});function G(D){var J;let X=g?.Parent?new U:this;_(X,D),(J=X._zod).deferred??(J.deferred=[]);for(let Q of X._zod.deferred)Q();return X}return Object.defineProperty(G,"init",{value:_}),Object.defineProperty(G,Symbol.hasInstance,{value:(D)=>{if(g?.Parent&&D instanceof g.Parent)return!0;return D?._zod?.traits?.has($)}}),Object.defineProperty(G,"name",{value:$}),G}var x6=Symbol("zod_brand");class Yw extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class zv extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var E6={};function Q$($){if($)Object.assign(E6,$);return E6}var n={};p$(n,{unwrapMessage:()=>h6,uint8ArrayToHex:()=>XB,uint8ArrayToBase64url:()=>DB,uint8ArrayToBase64:()=>_8,stringifyPrimitive:()=>k,slugify:()=>o0,shallowClone:()=>p0,safeExtend:()=>vB,required:()=>UB,randomString:()=>rq,propertyKeyTypes:()=>c6,promiseAllObject:()=>oq,primitiveTypes:()=>e0,prefixIssues:()=>u$,pick:()=>sq,partial:()=>_B,parsedType:()=>M,optionalKeys:()=>a0,omit:()=>$B,objectClone:()=>mq,numKeys:()=>pq,nullish:()=>yw,normalizeParams:()=>A,mergeDefs:()=>Nw,merge:()=>gB,jsonStringifyReplacer:()=>Q4,joinValues:()=>N,issue:()=>W4,isPlainObject:()=>tw,isObject:()=>fv,hexToUint8Array:()=>JB,getSizableOrigin:()=>y6,getParsedType:()=>eq,getLengthableOrigin:()=>m6,getEnumValues:()=>X4,getElementAtPath:()=>dq,floatSafeRemainder:()=>d0,finalizeIssue:()=>A$,extend:()=>wB,escapeRegex:()=>h$,esc:()=>vU,defineLazy:()=>a,createTransparentProxy:()=>aq,cloneDef:()=>tq,clone:()=>F$,cleanRegex:()=>l6,cleanEnum:()=>bB,captureStackTrace:()=>gU,cached:()=>Y4,base64urlToUint8Array:()=>GB,base64ToUint8Array:()=>g8,assignProp:()=>mw,assertNotEqual:()=>hq,assertNever:()=>cq,assertIs:()=>lq,assertEqual:()=>xq,assert:()=>yq,allowsEval:()=>r0,aborted:()=>dw,NUMBER_FORMAT_RANGES:()=>s0,Class:()=>U8,BIGINT_FORMAT_RANGES:()=>$2});function xq($){return $}function hq($){return $}function lq($){}function cq($){throw Error("Unexpected value in exhaustive check")}function yq($){}function X4($){let w=Object.values($).filter((_)=>typeof _==="number");return Object.entries($).filter(([_,v])=>w.indexOf(+_)===-1).map(([_,v])=>v)}function N($,w="|"){return $.map((g)=>k(g)).join(w)}function Q4($,w){if(typeof w==="bigint")return w.toString();return w}function Y4($){return{get value(){{let g=$();return Object.defineProperty(this,"value",{value:g}),g}throw Error("cached value already set")}}}function yw($){return $===null||$===void 0}function l6($){let w=$.startsWith("^")?1:0,g=$.endsWith("$")?$.length-1:$.length;return $.slice(w,g)}function d0($,w){let g=($.toString().split(".")[1]||"").length,_=w.toString(),v=(_.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(_)){let J=_.match(/\d?e-(\d?)/);if(J?.[1])v=Number.parseInt(J[1])}let U=g>v?g:v,G=Number.parseInt($.toFixed(U).replace(".","")),D=Number.parseInt(w.toFixed(U).replace(".",""));return G%D/10**U}var v8=Symbol("evaluating");function a($,w,g){let _=void 0;Object.defineProperty($,w,{get(){if(_===v8)return;if(_===void 0)_=v8,_=g();return _},set(v){Object.defineProperty($,w,{value:v})},configurable:!0})}function mq($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function mw($,w,g){Object.defineProperty($,w,{value:g,writable:!0,enumerable:!0,configurable:!0})}function Nw(...$){let w={};for(let g of $){let _=Object.getOwnPropertyDescriptors(g);Object.assign(w,_)}return Object.defineProperties({},w)}function tq($){return Nw($._zod.def)}function dq($,w){if(!w)return $;return w.reduce((g,_)=>g?.[_],$)}function oq($){let w=Object.keys($),g=w.map((_)=>$[_]);return Promise.all(g).then((_)=>{let v={};for(let U=0;U<w.length;U++)v[w[U]]=_[U];return v})}function rq($=10){let g="";for(let _=0;_<$;_++)g+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return g}function vU($){return JSON.stringify($)}function o0($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var gU="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function fv($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var r0=Y4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function tw($){if(fv($)===!1)return!1;let w=$.constructor;if(w===void 0)return!0;if(typeof w!=="function")return!0;let g=w.prototype;if(fv(g)===!1)return!1;if(Object.prototype.hasOwnProperty.call(g,"isPrototypeOf")===!1)return!1;return!0}function p0($){if(tw($))return{...$};if(Array.isArray($))return[...$];return $}function pq($){let w=0;for(let g in $)if(Object.prototype.hasOwnProperty.call($,g))w++;return w}var eq=($)=>{let w=typeof $;switch(w){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${w}`)}},c6=new Set(["string","number","symbol"]),e0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function h$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F$($,w,g){let _=new $._zod.constr(w??$._zod.def);if(!w||g?.parent)_._zod.parent=$;return _}function A($){let w=$;if(!w)return{};if(typeof w==="string")return{error:()=>w};if(w?.message!==void 0){if(w?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");w.error=w.message}if(delete w.message,typeof w.error==="string")return{...w,error:()=>w.error};return w}function aq($){let w;return new Proxy({},{get(g,_,v){return w??(w=$()),Reflect.get(w,_,v)},set(g,_,v,U){return w??(w=$()),Reflect.set(w,_,v,U)},has(g,_){return w??(w=$()),Reflect.has(w,_)},deleteProperty(g,_){return w??(w=$()),Reflect.deleteProperty(w,_)},ownKeys(g){return w??(w=$()),Reflect.ownKeys(w)},getOwnPropertyDescriptor(g,_){return w??(w=$()),Reflect.getOwnPropertyDescriptor(w,_)},defineProperty(g,_,v){return w??(w=$()),Reflect.defineProperty(w,_,v)}})}function k($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function a0($){return Object.keys($).filter((w)=>{return $[w]._zod.optin==="optional"&&$[w]._zod.optout==="optional"})}var s0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$2={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function sq($,w){let g=$._zod.def,_=g.checks;if(_&&_.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let U=Nw($._zod.def,{get shape(){let G={};for(let D in w){if(!(D in g.shape))throw Error(`Unrecognized key: "${D}"`);if(!w[D])continue;G[D]=g.shape[D]}return mw(this,"shape",G),G},checks:[]});return F$($,U)}function $B($,w){let g=$._zod.def,_=g.checks;if(_&&_.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let U=Nw($._zod.def,{get shape(){let G={...$._zod.def.shape};for(let D in w){if(!(D in g.shape))throw Error(`Unrecognized key: "${D}"`);if(!w[D])continue;delete G[D]}return mw(this,"shape",G),G},checks:[]});return F$($,U)}function wB($,w){if(!tw(w))throw Error("Invalid input to extend: expected a plain object");let g=$._zod.def.checks;if(g&&g.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let v=Nw($._zod.def,{get shape(){let U={...$._zod.def.shape,...w};return mw(this,"shape",U),U},checks:[]});return F$($,v)}function vB($,w){if(!tw(w))throw Error("Invalid input to safeExtend: expected a plain object");let g=Nw($._zod.def,{get shape(){let _={...$._zod.def.shape,...w};return mw(this,"shape",_),_}});return F$($,g)}function gB($,w){let g=Nw($._zod.def,{get shape(){let _={...$._zod.def.shape,...w._zod.def.shape};return mw(this,"shape",_),_},get catchall(){return w._zod.def.catchall},checks:[]});return F$($,g)}function _B($,w,g){let v=w._zod.def.checks;if(v&&v.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let G=Nw(w._zod.def,{get shape(){let D=w._zod.def.shape,J={...D};if(g)for(let X in g){if(!(X in D))throw Error(`Unrecognized key: "${X}"`);if(!g[X])continue;J[X]=$?new $({type:"optional",innerType:D[X]}):D[X]}else for(let X in D)J[X]=$?new $({type:"optional",innerType:D[X]}):D[X];return mw(this,"shape",J),J},checks:[]});return F$(w,G)}function UB($,w,g){let _=Nw(w._zod.def,{get shape(){let v=w._zod.def.shape,U={...v};if(g)for(let G in g){if(!(G in U))throw Error(`Unrecognized key: "${G}"`);if(!g[G])continue;U[G]=new $({type:"nonoptional",innerType:v[G]})}else for(let G in v)U[G]=new $({type:"nonoptional",innerType:v[G]});return mw(this,"shape",U),U}});return F$(w,_)}function dw($,w=0){if($.aborted===!0)return!0;for(let g=w;g<$.issues.length;g++)if($.issues[g]?.continue!==!0)return!0;return!1}function u$($,w){return w.map((g)=>{var _;return(_=g).path??(_.path=[]),g.path.unshift($),g})}function h6($){return typeof $==="string"?$:$?.message}function A$($,w,g){let _={...$,path:$.path??[]};if(!$.message){let v=h6($.inst?._zod.def?.error?.($))??h6(w?.error?.($))??h6(g.customError?.($))??h6(g.localeError?.($))??"Invalid input";_.message=v}if(delete _.inst,delete _.continue,!w?.reportInput)delete _.input;return _}function y6($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function m6($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function M($){let w=typeof $;switch(w){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let g=$;if(g&&Object.getPrototypeOf(g)!==Object.prototype&&"constructor"in g&&g.constructor)return g.constructor.name}}return w}function W4(...$){let[w,g,_]=$;if(typeof w==="string")return{message:w,code:"custom",input:g,inst:_};return{...w}}function bB($){return Object.entries($).filter(([w,g])=>{return Number.isNaN(Number.parseInt(w,10))}).map((w)=>w[1])}function g8($){let w=atob($),g=new Uint8Array(w.length);for(let _=0;_<w.length;_++)g[_]=w.charCodeAt(_);return g}function _8($){let w="";for(let g=0;g<$.length;g++)w+=String.fromCharCode($[g]);return btoa(w)}function GB($){let w=$.replace(/-/g,"+").replace(/_/g,"/"),g="=".repeat((4-w.length%4)%4);return g8(w+g)}function DB($){return _8($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JB($){let w=$.replace(/^0x/,"");if(w.length%2!==0)throw Error("Invalid hex string length");let g=new Uint8Array(w.length/2);for(let _=0;_<w.length;_+=2)g[_/2]=Number.parseInt(w.slice(_,_+2),16);return g}function XB($){return Array.from($).map((w)=>w.toString(16).padStart(2,"0")).join("")}class U8{constructor(...$){}}var b8=($,w)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:w,enumerable:!1}),$.message=JSON.stringify(w,Q4,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},t6=j("$ZodError",b8),S$=j("$ZodError",b8,{Parent:Error});function Av($,w=(g)=>g.message){let g={},_=[];for(let v of $.issues)if(v.path.length>0)g[v.path[0]]=g[v.path[0]]||[],g[v.path[0]].push(w(v));else _.push(w(v));return{formErrors:_,fieldErrors:g}}function Sv($,w=(g)=>g.message){let g={_errors:[]},_=(v)=>{for(let U of v.issues)if(U.code==="invalid_union"&&U.errors.length)U.errors.map((G)=>_({issues:G}));else if(U.code==="invalid_key")_({issues:U.issues});else if(U.code==="invalid_element")_({issues:U.issues});else if(U.path.length===0)g._errors.push(w(U));else{let G=g,D=0;while(D<U.path.length){let J=U.path[D];if(D!==U.path.length-1)G[J]=G[J]||{_errors:[]};else G[J]=G[J]||{_errors:[]},G[J]._errors.push(w(U));G=G[J],D++}}};return _($),g}function d6($,w=(g)=>g.message){let g={errors:[]},_=(v,U=[])=>{var G,D;for(let J of v.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((X)=>_({issues:X},J.path));else if(J.code==="invalid_key")_({issues:J.issues},J.path);else if(J.code==="invalid_element")_({issues:J.issues},J.path);else{let X=[...U,...J.path];if(X.length===0){g.errors.push(w(J));continue}let Q=g,Y=0;while(Y<X.length){let q=X[Y],L=Y===X.length-1;if(typeof q==="string")Q.properties??(Q.properties={}),(G=Q.properties)[q]??(G[q]={errors:[]}),Q=Q.properties[q];else Q.items??(Q.items=[]),(D=Q.items)[q]??(D[q]={errors:[]}),Q=Q.items[q];if(L)Q.errors.push(w(J));Y++}}};return _($),g}function G8($){let w=[],g=$.map((_)=>typeof _==="object"?_.key:_);for(let _ of g)if(typeof _==="number")w.push(`[${_}]`);else if(typeof _==="symbol")w.push(`[${JSON.stringify(String(_))}]`);else if(/[^\w$]/.test(_))w.push(`[${JSON.stringify(_)}]`);else{if(w.length)w.push(".");w.push(_)}return w.join("")}function o6($){let w=[],g=[...$.issues].sort((_,v)=>(_.path??[]).length-(v.path??[]).length);for(let _ of g)if(w.push(`✖ ${_.message}`),_.path?.length)w.push(` → at ${G8(_.path)}`);return w.join(`
|
|
140
|
+
`)}var H4=($)=>(w,g,_,v)=>{let U=_?Object.assign(_,{async:!1}):{async:!1},G=w._zod.run({value:g,issues:[]},U);if(G instanceof Promise)throw new Yw;if(G.issues.length){let D=new(v?.Err??$)(G.issues.map((J)=>A$(J,U,Q$())));throw gU(D,v?.callee),D}return G.value},_U=H4(S$),q4=($)=>async(w,g,_,v)=>{let U=_?Object.assign(_,{async:!0}):{async:!0},G=w._zod.run({value:g,issues:[]},U);if(G instanceof Promise)G=await G;if(G.issues.length){let D=new(v?.Err??$)(G.issues.map((J)=>A$(J,U,Q$())));throw gU(D,v?.callee),D}return G.value},UU=q4(S$),B4=($)=>(w,g,_)=>{let v=_?{..._,async:!1}:{async:!1},U=w._zod.run({value:g,issues:[]},v);if(U instanceof Promise)throw new Yw;return U.issues.length?{success:!1,error:new($??t6)(U.issues.map((G)=>A$(G,v,Q$())))}:{success:!0,data:U.value}},w2=B4(S$),I4=($)=>async(w,g,_)=>{let v=_?Object.assign(_,{async:!0}):{async:!0},U=w._zod.run({value:g,issues:[]},v);if(U instanceof Promise)U=await U;return U.issues.length?{success:!1,error:new $(U.issues.map((G)=>A$(G,v,Q$())))}:{success:!0,data:U.value}},v2=I4(S$),bU=($)=>(w,g,_)=>{let v=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return H4($)(w,g,v)},YB=bU(S$),GU=($)=>(w,g,_)=>{return H4($)(w,g,_)},WB=GU(S$),DU=($)=>async(w,g,_)=>{let v=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return q4($)(w,g,v)},HB=DU(S$),JU=($)=>async(w,g,_)=>{return q4($)(w,g,_)},qB=JU(S$),XU=($)=>(w,g,_)=>{let v=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return B4($)(w,g,v)},BB=XU(S$),QU=($)=>(w,g,_)=>{return B4($)(w,g,_)},IB=QU(S$),YU=($)=>async(w,g,_)=>{let v=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return I4($)(w,g,v)},LB=YU(S$),WU=($)=>async(w,g,_)=>{return I4($)(w,g,_)},VB=WU(S$);var i$={};p$(i$,{xid:()=>b2,uuid7:()=>OB,uuid6:()=>KB,uuid4:()=>jB,uuid:()=>iv,uppercase:()=>f2,unicodeEmail:()=>D8,undefined:()=>M2,ulid:()=>U2,time:()=>j2,string:()=>O2,sha512_hex:()=>yB,sha512_base64url:()=>tB,sha512_base64:()=>mB,sha384_hex:()=>hB,sha384_base64url:()=>cB,sha384_base64:()=>lB,sha256_hex:()=>EB,sha256_base64url:()=>xB,sha256_base64:()=>ZB,sha1_hex:()=>RB,sha1_base64url:()=>uB,sha1_base64:()=>CB,rfc5322Email:()=>PB,number:()=>r6,null:()=>n2,nanoid:()=>D2,md5_hex:()=>SB,md5_base64url:()=>TB,md5_base64:()=>iB,mac:()=>q2,lowercase:()=>z2,ksuid:()=>G2,ipv6:()=>H2,ipv4:()=>W2,integer:()=>P2,idnEmail:()=>kB,html5Email:()=>NB,hostname:()=>zB,hex:()=>AB,guid:()=>X2,extendedDuration:()=>FB,emoji:()=>Y2,email:()=>Q2,e164:()=>V2,duration:()=>J2,domain:()=>fB,datetime:()=>K2,date:()=>F2,cuid2:()=>_2,cuid:()=>g2,cidrv6:()=>I2,cidrv4:()=>B2,browserEmail:()=>nB,boolean:()=>k2,bigint:()=>N2,base64url:()=>HU,base64:()=>L2});var g2=/^[cC][^\s-]{8,}$/,_2=/^[0-9a-z]+$/,U2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,b2=/^[0-9a-vA-V]{20}$/,G2=/^[A-Za-z0-9]{27}$/,D2=/^[a-zA-Z0-9_-]{21}$/,J2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,FB=/^[-+]?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)?)??$/,X2=/^([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})$/,iv=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},jB=iv(4),KB=iv(6),OB=iv(7),Q2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,NB=/^[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])?)*$/,PB=/^(([^<>()\[\]\\.,;:\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,}))$/,D8=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,kB=D8,nB=/^[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])?)*$/,MB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Y2(){return new RegExp(MB,"u")}var W2=/^(?:(?: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])$/,H2=/^(([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}|:))$/,q2=($)=>{let w=h$($??":");return new RegExp(`^(?:[0-9A-F]{2}${w}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${w}){5}[0-9a-f]{2}$`)},B2=/^((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])$/,I2=/^(([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])$/,L2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,HU=/^[A-Za-z0-9_-]*$/,zB=/^(?=.{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])?)*\.?$/,fB=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,V2=/^\+[1-9]\d{6,14}$/,J8="(?:(?:\\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])))",F2=new RegExp(`^${J8}$`);function X8($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function j2($){return new RegExp(`^${X8($)}$`)}function K2($){let w=X8({precision:$.precision}),g=["Z"];if($.local)g.push("");if($.offset)g.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let _=`${w}(?:${g.join("|")})`;return new RegExp(`^${J8}T(?:${_})$`)}var O2=($)=>{let w=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${w}$`)},N2=/^-?\d+n?$/,P2=/^-?\d+$/,r6=/^-?\d+(?:\.\d+)?$/,k2=/^(?:true|false)$/i,n2=/^null$/i;var M2=/^undefined$/i;var z2=/^[^A-Z]*$/,f2=/^[^a-z]*$/,AB=/^[0-9a-fA-F]*$/;function p6($,w){return new RegExp(`^[A-Za-z0-9+/]{${$}}${w}$`)}function e6($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var SB=/^[0-9a-fA-F]{32}$/,iB=p6(22,"=="),TB=e6(22),RB=/^[0-9a-fA-F]{40}$/,CB=p6(27,"="),uB=e6(27),EB=/^[0-9a-fA-F]{64}$/,ZB=p6(43,"="),xB=e6(43),hB=/^[0-9a-fA-F]{96}$/,lB=p6(64,""),cB=e6(64),yB=/^[0-9a-fA-F]{128}$/,mB=p6(86,"=="),tB=e6(86);var D$=j("$ZodCheck",($,w)=>{var g;$._zod??($._zod={}),$._zod.def=w,(g=$._zod).onattach??(g.onattach=[])}),Y8={number:"number",bigint:"bigint",object:"date"},qU=j("$ZodCheckLessThan",($,w)=>{D$.init($,w);let g=Y8[typeof w.value];$._zod.onattach.push((_)=>{let v=_._zod.bag,U=(w.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(w.value<U)if(w.inclusive)v.maximum=w.value;else v.exclusiveMaximum=w.value}),$._zod.check=(_)=>{if(w.inclusive?_.value<=w.value:_.value<w.value)return;_.issues.push({origin:g,code:"too_big",maximum:typeof w.value==="object"?w.value.getTime():w.value,input:_.value,inclusive:w.inclusive,inst:$,continue:!w.abort})}}),BU=j("$ZodCheckGreaterThan",($,w)=>{D$.init($,w);let g=Y8[typeof w.value];$._zod.onattach.push((_)=>{let v=_._zod.bag,U=(w.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(w.value>U)if(w.inclusive)v.minimum=w.value;else v.exclusiveMinimum=w.value}),$._zod.check=(_)=>{if(w.inclusive?_.value>=w.value:_.value>w.value)return;_.issues.push({origin:g,code:"too_small",minimum:typeof w.value==="object"?w.value.getTime():w.value,input:_.value,inclusive:w.inclusive,inst:$,continue:!w.abort})}}),A2=j("$ZodCheckMultipleOf",($,w)=>{D$.init($,w),$._zod.onattach.push((g)=>{var _;(_=g._zod.bag).multipleOf??(_.multipleOf=w.value)}),$._zod.check=(g)=>{if(typeof g.value!==typeof w.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof g.value==="bigint"?g.value%w.value===BigInt(0):d0(g.value,w.value)===0)return;g.issues.push({origin:typeof g.value,code:"not_multiple_of",divisor:w.value,input:g.value,inst:$,continue:!w.abort})}}),S2=j("$ZodCheckNumberFormat",($,w)=>{D$.init($,w),w.format=w.format||"float64";let g=w.format?.includes("int"),_=g?"int":"number",[v,U]=s0[w.format];$._zod.onattach.push((G)=>{let D=G._zod.bag;if(D.format=w.format,D.minimum=v,D.maximum=U,g)D.pattern=P2}),$._zod.check=(G)=>{let D=G.value;if(g){if(!Number.isInteger(D)){G.issues.push({expected:_,format:w.format,code:"invalid_type",continue:!1,input:D,inst:$});return}if(!Number.isSafeInteger(D)){if(D>0)G.issues.push({input:D,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:_,inclusive:!0,continue:!w.abort});else G.issues.push({input:D,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:_,inclusive:!0,continue:!w.abort});return}}if(D<v)G.issues.push({origin:"number",input:D,code:"too_small",minimum:v,inclusive:!0,inst:$,continue:!w.abort});if(D>U)G.issues.push({origin:"number",input:D,code:"too_big",maximum:U,inclusive:!0,inst:$,continue:!w.abort})}}),i2=j("$ZodCheckBigIntFormat",($,w)=>{D$.init($,w);let[g,_]=$2[w.format];$._zod.onattach.push((v)=>{let U=v._zod.bag;U.format=w.format,U.minimum=g,U.maximum=_}),$._zod.check=(v)=>{let U=v.value;if(U<g)v.issues.push({origin:"bigint",input:U,code:"too_small",minimum:g,inclusive:!0,inst:$,continue:!w.abort});if(U>_)v.issues.push({origin:"bigint",input:U,code:"too_big",maximum:_,inclusive:!0,inst:$,continue:!w.abort})}}),T2=j("$ZodCheckMaxSize",($,w)=>{var g;D$.init($,w),(g=$._zod.def).when??(g.when=(_)=>{let v=_.value;return!yw(v)&&v.size!==void 0}),$._zod.onattach.push((_)=>{let v=_._zod.bag.maximum??Number.POSITIVE_INFINITY;if(w.maximum<v)_._zod.bag.maximum=w.maximum}),$._zod.check=(_)=>{let v=_.value;if(v.size<=w.maximum)return;_.issues.push({origin:y6(v),code:"too_big",maximum:w.maximum,inclusive:!0,input:v,inst:$,continue:!w.abort})}}),R2=j("$ZodCheckMinSize",($,w)=>{var g;D$.init($,w),(g=$._zod.def).when??(g.when=(_)=>{let v=_.value;return!yw(v)&&v.size!==void 0}),$._zod.onattach.push((_)=>{let v=_._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(w.minimum>v)_._zod.bag.minimum=w.minimum}),$._zod.check=(_)=>{let v=_.value;if(v.size>=w.minimum)return;_.issues.push({origin:y6(v),code:"too_small",minimum:w.minimum,inclusive:!0,input:v,inst:$,continue:!w.abort})}}),C2=j("$ZodCheckSizeEquals",($,w)=>{var g;D$.init($,w),(g=$._zod.def).when??(g.when=(_)=>{let v=_.value;return!yw(v)&&v.size!==void 0}),$._zod.onattach.push((_)=>{let v=_._zod.bag;v.minimum=w.size,v.maximum=w.size,v.size=w.size}),$._zod.check=(_)=>{let v=_.value,U=v.size;if(U===w.size)return;let G=U>w.size;_.issues.push({origin:y6(v),...G?{code:"too_big",maximum:w.size}:{code:"too_small",minimum:w.size},inclusive:!0,exact:!0,input:_.value,inst:$,continue:!w.abort})}}),u2=j("$ZodCheckMaxLength",($,w)=>{var g;D$.init($,w),(g=$._zod.def).when??(g.when=(_)=>{let v=_.value;return!yw(v)&&v.length!==void 0}),$._zod.onattach.push((_)=>{let v=_._zod.bag.maximum??Number.POSITIVE_INFINITY;if(w.maximum<v)_._zod.bag.maximum=w.maximum}),$._zod.check=(_)=>{let v=_.value;if(v.length<=w.maximum)return;let G=m6(v);_.issues.push({origin:G,code:"too_big",maximum:w.maximum,inclusive:!0,input:v,inst:$,continue:!w.abort})}}),E2=j("$ZodCheckMinLength",($,w)=>{var g;D$.init($,w),(g=$._zod.def).when??(g.when=(_)=>{let v=_.value;return!yw(v)&&v.length!==void 0}),$._zod.onattach.push((_)=>{let v=_._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(w.minimum>v)_._zod.bag.minimum=w.minimum}),$._zod.check=(_)=>{let v=_.value;if(v.length>=w.minimum)return;let G=m6(v);_.issues.push({origin:G,code:"too_small",minimum:w.minimum,inclusive:!0,input:v,inst:$,continue:!w.abort})}}),Z2=j("$ZodCheckLengthEquals",($,w)=>{var g;D$.init($,w),(g=$._zod.def).when??(g.when=(_)=>{let v=_.value;return!yw(v)&&v.length!==void 0}),$._zod.onattach.push((_)=>{let v=_._zod.bag;v.minimum=w.length,v.maximum=w.length,v.length=w.length}),$._zod.check=(_)=>{let v=_.value,U=v.length;if(U===w.length)return;let G=m6(v),D=U>w.length;_.issues.push({origin:G,...D?{code:"too_big",maximum:w.length}:{code:"too_small",minimum:w.length},inclusive:!0,exact:!0,input:_.value,inst:$,continue:!w.abort})}}),L4=j("$ZodCheckStringFormat",($,w)=>{var g,_;if(D$.init($,w),$._zod.onattach.push((v)=>{let U=v._zod.bag;if(U.format=w.format,w.pattern)U.patterns??(U.patterns=new Set),U.patterns.add(w.pattern)}),w.pattern)(g=$._zod).check??(g.check=(v)=>{if(w.pattern.lastIndex=0,w.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:w.format,input:v.value,...w.pattern?{pattern:w.pattern.toString()}:{},inst:$,continue:!w.abort})});else(_=$._zod).check??(_.check=()=>{})}),x2=j("$ZodCheckRegex",($,w)=>{L4.init($,w),$._zod.check=(g)=>{if(w.pattern.lastIndex=0,w.pattern.test(g.value))return;g.issues.push({origin:"string",code:"invalid_format",format:"regex",input:g.value,pattern:w.pattern.toString(),inst:$,continue:!w.abort})}}),h2=j("$ZodCheckLowerCase",($,w)=>{w.pattern??(w.pattern=z2),L4.init($,w)}),l2=j("$ZodCheckUpperCase",($,w)=>{w.pattern??(w.pattern=f2),L4.init($,w)}),c2=j("$ZodCheckIncludes",($,w)=>{D$.init($,w);let g=h$(w.includes),_=new RegExp(typeof w.position==="number"?`^.{${w.position}}${g}`:g);w.pattern=_,$._zod.onattach.push((v)=>{let U=v._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(_)}),$._zod.check=(v)=>{if(v.value.includes(w.includes,w.position))return;v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:w.includes,input:v.value,inst:$,continue:!w.abort})}}),y2=j("$ZodCheckStartsWith",($,w)=>{D$.init($,w);let g=new RegExp(`^${h$(w.prefix)}.*`);w.pattern??(w.pattern=g),$._zod.onattach.push((_)=>{let v=_._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.startsWith(w.prefix))return;_.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:w.prefix,input:_.value,inst:$,continue:!w.abort})}}),m2=j("$ZodCheckEndsWith",($,w)=>{D$.init($,w);let g=new RegExp(`.*${h$(w.suffix)}$`);w.pattern??(w.pattern=g),$._zod.onattach.push((_)=>{let v=_._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.endsWith(w.suffix))return;_.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:w.suffix,input:_.value,inst:$,continue:!w.abort})}});function Q8($,w,g){if($.issues.length)w.issues.push(...u$(g,$.issues))}var t2=j("$ZodCheckProperty",($,w)=>{D$.init($,w),$._zod.check=(g)=>{let _=w.schema._zod.run({value:g.value[w.property],issues:[]},{});if(_ instanceof Promise)return _.then((v)=>Q8(v,g,w.property));Q8(_,g,w.property);return}}),d2=j("$ZodCheckMimeType",($,w)=>{D$.init($,w);let g=new Set(w.mime);$._zod.onattach.push((_)=>{_._zod.bag.mime=w.mime}),$._zod.check=(_)=>{if(g.has(_.value.type))return;_.issues.push({code:"invalid_value",values:w.mime,input:_.value.type,inst:$,continue:!w.abort})}}),o2=j("$ZodCheckOverwrite",($,w)=>{D$.init($,w),$._zod.check=(g)=>{g.value=w.tx(g.value)}});class IU{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let g=$.split(`
|
|
141
|
+
`).filter((U)=>U),_=Math.min(...g.map((U)=>U.length-U.trimStart().length)),v=g.map((U)=>U.slice(_)).map((U)=>" ".repeat(this.indent*2)+U);for(let U of v)this.content.push(U)}compile(){let $=Function,w=this?.args,_=[...(this?.content??[""]).map((v)=>` ${v}`)];return new $(...w,_.join(`
|
|
142
|
+
`))}}var r2={major:4,minor:3,patch:0};var t=j("$ZodType",($,w)=>{var g;$??($={}),$._zod.def=w,$._zod.bag=$._zod.bag||{},$._zod.version=r2;let _=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))_.unshift($);for(let v of _)for(let U of v._zod.onattach)U($);if(_.length===0)(g=$._zod).deferred??(g.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let v=(G,D,J)=>{let X=dw(G),Q;for(let Y of D){if(Y._zod.def.when){if(!Y._zod.def.when(G))continue}else if(X)continue;let q=G.issues.length,L=Y._zod.check(G);if(L instanceof Promise&&J?.async===!1)throw new Yw;if(Q||L instanceof Promise)Q=(Q??Promise.resolve()).then(async()=>{if(await L,G.issues.length===q)return;if(!X)X=dw(G,q)});else{if(G.issues.length===q)continue;if(!X)X=dw(G,q)}}if(Q)return Q.then(()=>{return G});return G},U=(G,D,J)=>{if(dw(G))return G.aborted=!0,G;let X=v(D,_,J);if(X instanceof Promise){if(J.async===!1)throw new Yw;return X.then((Q)=>$._zod.parse(Q,J))}return $._zod.parse(X,J)};$._zod.run=(G,D)=>{if(D.skipChecks)return $._zod.parse(G,D);if(D.direction==="backward"){let X=$._zod.parse({value:G.value,issues:[]},{...D,skipChecks:!0});if(X instanceof Promise)return X.then((Q)=>{return U(Q,G,D)});return U(X,G,D)}let J=$._zod.parse(G,D);if(J instanceof Promise){if(D.async===!1)throw new Yw;return J.then((X)=>v(X,_,D))}return v(J,_,D)}}a($,"~standard",()=>({validate:(v)=>{try{let U=w2($,v);return U.success?{value:U.data}:{issues:U.error?.issues}}catch(U){return v2($,v).then((G)=>G.success?{value:G.data}:{issues:G.error?.issues})}},vendor:"zod",version:1}))}),Tv=j("$ZodString",($,w)=>{t.init($,w),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??O2($._zod.bag),$._zod.parse=(g,_)=>{if(w.coerce)try{g.value=String(g.value)}catch(v){}if(typeof g.value==="string")return g;return g.issues.push({expected:"string",code:"invalid_type",input:g.value,inst:$}),g}}),b$=j("$ZodStringFormat",($,w)=>{L4.init($,w),Tv.init($,w)}),e2=j("$ZodGUID",($,w)=>{w.pattern??(w.pattern=X2),b$.init($,w)}),a2=j("$ZodUUID",($,w)=>{if(w.version){let _={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[w.version];if(_===void 0)throw Error(`Invalid UUID version: "${w.version}"`);w.pattern??(w.pattern=iv(_))}else w.pattern??(w.pattern=iv());b$.init($,w)}),s2=j("$ZodEmail",($,w)=>{w.pattern??(w.pattern=Q2),b$.init($,w)}),$G=j("$ZodURL",($,w)=>{b$.init($,w),$._zod.check=(g)=>{try{let _=g.value.trim(),v=new URL(_);if(w.hostname){if(w.hostname.lastIndex=0,!w.hostname.test(v.hostname))g.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:w.hostname.source,input:g.value,inst:$,continue:!w.abort})}if(w.protocol){if(w.protocol.lastIndex=0,!w.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol))g.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:w.protocol.source,input:g.value,inst:$,continue:!w.abort})}if(w.normalize)g.value=v.href;else g.value=_;return}catch(_){g.issues.push({code:"invalid_format",format:"url",input:g.value,inst:$,continue:!w.abort})}}}),wG=j("$ZodEmoji",($,w)=>{w.pattern??(w.pattern=Y2()),b$.init($,w)}),vG=j("$ZodNanoID",($,w)=>{w.pattern??(w.pattern=D2),b$.init($,w)}),gG=j("$ZodCUID",($,w)=>{w.pattern??(w.pattern=g2),b$.init($,w)}),_G=j("$ZodCUID2",($,w)=>{w.pattern??(w.pattern=_2),b$.init($,w)}),UG=j("$ZodULID",($,w)=>{w.pattern??(w.pattern=U2),b$.init($,w)}),bG=j("$ZodXID",($,w)=>{w.pattern??(w.pattern=b2),b$.init($,w)}),GG=j("$ZodKSUID",($,w)=>{w.pattern??(w.pattern=G2),b$.init($,w)}),DG=j("$ZodISODateTime",($,w)=>{w.pattern??(w.pattern=K2(w)),b$.init($,w)}),JG=j("$ZodISODate",($,w)=>{w.pattern??(w.pattern=F2),b$.init($,w)}),XG=j("$ZodISOTime",($,w)=>{w.pattern??(w.pattern=j2(w)),b$.init($,w)}),QG=j("$ZodISODuration",($,w)=>{w.pattern??(w.pattern=J2),b$.init($,w)}),YG=j("$ZodIPv4",($,w)=>{w.pattern??(w.pattern=W2),b$.init($,w),$._zod.bag.format="ipv4"}),WG=j("$ZodIPv6",($,w)=>{w.pattern??(w.pattern=H2),b$.init($,w),$._zod.bag.format="ipv6",$._zod.check=(g)=>{try{new URL(`http://[${g.value}]`)}catch{g.issues.push({code:"invalid_format",format:"ipv6",input:g.value,inst:$,continue:!w.abort})}}}),HG=j("$ZodMAC",($,w)=>{w.pattern??(w.pattern=q2(w.delimiter)),b$.init($,w),$._zod.bag.format="mac"}),qG=j("$ZodCIDRv4",($,w)=>{w.pattern??(w.pattern=B2),b$.init($,w)}),BG=j("$ZodCIDRv6",($,w)=>{w.pattern??(w.pattern=I2),b$.init($,w),$._zod.check=(g)=>{let _=g.value.split("/");try{if(_.length!==2)throw Error();let[v,U]=_;if(!U)throw Error();let G=Number(U);if(`${G}`!==U)throw Error();if(G<0||G>128)throw Error();new URL(`http://[${v}]`)}catch{g.issues.push({code:"invalid_format",format:"cidrv6",input:g.value,inst:$,continue:!w.abort})}}});function IG($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var LG=j("$ZodBase64",($,w)=>{w.pattern??(w.pattern=L2),b$.init($,w),$._zod.bag.contentEncoding="base64",$._zod.check=(g)=>{if(IG(g.value))return;g.issues.push({code:"invalid_format",format:"base64",input:g.value,inst:$,continue:!w.abort})}});function P8($){if(!HU.test($))return!1;let w=$.replace(/[-_]/g,(_)=>_==="-"?"+":"/"),g=w.padEnd(Math.ceil(w.length/4)*4,"=");return IG(g)}var VG=j("$ZodBase64URL",($,w)=>{w.pattern??(w.pattern=HU),b$.init($,w),$._zod.bag.contentEncoding="base64url",$._zod.check=(g)=>{if(P8(g.value))return;g.issues.push({code:"invalid_format",format:"base64url",input:g.value,inst:$,continue:!w.abort})}}),FG=j("$ZodE164",($,w)=>{w.pattern??(w.pattern=V2),b$.init($,w)});function k8($,w=null){try{let g=$.split(".");if(g.length!==3)return!1;let[_]=g;if(!_)return!1;let v=JSON.parse(atob(_));if("typ"in v&&v?.typ!=="JWT")return!1;if(!v.alg)return!1;if(w&&(!("alg"in v)||v.alg!==w))return!1;return!0}catch{return!1}}var jG=j("$ZodJWT",($,w)=>{b$.init($,w),$._zod.check=(g)=>{if(k8(g.value,w.alg))return;g.issues.push({code:"invalid_format",format:"jwt",input:g.value,inst:$,continue:!w.abort})}}),KG=j("$ZodCustomStringFormat",($,w)=>{b$.init($,w),$._zod.check=(g)=>{if(w.fn(g.value))return;g.issues.push({code:"invalid_format",format:w.format,input:g.value,inst:$,continue:!w.abort})}}),OU=j("$ZodNumber",($,w)=>{t.init($,w),$._zod.pattern=$._zod.bag.pattern??r6,$._zod.parse=(g,_)=>{if(w.coerce)try{g.value=Number(g.value)}catch(G){}let v=g.value;if(typeof v==="number"&&!Number.isNaN(v)&&Number.isFinite(v))return g;let U=typeof v==="number"?Number.isNaN(v)?"NaN":!Number.isFinite(v)?"Infinity":void 0:void 0;return g.issues.push({expected:"number",code:"invalid_type",input:v,inst:$,...U?{received:U}:{}}),g}}),OG=j("$ZodNumberFormat",($,w)=>{S2.init($,w),OU.init($,w)}),a6=j("$ZodBoolean",($,w)=>{t.init($,w),$._zod.pattern=k2,$._zod.parse=(g,_)=>{if(w.coerce)try{g.value=Boolean(g.value)}catch(U){}let v=g.value;if(typeof v==="boolean")return g;return g.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:$}),g}}),NU=j("$ZodBigInt",($,w)=>{t.init($,w),$._zod.pattern=N2,$._zod.parse=(g,_)=>{if(w.coerce)try{g.value=BigInt(g.value)}catch(v){}if(typeof g.value==="bigint")return g;return g.issues.push({expected:"bigint",code:"invalid_type",input:g.value,inst:$}),g}}),NG=j("$ZodBigIntFormat",($,w)=>{i2.init($,w),NU.init($,w)}),PG=j("$ZodSymbol",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value;if(typeof v==="symbol")return g;return g.issues.push({expected:"symbol",code:"invalid_type",input:v,inst:$}),g}}),kG=j("$ZodUndefined",($,w)=>{t.init($,w),$._zod.pattern=M2,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(g,_)=>{let v=g.value;if(typeof v>"u")return g;return g.issues.push({expected:"undefined",code:"invalid_type",input:v,inst:$}),g}}),nG=j("$ZodNull",($,w)=>{t.init($,w),$._zod.pattern=n2,$._zod.values=new Set([null]),$._zod.parse=(g,_)=>{let v=g.value;if(v===null)return g;return g.issues.push({expected:"null",code:"invalid_type",input:v,inst:$}),g}}),MG=j("$ZodAny",($,w)=>{t.init($,w),$._zod.parse=(g)=>g}),zG=j("$ZodUnknown",($,w)=>{t.init($,w),$._zod.parse=(g)=>g}),fG=j("$ZodNever",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{return g.issues.push({expected:"never",code:"invalid_type",input:g.value,inst:$}),g}}),AG=j("$ZodVoid",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value;if(typeof v>"u")return g;return g.issues.push({expected:"void",code:"invalid_type",input:v,inst:$}),g}}),SG=j("$ZodDate",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{if(w.coerce)try{g.value=new Date(g.value)}catch(D){}let v=g.value,U=v instanceof Date;if(U&&!Number.isNaN(v.getTime()))return g;return g.issues.push({expected:"date",code:"invalid_type",input:v,...U?{received:"Invalid Date"}:{},inst:$}),g}});function H8($,w,g){if($.issues.length)w.issues.push(...u$(g,$.issues));w.value[g]=$.value}var iG=j("$ZodArray",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value;if(!Array.isArray(v))return g.issues.push({expected:"array",code:"invalid_type",input:v,inst:$}),g;g.value=Array(v.length);let U=[];for(let G=0;G<v.length;G++){let D=v[G],J=w.element._zod.run({value:D,issues:[]},_);if(J instanceof Promise)U.push(J.then((X)=>H8(X,g,G)));else H8(J,g,G)}if(U.length)return Promise.all(U).then(()=>g);return g}});function KU($,w,g,_,v){if($.issues.length){if(v&&!(g in _))return;w.issues.push(...u$(g,$.issues))}if($.value===void 0){if(g in _)w.value[g]=void 0}else w.value[g]=$.value}function n8($){let w=Object.keys($.shape);for(let _ of w)if(!$.shape?.[_]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${_}": expected a Zod schema`);let g=a0($.shape);return{...$,keys:w,keySet:new Set(w),numKeys:w.length,optionalKeys:new Set(g)}}function M8($,w,g,_,v,U){let G=[],D=v.keySet,J=v.catchall._zod,X=J.def.type,Q=J.optout==="optional";for(let Y in w){if(D.has(Y))continue;if(X==="never"){G.push(Y);continue}let q=J.run({value:w[Y],issues:[]},_);if(q instanceof Promise)$.push(q.then((L)=>KU(L,g,Y,w,Q)));else KU(q,g,Y,w,Q)}if(G.length)g.issues.push({code:"unrecognized_keys",keys:G,input:w,inst:U});if(!$.length)return g;return Promise.all($).then(()=>{return g})}var z8=j("$ZodObject",($,w)=>{if(t.init($,w),!Object.getOwnPropertyDescriptor(w,"shape")?.get){let D=w.shape;Object.defineProperty(w,"shape",{get:()=>{let J={...D};return Object.defineProperty(w,"shape",{value:J}),J}})}let _=Y4(()=>n8(w));a($._zod,"propValues",()=>{let D=w.shape,J={};for(let X in D){let Q=D[X]._zod;if(Q.values){J[X]??(J[X]=new Set);for(let Y of Q.values)J[X].add(Y)}}return J});let v=fv,U=w.catchall,G;$._zod.parse=(D,J)=>{G??(G=_.value);let X=D.value;if(!v(X))return D.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),D;D.value={};let Q=[],Y=G.shape;for(let q of G.keys){let L=Y[q],F=L._zod.optout==="optional",H=L._zod.run({value:X[q],issues:[]},J);if(H instanceof Promise)Q.push(H.then((V)=>KU(V,D,q,X,F)));else KU(H,D,q,X,F)}if(!U)return Q.length?Promise.all(Q).then(()=>D):D;return M8(Q,X,D,J,_.value,$)}}),TG=j("$ZodObjectJIT",($,w)=>{z8.init($,w);let g=$._zod.parse,_=Y4(()=>n8(w)),v=(q)=>{let L=new IU(["shape","payload","ctx"]),F=_.value,H=(S)=>{let u=vU(S);return`shape[${u}]._zod.run({ value: input[${u}], issues: [] }, ctx)`};L.write("const input = payload.value;");let V=Object.create(null),K=0;for(let S of F.keys)V[S]=`key_${K++}`;L.write("const newResult = {};");for(let S of F.keys){let u=V[S],Z=vU(S),c=q[S]?._zod?.optout==="optional";if(L.write(`const ${u} = ${H(S)};`),c)L.write(`
|
|
143
|
+
if (${u}.issues.length) {
|
|
144
|
+
if (${Z} in input) {
|
|
145
|
+
payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
|
|
10
146
|
...iss,
|
|
11
|
-
path: iss.path ? [${
|
|
147
|
+
path: iss.path ? [${Z}, ...iss.path] : [${Z}]
|
|
12
148
|
})));
|
|
13
149
|
}
|
|
14
150
|
}
|
|
15
151
|
|
|
16
|
-
if (${
|
|
17
|
-
if (${
|
|
18
|
-
newResult[${
|
|
152
|
+
if (${u}.value === undefined) {
|
|
153
|
+
if (${Z} in input) {
|
|
154
|
+
newResult[${Z}] = undefined;
|
|
19
155
|
}
|
|
20
156
|
} else {
|
|
21
|
-
newResult[${
|
|
157
|
+
newResult[${Z}] = ${u}.value;
|
|
22
158
|
}
|
|
23
159
|
|
|
24
|
-
`);else
|
|
25
|
-
if (${
|
|
26
|
-
payload.issues = payload.issues.concat(${
|
|
160
|
+
`);else L.write(`
|
|
161
|
+
if (${u}.issues.length) {
|
|
162
|
+
payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
|
|
27
163
|
...iss,
|
|
28
|
-
path: iss.path ? [${
|
|
164
|
+
path: iss.path ? [${Z}, ...iss.path] : [${Z}]
|
|
29
165
|
})));
|
|
30
166
|
}
|
|
31
167
|
|
|
32
|
-
if (${
|
|
33
|
-
if (${
|
|
34
|
-
newResult[${
|
|
168
|
+
if (${u}.value === undefined) {
|
|
169
|
+
if (${Z} in input) {
|
|
170
|
+
newResult[${Z}] = undefined;
|
|
35
171
|
}
|
|
36
172
|
} else {
|
|
37
|
-
newResult[${
|
|
173
|
+
newResult[${Z}] = ${u}.value;
|
|
38
174
|
}
|
|
39
175
|
|
|
40
|
-
`)}u.write("payload.value = newResult;"),u.write("return payload;");let E=u.compile();return(T,a)=>E(j,T,a)},w,_=ii,U=!p$.jitless,l=U&&C_.value,J=i.catchall,Q;n._zod.parse=(j,u)=>{Q??(Q=g.value);let W=j.value;if(!_(W))return j.issues.push({expected:"object",code:"invalid_type",input:W,inst:n}),j;if(U&&l&&u?.async===!1&&u.jitless!==!0){if(!w)w=v(i.shape);if(j=w(j,u),!J)return j;return il([],W,j,u,Q,n)}return $(j,u)}});function o2(n,i,$,g){for(let w of n)if(w.issues.length===0)return i.value=w.value,i;let v=n.filter((w)=>!Vv(w));if(v.length===1)return i.value=v[0].value,v[0];return i.issues.push({code:"invalid_union",input:i.value,inst:$,errors:n.map((w)=>w.issues.map((_)=>Qn(_,g,vn())))}),i}var Jg=t("$ZodUnion",(n,i)=>{M.init(n,i),C(n._zod,"optin",()=>i.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),C(n._zod,"optout",()=>i.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),C(n._zod,"values",()=>{if(i.options.every((v)=>v._zod.values))return new Set(i.options.flatMap((v)=>Array.from(v._zod.values)));return}),C(n._zod,"pattern",()=>{if(i.options.every((v)=>v._zod.pattern)){let v=i.options.map((w)=>w._zod.pattern);return new RegExp(`^(${v.map((w)=>vg(w.source)).join("|")})$`)}return});let $=i.options.length===1,g=i.options[0]._zod.run;n._zod.parse=(v,w)=>{if($)return g(v,w);let _=!1,U=[];for(let k of i.options){let l=k._zod.run({value:v.value,issues:[]},w);if(l instanceof Promise)U.push(l),_=!0;else{if(l.issues.length===0)return l;U.push(l)}}if(!_)return o2(U,v,n,w);return Promise.all(U).then((k)=>{return o2(k,v,n,w)})}});function T2(n,i,$,g){let v=n.filter((w)=>w.issues.length===0);if(v.length===1)return i.value=v[0].value,i;if(v.length===0)i.issues.push({code:"invalid_union",input:i.value,inst:$,errors:n.map((w)=>w.issues.map((_)=>Qn(_,g,vn())))});else i.issues.push({code:"invalid_union",input:i.value,inst:$,errors:[],inclusive:!1});return i}var KU=t("$ZodXor",(n,i)=>{Jg.init(n,i),i.inclusive=!1;let $=i.options.length===1,g=i.options[0]._zod.run;n._zod.parse=(v,w)=>{if($)return g(v,w);let _=!1,U=[];for(let k of i.options){let l=k._zod.run({value:v.value,issues:[]},w);if(l instanceof Promise)U.push(l),_=!0;else U.push(l)}if(!_)return T2(U,v,n,w);return Promise.all(U).then((k)=>{return T2(k,v,n,w)})}}),OU=t("$ZodDiscriminatedUnion",(n,i)=>{i.inclusive=!1,Jg.init(n,i);let $=n._zod.parse;C(n._zod,"propValues",()=>{let v={};for(let w of i.options){let _=w._zod.propValues;if(!_||Object.keys(_).length===0)throw Error(`Invalid discriminated union option at index "${i.options.indexOf(w)}"`);for(let[U,k]of Object.entries(_)){if(!v[U])v[U]=new Set;for(let l of k)v[U].add(l)}}return v});let g=hi(()=>{let v=i.options,w=new Map;for(let _ of v){let U=_._zod.propValues?.[i.discriminator];if(!U||U.size===0)throw Error(`Invalid discriminated union option at index "${i.options.indexOf(_)}"`);for(let k of U){if(w.has(k))throw Error(`Duplicate discriminator value "${String(k)}"`);w.set(k,_)}}return w});n._zod.parse=(v,w)=>{let _=v.value;if(!ii(_))return v.issues.push({code:"invalid_type",expected:"object",input:_,inst:n}),v;let U=g.value.get(_?.[i.discriminator]);if(U)return U._zod.run(v,w);if(i.unionFallback)return $(v,w);return v.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:i.discriminator,input:_,path:[i.discriminator],inst:n}),v}}),BU=t("$ZodIntersection",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value,w=i.left._zod.run({value:v,issues:[]},g),_=i.right._zod.run({value:v,issues:[]},g);if(w instanceof Promise||_ instanceof Promise)return Promise.all([w,_]).then(([k,l])=>{return Z2($,k,l)});return Z2($,w,_)}});function Eb(n,i){if(n===i)return{valid:!0,data:n};if(n instanceof Date&&i instanceof Date&&+n===+i)return{valid:!0,data:n};if(Hv(n)&&Hv(i)){let $=Object.keys(i),g=Object.keys(n).filter((w)=>$.indexOf(w)!==-1),v={...n,...i};for(let w of g){let _=Eb(n[w],i[w]);if(!_.valid)return{valid:!1,mergeErrorPath:[w,..._.mergeErrorPath]};v[w]=_.data}return{valid:!0,data:v}}if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return{valid:!1,mergeErrorPath:[]};let $=[];for(let g=0;g<n.length;g++){let v=n[g],w=i[g],_=Eb(v,w);if(!_.valid)return{valid:!1,mergeErrorPath:[g,..._.mergeErrorPath]};$.push(_.data)}return{valid:!0,data:$}}return{valid:!1,mergeErrorPath:[]}}function Z2(n,i,$){if(i.issues.length)n.issues.push(...i.issues);if($.issues.length)n.issues.push(...$.issues);if(Vv(n))return n;let g=Eb(i.value,$.value);if(!g.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return n.value=g.data,n}var G4=t("$ZodTuple",(n,i)=>{M.init(n,i);let $=i.items;n._zod.parse=(g,v)=>{let w=g.value;if(!Array.isArray(w))return g.issues.push({input:w,inst:n,expected:"tuple",code:"invalid_type"}),g;g.value=[];let _=[],U=[...$].reverse().findIndex((J)=>J._zod.optin!=="optional"),k=U===-1?0:$.length-U;if(!i.rest){let J=w.length>$.length,Q=w.length<k-1;if(J||Q)return g.issues.push({...J?{code:"too_big",maximum:$.length,inclusive:!0}:{code:"too_small",minimum:$.length},input:w,inst:n,origin:"array"}),g}let l=-1;for(let J of $){if(l++,l>=w.length){if(l>=k)continue}let Q=J._zod.run({value:w[l],issues:[]},v);if(Q instanceof Promise)_.push(Q.then((j)=>b4(j,g,l)));else b4(Q,g,l)}if(i.rest){let J=w.slice($.length);for(let Q of J){l++;let j=i.rest._zod.run({value:Q,issues:[]},v);if(j instanceof Promise)_.push(j.then((u)=>b4(u,g,l)));else b4(j,g,l)}}if(_.length)return Promise.all(_).then(()=>g);return g}});function b4(n,i,$){if(n.issues.length)i.issues.push(...un($,n.issues));i.value[$]=n.value}var FU=t("$ZodRecord",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value;if(!Hv(v))return $.issues.push({expected:"record",code:"invalid_type",input:v,inst:n}),$;let w=[],_=i.keyType._zod.values;if(_){$.value={};let U=new Set;for(let l of _)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){U.add(typeof l==="number"?l.toString():l);let J=i.valueType._zod.run({value:v[l],issues:[]},g);if(J instanceof Promise)w.push(J.then((Q)=>{if(Q.issues.length)$.issues.push(...un(l,Q.issues));$.value[l]=Q.value}));else{if(J.issues.length)$.issues.push(...un(l,J.issues));$.value[l]=J.value}}let k;for(let l in v)if(!U.has(l))k=k??[],k.push(l);if(k&&k.length>0)$.issues.push({code:"unrecognized_keys",input:v,inst:n,keys:k})}else{$.value={};for(let U of Reflect.ownKeys(v)){if(U==="__proto__")continue;let k=i.keyType._zod.run({value:U,issues:[]},g);if(k instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof U==="string"&&Ug.test(U)&&k.issues.length&&k.issues.some((Q)=>Q.code==="invalid_type"&&Q.expected==="number")){let Q=i.keyType._zod.run({value:Number(U),issues:[]},g);if(Q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Q.issues.length===0)k=Q}if(k.issues.length){if(i.mode==="loose")$.value[U]=v[U];else $.issues.push({code:"invalid_key",origin:"record",issues:k.issues.map((Q)=>Qn(Q,g,vn())),input:U,path:[U],inst:n});continue}let J=i.valueType._zod.run({value:v[U],issues:[]},g);if(J instanceof Promise)w.push(J.then((Q)=>{if(Q.issues.length)$.issues.push(...un(U,Q.issues));$.value[k.value]=Q.value}));else{if(J.issues.length)$.issues.push(...un(U,J.issues));$.value[k.value]=J.value}}}if(w.length)return Promise.all(w).then(()=>$);return $}}),NU=t("$ZodMap",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value;if(!(v instanceof Map))return $.issues.push({expected:"map",code:"invalid_type",input:v,inst:n}),$;let w=[];$.value=new Map;for(let[_,U]of v){let k=i.keyType._zod.run({value:_,issues:[]},g),l=i.valueType._zod.run({value:U,issues:[]},g);if(k instanceof Promise||l instanceof Promise)w.push(Promise.all([k,l]).then(([J,Q])=>{r2(J,Q,$,_,v,n,g)}));else r2(k,l,$,_,v,n,g)}if(w.length)return Promise.all(w).then(()=>$);return $}});function r2(n,i,$,g,v,w,_){if(n.issues.length)if(ig.has(typeof g))$.issues.push(...un(g,n.issues));else $.issues.push({code:"invalid_key",origin:"map",input:v,inst:w,issues:n.issues.map((U)=>Qn(U,_,vn()))});if(i.issues.length)if(ig.has(typeof g))$.issues.push(...un(g,i.issues));else $.issues.push({origin:"map",code:"invalid_element",input:v,inst:w,key:g,issues:i.issues.map((U)=>Qn(U,_,vn()))});$.value.set(n.value,i.value)}var cU=t("$ZodSet",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value;if(!(v instanceof Set))return $.issues.push({input:v,inst:n,expected:"set",code:"invalid_type"}),$;let w=[];$.value=new Set;for(let _ of v){let U=i.valueType._zod.run({value:_,issues:[]},g);if(U instanceof Promise)w.push(U.then((k)=>m2(k,$)));else m2(U,$)}if(w.length)return Promise.all(w).then(()=>$);return $}});function m2(n,i){if(n.issues.length)i.issues.push(...n.issues);i.value.add(n.value)}var PU=t("$ZodEnum",(n,i)=>{M.init(n,i);let $=Ai(i.entries),g=new Set($);n._zod.values=g,n._zod.pattern=new RegExp(`^(${$.filter((v)=>ig.has(typeof v)).map((v)=>typeof v==="string"?fn(v):v.toString()).join("|")})$`),n._zod.parse=(v,w)=>{let _=v.value;if(g.has(_))return v;return v.issues.push({code:"invalid_value",values:$,input:_,inst:n}),v}}),SU=t("$ZodLiteral",(n,i)=>{if(M.init(n,i),i.values.length===0)throw Error("Cannot create literal schema with no valid values");let $=new Set(i.values);n._zod.values=$,n._zod.pattern=new RegExp(`^(${i.values.map((g)=>typeof g==="string"?fn(g):g?fn(g.toString()):String(g)).join("|")})$`),n._zod.parse=(g,v)=>{let w=g.value;if($.has(w))return g;return g.issues.push({code:"invalid_value",values:i.values,input:w,inst:n}),g}}),zU=t("$ZodFile",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{let v=$.value;if(v instanceof File)return $;return $.issues.push({expected:"file",code:"invalid_type",input:v,inst:n}),$}}),MU=t("$ZodTransform",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{if(g.direction==="backward")throw new vi(n.constructor.name);let v=i.transform($.value,$);if(g.async)return(v instanceof Promise?v:Promise.resolve(v)).then((_)=>{return $.value=_,$});if(v instanceof Promise)throw new mn;return $.value=v,$}});function y2(n,i){if(n.issues.length&&i===void 0)return{issues:[],value:void 0};return n}var t4=t("$ZodOptional",(n,i)=>{M.init(n,i),n._zod.optin="optional",n._zod.optout="optional",C(n._zod,"values",()=>{return i.innerType._zod.values?new Set([...i.innerType._zod.values,void 0]):void 0}),C(n._zod,"pattern",()=>{let $=i.innerType._zod.pattern;return $?new RegExp(`^(${vg($.source)})?$`):void 0}),n._zod.parse=($,g)=>{if(i.innerType._zod.optin==="optional"){let v=i.innerType._zod.run($,g);if(v instanceof Promise)return v.then((w)=>y2(w,$.value));return y2(v,$.value)}if($.value===void 0)return $;return i.innerType._zod.run($,g)}}),RU=t("$ZodExactOptional",(n,i)=>{t4.init(n,i),C(n._zod,"values",()=>i.innerType._zod.values),C(n._zod,"pattern",()=>i.innerType._zod.pattern),n._zod.parse=($,g)=>{return i.innerType._zod.run($,g)}}),AU=t("$ZodNullable",(n,i)=>{M.init(n,i),C(n._zod,"optin",()=>i.innerType._zod.optin),C(n._zod,"optout",()=>i.innerType._zod.optout),C(n._zod,"pattern",()=>{let $=i.innerType._zod.pattern;return $?new RegExp(`^(${vg($.source)}|null)$`):void 0}),C(n._zod,"values",()=>{return i.innerType._zod.values?new Set([...i.innerType._zod.values,null]):void 0}),n._zod.parse=($,g)=>{if($.value===null)return $;return i.innerType._zod.run($,g)}}),xU=t("$ZodDefault",(n,i)=>{M.init(n,i),n._zod.optin="optional",C(n._zod,"values",()=>i.innerType._zod.values),n._zod.parse=($,g)=>{if(g.direction==="backward")return i.innerType._zod.run($,g);if($.value===void 0)return $.value=i.defaultValue,$;let v=i.innerType._zod.run($,g);if(v instanceof Promise)return v.then((w)=>d2(w,i));return d2(v,i)}});function d2(n,i){if(n.value===void 0)n.value=i.defaultValue;return n}var hU=t("$ZodPrefault",(n,i)=>{M.init(n,i),n._zod.optin="optional",C(n._zod,"values",()=>i.innerType._zod.values),n._zod.parse=($,g)=>{if(g.direction==="backward")return i.innerType._zod.run($,g);if($.value===void 0)$.value=i.defaultValue;return i.innerType._zod.run($,g)}}),CU=t("$ZodNonOptional",(n,i)=>{M.init(n,i),C(n._zod,"values",()=>{let $=i.innerType._zod.values;return $?new Set([...$].filter((g)=>g!==void 0)):void 0}),n._zod.parse=($,g)=>{let v=i.innerType._zod.run($,g);if(v instanceof Promise)return v.then((w)=>e2(w,n));return e2(v,n)}});function e2(n,i){if(!n.issues.length&&n.value===void 0)n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:i});return n}var EU=t("$ZodSuccess",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{if(g.direction==="backward")throw new vi("ZodSuccess");let v=i.innerType._zod.run($,g);if(v instanceof Promise)return v.then((w)=>{return $.value=w.issues.length===0,$});return $.value=v.issues.length===0,$}}),oU=t("$ZodCatch",(n,i)=>{M.init(n,i),C(n._zod,"optin",()=>i.innerType._zod.optin),C(n._zod,"optout",()=>i.innerType._zod.optout),C(n._zod,"values",()=>i.innerType._zod.values),n._zod.parse=($,g)=>{if(g.direction==="backward")return i.innerType._zod.run($,g);let v=i.innerType._zod.run($,g);if(v instanceof Promise)return v.then((w)=>{if($.value=w.value,w.issues.length)$.value=i.catchValue({...$,error:{issues:w.issues.map((_)=>Qn(_,g,vn()))},input:$.value}),$.issues=[];return $});if($.value=v.value,v.issues.length)$.value=i.catchValue({...$,error:{issues:v.issues.map((w)=>Qn(w,g,vn()))},input:$.value}),$.issues=[];return $}}),TU=t("$ZodNaN",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{if(typeof $.value!=="number"||!Number.isNaN($.value))return $.issues.push({input:$.value,inst:n,expected:"nan",code:"invalid_type"}),$;return $}}),ZU=t("$ZodPipe",(n,i)=>{M.init(n,i),C(n._zod,"values",()=>i.in._zod.values),C(n._zod,"optin",()=>i.in._zod.optin),C(n._zod,"optout",()=>i.out._zod.optout),C(n._zod,"propValues",()=>i.in._zod.propValues),n._zod.parse=($,g)=>{if(g.direction==="backward"){let w=i.out._zod.run($,g);if(w instanceof Promise)return w.then((_)=>U4(_,i.in,g));return U4(w,i.in,g)}let v=i.in._zod.run($,g);if(v instanceof Promise)return v.then((w)=>U4(w,i.out,g));return U4(v,i.out,g)}});function U4(n,i,$){if(n.issues.length)return n.aborted=!0,n;return i._zod.run({value:n.value,issues:n.issues},$)}var Xg=t("$ZodCodec",(n,i)=>{M.init(n,i),C(n._zod,"values",()=>i.in._zod.values),C(n._zod,"optin",()=>i.in._zod.optin),C(n._zod,"optout",()=>i.out._zod.optout),C(n._zod,"propValues",()=>i.in._zod.propValues),n._zod.parse=($,g)=>{if((g.direction||"forward")==="forward"){let w=i.in._zod.run($,g);if(w instanceof Promise)return w.then((_)=>k4(_,i,g));return k4(w,i,g)}else{let w=i.out._zod.run($,g);if(w instanceof Promise)return w.then((_)=>k4(_,i,g));return k4(w,i,g)}}});function k4(n,i,$){if(n.issues.length)return n.aborted=!0,n;if(($.direction||"forward")==="forward"){let v=i.transform(n.value,n);if(v instanceof Promise)return v.then((w)=>l4(n,w,i.out,$));return l4(n,v,i.out,$)}else{let v=i.reverseTransform(n.value,n);if(v instanceof Promise)return v.then((w)=>l4(n,w,i.in,$));return l4(n,v,i.in,$)}}function l4(n,i,$,g){if(n.issues.length)return n.aborted=!0,n;return $._zod.run({value:i,issues:n.issues},g)}var rU=t("$ZodReadonly",(n,i)=>{M.init(n,i),C(n._zod,"propValues",()=>i.innerType._zod.propValues),C(n._zod,"values",()=>i.innerType._zod.values),C(n._zod,"optin",()=>i.innerType?._zod?.optin),C(n._zod,"optout",()=>i.innerType?._zod?.optout),n._zod.parse=($,g)=>{if(g.direction==="backward")return i.innerType._zod.run($,g);let v=i.innerType._zod.run($,g);if(v instanceof Promise)return v.then(p2);return p2(v)}});function p2(n){return n.value=Object.freeze(n.value),n}var mU=t("$ZodTemplateLiteral",(n,i)=>{M.init(n,i);let $=[];for(let g of i.parts)if(typeof g==="object"&&g!==null){if(!g._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...g._zod.traits].shift()}`);let v=g._zod.pattern instanceof RegExp?g._zod.pattern.source:g._zod.pattern;if(!v)throw Error(`Invalid template literal part: ${g._zod.traits}`);let w=v.startsWith("^")?1:0,_=v.endsWith("$")?v.length-1:v.length;$.push(v.slice(w,_))}else if(g===null||o_.has(typeof g))$.push(fn(`${g}`));else throw Error(`Invalid template literal part: ${g}`);n._zod.pattern=new RegExp(`^${$.join("")}$`),n._zod.parse=(g,v)=>{if(typeof g.value!=="string")return g.issues.push({input:g.value,inst:n,expected:"string",code:"invalid_type"}),g;if(n._zod.pattern.lastIndex=0,!n._zod.pattern.test(g.value))return g.issues.push({input:g.value,inst:n,code:"invalid_format",format:i.format??"template_literal",pattern:n._zod.pattern.source}),g;return g}}),yU=t("$ZodFunction",(n,i)=>{return M.init(n,i),n._def=i,n._zod.def=i,n.implement=($)=>{if(typeof $!=="function")throw Error("implement() must be called with a function");return function(...g){let v=n._def.input?mw(n._def.input,g):g,w=Reflect.apply($,this,v);if(n._def.output)return mw(n._def.output,w);return w}},n.implementAsync=($)=>{if(typeof $!=="function")throw Error("implementAsync() must be called with a function");return async function(...g){let v=n._def.input?await yw(n._def.input,g):g,w=await Reflect.apply($,this,v);if(n._def.output)return await yw(n._def.output,w);return w}},n._zod.parse=($,g)=>{if(typeof $.value!=="function")return $.issues.push({code:"invalid_type",expected:"function",input:$.value,inst:n}),$;if(n._def.output&&n._def.output._zod.def.type==="promise")$.value=n.implementAsync($.value);else $.value=n.implement($.value);return $},n.input=(...$)=>{let g=n.constructor;if(Array.isArray($[0]))return new g({type:"function",input:new G4({type:"tuple",items:$[0],rest:$[1]}),output:n._def.output});return new g({type:"function",input:$[0],output:n._def.output})},n.output=($)=>{return new n.constructor({type:"function",input:n._def.input,output:$})},n}),dU=t("$ZodPromise",(n,i)=>{M.init(n,i),n._zod.parse=($,g)=>{return Promise.resolve($.value).then((v)=>i.innerType._zod.run({value:v,issues:[]},g))}}),eU=t("$ZodLazy",(n,i)=>{M.init(n,i),C(n._zod,"innerType",()=>i.getter()),C(n._zod,"pattern",()=>n._zod.innerType?._zod?.pattern),C(n._zod,"propValues",()=>n._zod.innerType?._zod?.propValues),C(n._zod,"optin",()=>n._zod.innerType?._zod?.optin??void 0),C(n._zod,"optout",()=>n._zod.innerType?._zod?.optout??void 0),n._zod.parse=($,g)=>{return n._zod.innerType._zod.run($,g)}}),pU=t("$ZodCustom",(n,i)=>{p.init(n,i),M.init(n,i),n._zod.parse=($,g)=>{return $},n._zod.check=($)=>{let g=$.value,v=i.fn(g);if(v instanceof Promise)return v.then((w)=>a2(w,$,g,n));a2(v,$,g,n);return}});function a2(n,i,$,g){if(!n){let v={code:"custom",input:$,inst:g,path:[...g._zod.def.path??[]],continue:!g._zod.def.abort};if(g._zod.def.params)v.params=g._zod.def.params;i.issues.push(Ci(v))}}var bi={};Nn(bi,{zhTW:()=>E1,zhCN:()=>C1,yo:()=>o1,vi:()=>h1,uz:()=>x1,ur:()=>A1,uk:()=>Wg,ua:()=>R1,tr:()=>M1,th:()=>z1,ta:()=>S1,sv:()=>P1,sl:()=>c1,ru:()=>N1,pt:()=>F1,ps:()=>O1,pl:()=>B1,ota:()=>K1,no:()=>L1,nl:()=>q1,ms:()=>f1,mk:()=>V1,lt:()=>H1,ko:()=>u1,km:()=>tg,kh:()=>j1,ka:()=>I1,ja:()=>Y1,it:()=>W1,is:()=>Q1,id:()=>t1,hy:()=>G1,hu:()=>X1,he:()=>J1,frCA:()=>D1,fr:()=>l1,fi:()=>k1,fa:()=>U1,es:()=>b1,eo:()=>_1,en:()=>Gg,de:()=>w1,da:()=>g1,cs:()=>$1,ca:()=>i1,bg:()=>v1,be:()=>n1,az:()=>sU,ar:()=>aU});var SQ=()=>{let n={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function i(v){return n[v]??null}let $={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${v.expected}، ولكن تم إدخال ${U}`;return`مدخلات غير مقبولة: يفترض إدخال ${w}، ولكن تم إدخال ${U}`}case"invalid_value":if(v.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${V(v.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return` أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${w} ${v.maximum.toString()} ${_.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${w} ${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${w} ${v.minimum.toString()} ${_.unit}`;return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${w} ${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${v.prefix}"`;if(w.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${w.suffix}"`;if(w.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${w.includes}"`;if(w.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${w.pattern}`;return`${$[w.format]??v.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${v.divisor}`;case"unrecognized_keys":return`معرف${v.keys.length>1?"ات":""} غريب${v.keys.length>1?"ة":""}: ${I(v.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${v.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${v.origin}`;default:return"مدخل غير مقبول"}}};function aU(){return{localeError:SQ()}}var zQ=()=>{let n={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function i(v){return n[v]??null}let $={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Yanlış dəyər: gözlənilən instanceof ${v.expected}, daxil olan ${U}`;return`Yanlış dəyər: gözlənilən ${w}, daxil olan ${U}`}case"invalid_value":if(v.values.length===1)return`Yanlış dəyər: gözlənilən ${V(v.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${w}${v.maximum.toString()} ${_.unit??"element"}`;return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Çox kiçik: gözlənilən ${v.origin} ${w}${v.minimum.toString()} ${_.unit}`;return`Çox kiçik: gözlənilən ${v.origin} ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Yanlış mətn: "${w.prefix}" ilə başlamalıdır`;if(w.format==="ends_with")return`Yanlış mətn: "${w.suffix}" ilə bitməlidir`;if(w.format==="includes")return`Yanlış mətn: "${w.includes}" daxil olmalıdır`;if(w.format==="regex")return`Yanlış mətn: ${w.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${$[w.format]??v.format}`}case"not_multiple_of":return`Yanlış ədəd: ${v.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${v.keys.length>1?"lar":""}: ${I(v.keys,", ")}`;case"invalid_key":return`${v.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${v.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function sU(){return{localeError:zQ()}}function gl(n,i,$,g){let v=Math.abs(n),w=v%10,_=v%100;if(_>=11&&_<=19)return g;if(w===1)return i;if(w>=2&&w<=4)return $;return g}var MQ=()=>{let n={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function i(v){return n[v]??null}let $={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},g={nan:"NaN",number:"лік",array:"масіў"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Няправільны ўвод: чакаўся instanceof ${v.expected}, атрымана ${U}`;return`Няправільны ўвод: чакаўся ${w}, атрымана ${U}`}case"invalid_value":if(v.values.length===1)return`Няправільны ўвод: чакалася ${V(v.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_){let U=Number(v.maximum),k=gl(U,_.unit.one,_.unit.few,_.unit.many);return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна ${_.verb} ${w}${v.maximum.toString()} ${k}`}return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна быць ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_){let U=Number(v.minimum),k=gl(U,_.unit.one,_.unit.few,_.unit.many);return`Занадта малы: чакалася, што ${v.origin} павінна ${_.verb} ${w}${v.minimum.toString()} ${k}`}return`Занадта малы: чакалася, што ${v.origin} павінна быць ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${w.prefix}"`;if(w.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${w.suffix}"`;if(w.format==="includes")return`Няправільны радок: павінен змяшчаць "${w.includes}"`;if(w.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${w.pattern}`;return`Няправільны ${$[w.format]??v.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${v.keys.length>1?"ключы":"ключ"}: ${I(v.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${v.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${v.origin}`;default:return"Няправільны ўвод"}}};function n1(){return{localeError:MQ()}}var RQ=()=>{let n={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function i(v){return n[v]??null}let $={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},g={nan:"NaN",number:"число",array:"масив"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Невалиден вход: очакван instanceof ${v.expected}, получен ${U}`;return`Невалиден вход: очакван ${w}, получен ${U}`}case"invalid_value":if(v.values.length===1)return`Невалиден вход: очакван ${V(v.values[0])}`;return`Невалидна опция: очаквано едно от ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Твърде голямо: очаква се ${v.origin??"стойност"} да съдържа ${w}${v.maximum.toString()} ${_.unit??"елемента"}`;return`Твърде голямо: очаква се ${v.origin??"стойност"} да бъде ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Твърде малко: очаква се ${v.origin} да съдържа ${w}${v.minimum.toString()} ${_.unit}`;return`Твърде малко: очаква се ${v.origin} да бъде ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Невалиден низ: трябва да започва с "${w.prefix}"`;if(w.format==="ends_with")return`Невалиден низ: трябва да завършва с "${w.suffix}"`;if(w.format==="includes")return`Невалиден низ: трябва да включва "${w.includes}"`;if(w.format==="regex")return`Невалиден низ: трябва да съвпада с ${w.pattern}`;let _="Невалиден";if(w.format==="emoji")_="Невалидно";if(w.format==="datetime")_="Невалидно";if(w.format==="date")_="Невалидна";if(w.format==="time")_="Невалидно";if(w.format==="duration")_="Невалидна";return`${_} ${$[w.format]??v.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${v.divisor}`;case"unrecognized_keys":return`Неразпознат${v.keys.length>1?"и":""} ключ${v.keys.length>1?"ове":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${v.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${v.origin}`;default:return"Невалиден вход"}}};function v1(){return{localeError:RQ()}}var AQ=()=>{let n={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function i(v){return n[v]??null}let $={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Tipus invàlid: s'esperava instanceof ${v.expected}, s'ha rebut ${U}`;return`Tipus invàlid: s'esperava ${w}, s'ha rebut ${U}`}case"invalid_value":if(v.values.length===1)return`Valor invàlid: s'esperava ${V(v.values[0])}`;return`Opció invàlida: s'esperava una de ${I(v.values," o ")}`;case"too_big":{let w=v.inclusive?"com a màxim":"menys de",_=i(v.origin);if(_)return`Massa gran: s'esperava que ${v.origin??"el valor"} contingués ${w} ${v.maximum.toString()} ${_.unit??"elements"}`;return`Massa gran: s'esperava que ${v.origin??"el valor"} fos ${w} ${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?"com a mínim":"més de",_=i(v.origin);if(_)return`Massa petit: s'esperava que ${v.origin} contingués ${w} ${v.minimum.toString()} ${_.unit}`;return`Massa petit: s'esperava que ${v.origin} fos ${w} ${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Format invàlid: ha de començar amb "${w.prefix}"`;if(w.format==="ends_with")return`Format invàlid: ha d'acabar amb "${w.suffix}"`;if(w.format==="includes")return`Format invàlid: ha d'incloure "${w.includes}"`;if(w.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${w.pattern}`;return`Format invàlid per a ${$[w.format]??v.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${v.divisor}`;case"unrecognized_keys":return`Clau${v.keys.length>1?"s":""} no reconeguda${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${v.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${v.origin}`;default:return"Entrada invàlida"}}};function i1(){return{localeError:AQ()}}var xQ=()=>{let n={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function i(v){return n[v]??null}let $={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},g={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Neplatný vstup: očekáváno instanceof ${v.expected}, obdrženo ${U}`;return`Neplatný vstup: očekáváno ${w}, obdrženo ${U}`}case"invalid_value":if(v.values.length===1)return`Neplatný vstup: očekáváno ${V(v.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí mít ${w}${v.maximum.toString()} ${_.unit??"prvků"}`;return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí být ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí mít ${w}${v.minimum.toString()} ${_.unit??"prvků"}`;return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí být ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Neplatný řetězec: musí začínat na "${w.prefix}"`;if(w.format==="ends_with")return`Neplatný řetězec: musí končit na "${w.suffix}"`;if(w.format==="includes")return`Neplatný řetězec: musí obsahovat "${w.includes}"`;if(w.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${w.pattern}`;return`Neplatný formát ${$[w.format]??v.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${v.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${I(v.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${v.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${v.origin}`;default:return"Neplatný vstup"}}};function $1(){return{localeError:xQ()}}var hQ=()=>{let n={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function i(v){return n[v]??null}let $={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Ugyldigt input: forventede instanceof ${v.expected}, fik ${U}`;return`Ugyldigt input: forventede ${w}, fik ${U}`}case"invalid_value":if(v.values.length===1)return`Ugyldig værdi: forventede ${V(v.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin),U=g[v.origin]??v.origin;if(_)return`For stor: forventede ${U??"value"} ${_.verb} ${w} ${v.maximum.toString()} ${_.unit??"elementer"}`;return`For stor: forventede ${U??"value"} havde ${w} ${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin),U=g[v.origin]??v.origin;if(_)return`For lille: forventede ${U} ${_.verb} ${w} ${v.minimum.toString()} ${_.unit}`;return`For lille: forventede ${U} havde ${w} ${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Ugyldig streng: skal starte med "${w.prefix}"`;if(w.format==="ends_with")return`Ugyldig streng: skal ende med "${w.suffix}"`;if(w.format==="includes")return`Ugyldig streng: skal indeholde "${w.includes}"`;if(w.format==="regex")return`Ugyldig streng: skal matche mønsteret ${w.pattern}`;return`Ugyldig ${$[w.format]??v.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${I(v.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${v.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${v.origin}`;default:return"Ugyldigt input"}}};function g1(){return{localeError:hQ()}}var CQ=()=>{let n={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function i(v){return n[v]??null}let $={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},g={nan:"NaN",number:"Zahl",array:"Array"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Ungültige Eingabe: erwartet instanceof ${v.expected}, erhalten ${U}`;return`Ungültige Eingabe: erwartet ${w}, erhalten ${U}`}case"invalid_value":if(v.values.length===1)return`Ungültige Eingabe: erwartet ${V(v.values[0])}`;return`Ungültige Option: erwartet eine von ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${w}${v.maximum.toString()} ${_.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${w}${v.maximum.toString()} ist`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Zu klein: erwartet, dass ${v.origin} ${w}${v.minimum.toString()} ${_.unit} hat`;return`Zu klein: erwartet, dass ${v.origin} ${w}${v.minimum.toString()} ist`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Ungültiger String: muss mit "${w.prefix}" beginnen`;if(w.format==="ends_with")return`Ungültiger String: muss mit "${w.suffix}" enden`;if(w.format==="includes")return`Ungültiger String: muss "${w.includes}" enthalten`;if(w.format==="regex")return`Ungültiger String: muss dem Muster ${w.pattern} entsprechen`;return`Ungültig: ${$[w.format]??v.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${v.divisor} sein`;case"unrecognized_keys":return`${v.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${I(v.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${v.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${v.origin}`;default:return"Ungültige Eingabe"}}};function w1(){return{localeError:CQ()}}var EQ=()=>{let n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function i(v){return n[v]??null}let $={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;return`Invalid input: expected ${w}, received ${U}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${V(v.values[0])}`;return`Invalid option: expected one of ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Too big: expected ${v.origin??"value"} to have ${w}${v.maximum.toString()} ${_.unit??"elements"}`;return`Too big: expected ${v.origin??"value"} to be ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Too small: expected ${v.origin} to have ${w}${v.minimum.toString()} ${_.unit}`;return`Too small: expected ${v.origin} to be ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${$[w.format]??v.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${v.divisor}`;case"unrecognized_keys":return`Unrecognized key${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Invalid key in ${v.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${v.origin}`;default:return"Invalid input"}}};function Gg(){return{localeError:EQ()}}var oQ=()=>{let n={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function i(v){return n[v]??null}let $={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},g={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Nevalida enigo: atendiĝis instanceof ${v.expected}, riceviĝis ${U}`;return`Nevalida enigo: atendiĝis ${w}, riceviĝis ${U}`}case"invalid_value":if(v.values.length===1)return`Nevalida enigo: atendiĝis ${V(v.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Tro granda: atendiĝis ke ${v.origin??"valoro"} havu ${w}${v.maximum.toString()} ${_.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${v.origin??"valoro"} havu ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Tro malgranda: atendiĝis ke ${v.origin} havu ${w}${v.minimum.toString()} ${_.unit}`;return`Tro malgranda: atendiĝis ke ${v.origin} estu ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${w.prefix}"`;if(w.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${w.suffix}"`;if(w.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${w.includes}"`;if(w.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${w.pattern}`;return`Nevalida ${$[w.format]??v.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${v.divisor}`;case"unrecognized_keys":return`Nekonata${v.keys.length>1?"j":""} ŝlosilo${v.keys.length>1?"j":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${v.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${v.origin}`;default:return"Nevalida enigo"}}};function _1(){return{localeError:oQ()}}var TQ=()=>{let n={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function i(v){return n[v]??null}let $={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Entrada inválida: se esperaba instanceof ${v.expected}, recibido ${U}`;return`Entrada inválida: se esperaba ${w}, recibido ${U}`}case"invalid_value":if(v.values.length===1)return`Entrada inválida: se esperaba ${V(v.values[0])}`;return`Opción inválida: se esperaba una de ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin),U=g[v.origin]??v.origin;if(_)return`Demasiado grande: se esperaba que ${U??"valor"} tuviera ${w}${v.maximum.toString()} ${_.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${U??"valor"} fuera ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin),U=g[v.origin]??v.origin;if(_)return`Demasiado pequeño: se esperaba que ${U} tuviera ${w}${v.minimum.toString()} ${_.unit}`;return`Demasiado pequeño: se esperaba que ${U} fuera ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Cadena inválida: debe comenzar con "${w.prefix}"`;if(w.format==="ends_with")return`Cadena inválida: debe terminar en "${w.suffix}"`;if(w.format==="includes")return`Cadena inválida: debe incluir "${w.includes}"`;if(w.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${w.pattern}`;return`Inválido ${$[w.format]??v.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${v.divisor}`;case"unrecognized_keys":return`Llave${v.keys.length>1?"s":""} desconocida${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Llave inválida en ${g[v.origin]??v.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${g[v.origin]??v.origin}`;default:return"Entrada inválida"}}};function b1(){return{localeError:TQ()}}var ZQ=()=>{let n={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function i(v){return n[v]??null}let $={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},g={nan:"NaN",number:"عدد",array:"آرایه"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`ورودی نامعتبر: میبایست instanceof ${v.expected} میبود، ${U} دریافت شد`;return`ورودی نامعتبر: میبایست ${w} میبود، ${U} دریافت شد`}case"invalid_value":if(v.values.length===1)return`ورودی نامعتبر: میبایست ${V(v.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${I(v.values,"|")} میبود`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${w}${v.maximum.toString()} ${_.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${w}${v.maximum.toString()} باشد`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`خیلی کوچک: ${v.origin} باید ${w}${v.minimum.toString()} ${_.unit} باشد`;return`خیلی کوچک: ${v.origin} باید ${w}${v.minimum.toString()} باشد`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`رشته نامعتبر: باید با "${w.prefix}" شروع شود`;if(w.format==="ends_with")return`رشته نامعتبر: باید با "${w.suffix}" تمام شود`;if(w.format==="includes")return`رشته نامعتبر: باید شامل "${w.includes}" باشد`;if(w.format==="regex")return`رشته نامعتبر: باید با الگوی ${w.pattern} مطابقت داشته باشد`;return`${$[w.format]??v.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${v.divisor} باشد`;case"unrecognized_keys":return`کلید${v.keys.length>1?"های":""} ناشناس: ${I(v.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${v.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${v.origin}`;default:return"ورودی نامعتبر"}}};function U1(){return{localeError:ZQ()}}var rQ=()=>{let n={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function i(v){return n[v]??null}let $={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Virheellinen tyyppi: odotettiin instanceof ${v.expected}, oli ${U}`;return`Virheellinen tyyppi: odotettiin ${w}, oli ${U}`}case"invalid_value":if(v.values.length===1)return`Virheellinen syöte: täytyy olla ${V(v.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Liian suuri: ${_.subject} täytyy olla ${w}${v.maximum.toString()} ${_.unit}`.trim();return`Liian suuri: arvon täytyy olla ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Liian pieni: ${_.subject} täytyy olla ${w}${v.minimum.toString()} ${_.unit}`.trim();return`Liian pieni: arvon täytyy olla ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${w.prefix}"`;if(w.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${w.suffix}"`;if(w.format==="includes")return`Virheellinen syöte: täytyy sisältää "${w.includes}"`;if(w.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${w.pattern}`;return`Virheellinen ${$[w.format]??v.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${v.divisor} monikerta`;case"unrecognized_keys":return`${v.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${I(v.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function k1(){return{localeError:rQ()}}var mQ=()=>{let n={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function i(v){return n[v]??null}let $={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={nan:"NaN",number:"nombre",array:"tableau"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Entrée invalide : instanceof ${v.expected} attendu, ${U} reçu`;return`Entrée invalide : ${w} attendu, ${U} reçu`}case"invalid_value":if(v.values.length===1)return`Entrée invalide : ${V(v.values[0])} attendu`;return`Option invalide : une valeur parmi ${I(v.values,"|")} attendue`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Trop grand : ${v.origin??"valeur"} doit ${_.verb} ${w}${v.maximum.toString()} ${_.unit??"élément(s)"}`;return`Trop grand : ${v.origin??"valeur"} doit être ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Trop petit : ${v.origin} doit ${_.verb} ${w}${v.minimum.toString()} ${_.unit}`;return`Trop petit : ${v.origin} doit être ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Chaîne invalide : doit commencer par "${w.prefix}"`;if(w.format==="ends_with")return`Chaîne invalide : doit se terminer par "${w.suffix}"`;if(w.format==="includes")return`Chaîne invalide : doit inclure "${w.includes}"`;if(w.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${w.pattern}`;return`${$[w.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${I(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function l1(){return{localeError:mQ()}}var yQ=()=>{let n={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function i(v){return n[v]??null}let $={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Entrée invalide : attendu instanceof ${v.expected}, reçu ${U}`;return`Entrée invalide : attendu ${w}, reçu ${U}`}case"invalid_value":if(v.values.length===1)return`Entrée invalide : attendu ${V(v.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"≤":"<",_=i(v.origin);if(_)return`Trop grand : attendu que ${v.origin??"la valeur"} ait ${w}${v.maximum.toString()} ${_.unit}`;return`Trop grand : attendu que ${v.origin??"la valeur"} soit ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?"≥":">",_=i(v.origin);if(_)return`Trop petit : attendu que ${v.origin} ait ${w}${v.minimum.toString()} ${_.unit}`;return`Trop petit : attendu que ${v.origin} soit ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Chaîne invalide : doit commencer par "${w.prefix}"`;if(w.format==="ends_with")return`Chaîne invalide : doit se terminer par "${w.suffix}"`;if(w.format==="includes")return`Chaîne invalide : doit inclure "${w.includes}"`;if(w.format==="regex")return`Chaîne invalide : doit correspondre au motif ${w.pattern}`;return`${$[w.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${I(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function D1(){return{localeError:yQ()}}var dQ=()=>{let n={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},i={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},$=(l)=>l?n[l]:void 0,g=(l)=>{let J=$(l);if(J)return J.label;return l??n.unknown.label},v=(l)=>`ה${g(l)}`,w=(l)=>{return($(l)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},_=(l)=>{if(!l)return null;return i[l]??null},U={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},k={nan:"NaN"};return(l)=>{switch(l.code){case"invalid_type":{let J=l.expected,Q=k[J??""]??g(J),j=L(l.input),u=k[j]??n[j]?.label??j;if(/^[A-Z]/.test(l.expected))return`קלט לא תקין: צריך להיות instanceof ${l.expected}, התקבל ${u}`;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${u}`}case"invalid_value":{if(l.values.length===1)return`ערך לא תקין: הערך חייב להיות ${V(l.values[0])}`;let J=l.values.map((u)=>V(u));if(l.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${J[0]} או ${J[1]}`;let Q=J[J.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${J.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let J=_(l.origin),Q=v(l.origin??"value");if(l.origin==="string")return`${J?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${l.maximum.toString()} ${J?.unit??""} ${l.inclusive?"או פחות":"לכל היותר"}`.trim();if(l.origin==="number"){let W=l.inclusive?`קטן או שווה ל-${l.maximum}`:`קטן מ-${l.maximum}`;return`גדול מדי: ${Q} צריך להיות ${W}`}if(l.origin==="array"||l.origin==="set"){let W=l.origin==="set"?"צריכה":"צריך",Y=l.inclusive?`${l.maximum} ${J?.unit??""} או פחות`:`פחות מ-${l.maximum} ${J?.unit??""}`;return`גדול מדי: ${Q} ${W} להכיל ${Y}`.trim()}let j=l.inclusive?"<=":"<",u=w(l.origin??"value");if(J?.unit)return`${J.longLabel} מדי: ${Q} ${u} ${j}${l.maximum.toString()} ${J.unit}`;return`${J?.longLabel??"גדול"} מדי: ${Q} ${u} ${j}${l.maximum.toString()}`}case"too_small":{let J=_(l.origin),Q=v(l.origin??"value");if(l.origin==="string")return`${J?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${l.minimum.toString()} ${J?.unit??""} ${l.inclusive?"או יותר":"לפחות"}`.trim();if(l.origin==="number"){let W=l.inclusive?`גדול או שווה ל-${l.minimum}`:`גדול מ-${l.minimum}`;return`קטן מדי: ${Q} צריך להיות ${W}`}if(l.origin==="array"||l.origin==="set"){let W=l.origin==="set"?"צריכה":"צריך";if(l.minimum===1&&l.inclusive){let B=l.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${W} להכיל ${B}`}let Y=l.inclusive?`${l.minimum} ${J?.unit??""} או יותר`:`יותר מ-${l.minimum} ${J?.unit??""}`;return`קטן מדי: ${Q} ${W} להכיל ${Y}`.trim()}let j=l.inclusive?">=":">",u=w(l.origin??"value");if(J?.unit)return`${J.shortLabel} מדי: ${Q} ${u} ${j}${l.minimum.toString()} ${J.unit}`;return`${J?.shortLabel??"קטן"} מדי: ${Q} ${u} ${j}${l.minimum.toString()}`}case"invalid_format":{let J=l;if(J.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${J.prefix}"`;if(J.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${J.suffix}"`;if(J.format==="includes")return`המחרוזת חייבת לכלול "${J.includes}"`;if(J.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${J.pattern}`;let Q=U[J.format],j=Q?.label??J.format,W=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${j} לא ${W}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${l.divisor}`;case"unrecognized_keys":return`מפתח${l.keys.length>1?"ות":""} לא מזוה${l.keys.length>1?"ים":"ה"}: ${I(l.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${v(l.origin??"array")}`;default:return"קלט לא תקין"}}};function J1(){return{localeError:dQ()}}var eQ=()=>{let n={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function i(v){return n[v]??null}let $={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},g={nan:"NaN",number:"szám",array:"tömb"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Érvénytelen bemenet: a várt érték instanceof ${v.expected}, a kapott érték ${U}`;return`Érvénytelen bemenet: a várt érték ${w}, a kapott érték ${U}`}case"invalid_value":if(v.values.length===1)return`Érvénytelen bemenet: a várt érték ${V(v.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Túl nagy: ${v.origin??"érték"} mérete túl nagy ${w}${v.maximum.toString()} ${_.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${v.origin??"érték"} túl nagy: ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Túl kicsi: a bemeneti érték ${v.origin} mérete túl kicsi ${w}${v.minimum.toString()} ${_.unit}`;return`Túl kicsi: a bemeneti érték ${v.origin} túl kicsi ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Érvénytelen string: "${w.prefix}" értékkel kell kezdődnie`;if(w.format==="ends_with")return`Érvénytelen string: "${w.suffix}" értékkel kell végződnie`;if(w.format==="includes")return`Érvénytelen string: "${w.includes}" értéket kell tartalmaznia`;if(w.format==="regex")return`Érvénytelen string: ${w.pattern} mintának kell megfelelnie`;return`Érvénytelen ${$[w.format]??v.format}`}case"not_multiple_of":return`Érvénytelen szám: ${v.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${v.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${v.origin}`;default:return"Érvénytelen bemenet"}}};function X1(){return{localeError:eQ()}}function wl(n,i,$){return Math.abs(n)===1?i:$}function mi(n){if(!n)return"";let i=["ա","ե","ը","ի","ո","ու","օ"],$=n[n.length-1];return n+(i.includes($)?"ն":"ը")}var pQ=()=>{let n={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function i(v){return n[v]??null}let $={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},g={nan:"NaN",number:"թիվ",array:"զանգված"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${v.expected}, ստացվել է ${U}`;return`Սխալ մուտքագրում․ սպասվում էր ${w}, ստացվել է ${U}`}case"invalid_value":if(v.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${V(v.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_){let U=Number(v.maximum),k=wl(U,_.unit.one,_.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${mi(v.origin??"արժեք")} կունենա ${w}${v.maximum.toString()} ${k}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${mi(v.origin??"արժեք")} լինի ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_){let U=Number(v.minimum),k=wl(U,_.unit.one,_.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${mi(v.origin)} կունենա ${w}${v.minimum.toString()} ${k}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${mi(v.origin)} լինի ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${w.prefix}"-ով`;if(w.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${w.suffix}"-ով`;if(w.format==="includes")return`Սխալ տող․ պետք է պարունակի "${w.includes}"`;if(w.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${w.pattern} ձևաչափին`;return`Սխալ ${$[w.format]??v.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${v.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${v.keys.length>1?"ներ":""}. ${I(v.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${mi(v.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${mi(v.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function G1(){return{localeError:pQ()}}var aQ=()=>{let n={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function i(v){return n[v]??null}let $={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Input tidak valid: diharapkan instanceof ${v.expected}, diterima ${U}`;return`Input tidak valid: diharapkan ${w}, diterima ${U}`}case"invalid_value":if(v.values.length===1)return`Input tidak valid: diharapkan ${V(v.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Terlalu besar: diharapkan ${v.origin??"value"} memiliki ${w}${v.maximum.toString()} ${_.unit??"elemen"}`;return`Terlalu besar: diharapkan ${v.origin??"value"} menjadi ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Terlalu kecil: diharapkan ${v.origin} memiliki ${w}${v.minimum.toString()} ${_.unit}`;return`Terlalu kecil: diharapkan ${v.origin} menjadi ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`String tidak valid: harus dimulai dengan "${w.prefix}"`;if(w.format==="ends_with")return`String tidak valid: harus berakhir dengan "${w.suffix}"`;if(w.format==="includes")return`String tidak valid: harus menyertakan "${w.includes}"`;if(w.format==="regex")return`String tidak valid: harus sesuai pola ${w.pattern}`;return`${$[w.format]??v.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${v.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${v.origin}`;default:return"Input tidak valid"}}};function t1(){return{localeError:aQ()}}var sQ=()=>{let n={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function i(v){return n[v]??null}let $={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},g={nan:"NaN",number:"númer",array:"fylki"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Rangt gildi: Þú slóst inn ${U} þar sem á að vera instanceof ${v.expected}`;return`Rangt gildi: Þú slóst inn ${U} þar sem á að vera ${w}`}case"invalid_value":if(v.values.length===1)return`Rangt gildi: gert ráð fyrir ${V(v.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Of stórt: gert er ráð fyrir að ${v.origin??"gildi"} hafi ${w}${v.maximum.toString()} ${_.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${v.origin??"gildi"} sé ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Of lítið: gert er ráð fyrir að ${v.origin} hafi ${w}${v.minimum.toString()} ${_.unit}`;return`Of lítið: gert er ráð fyrir að ${v.origin} sé ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Ógildur strengur: verður að byrja á "${w.prefix}"`;if(w.format==="ends_with")return`Ógildur strengur: verður að enda á "${w.suffix}"`;if(w.format==="includes")return`Ógildur strengur: verður að innihalda "${w.includes}"`;if(w.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${w.pattern}`;return`Rangt ${$[w.format]??v.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${v.divisor}`;case"unrecognized_keys":return`Óþekkt ${v.keys.length>1?"ir lyklar":"ur lykill"}: ${I(v.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${v.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${v.origin}`;default:return"Rangt gildi"}}};function Q1(){return{localeError:sQ()}}var n9=()=>{let n={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function i(v){return n[v]??null}let $={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"numero",array:"vettore"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Input non valido: atteso instanceof ${v.expected}, ricevuto ${U}`;return`Input non valido: atteso ${w}, ricevuto ${U}`}case"invalid_value":if(v.values.length===1)return`Input non valido: atteso ${V(v.values[0])}`;return`Opzione non valida: atteso uno tra ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Troppo grande: ${v.origin??"valore"} deve avere ${w}${v.maximum.toString()} ${_.unit??"elementi"}`;return`Troppo grande: ${v.origin??"valore"} deve essere ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Troppo piccolo: ${v.origin} deve avere ${w}${v.minimum.toString()} ${_.unit}`;return`Troppo piccolo: ${v.origin} deve essere ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Stringa non valida: deve iniziare con "${w.prefix}"`;if(w.format==="ends_with")return`Stringa non valida: deve terminare con "${w.suffix}"`;if(w.format==="includes")return`Stringa non valida: deve includere "${w.includes}"`;if(w.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${w.pattern}`;return`Invalid ${$[w.format]??v.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${v.divisor}`;case"unrecognized_keys":return`Chiav${v.keys.length>1?"i":"e"} non riconosciut${v.keys.length>1?"e":"a"}: ${I(v.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${v.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${v.origin}`;default:return"Input non valido"}}};function W1(){return{localeError:n9()}}var v9=()=>{let n={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function i(v){return n[v]??null}let $={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},g={nan:"NaN",number:"数値",array:"配列"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`無効な入力: instanceof ${v.expected}が期待されましたが、${U}が入力されました`;return`無効な入力: ${w}が期待されましたが、${U}が入力されました`}case"invalid_value":if(v.values.length===1)return`無効な入力: ${V(v.values[0])}が期待されました`;return`無効な選択: ${I(v.values,"、")}のいずれかである必要があります`;case"too_big":{let w=v.inclusive?"以下である":"より小さい",_=i(v.origin);if(_)return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${_.unit??"要素"}${w}必要があります`;return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${w}必要があります`}case"too_small":{let w=v.inclusive?"以上である":"より大きい",_=i(v.origin);if(_)return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${_.unit}${w}必要があります`;return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${w}必要があります`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`無効な文字列: "${w.prefix}"で始まる必要があります`;if(w.format==="ends_with")return`無効な文字列: "${w.suffix}"で終わる必要があります`;if(w.format==="includes")return`無効な文字列: "${w.includes}"を含む必要があります`;if(w.format==="regex")return`無効な文字列: パターン${w.pattern}に一致する必要があります`;return`無効な${$[w.format]??v.format}`}case"not_multiple_of":return`無効な数値: ${v.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${v.keys.length>1?"群":""}: ${I(v.keys,"、")}`;case"invalid_key":return`${v.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${v.origin}内の無効な値`;default:return"無効な入力"}}};function Y1(){return{localeError:v9()}}var i9=()=>{let n={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function i(v){return n[v]??null}let $={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},g={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${v.expected}, მიღებული ${U}`;return`არასწორი შეყვანა: მოსალოდნელი ${w}, მიღებული ${U}`}case"invalid_value":if(v.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${V(v.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${I(v.values,"|")}-დან`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`ზედმეტად დიდი: მოსალოდნელი ${v.origin??"მნიშვნელობა"} ${_.verb} ${w}${v.maximum.toString()} ${_.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${v.origin??"მნიშვნელობა"} იყოს ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`ზედმეტად პატარა: მოსალოდნელი ${v.origin} ${_.verb} ${w}${v.minimum.toString()} ${_.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${v.origin} იყოს ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${w.prefix}"-ით`;if(w.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${w.suffix}"-ით`;if(w.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${w.includes}"-ს`;if(w.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${w.pattern}`;return`არასწორი ${$[w.format]??v.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${v.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${v.keys.length>1?"ები":"ი"}: ${I(v.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${v.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${v.origin}-ში`;default:return"არასწორი შეყვანა"}}};function I1(){return{localeError:i9()}}var $9=()=>{let n={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function i(v){return n[v]??null}let $={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},g={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${v.expected} ប៉ុន្តែទទួលបាន ${U}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${w} ប៉ុន្តែទទួលបាន ${U}`}case"invalid_value":if(v.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${V(v.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${w} ${v.maximum.toString()} ${_.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${w} ${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`តូចពេក៖ ត្រូវការ ${v.origin} ${w} ${v.minimum.toString()} ${_.unit}`;return`តូចពេក៖ ត្រូវការ ${v.origin} ${w} ${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${w.prefix}"`;if(w.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${w.suffix}"`;if(w.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${w.includes}"`;if(w.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${w.pattern}`;return`មិនត្រឹមត្រូវ៖ ${$[w.format]??v.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${v.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${I(v.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function tg(){return{localeError:$9()}}function j1(){return tg()}var g9=()=>{let n={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function i(v){return n[v]??null}let $={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`잘못된 입력: 예상 타입은 instanceof ${v.expected}, 받은 타입은 ${U}입니다`;return`잘못된 입력: 예상 타입은 ${w}, 받은 타입은 ${U}입니다`}case"invalid_value":if(v.values.length===1)return`잘못된 입력: 값은 ${V(v.values[0])} 이어야 합니다`;return`잘못된 옵션: ${I(v.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let w=v.inclusive?"이하":"미만",_=w==="미만"?"이어야 합니다":"여야 합니다",U=i(v.origin),k=U?.unit??"요소";if(U)return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()}${k} ${w}${_}`;return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()} ${w}${_}`}case"too_small":{let w=v.inclusive?"이상":"초과",_=w==="이상"?"이어야 합니다":"여야 합니다",U=i(v.origin),k=U?.unit??"요소";if(U)return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()}${k} ${w}${_}`;return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()} ${w}${_}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`잘못된 문자열: "${w.prefix}"(으)로 시작해야 합니다`;if(w.format==="ends_with")return`잘못된 문자열: "${w.suffix}"(으)로 끝나야 합니다`;if(w.format==="includes")return`잘못된 문자열: "${w.includes}"을(를) 포함해야 합니다`;if(w.format==="regex")return`잘못된 문자열: 정규식 ${w.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${$[w.format]??v.format}`}case"not_multiple_of":return`잘못된 숫자: ${v.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${I(v.keys,", ")}`;case"invalid_key":return`잘못된 키: ${v.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${v.origin}`;default:return"잘못된 입력"}}};function u1(){return{localeError:g9()}}var Qg=(n)=>{return n.charAt(0).toUpperCase()+n.slice(1)};function _l(n){let i=Math.abs(n),$=i%10,g=i%100;if(g>=11&&g<=19||$===0)return"many";if($===1)return"one";return"few"}var w9=()=>{let n={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function i(v,w,_,U){let k=n[v]??null;if(k===null)return k;return{unit:k.unit[w],verb:k.verb[U][_?"inclusive":"notInclusive"]}}let $={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},g={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Gautas tipas ${U}, o tikėtasi - instanceof ${v.expected}`;return`Gautas tipas ${U}, o tikėtasi - ${w}`}case"invalid_value":if(v.values.length===1)return`Privalo būti ${V(v.values[0])}`;return`Privalo būti vienas iš ${I(v.values,"|")} pasirinkimų`;case"too_big":{let w=g[v.origin]??v.origin,_=i(v.origin,_l(Number(v.maximum)),v.inclusive??!1,"smaller");if(_?.verb)return`${Qg(w??v.origin??"reikšmė")} ${_.verb} ${v.maximum.toString()} ${_.unit??"elementų"}`;let U=v.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Qg(w??v.origin??"reikšmė")} turi būti ${U} ${v.maximum.toString()} ${_?.unit}`}case"too_small":{let w=g[v.origin]??v.origin,_=i(v.origin,_l(Number(v.minimum)),v.inclusive??!1,"bigger");if(_?.verb)return`${Qg(w??v.origin??"reikšmė")} ${_.verb} ${v.minimum.toString()} ${_.unit??"elementų"}`;let U=v.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Qg(w??v.origin??"reikšmė")} turi būti ${U} ${v.minimum.toString()} ${_?.unit}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Eilutė privalo prasidėti "${w.prefix}"`;if(w.format==="ends_with")return`Eilutė privalo pasibaigti "${w.suffix}"`;if(w.format==="includes")return`Eilutė privalo įtraukti "${w.includes}"`;if(w.format==="regex")return`Eilutė privalo atitikti ${w.pattern}`;return`Neteisingas ${$[w.format]??v.format}`}case"not_multiple_of":return`Skaičius privalo būti ${v.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${v.keys.length>1?"i":"as"} rakt${v.keys.length>1?"ai":"as"}: ${I(v.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let w=g[v.origin]??v.origin;return`${Qg(w??v.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function H1(){return{localeError:w9()}}var _9=()=>{let n={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function i(v){return n[v]??null}let $={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},g={nan:"NaN",number:"број",array:"низа"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Грешен внес: се очекува instanceof ${v.expected}, примено ${U}`;return`Грешен внес: се очекува ${w}, примено ${U}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${V(v.values[0])}`;return`Грешана опција: се очекува една ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Премногу голем: се очекува ${v.origin??"вредноста"} да има ${w}${v.maximum.toString()} ${_.unit??"елементи"}`;return`Премногу голем: се очекува ${v.origin??"вредноста"} да биде ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Премногу мал: се очекува ${v.origin} да има ${w}${v.minimum.toString()} ${_.unit}`;return`Премногу мал: се очекува ${v.origin} да биде ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Неважечка низа: мора да започнува со "${w.prefix}"`;if(w.format==="ends_with")return`Неважечка низа: мора да завршува со "${w.suffix}"`;if(w.format==="includes")return`Неважечка низа: мора да вклучува "${w.includes}"`;if(w.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${w.pattern}`;return`Invalid ${$[w.format]??v.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${I(v.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${v.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${v.origin}`;default:return"Грешен внес"}}};function V1(){return{localeError:_9()}}var b9=()=>{let n={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function i(v){return n[v]??null}let $={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"nombor"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Input tidak sah: dijangka instanceof ${v.expected}, diterima ${U}`;return`Input tidak sah: dijangka ${w}, diterima ${U}`}case"invalid_value":if(v.values.length===1)return`Input tidak sah: dijangka ${V(v.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Terlalu besar: dijangka ${v.origin??"nilai"} ${_.verb} ${w}${v.maximum.toString()} ${_.unit??"elemen"}`;return`Terlalu besar: dijangka ${v.origin??"nilai"} adalah ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Terlalu kecil: dijangka ${v.origin} ${_.verb} ${w}${v.minimum.toString()} ${_.unit}`;return`Terlalu kecil: dijangka ${v.origin} adalah ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`String tidak sah: mesti bermula dengan "${w.prefix}"`;if(w.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${w.suffix}"`;if(w.format==="includes")return`String tidak sah: mesti mengandungi "${w.includes}"`;if(w.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${w.pattern}`;return`${$[w.format]??v.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(v.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${v.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${v.origin}`;default:return"Input tidak sah"}}};function f1(){return{localeError:b9()}}var U9=()=>{let n={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function i(v){return n[v]??null}let $={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},g={nan:"NaN",number:"getal"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Ongeldige invoer: verwacht instanceof ${v.expected}, ontving ${U}`;return`Ongeldige invoer: verwacht ${w}, ontving ${U}`}case"invalid_value":if(v.values.length===1)return`Ongeldige invoer: verwacht ${V(v.values[0])}`;return`Ongeldige optie: verwacht één van ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin),U=v.origin==="date"?"laat":v.origin==="string"?"lang":"groot";if(_)return`Te ${U}: verwacht dat ${v.origin??"waarde"} ${w}${v.maximum.toString()} ${_.unit??"elementen"} ${_.verb}`;return`Te ${U}: verwacht dat ${v.origin??"waarde"} ${w}${v.maximum.toString()} is`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin),U=v.origin==="date"?"vroeg":v.origin==="string"?"kort":"klein";if(_)return`Te ${U}: verwacht dat ${v.origin} ${w}${v.minimum.toString()} ${_.unit} ${_.verb}`;return`Te ${U}: verwacht dat ${v.origin} ${w}${v.minimum.toString()} is`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Ongeldige tekst: moet met "${w.prefix}" beginnen`;if(w.format==="ends_with")return`Ongeldige tekst: moet op "${w.suffix}" eindigen`;if(w.format==="includes")return`Ongeldige tekst: moet "${w.includes}" bevatten`;if(w.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${w.pattern}`;return`Ongeldig: ${$[w.format]??v.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${v.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${v.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${v.origin}`;default:return"Ongeldige invoer"}}};function q1(){return{localeError:U9()}}var k9=()=>{let n={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function i(v){return n[v]??null}let $={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"tall",array:"liste"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Ugyldig input: forventet instanceof ${v.expected}, fikk ${U}`;return`Ugyldig input: forventet ${w}, fikk ${U}`}case"invalid_value":if(v.values.length===1)return`Ugyldig verdi: forventet ${V(v.values[0])}`;return`Ugyldig valg: forventet en av ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`For stor(t): forventet ${v.origin??"value"} til å ha ${w}${v.maximum.toString()} ${_.unit??"elementer"}`;return`For stor(t): forventet ${v.origin??"value"} til å ha ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`For lite(n): forventet ${v.origin} til å ha ${w}${v.minimum.toString()} ${_.unit}`;return`For lite(n): forventet ${v.origin} til å ha ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Ugyldig streng: må starte med "${w.prefix}"`;if(w.format==="ends_with")return`Ugyldig streng: må ende med "${w.suffix}"`;if(w.format==="includes")return`Ugyldig streng: må inneholde "${w.includes}"`;if(w.format==="regex")return`Ugyldig streng: må matche mønsteret ${w.pattern}`;return`Ugyldig ${$[w.format]??v.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${I(v.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${v.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${v.origin}`;default:return"Ugyldig input"}}};function L1(){return{localeError:k9()}}var l9=()=>{let n={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function i(v){return n[v]??null}let $={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},g={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Fâsit giren: umulan instanceof ${v.expected}, alınan ${U}`;return`Fâsit giren: umulan ${w}, alınan ${U}`}case"invalid_value":if(v.values.length===1)return`Fâsit giren: umulan ${V(v.values[0])}`;return`Fâsit tercih: mûteberler ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Fazla büyük: ${v.origin??"value"}, ${w}${v.maximum.toString()} ${_.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${v.origin??"value"}, ${w}${v.maximum.toString()} olmalıydı.`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Fazla küçük: ${v.origin}, ${w}${v.minimum.toString()} ${_.unit} sahip olmalıydı.`;return`Fazla küçük: ${v.origin}, ${w}${v.minimum.toString()} olmalıydı.`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Fâsit metin: "${w.prefix}" ile başlamalı.`;if(w.format==="ends_with")return`Fâsit metin: "${w.suffix}" ile bitmeli.`;if(w.format==="includes")return`Fâsit metin: "${w.includes}" ihtivâ etmeli.`;if(w.format==="regex")return`Fâsit metin: ${w.pattern} nakşına uymalı.`;return`Fâsit ${$[w.format]??v.format}`}case"not_multiple_of":return`Fâsit sayı: ${v.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`${v.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${v.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function K1(){return{localeError:l9()}}var D9=()=>{let n={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function i(v){return n[v]??null}let $={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},g={nan:"NaN",number:"عدد",array:"ارې"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`ناسم ورودي: باید instanceof ${v.expected} وای, مګر ${U} ترلاسه شو`;return`ناسم ورودي: باید ${w} وای, مګر ${U} ترلاسه شو`}case"invalid_value":if(v.values.length===1)return`ناسم ورودي: باید ${V(v.values[0])} وای`;return`ناسم انتخاب: باید یو له ${I(v.values,"|")} څخه وای`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`ډیر لوی: ${v.origin??"ارزښت"} باید ${w}${v.maximum.toString()} ${_.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${v.origin??"ارزښت"} باید ${w}${v.maximum.toString()} وي`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`ډیر کوچنی: ${v.origin} باید ${w}${v.minimum.toString()} ${_.unit} ولري`;return`ډیر کوچنی: ${v.origin} باید ${w}${v.minimum.toString()} وي`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`ناسم متن: باید د "${w.prefix}" سره پیل شي`;if(w.format==="ends_with")return`ناسم متن: باید د "${w.suffix}" سره پای ته ورسيږي`;if(w.format==="includes")return`ناسم متن: باید "${w.includes}" ولري`;if(w.format==="regex")return`ناسم متن: باید د ${w.pattern} سره مطابقت ولري`;return`${$[w.format]??v.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${v.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${v.keys.length>1?"کلیډونه":"کلیډ"}: ${I(v.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${v.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${v.origin} کې`;default:return"ناسمه ورودي"}}};function O1(){return{localeError:D9()}}var J9=()=>{let n={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function i(v){return n[v]??null}let $={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},g={nan:"NaN",number:"liczba",array:"tablica"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${v.expected}, otrzymano ${U}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${w}, otrzymano ${U}`}case"invalid_value":if(v.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${V(v.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Za duża wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${w}${v.maximum.toString()} ${_.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Za mała wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${w}${v.minimum.toString()} ${_.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${w.prefix}"`;if(w.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${w.suffix}"`;if(w.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${w.includes}"`;if(w.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${w.pattern}`;return`Nieprawidłow(y/a/e) ${$[w.format]??v.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${v.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${v.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${v.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function B1(){return{localeError:J9()}}var X9=()=>{let n={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function i(v){return n[v]??null}let $={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",number:"número",null:"nulo"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Tipo inválido: esperado instanceof ${v.expected}, recebido ${U}`;return`Tipo inválido: esperado ${w}, recebido ${U}`}case"invalid_value":if(v.values.length===1)return`Entrada inválida: esperado ${V(v.values[0])}`;return`Opção inválida: esperada uma das ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Muito grande: esperado que ${v.origin??"valor"} tivesse ${w}${v.maximum.toString()} ${_.unit??"elementos"}`;return`Muito grande: esperado que ${v.origin??"valor"} fosse ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Muito pequeno: esperado que ${v.origin} tivesse ${w}${v.minimum.toString()} ${_.unit}`;return`Muito pequeno: esperado que ${v.origin} fosse ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Texto inválido: deve começar com "${w.prefix}"`;if(w.format==="ends_with")return`Texto inválido: deve terminar com "${w.suffix}"`;if(w.format==="includes")return`Texto inválido: deve incluir "${w.includes}"`;if(w.format==="regex")return`Texto inválido: deve corresponder ao padrão ${w.pattern}`;return`${$[w.format]??v.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${v.divisor}`;case"unrecognized_keys":return`Chave${v.keys.length>1?"s":""} desconhecida${v.keys.length>1?"s":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Chave inválida em ${v.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${v.origin}`;default:return"Campo inválido"}}};function F1(){return{localeError:X9()}}function bl(n,i,$,g){let v=Math.abs(n),w=v%10,_=v%100;if(_>=11&&_<=19)return g;if(w===1)return i;if(w>=2&&w<=4)return $;return g}var G9=()=>{let n={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function i(v){return n[v]??null}let $={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},g={nan:"NaN",number:"число",array:"массив"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Неверный ввод: ожидалось instanceof ${v.expected}, получено ${U}`;return`Неверный ввод: ожидалось ${w}, получено ${U}`}case"invalid_value":if(v.values.length===1)return`Неверный ввод: ожидалось ${V(v.values[0])}`;return`Неверный вариант: ожидалось одно из ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_){let U=Number(v.maximum),k=bl(U,_.unit.one,_.unit.few,_.unit.many);return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет иметь ${w}${v.maximum.toString()} ${k}`}return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_){let U=Number(v.minimum),k=bl(U,_.unit.one,_.unit.few,_.unit.many);return`Слишком маленькое значение: ожидалось, что ${v.origin} будет иметь ${w}${v.minimum.toString()} ${k}`}return`Слишком маленькое значение: ожидалось, что ${v.origin} будет ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Неверная строка: должна начинаться с "${w.prefix}"`;if(w.format==="ends_with")return`Неверная строка: должна заканчиваться на "${w.suffix}"`;if(w.format==="includes")return`Неверная строка: должна содержать "${w.includes}"`;if(w.format==="regex")return`Неверная строка: должна соответствовать шаблону ${w.pattern}`;return`Неверный ${$[w.format]??v.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспознанн${v.keys.length>1?"ые":"ый"} ключ${v.keys.length>1?"и":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${v.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${v.origin}`;default:return"Неверные входные данные"}}};function N1(){return{localeError:G9()}}var t9=()=>{let n={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function i(v){return n[v]??null}let $={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},g={nan:"NaN",number:"število",array:"tabela"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Neveljaven vnos: pričakovano instanceof ${v.expected}, prejeto ${U}`;return`Neveljaven vnos: pričakovano ${w}, prejeto ${U}`}case"invalid_value":if(v.values.length===1)return`Neveljaven vnos: pričakovano ${V(v.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} imelo ${w}${v.maximum.toString()} ${_.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Premajhno: pričakovano, da bo ${v.origin} imelo ${w}${v.minimum.toString()} ${_.unit}`;return`Premajhno: pričakovano, da bo ${v.origin} ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Neveljaven niz: mora se začeti z "${w.prefix}"`;if(w.format==="ends_with")return`Neveljaven niz: mora se končati z "${w.suffix}"`;if(w.format==="includes")return`Neveljaven niz: mora vsebovati "${w.includes}"`;if(w.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${w.pattern}`;return`Neveljaven ${$[w.format]??v.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${v.divisor}`;case"unrecognized_keys":return`Neprepoznan${v.keys.length>1?"i ključi":" ključ"}: ${I(v.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${v.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${v.origin}`;default:return"Neveljaven vnos"}}};function c1(){return{localeError:t9()}}var Q9=()=>{let n={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function i(v){return n[v]??null}let $={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},g={nan:"NaN",number:"antal",array:"lista"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Ogiltig inmatning: förväntat instanceof ${v.expected}, fick ${U}`;return`Ogiltig inmatning: förväntat ${w}, fick ${U}`}case"invalid_value":if(v.values.length===1)return`Ogiltig inmatning: förväntat ${V(v.values[0])}`;return`Ogiltigt val: förväntade en av ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`För stor(t): förväntade ${v.origin??"värdet"} att ha ${w}${v.maximum.toString()} ${_.unit??"element"}`;return`För stor(t): förväntat ${v.origin??"värdet"} att ha ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${w}${v.minimum.toString()} ${_.unit}`;return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Ogiltig sträng: måste börja med "${w.prefix}"`;if(w.format==="ends_with")return`Ogiltig sträng: måste sluta med "${w.suffix}"`;if(w.format==="includes")return`Ogiltig sträng: måste innehålla "${w.includes}"`;if(w.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${w.pattern}"`;return`Ogiltig(t) ${$[w.format]??v.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${I(v.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${v.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${v.origin??"värdet"}`;default:return"Ogiltig input"}}};function P1(){return{localeError:Q9()}}var W9=()=>{let n={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function i(v){return n[v]??null}let $={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${v.expected}, பெறப்பட்டது ${U}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${w}, பெறப்பட்டது ${U}`}case"invalid_value":if(v.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${V(v.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${I(v.values,"|")} இல் ஒன்று`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${w}${v.maximum.toString()} ${_.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${w}${v.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${w}${v.minimum.toString()} ${_.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${w}${v.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`தவறான சரம்: "${w.prefix}" இல் தொடங்க வேண்டும்`;if(w.format==="ends_with")return`தவறான சரம்: "${w.suffix}" இல் முடிவடைய வேண்டும்`;if(w.format==="includes")return`தவறான சரம்: "${w.includes}" ஐ உள்ளடக்க வேண்டும்`;if(w.format==="regex")return`தவறான சரம்: ${w.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${$[w.format]??v.format}`}case"not_multiple_of":return`தவறான எண்: ${v.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${v.keys.length>1?"கள்":""}: ${I(v.keys,", ")}`;case"invalid_key":return`${v.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${v.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function S1(){return{localeError:W9()}}var Y9=()=>{let n={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function i(v){return n[v]??null}let $={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},g={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${v.expected} แต่ได้รับ ${U}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${w} แต่ได้รับ ${U}`}case"invalid_value":if(v.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${V(v.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"ไม่เกิน":"น้อยกว่า",_=i(v.origin);if(_)return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${w} ${v.maximum.toString()} ${_.unit??"รายการ"}`;return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${w} ${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?"อย่างน้อย":"มากกว่า",_=i(v.origin);if(_)return`น้อยกว่ากำหนด: ${v.origin} ควรมี${w} ${v.minimum.toString()} ${_.unit}`;return`น้อยกว่ากำหนด: ${v.origin} ควรมี${w} ${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${w.prefix}"`;if(w.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${w.suffix}"`;if(w.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${w.includes}" อยู่ในข้อความ`;if(w.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${w.pattern}`;return`รูปแบบไม่ถูกต้อง: ${$[w.format]??v.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${v.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${I(v.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${v.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${v.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function z1(){return{localeError:Y9()}}var I9=()=>{let n={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function i(v){return n[v]??null}let $={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Geçersiz değer: beklenen instanceof ${v.expected}, alınan ${U}`;return`Geçersiz değer: beklenen ${w}, alınan ${U}`}case"invalid_value":if(v.values.length===1)return`Geçersiz değer: beklenen ${V(v.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Çok büyük: beklenen ${v.origin??"değer"} ${w}${v.maximum.toString()} ${_.unit??"öğe"}`;return`Çok büyük: beklenen ${v.origin??"değer"} ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Çok küçük: beklenen ${v.origin} ${w}${v.minimum.toString()} ${_.unit}`;return`Çok küçük: beklenen ${v.origin} ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Geçersiz metin: "${w.prefix}" ile başlamalı`;if(w.format==="ends_with")return`Geçersiz metin: "${w.suffix}" ile bitmeli`;if(w.format==="includes")return`Geçersiz metin: "${w.includes}" içermeli`;if(w.format==="regex")return`Geçersiz metin: ${w.pattern} desenine uymalı`;return`Geçersiz ${$[w.format]??v.format}`}case"not_multiple_of":return`Geçersiz sayı: ${v.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${v.keys.length>1?"lar":""}: ${I(v.keys,", ")}`;case"invalid_key":return`${v.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${v.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function M1(){return{localeError:I9()}}var j9=()=>{let n={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function i(v){return n[v]??null}let $={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},g={nan:"NaN",number:"число",array:"масив"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Неправильні вхідні дані: очікується instanceof ${v.expected}, отримано ${U}`;return`Неправильні вхідні дані: очікується ${w}, отримано ${U}`}case"invalid_value":if(v.values.length===1)return`Неправильні вхідні дані: очікується ${V(v.values[0])}`;return`Неправильна опція: очікується одне з ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Занадто велике: очікується, що ${v.origin??"значення"} ${_.verb} ${w}${v.maximum.toString()} ${_.unit??"елементів"}`;return`Занадто велике: очікується, що ${v.origin??"значення"} буде ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Занадто мале: очікується, що ${v.origin} ${_.verb} ${w}${v.minimum.toString()} ${_.unit}`;return`Занадто мале: очікується, що ${v.origin} буде ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Неправильний рядок: повинен починатися з "${w.prefix}"`;if(w.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${w.suffix}"`;if(w.format==="includes")return`Неправильний рядок: повинен містити "${w.includes}"`;if(w.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${w.pattern}`;return`Неправильний ${$[w.format]??v.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${v.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${v.keys.length>1?"і":""}: ${I(v.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${v.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${v.origin}`;default:return"Неправильні вхідні дані"}}};function Wg(){return{localeError:j9()}}function R1(){return Wg()}var u9=()=>{let n={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function i(v){return n[v]??null}let $={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},g={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`غلط ان پٹ: instanceof ${v.expected} متوقع تھا، ${U} موصول ہوا`;return`غلط ان پٹ: ${w} متوقع تھا، ${U} موصول ہوا`}case"invalid_value":if(v.values.length===1)return`غلط ان پٹ: ${V(v.values[0])} متوقع تھا`;return`غلط آپشن: ${I(v.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`بہت بڑا: ${v.origin??"ویلیو"} کے ${w}${v.maximum.toString()} ${_.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${v.origin??"ویلیو"} کا ${w}${v.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`بہت چھوٹا: ${v.origin} کے ${w}${v.minimum.toString()} ${_.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${v.origin} کا ${w}${v.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`غلط سٹرنگ: "${w.prefix}" سے شروع ہونا چاہیے`;if(w.format==="ends_with")return`غلط سٹرنگ: "${w.suffix}" پر ختم ہونا چاہیے`;if(w.format==="includes")return`غلط سٹرنگ: "${w.includes}" شامل ہونا چاہیے`;if(w.format==="regex")return`غلط سٹرنگ: پیٹرن ${w.pattern} سے میچ ہونا چاہیے`;return`غلط ${$[w.format]??v.format}`}case"not_multiple_of":return`غلط نمبر: ${v.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${v.keys.length>1?"ز":""}: ${I(v.keys,"، ")}`;case"invalid_key":return`${v.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${v.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function A1(){return{localeError:u9()}}var H9=()=>{let n={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function i(v){return n[v]??null}let $={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},g={nan:"NaN",number:"raqam",array:"massiv"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${v.expected}, qabul qilingan ${U}`;return`Noto‘g‘ri kirish: kutilgan ${w}, qabul qilingan ${U}`}case"invalid_value":if(v.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${V(v.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Juda katta: kutilgan ${v.origin??"qiymat"} ${w}${v.maximum.toString()} ${_.unit} ${_.verb}`;return`Juda katta: kutilgan ${v.origin??"qiymat"} ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Juda kichik: kutilgan ${v.origin} ${w}${v.minimum.toString()} ${_.unit} ${_.verb}`;return`Juda kichik: kutilgan ${v.origin} ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Noto‘g‘ri satr: "${w.prefix}" bilan boshlanishi kerak`;if(w.format==="ends_with")return`Noto‘g‘ri satr: "${w.suffix}" bilan tugashi kerak`;if(w.format==="includes")return`Noto‘g‘ri satr: "${w.includes}" ni o‘z ichiga olishi kerak`;if(w.format==="regex")return`Noto‘g‘ri satr: ${w.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${$[w.format]??v.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${v.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${v.keys.length>1?"lar":""}: ${I(v.keys,", ")}`;case"invalid_key":return`${v.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${v.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function x1(){return{localeError:H9()}}var V9=()=>{let n={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function i(v){return n[v]??null}let $={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},g={nan:"NaN",number:"số",array:"mảng"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${v.expected}, nhận được ${U}`;return`Đầu vào không hợp lệ: mong đợi ${w}, nhận được ${U}`}case"invalid_value":if(v.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${V(v.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${_.verb} ${w}${v.maximum.toString()} ${_.unit??"phần tử"}`;return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Quá nhỏ: mong đợi ${v.origin} ${_.verb} ${w}${v.minimum.toString()} ${_.unit}`;return`Quá nhỏ: mong đợi ${v.origin} ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${w.prefix}"`;if(w.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${w.suffix}"`;if(w.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${w.includes}"`;if(w.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${w.pattern}`;return`${$[w.format]??v.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${v.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${I(v.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${v.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${v.origin}`;default:return"Đầu vào không hợp lệ"}}};function h1(){return{localeError:V9()}}var f9=()=>{let n={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function i(v){return n[v]??null}let $={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},g={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`无效输入:期望 instanceof ${v.expected},实际接收 ${U}`;return`无效输入:期望 ${w},实际接收 ${U}`}case"invalid_value":if(v.values.length===1)return`无效输入:期望 ${V(v.values[0])}`;return`无效选项:期望以下之一 ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`数值过大:期望 ${v.origin??"值"} ${w}${v.maximum.toString()} ${_.unit??"个元素"}`;return`数值过大:期望 ${v.origin??"值"} ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`数值过小:期望 ${v.origin} ${w}${v.minimum.toString()} ${_.unit}`;return`数值过小:期望 ${v.origin} ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`无效字符串:必须以 "${w.prefix}" 开头`;if(w.format==="ends_with")return`无效字符串:必须以 "${w.suffix}" 结尾`;if(w.format==="includes")return`无效字符串:必须包含 "${w.includes}"`;if(w.format==="regex")return`无效字符串:必须满足正则表达式 ${w.pattern}`;return`无效${$[w.format]??v.format}`}case"not_multiple_of":return`无效数字:必须是 ${v.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${I(v.keys,", ")}`;case"invalid_key":return`${v.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${v.origin} 中包含无效值(value)`;default:return"无效输入"}}};function C1(){return{localeError:f9()}}var q9=()=>{let n={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function i(v){return n[v]??null}let $={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},g={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`無效的輸入值:預期為 instanceof ${v.expected},但收到 ${U}`;return`無效的輸入值:預期為 ${w},但收到 ${U}`}case"invalid_value":if(v.values.length===1)return`無效的輸入值:預期為 ${V(v.values[0])}`;return`無效的選項:預期為以下其中之一 ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`數值過大:預期 ${v.origin??"值"} 應為 ${w}${v.maximum.toString()} ${_.unit??"個元素"}`;return`數值過大:預期 ${v.origin??"值"} 應為 ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`數值過小:預期 ${v.origin} 應為 ${w}${v.minimum.toString()} ${_.unit}`;return`數值過小:預期 ${v.origin} 應為 ${w}${v.minimum.toString()}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`無效的字串:必須以 "${w.prefix}" 開頭`;if(w.format==="ends_with")return`無效的字串:必須以 "${w.suffix}" 結尾`;if(w.format==="includes")return`無效的字串:必須包含 "${w.includes}"`;if(w.format==="regex")return`無效的字串:必須符合格式 ${w.pattern}`;return`無效的 ${$[w.format]??v.format}`}case"not_multiple_of":return`無效的數字:必須為 ${v.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${v.keys.length>1?"們":""}:${I(v.keys,"、")}`;case"invalid_key":return`${v.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${v.origin} 中有無效的值`;default:return"無效的輸入值"}}};function E1(){return{localeError:q9()}}var L9=()=>{let n={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function i(v){return n[v]??null}let $={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},g={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(v)=>{switch(v.code){case"invalid_type":{let w=g[v.expected]??v.expected,_=L(v.input),U=g[_]??_;if(/^[A-Z]/.test(v.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${v.expected}, àmọ̀ a rí ${U}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${w}, àmọ̀ a rí ${U}`}case"invalid_value":if(v.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${V(v.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${I(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=i(v.origin);if(_)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${v.origin??"iye"} ${_.verb} ${w}${v.maximum} ${_.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${w}${v.maximum}`}case"too_small":{let w=v.inclusive?">=":">",_=i(v.origin);if(_)return`Kéré ju: a ní láti jẹ́ pé ${v.origin} ${_.verb} ${w}${v.minimum} ${_.unit}`;return`Kéré ju: a ní láti jẹ́ ${w}${v.minimum}`}case"invalid_format":{let w=v;if(w.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${w.prefix}"`;if(w.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${w.suffix}"`;if(w.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${w.includes}"`;if(w.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${w.pattern}`;return`Aṣìṣe: ${$[w.format]??v.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${v.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${I(v.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${v.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${v.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function o1(){return{localeError:L9()}}var Ul,Yg=Symbol("ZodOutput"),Ig=Symbol("ZodInput");class T1{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...i){let $=i[0];if(this._map.set(n,$),$&&typeof $==="object"&&"id"in $)this._idmap.set($.id,n);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){let i=this._map.get(n);if(i&&typeof i==="object"&&"id"in i)this._idmap.delete(i.id);return this._map.delete(n),this}get(n){let i=n._zod.parent;if(i){let $={...this.get(i)??{}};delete $.id;let g={...$,...this._map.get(n)};return Object.keys(g).length?g:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function yi(){return new T1}(Ul=globalThis).__zod_globalRegistry??(Ul.__zod_globalRegistry=yi());var wn=globalThis.__zod_globalRegistry;function Z1(n,i){return new n({type:"string",...K(i)})}function r1(n,i){return new n({type:"string",coerce:!0,...K(i)})}function Q4(n,i){return new n({type:"string",format:"email",check:"string_format",abort:!1,...K(i)})}function jg(n,i){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...K(i)})}function W4(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...K(i)})}function Y4(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(i)})}function I4(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(i)})}function j4(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(i)})}function ug(n,i){return new n({type:"string",format:"url",check:"string_format",abort:!1,...K(i)})}function u4(n,i){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...K(i)})}function H4(n,i){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(i)})}function V4(n,i){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...K(i)})}function f4(n,i){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(i)})}function q4(n,i){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...K(i)})}function L4(n,i){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...K(i)})}function K4(n,i){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(i)})}function O4(n,i){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(i)})}function B4(n,i){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(i)})}function m1(n,i){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...K(i)})}function F4(n,i){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(i)})}function N4(n,i){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(i)})}function c4(n,i){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...K(i)})}function P4(n,i){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...K(i)})}function S4(n,i){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...K(i)})}function z4(n,i){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...K(i)})}var Hg={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function y1(n,i){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(i)})}function d1(n,i){return new n({type:"string",format:"date",check:"string_format",...K(i)})}function e1(n,i){return new n({type:"string",format:"time",check:"string_format",precision:null,...K(i)})}function p1(n,i){return new n({type:"string",format:"duration",check:"string_format",...K(i)})}function a1(n,i){return new n({type:"number",checks:[],...K(i)})}function s1(n,i){return new n({type:"number",coerce:!0,checks:[],...K(i)})}function nk(n,i){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...K(i)})}function vk(n,i){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...K(i)})}function ik(n,i){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...K(i)})}function $k(n,i){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...K(i)})}function gk(n,i){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...K(i)})}function wk(n,i){return new n({type:"boolean",...K(i)})}function _k(n,i){return new n({type:"boolean",coerce:!0,...K(i)})}function bk(n,i){return new n({type:"bigint",...K(i)})}function Uk(n,i){return new n({type:"bigint",coerce:!0,...K(i)})}function kk(n,i){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...K(i)})}function lk(n,i){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...K(i)})}function Dk(n,i){return new n({type:"symbol",...K(i)})}function Jk(n,i){return new n({type:"undefined",...K(i)})}function Xk(n,i){return new n({type:"null",...K(i)})}function Gk(n){return new n({type:"any"})}function tk(n){return new n({type:"unknown"})}function Qk(n,i){return new n({type:"never",...K(i)})}function Wk(n,i){return new n({type:"void",...K(i)})}function Yk(n,i){return new n({type:"date",...K(i)})}function Ik(n,i){return new n({type:"date",coerce:!0,...K(i)})}function jk(n,i){return new n({type:"nan",...K(i)})}function qn(n,i){return new g4({check:"less_than",...K(i),value:n,inclusive:!1})}function Xn(n,i){return new g4({check:"less_than",...K(i),value:n,inclusive:!0})}function Ln(n,i){return new w4({check:"greater_than",...K(i),value:n,inclusive:!1})}function Un(n,i){return new w4({check:"greater_than",...K(i),value:n,inclusive:!0})}function di(n){return Ln(0,n)}function ei(n){return qn(0,n)}function pi(n){return Xn(0,n)}function ai(n){return Un(0,n)}function yn(n,i){return new Vb({check:"multiple_of",...K(i),value:n})}function dn(n,i){return new Lb({check:"max_size",...K(i),maximum:n})}function Kn(n,i){return new Kb({check:"min_size",...K(i),minimum:n})}function bv(n,i){return new Ob({check:"size_equals",...K(i),size:n})}function Uv(n,i){return new Bb({check:"max_length",...K(i),maximum:n})}function An(n,i){return new Fb({check:"min_length",...K(i),minimum:n})}function kv(n,i){return new Nb({check:"length_equals",...K(i),length:n})}function fv(n,i){return new cb({check:"string_format",format:"regex",...K(i),pattern:n})}function qv(n){return new Pb({check:"string_format",format:"lowercase",...K(n)})}function Lv(n){return new Sb({check:"string_format",format:"uppercase",...K(n)})}function Kv(n,i){return new zb({check:"string_format",format:"includes",...K(i),includes:n})}function Ov(n,i){return new Mb({check:"string_format",format:"starts_with",...K(i),prefix:n})}function Bv(n,i){return new Rb({check:"string_format",format:"ends_with",...K(i),suffix:n})}function si(n,i,$){return new Ab({check:"property",property:n,schema:i,...K($)})}function Fv(n,i){return new xb({check:"mime_type",mime:n,...K(i)})}function Hn(n){return new hb({check:"overwrite",tx:n})}function Nv(n){return Hn((i)=>i.normalize(n))}function cv(){return Hn((n)=>n.trim())}function Pv(){return Hn((n)=>n.toLowerCase())}function Sv(){return Hn((n)=>n.toUpperCase())}function zv(){return Hn((n)=>h_(n))}function uk(n,i,$){return new n({type:"array",element:i,...K($)})}function O9(n,i,$){return new n({type:"union",options:i,...K($)})}function B9(n,i,$){return new n({type:"union",options:i,inclusive:!1,...K($)})}function F9(n,i,$,g){return new n({type:"union",options:$,discriminator:i,...K(g)})}function N9(n,i,$){return new n({type:"intersection",left:i,right:$})}function c9(n,i,$,g){let v=$ instanceof M;return new n({type:"tuple",items:i,rest:v?$:null,...K(v?g:$)})}function P9(n,i,$,g){return new n({type:"record",keyType:i,valueType:$,...K(g)})}function S9(n,i,$,g){return new n({type:"map",keyType:i,valueType:$,...K(g)})}function z9(n,i,$){return new n({type:"set",valueType:i,...K($)})}function M9(n,i,$){let g=Array.isArray(i)?Object.fromEntries(i.map((v)=>[v,v])):i;return new n({type:"enum",entries:g,...K($)})}function R9(n,i,$){return new n({type:"enum",entries:i,...K($)})}function A9(n,i,$){return new n({type:"literal",values:Array.isArray(i)?i:[i],...K($)})}function Hk(n,i){return new n({type:"file",...K(i)})}function x9(n,i){return new n({type:"transform",transform:i})}function h9(n,i){return new n({type:"optional",innerType:i})}function C9(n,i){return new n({type:"nullable",innerType:i})}function E9(n,i,$){return new n({type:"default",innerType:i,get defaultValue(){return typeof $==="function"?$():E_($)}})}function o9(n,i,$){return new n({type:"nonoptional",innerType:i,...K($)})}function T9(n,i){return new n({type:"success",innerType:i})}function Z9(n,i,$){return new n({type:"catch",innerType:i,catchValue:typeof $==="function"?$:()=>$})}function r9(n,i,$){return new n({type:"pipe",in:i,out:$})}function m9(n,i){return new n({type:"readonly",innerType:i})}function y9(n,i,$){return new n({type:"template_literal",parts:i,...K($)})}function d9(n,i){return new n({type:"lazy",getter:i})}function e9(n,i){return new n({type:"promise",innerType:i})}function Vk(n,i,$){let g=K($);return g.abort??(g.abort=!0),new n({type:"custom",check:"custom",fn:i,...g})}function fk(n,i,$){return new n({type:"custom",check:"custom",fn:i,...K($)})}function qk(n){let i=kl(($)=>{return $.addIssue=(g)=>{if(typeof g==="string")$.issues.push(Ci(g,$.value,i._zod.def));else{let v=g;if(v.fatal)v.continue=!1;v.code??(v.code="custom"),v.input??(v.input=$.value),v.inst??(v.inst=i),v.continue??(v.continue=!i._zod.def.abort),$.issues.push(Ci(v))}},n($.value,$)});return i}function kl(n,i){let $=new p({check:"custom",...K(i)});return $._zod.check=n,$}function Lk(n){let i=new p({check:"describe"});return i._zod.onattach=[($)=>{let g=wn.get($)??{};wn.add($,{...g,description:n})}],i._zod.check=()=>{},i}function Kk(n){let i=new p({check:"meta"});return i._zod.onattach=[($)=>{let g=wn.get($)??{};wn.add($,{...g,...n})}],i._zod.check=()=>{},i}function Ok(n,i){let $=K(i),g=$.truthy??["true","1","yes","on","y","enabled"],v=$.falsy??["false","0","no","off","n","disabled"];if($.case!=="sensitive")g=g.map((u)=>typeof u==="string"?u.toLowerCase():u),v=v.map((u)=>typeof u==="string"?u.toLowerCase():u);let w=new Set(g),_=new Set(v),U=n.Codec??Xg,k=n.Boolean??Dg,J=new(n.String??_i)({type:"string",error:$.error}),Q=new k({type:"boolean",error:$.error}),j=new U({type:"pipe",in:J,out:Q,transform:(u,W)=>{let Y=u;if($.case!=="sensitive")Y=Y.toLowerCase();if(w.has(Y))return!0;else if(_.has(Y))return!1;else return W.issues.push({code:"invalid_value",expected:"stringbool",values:[...w,..._],input:W.value,inst:j,continue:!1}),{}},reverseTransform:(u,W)=>{if(u===!0)return g[0]||"true";else return v[0]||"false"},error:$.error});return j}function n$(n,i,$,g={}){let v=K(g),w={...K(g),check:"string_format",type:"string",format:i,fn:typeof $==="function"?$:(U)=>$.test(U),...v};if($ instanceof RegExp)w.pattern=$;return new n(w)}function Mv(n){let i=n?.target??"draft-2020-12";if(i==="draft-4")i="draft-04";if(i==="draft-7")i="draft-07";return{processors:n.processors??{},metadataRegistry:n?.metadata??wn,target:i,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function y(n,i,$={path:[],schemaPath:[]}){var g;let v=n._zod.def,w=i.seen.get(n);if(w){if(w.count++,$.schemaPath.includes(n))w.cycle=$.path;return w.schema}let _={schema:{},count:1,cycle:void 0,path:$.path};i.seen.set(n,_);let U=n._zod.toJSONSchema?.();if(U)_.schema=U;else{let J={...$,schemaPath:[...$.schemaPath,n],path:$.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(i,_.schema,J);else{let j=_.schema,u=i.processors[v.type];if(!u)throw Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);u(n,i,j,J)}let Q=n._zod.parent;if(Q){if(!_.ref)_.ref=Q;y(Q,i,J),i.seen.get(Q).isParent=!0}}let k=i.metadataRegistry.get(n);if(k)Object.assign(_.schema,k);if(i.io==="input"&&Gn(n))delete _.schema.examples,delete _.schema.default;if(i.io==="input"&&_.schema._prefault)(g=_.schema).default??(g.default=_.schema._prefault);return delete _.schema._prefault,i.seen.get(n).schema}function Rv(n,i){let $=n.seen.get(i);if(!$)throw Error("Unprocessed schema. This is a bug in Zod.");let g=new Map;for(let _ of n.seen.entries()){let U=n.metadataRegistry.get(_[0])?.id;if(U){let k=g.get(U);if(k&&k!==_[0])throw Error(`Duplicate schema id "${U}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);g.set(U,_[0])}}let v=(_)=>{let U=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let Q=n.external.registry.get(_[0])?.id,j=n.external.uri??((W)=>W);if(Q)return{ref:j(Q)};let u=_[1].defId??_[1].schema.id??`schema${n.counter++}`;return _[1].defId=u,{defId:u,ref:`${j("__shared")}#/${U}/${u}`}}if(_[1]===$)return{ref:"#"};let l=`${"#"}/${U}/`,J=_[1].schema.id??`__schema${n.counter++}`;return{defId:J,ref:l+J}},w=(_)=>{if(_[1].schema.$ref)return;let U=_[1],{ref:k,defId:l}=v(_);if(U.def={...U.schema},l)U.defId=l;let J=U.schema;for(let Q in J)delete J[Q];J.$ref=k};if(n.cycles==="throw")for(let _ of n.seen.entries()){let U=_[1];if(U.cycle)throw Error(`Cycle detected: #/${U.cycle?.join("/")}/<root>
|
|
176
|
+
`)}L.write("payload.value = newResult;"),L.write("return payload;");let f=L.compile();return(S,u)=>f(q,S,u)},U,G=fv,D=!E6.jitless,X=D&&r0.value,Q=w.catchall,Y;$._zod.parse=(q,L)=>{Y??(Y=_.value);let F=q.value;if(!G(F))return q.issues.push({expected:"object",code:"invalid_type",input:F,inst:$}),q;if(D&&X&&L?.async===!1&&L.jitless!==!0){if(!U)U=v(w.shape);if(q=U(q,L),!Q)return q;return M8([],F,q,L,Y,$)}return g(q,L)}});function q8($,w,g,_){for(let U of $)if(U.issues.length===0)return w.value=U.value,w;let v=$.filter((U)=>!dw(U));if(v.length===1)return w.value=v[0].value,v[0];return w.issues.push({code:"invalid_union",input:w.value,inst:g,errors:$.map((U)=>U.issues.map((G)=>A$(G,_,Q$())))}),w}var s6=j("$ZodUnion",($,w)=>{t.init($,w),a($._zod,"optin",()=>w.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),a($._zod,"optout",()=>w.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),a($._zod,"values",()=>{if(w.options.every((v)=>v._zod.values))return new Set(w.options.flatMap((v)=>Array.from(v._zod.values)));return}),a($._zod,"pattern",()=>{if(w.options.every((v)=>v._zod.pattern)){let v=w.options.map((U)=>U._zod.pattern);return new RegExp(`^(${v.map((U)=>l6(U.source)).join("|")})$`)}return});let g=w.options.length===1,_=w.options[0]._zod.run;$._zod.parse=(v,U)=>{if(g)return _(v,U);let G=!1,D=[];for(let J of w.options){let X=J._zod.run({value:v.value,issues:[]},U);if(X instanceof Promise)D.push(X),G=!0;else{if(X.issues.length===0)return X;D.push(X)}}if(!G)return q8(D,v,$,U);return Promise.all(D).then((J)=>{return q8(J,v,$,U)})}});function B8($,w,g,_){let v=$.filter((U)=>U.issues.length===0);if(v.length===1)return w.value=v[0].value,w;if(v.length===0)w.issues.push({code:"invalid_union",input:w.value,inst:g,errors:$.map((U)=>U.issues.map((G)=>A$(G,_,Q$())))});else w.issues.push({code:"invalid_union",input:w.value,inst:g,errors:[],inclusive:!1});return w}var RG=j("$ZodXor",($,w)=>{s6.init($,w),w.inclusive=!1;let g=w.options.length===1,_=w.options[0]._zod.run;$._zod.parse=(v,U)=>{if(g)return _(v,U);let G=!1,D=[];for(let J of w.options){let X=J._zod.run({value:v.value,issues:[]},U);if(X instanceof Promise)D.push(X),G=!0;else D.push(X)}if(!G)return B8(D,v,$,U);return Promise.all(D).then((J)=>{return B8(J,v,$,U)})}}),CG=j("$ZodDiscriminatedUnion",($,w)=>{w.inclusive=!1,s6.init($,w);let g=$._zod.parse;a($._zod,"propValues",()=>{let v={};for(let U of w.options){let G=U._zod.propValues;if(!G||Object.keys(G).length===0)throw Error(`Invalid discriminated union option at index "${w.options.indexOf(U)}"`);for(let[D,J]of Object.entries(G)){if(!v[D])v[D]=new Set;for(let X of J)v[D].add(X)}}return v});let _=Y4(()=>{let v=w.options,U=new Map;for(let G of v){let D=G._zod.propValues?.[w.discriminator];if(!D||D.size===0)throw Error(`Invalid discriminated union option at index "${w.options.indexOf(G)}"`);for(let J of D){if(U.has(J))throw Error(`Duplicate discriminator value "${String(J)}"`);U.set(J,G)}}return U});$._zod.parse=(v,U)=>{let G=v.value;if(!fv(G))return v.issues.push({code:"invalid_type",expected:"object",input:G,inst:$}),v;let D=_.value.get(G?.[w.discriminator]);if(D)return D._zod.run(v,U);if(w.unionFallback)return g(v,U);return v.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:w.discriminator,input:G,path:[w.discriminator],inst:$}),v}}),uG=j("$ZodIntersection",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value,U=w.left._zod.run({value:v,issues:[]},_),G=w.right._zod.run({value:v,issues:[]},_);if(U instanceof Promise||G instanceof Promise)return Promise.all([U,G]).then(([J,X])=>{return I8(g,J,X)});return I8(g,U,G)}});function p2($,w){if($===w)return{valid:!0,data:$};if($ instanceof Date&&w instanceof Date&&+$===+w)return{valid:!0,data:$};if(tw($)&&tw(w)){let g=Object.keys(w),_=Object.keys($).filter((U)=>g.indexOf(U)!==-1),v={...$,...w};for(let U of _){let G=p2($[U],w[U]);if(!G.valid)return{valid:!1,mergeErrorPath:[U,...G.mergeErrorPath]};v[U]=G.data}return{valid:!0,data:v}}if(Array.isArray($)&&Array.isArray(w)){if($.length!==w.length)return{valid:!1,mergeErrorPath:[]};let g=[];for(let _=0;_<$.length;_++){let v=$[_],U=w[_],G=p2(v,U);if(!G.valid)return{valid:!1,mergeErrorPath:[_,...G.mergeErrorPath]};g.push(G.data)}return{valid:!0,data:g}}return{valid:!1,mergeErrorPath:[]}}function I8($,w,g){if(w.issues.length)$.issues.push(...w.issues);if(g.issues.length)$.issues.push(...g.issues);if(dw($))return $;let _=p2(w.value,g.value);if(!_.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(_.mergeErrorPath)}`);return $.value=_.data,$}var PU=j("$ZodTuple",($,w)=>{t.init($,w);let g=w.items;$._zod.parse=(_,v)=>{let U=_.value;if(!Array.isArray(U))return _.issues.push({input:U,inst:$,expected:"tuple",code:"invalid_type"}),_;_.value=[];let G=[],D=[...g].reverse().findIndex((Q)=>Q._zod.optin!=="optional"),J=D===-1?0:g.length-D;if(!w.rest){let Q=U.length>g.length,Y=U.length<J-1;if(Q||Y)return _.issues.push({...Q?{code:"too_big",maximum:g.length,inclusive:!0}:{code:"too_small",minimum:g.length},input:U,inst:$,origin:"array"}),_}let X=-1;for(let Q of g){if(X++,X>=U.length){if(X>=J)continue}let Y=Q._zod.run({value:U[X],issues:[]},v);if(Y instanceof Promise)G.push(Y.then((q)=>LU(q,_,X)));else LU(Y,_,X)}if(w.rest){let Q=U.slice(g.length);for(let Y of Q){X++;let q=w.rest._zod.run({value:Y,issues:[]},v);if(q instanceof Promise)G.push(q.then((L)=>LU(L,_,X)));else LU(q,_,X)}}if(G.length)return Promise.all(G).then(()=>_);return _}});function LU($,w,g){if($.issues.length)w.issues.push(...u$(g,$.issues));w.value[g]=$.value}var EG=j("$ZodRecord",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value;if(!tw(v))return g.issues.push({expected:"record",code:"invalid_type",input:v,inst:$}),g;let U=[],G=w.keyType._zod.values;if(G){g.value={};let D=new Set;for(let X of G)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){D.add(typeof X==="number"?X.toString():X);let Q=w.valueType._zod.run({value:v[X],issues:[]},_);if(Q instanceof Promise)U.push(Q.then((Y)=>{if(Y.issues.length)g.issues.push(...u$(X,Y.issues));g.value[X]=Y.value}));else{if(Q.issues.length)g.issues.push(...u$(X,Q.issues));g.value[X]=Q.value}}let J;for(let X in v)if(!D.has(X))J=J??[],J.push(X);if(J&&J.length>0)g.issues.push({code:"unrecognized_keys",input:v,inst:$,keys:J})}else{g.value={};for(let D of Reflect.ownKeys(v)){if(D==="__proto__")continue;let J=w.keyType._zod.run({value:D,issues:[]},_);if(J instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof D==="string"&&r6.test(D)&&J.issues.length&&J.issues.some((Y)=>Y.code==="invalid_type"&&Y.expected==="number")){let Y=w.keyType._zod.run({value:Number(D),issues:[]},_);if(Y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Y.issues.length===0)J=Y}if(J.issues.length){if(w.mode==="loose")g.value[D]=v[D];else g.issues.push({code:"invalid_key",origin:"record",issues:J.issues.map((Y)=>A$(Y,_,Q$())),input:D,path:[D],inst:$});continue}let Q=w.valueType._zod.run({value:v[D],issues:[]},_);if(Q instanceof Promise)U.push(Q.then((Y)=>{if(Y.issues.length)g.issues.push(...u$(D,Y.issues));g.value[J.value]=Y.value}));else{if(Q.issues.length)g.issues.push(...u$(D,Q.issues));g.value[J.value]=Q.value}}}if(U.length)return Promise.all(U).then(()=>g);return g}}),ZG=j("$ZodMap",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value;if(!(v instanceof Map))return g.issues.push({expected:"map",code:"invalid_type",input:v,inst:$}),g;let U=[];g.value=new Map;for(let[G,D]of v){let J=w.keyType._zod.run({value:G,issues:[]},_),X=w.valueType._zod.run({value:D,issues:[]},_);if(J instanceof Promise||X instanceof Promise)U.push(Promise.all([J,X]).then(([Q,Y])=>{L8(Q,Y,g,G,v,$,_)}));else L8(J,X,g,G,v,$,_)}if(U.length)return Promise.all(U).then(()=>g);return g}});function L8($,w,g,_,v,U,G){if($.issues.length)if(c6.has(typeof _))g.issues.push(...u$(_,$.issues));else g.issues.push({code:"invalid_key",origin:"map",input:v,inst:U,issues:$.issues.map((D)=>A$(D,G,Q$()))});if(w.issues.length)if(c6.has(typeof _))g.issues.push(...u$(_,w.issues));else g.issues.push({origin:"map",code:"invalid_element",input:v,inst:U,key:_,issues:w.issues.map((D)=>A$(D,G,Q$()))});g.value.set($.value,w.value)}var xG=j("$ZodSet",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value;if(!(v instanceof Set))return g.issues.push({input:v,inst:$,expected:"set",code:"invalid_type"}),g;let U=[];g.value=new Set;for(let G of v){let D=w.valueType._zod.run({value:G,issues:[]},_);if(D instanceof Promise)U.push(D.then((J)=>V8(J,g)));else V8(D,g)}if(U.length)return Promise.all(U).then(()=>g);return g}});function V8($,w){if($.issues.length)w.issues.push(...$.issues);w.value.add($.value)}var hG=j("$ZodEnum",($,w)=>{t.init($,w);let g=X4(w.entries),_=new Set(g);$._zod.values=_,$._zod.pattern=new RegExp(`^(${g.filter((v)=>c6.has(typeof v)).map((v)=>typeof v==="string"?h$(v):v.toString()).join("|")})$`),$._zod.parse=(v,U)=>{let G=v.value;if(_.has(G))return v;return v.issues.push({code:"invalid_value",values:g,input:G,inst:$}),v}}),lG=j("$ZodLiteral",($,w)=>{if(t.init($,w),w.values.length===0)throw Error("Cannot create literal schema with no valid values");let g=new Set(w.values);$._zod.values=g,$._zod.pattern=new RegExp(`^(${w.values.map((_)=>typeof _==="string"?h$(_):_?h$(_.toString()):String(_)).join("|")})$`),$._zod.parse=(_,v)=>{let U=_.value;if(g.has(U))return _;return _.issues.push({code:"invalid_value",values:w.values,input:U,inst:$}),_}}),cG=j("$ZodFile",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{let v=g.value;if(v instanceof File)return g;return g.issues.push({expected:"file",code:"invalid_type",input:v,inst:$}),g}}),yG=j("$ZodTransform",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new zv($.constructor.name);let v=w.transform(g.value,g);if(_.async)return(v instanceof Promise?v:Promise.resolve(v)).then((G)=>{return g.value=G,g});if(v instanceof Promise)throw new Yw;return g.value=v,g}});function F8($,w){if($.issues.length&&w===void 0)return{issues:[],value:void 0};return $}var kU=j("$ZodOptional",($,w)=>{t.init($,w),$._zod.optin="optional",$._zod.optout="optional",a($._zod,"values",()=>{return w.innerType._zod.values?new Set([...w.innerType._zod.values,void 0]):void 0}),a($._zod,"pattern",()=>{let g=w.innerType._zod.pattern;return g?new RegExp(`^(${l6(g.source)})?$`):void 0}),$._zod.parse=(g,_)=>{if(w.innerType._zod.optin==="optional"){let v=w.innerType._zod.run(g,_);if(v instanceof Promise)return v.then((U)=>F8(U,g.value));return F8(v,g.value)}if(g.value===void 0)return g;return w.innerType._zod.run(g,_)}}),mG=j("$ZodExactOptional",($,w)=>{kU.init($,w),a($._zod,"values",()=>w.innerType._zod.values),a($._zod,"pattern",()=>w.innerType._zod.pattern),$._zod.parse=(g,_)=>{return w.innerType._zod.run(g,_)}}),tG=j("$ZodNullable",($,w)=>{t.init($,w),a($._zod,"optin",()=>w.innerType._zod.optin),a($._zod,"optout",()=>w.innerType._zod.optout),a($._zod,"pattern",()=>{let g=w.innerType._zod.pattern;return g?new RegExp(`^(${l6(g.source)}|null)$`):void 0}),a($._zod,"values",()=>{return w.innerType._zod.values?new Set([...w.innerType._zod.values,null]):void 0}),$._zod.parse=(g,_)=>{if(g.value===null)return g;return w.innerType._zod.run(g,_)}}),dG=j("$ZodDefault",($,w)=>{t.init($,w),$._zod.optin="optional",a($._zod,"values",()=>w.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return w.innerType._zod.run(g,_);if(g.value===void 0)return g.value=w.defaultValue,g;let v=w.innerType._zod.run(g,_);if(v instanceof Promise)return v.then((U)=>j8(U,w));return j8(v,w)}});function j8($,w){if($.value===void 0)$.value=w.defaultValue;return $}var oG=j("$ZodPrefault",($,w)=>{t.init($,w),$._zod.optin="optional",a($._zod,"values",()=>w.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return w.innerType._zod.run(g,_);if(g.value===void 0)g.value=w.defaultValue;return w.innerType._zod.run(g,_)}}),rG=j("$ZodNonOptional",($,w)=>{t.init($,w),a($._zod,"values",()=>{let g=w.innerType._zod.values;return g?new Set([...g].filter((_)=>_!==void 0)):void 0}),$._zod.parse=(g,_)=>{let v=w.innerType._zod.run(g,_);if(v instanceof Promise)return v.then((U)=>K8(U,$));return K8(v,$)}});function K8($,w){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:w});return $}var pG=j("$ZodSuccess",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new zv("ZodSuccess");let v=w.innerType._zod.run(g,_);if(v instanceof Promise)return v.then((U)=>{return g.value=U.issues.length===0,g});return g.value=v.issues.length===0,g}}),eG=j("$ZodCatch",($,w)=>{t.init($,w),a($._zod,"optin",()=>w.innerType._zod.optin),a($._zod,"optout",()=>w.innerType._zod.optout),a($._zod,"values",()=>w.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return w.innerType._zod.run(g,_);let v=w.innerType._zod.run(g,_);if(v instanceof Promise)return v.then((U)=>{if(g.value=U.value,U.issues.length)g.value=w.catchValue({...g,error:{issues:U.issues.map((G)=>A$(G,_,Q$()))},input:g.value}),g.issues=[];return g});if(g.value=v.value,v.issues.length)g.value=w.catchValue({...g,error:{issues:v.issues.map((U)=>A$(U,_,Q$()))},input:g.value}),g.issues=[];return g}}),aG=j("$ZodNaN",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{if(typeof g.value!=="number"||!Number.isNaN(g.value))return g.issues.push({input:g.value,inst:$,expected:"nan",code:"invalid_type"}),g;return g}}),sG=j("$ZodPipe",($,w)=>{t.init($,w),a($._zod,"values",()=>w.in._zod.values),a($._zod,"optin",()=>w.in._zod.optin),a($._zod,"optout",()=>w.out._zod.optout),a($._zod,"propValues",()=>w.in._zod.propValues),$._zod.parse=(g,_)=>{if(_.direction==="backward"){let U=w.out._zod.run(g,_);if(U instanceof Promise)return U.then((G)=>VU(G,w.in,_));return VU(U,w.in,_)}let v=w.in._zod.run(g,_);if(v instanceof Promise)return v.then((U)=>VU(U,w.out,_));return VU(v,w.out,_)}});function VU($,w,g){if($.issues.length)return $.aborted=!0,$;return w._zod.run({value:$.value,issues:$.issues},g)}var $g=j("$ZodCodec",($,w)=>{t.init($,w),a($._zod,"values",()=>w.in._zod.values),a($._zod,"optin",()=>w.in._zod.optin),a($._zod,"optout",()=>w.out._zod.optout),a($._zod,"propValues",()=>w.in._zod.propValues),$._zod.parse=(g,_)=>{if((_.direction||"forward")==="forward"){let U=w.in._zod.run(g,_);if(U instanceof Promise)return U.then((G)=>FU(G,w,_));return FU(U,w,_)}else{let U=w.out._zod.run(g,_);if(U instanceof Promise)return U.then((G)=>FU(G,w,_));return FU(U,w,_)}}});function FU($,w,g){if($.issues.length)return $.aborted=!0,$;if((g.direction||"forward")==="forward"){let v=w.transform($.value,$);if(v instanceof Promise)return v.then((U)=>jU($,U,w.out,g));return jU($,v,w.out,g)}else{let v=w.reverseTransform($.value,$);if(v instanceof Promise)return v.then((U)=>jU($,U,w.in,g));return jU($,v,w.in,g)}}function jU($,w,g,_){if($.issues.length)return $.aborted=!0,$;return g._zod.run({value:w,issues:$.issues},_)}var $D=j("$ZodReadonly",($,w)=>{t.init($,w),a($._zod,"propValues",()=>w.innerType._zod.propValues),a($._zod,"values",()=>w.innerType._zod.values),a($._zod,"optin",()=>w.innerType?._zod?.optin),a($._zod,"optout",()=>w.innerType?._zod?.optout),$._zod.parse=(g,_)=>{if(_.direction==="backward")return w.innerType._zod.run(g,_);let v=w.innerType._zod.run(g,_);if(v instanceof Promise)return v.then(O8);return O8(v)}});function O8($){return $.value=Object.freeze($.value),$}var wD=j("$ZodTemplateLiteral",($,w)=>{t.init($,w);let g=[];for(let _ of w.parts)if(typeof _==="object"&&_!==null){if(!_._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[..._._zod.traits].shift()}`);let v=_._zod.pattern instanceof RegExp?_._zod.pattern.source:_._zod.pattern;if(!v)throw Error(`Invalid template literal part: ${_._zod.traits}`);let U=v.startsWith("^")?1:0,G=v.endsWith("$")?v.length-1:v.length;g.push(v.slice(U,G))}else if(_===null||e0.has(typeof _))g.push(h$(`${_}`));else throw Error(`Invalid template literal part: ${_}`);$._zod.pattern=new RegExp(`^${g.join("")}$`),$._zod.parse=(_,v)=>{if(typeof _.value!=="string")return _.issues.push({input:_.value,inst:$,expected:"string",code:"invalid_type"}),_;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(_.value))return _.issues.push({input:_.value,inst:$,code:"invalid_format",format:w.format??"template_literal",pattern:$._zod.pattern.source}),_;return _}}),vD=j("$ZodFunction",($,w)=>{return t.init($,w),$._def=w,$._zod.def=w,$.implement=(g)=>{if(typeof g!=="function")throw Error("implement() must be called with a function");return function(..._){let v=$._def.input?_U($._def.input,_):_,U=Reflect.apply(g,this,v);if($._def.output)return _U($._def.output,U);return U}},$.implementAsync=(g)=>{if(typeof g!=="function")throw Error("implementAsync() must be called with a function");return async function(..._){let v=$._def.input?await UU($._def.input,_):_,U=await Reflect.apply(g,this,v);if($._def.output)return await UU($._def.output,U);return U}},$._zod.parse=(g,_)=>{if(typeof g.value!=="function")return g.issues.push({code:"invalid_type",expected:"function",input:g.value,inst:$}),g;if($._def.output&&$._def.output._zod.def.type==="promise")g.value=$.implementAsync(g.value);else g.value=$.implement(g.value);return g},$.input=(...g)=>{let _=$.constructor;if(Array.isArray(g[0]))return new _({type:"function",input:new PU({type:"tuple",items:g[0],rest:g[1]}),output:$._def.output});return new _({type:"function",input:g[0],output:$._def.output})},$.output=(g)=>{return new $.constructor({type:"function",input:$._def.input,output:g})},$}),gD=j("$ZodPromise",($,w)=>{t.init($,w),$._zod.parse=(g,_)=>{return Promise.resolve(g.value).then((v)=>w.innerType._zod.run({value:v,issues:[]},_))}}),_D=j("$ZodLazy",($,w)=>{t.init($,w),a($._zod,"innerType",()=>w.getter()),a($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),a($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),a($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),a($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(g,_)=>{return $._zod.innerType._zod.run(g,_)}}),UD=j("$ZodCustom",($,w)=>{D$.init($,w),t.init($,w),$._zod.parse=(g,_)=>{return g},$._zod.check=(g)=>{let _=g.value,v=w.fn(_);if(v instanceof Promise)return v.then((U)=>N8(U,g,_,$));N8(v,g,_,$);return}});function N8($,w,g,_){if(!$){let v={code:"custom",input:g,inst:_,path:[..._._zod.def.path??[]],continue:!_._zod.def.abort};if(_._zod.def.params)v.params=_._zod.def.params;w.issues.push(W4(v))}}var Rv={};p$(Rv,{zhTW:()=>pD,zhCN:()=>rD,yo:()=>eD,vi:()=>oD,uz:()=>dD,ur:()=>tD,uk:()=>_g,ua:()=>mD,tr:()=>yD,th:()=>cD,ta:()=>lD,sv:()=>hD,sl:()=>xD,ru:()=>ZD,pt:()=>ED,ps:()=>CD,pl:()=>uD,ota:()=>RD,no:()=>TD,nl:()=>iD,ms:()=>SD,mk:()=>AD,lt:()=>fD,ko:()=>zD,km:()=>vg,kh:()=>MD,ka:()=>nD,ja:()=>kD,it:()=>PD,is:()=>ND,id:()=>OD,hy:()=>KD,hu:()=>jD,he:()=>FD,frCA:()=>VD,fr:()=>LD,fi:()=>ID,fa:()=>BD,es:()=>qD,eo:()=>HD,en:()=>wg,de:()=>WD,da:()=>YD,cs:()=>QD,ca:()=>XD,bg:()=>JD,be:()=>DD,az:()=>GD,ar:()=>bD});var oB=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function w(v){return $[v]??null}let g={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${v.expected}، ولكن تم إدخال ${D}`;return`مدخلات غير مقبولة: يفترض إدخال ${U}، ولكن تم إدخال ${D}`}case"invalid_value":if(v.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(v.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return` أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${U} ${v.maximum.toString()} ${G.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${U} ${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${U} ${v.minimum.toString()} ${G.unit}`;return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${U} ${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${v.prefix}"`;if(U.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${U.suffix}"`;if(U.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${U.includes}"`;if(U.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${U.pattern}`;return`${g[U.format]??v.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${v.divisor}`;case"unrecognized_keys":return`معرف${v.keys.length>1?"ات":""} غريب${v.keys.length>1?"ة":""}: ${N(v.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${v.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${v.origin}`;default:return"مدخل غير مقبول"}}};function bD(){return{localeError:oB()}}var rB=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function w(v){return $[v]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Yanlış dəyər: gözlənilən instanceof ${v.expected}, daxil olan ${D}`;return`Yanlış dəyər: gözlənilən ${U}, daxil olan ${D}`}case"invalid_value":if(v.values.length===1)return`Yanlış dəyər: gözlənilən ${k(v.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${U}${v.maximum.toString()} ${G.unit??"element"}`;return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Çox kiçik: gözlənilən ${v.origin} ${U}${v.minimum.toString()} ${G.unit}`;return`Çox kiçik: gözlənilən ${v.origin} ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Yanlış mətn: "${U.prefix}" ilə başlamalıdır`;if(U.format==="ends_with")return`Yanlış mətn: "${U.suffix}" ilə bitməlidir`;if(U.format==="includes")return`Yanlış mətn: "${U.includes}" daxil olmalıdır`;if(U.format==="regex")return`Yanlış mətn: ${U.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${g[U.format]??v.format}`}case"not_multiple_of":return`Yanlış ədəd: ${v.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${v.keys.length>1?"lar":""}: ${N(v.keys,", ")}`;case"invalid_key":return`${v.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${v.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function GD(){return{localeError:rB()}}function f8($,w,g,_){let v=Math.abs($),U=v%10,G=v%100;if(G>=11&&G<=19)return _;if(U===1)return w;if(U>=2&&U<=4)return g;return _}var pB=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function w(v){return $[v]??null}let g={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},_={nan:"NaN",number:"лік",array:"масіў"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Няправільны ўвод: чакаўся instanceof ${v.expected}, атрымана ${D}`;return`Няправільны ўвод: чакаўся ${U}, атрымана ${D}`}case"invalid_value":if(v.values.length===1)return`Няправільны ўвод: чакалася ${k(v.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G){let D=Number(v.maximum),J=f8(D,G.unit.one,G.unit.few,G.unit.many);return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна ${G.verb} ${U}${v.maximum.toString()} ${J}`}return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна быць ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G){let D=Number(v.minimum),J=f8(D,G.unit.one,G.unit.few,G.unit.many);return`Занадта малы: чакалася, што ${v.origin} павінна ${G.verb} ${U}${v.minimum.toString()} ${J}`}return`Занадта малы: чакалася, што ${v.origin} павінна быць ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${U.prefix}"`;if(U.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${U.suffix}"`;if(U.format==="includes")return`Няправільны радок: павінен змяшчаць "${U.includes}"`;if(U.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${U.pattern}`;return`Няправільны ${g[U.format]??v.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${v.keys.length>1?"ключы":"ключ"}: ${N(v.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${v.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${v.origin}`;default:return"Няправільны ўвод"}}};function DD(){return{localeError:pB()}}var eB=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function w(v){return $[v]??null}let g={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},_={nan:"NaN",number:"число",array:"масив"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Невалиден вход: очакван instanceof ${v.expected}, получен ${D}`;return`Невалиден вход: очакван ${U}, получен ${D}`}case"invalid_value":if(v.values.length===1)return`Невалиден вход: очакван ${k(v.values[0])}`;return`Невалидна опция: очаквано едно от ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Твърде голямо: очаква се ${v.origin??"стойност"} да съдържа ${U}${v.maximum.toString()} ${G.unit??"елемента"}`;return`Твърде голямо: очаква се ${v.origin??"стойност"} да бъде ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Твърде малко: очаква се ${v.origin} да съдържа ${U}${v.minimum.toString()} ${G.unit}`;return`Твърде малко: очаква се ${v.origin} да бъде ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Невалиден низ: трябва да започва с "${U.prefix}"`;if(U.format==="ends_with")return`Невалиден низ: трябва да завършва с "${U.suffix}"`;if(U.format==="includes")return`Невалиден низ: трябва да включва "${U.includes}"`;if(U.format==="regex")return`Невалиден низ: трябва да съвпада с ${U.pattern}`;let G="Невалиден";if(U.format==="emoji")G="Невалидно";if(U.format==="datetime")G="Невалидно";if(U.format==="date")G="Невалидна";if(U.format==="time")G="Невалидно";if(U.format==="duration")G="Невалидна";return`${G} ${g[U.format]??v.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${v.divisor}`;case"unrecognized_keys":return`Неразпознат${v.keys.length>1?"и":""} ключ${v.keys.length>1?"ове":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${v.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${v.origin}`;default:return"Невалиден вход"}}};function JD(){return{localeError:eB()}}var aB=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function w(v){return $[v]??null}let g={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Tipus invàlid: s'esperava instanceof ${v.expected}, s'ha rebut ${D}`;return`Tipus invàlid: s'esperava ${U}, s'ha rebut ${D}`}case"invalid_value":if(v.values.length===1)return`Valor invàlid: s'esperava ${k(v.values[0])}`;return`Opció invàlida: s'esperava una de ${N(v.values," o ")}`;case"too_big":{let U=v.inclusive?"com a màxim":"menys de",G=w(v.origin);if(G)return`Massa gran: s'esperava que ${v.origin??"el valor"} contingués ${U} ${v.maximum.toString()} ${G.unit??"elements"}`;return`Massa gran: s'esperava que ${v.origin??"el valor"} fos ${U} ${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?"com a mínim":"més de",G=w(v.origin);if(G)return`Massa petit: s'esperava que ${v.origin} contingués ${U} ${v.minimum.toString()} ${G.unit}`;return`Massa petit: s'esperava que ${v.origin} fos ${U} ${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Format invàlid: ha de començar amb "${U.prefix}"`;if(U.format==="ends_with")return`Format invàlid: ha d'acabar amb "${U.suffix}"`;if(U.format==="includes")return`Format invàlid: ha d'incloure "${U.includes}"`;if(U.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${U.pattern}`;return`Format invàlid per a ${g[U.format]??v.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${v.divisor}`;case"unrecognized_keys":return`Clau${v.keys.length>1?"s":""} no reconeguda${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${v.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${v.origin}`;default:return"Entrada invàlida"}}};function XD(){return{localeError:aB()}}var sB=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function w(v){return $[v]??null}let g={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},_={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Neplatný vstup: očekáváno instanceof ${v.expected}, obdrženo ${D}`;return`Neplatný vstup: očekáváno ${U}, obdrženo ${D}`}case"invalid_value":if(v.values.length===1)return`Neplatný vstup: očekáváno ${k(v.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí mít ${U}${v.maximum.toString()} ${G.unit??"prvků"}`;return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí být ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí mít ${U}${v.minimum.toString()} ${G.unit??"prvků"}`;return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí být ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Neplatný řetězec: musí začínat na "${U.prefix}"`;if(U.format==="ends_with")return`Neplatný řetězec: musí končit na "${U.suffix}"`;if(U.format==="includes")return`Neplatný řetězec: musí obsahovat "${U.includes}"`;if(U.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${U.pattern}`;return`Neplatný formát ${g[U.format]??v.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${v.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${N(v.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${v.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${v.origin}`;default:return"Neplatný vstup"}}};function QD(){return{localeError:sB()}}var $I=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function w(v){return $[v]??null}let g={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},_={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Ugyldigt input: forventede instanceof ${v.expected}, fik ${D}`;return`Ugyldigt input: forventede ${U}, fik ${D}`}case"invalid_value":if(v.values.length===1)return`Ugyldig værdi: forventede ${k(v.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin),D=_[v.origin]??v.origin;if(G)return`For stor: forventede ${D??"value"} ${G.verb} ${U} ${v.maximum.toString()} ${G.unit??"elementer"}`;return`For stor: forventede ${D??"value"} havde ${U} ${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin),D=_[v.origin]??v.origin;if(G)return`For lille: forventede ${D} ${G.verb} ${U} ${v.minimum.toString()} ${G.unit}`;return`For lille: forventede ${D} havde ${U} ${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Ugyldig streng: skal starte med "${U.prefix}"`;if(U.format==="ends_with")return`Ugyldig streng: skal ende med "${U.suffix}"`;if(U.format==="includes")return`Ugyldig streng: skal indeholde "${U.includes}"`;if(U.format==="regex")return`Ugyldig streng: skal matche mønsteret ${U.pattern}`;return`Ugyldig ${g[U.format]??v.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${N(v.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${v.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${v.origin}`;default:return"Ugyldigt input"}}};function YD(){return{localeError:$I()}}var wI=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function w(v){return $[v]??null}let g={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},_={nan:"NaN",number:"Zahl",array:"Array"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Ungültige Eingabe: erwartet instanceof ${v.expected}, erhalten ${D}`;return`Ungültige Eingabe: erwartet ${U}, erhalten ${D}`}case"invalid_value":if(v.values.length===1)return`Ungültige Eingabe: erwartet ${k(v.values[0])}`;return`Ungültige Option: erwartet eine von ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${U}${v.maximum.toString()} ${G.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${U}${v.maximum.toString()} ist`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Zu klein: erwartet, dass ${v.origin} ${U}${v.minimum.toString()} ${G.unit} hat`;return`Zu klein: erwartet, dass ${v.origin} ${U}${v.minimum.toString()} ist`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Ungültiger String: muss mit "${U.prefix}" beginnen`;if(U.format==="ends_with")return`Ungültiger String: muss mit "${U.suffix}" enden`;if(U.format==="includes")return`Ungültiger String: muss "${U.includes}" enthalten`;if(U.format==="regex")return`Ungültiger String: muss dem Muster ${U.pattern} entsprechen`;return`Ungültig: ${g[U.format]??v.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${v.divisor} sein`;case"unrecognized_keys":return`${v.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${N(v.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${v.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${v.origin}`;default:return"Ungültige Eingabe"}}};function WD(){return{localeError:wI()}}var vI=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function w(v){return $[v]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;return`Invalid input: expected ${U}, received ${D}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${k(v.values[0])}`;return`Invalid option: expected one of ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Too big: expected ${v.origin??"value"} to have ${U}${v.maximum.toString()} ${G.unit??"elements"}`;return`Too big: expected ${v.origin??"value"} to be ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Too small: expected ${v.origin} to have ${U}${v.minimum.toString()} ${G.unit}`;return`Too small: expected ${v.origin} to be ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Invalid string: must start with "${U.prefix}"`;if(U.format==="ends_with")return`Invalid string: must end with "${U.suffix}"`;if(U.format==="includes")return`Invalid string: must include "${U.includes}"`;if(U.format==="regex")return`Invalid string: must match pattern ${U.pattern}`;return`Invalid ${g[U.format]??v.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${v.divisor}`;case"unrecognized_keys":return`Unrecognized key${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Invalid key in ${v.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${v.origin}`;default:return"Invalid input"}}};function wg(){return{localeError:vI()}}var gI=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function w(v){return $[v]??null}let g={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},_={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Nevalida enigo: atendiĝis instanceof ${v.expected}, riceviĝis ${D}`;return`Nevalida enigo: atendiĝis ${U}, riceviĝis ${D}`}case"invalid_value":if(v.values.length===1)return`Nevalida enigo: atendiĝis ${k(v.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Tro granda: atendiĝis ke ${v.origin??"valoro"} havu ${U}${v.maximum.toString()} ${G.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${v.origin??"valoro"} havu ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Tro malgranda: atendiĝis ke ${v.origin} havu ${U}${v.minimum.toString()} ${G.unit}`;return`Tro malgranda: atendiĝis ke ${v.origin} estu ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${U.prefix}"`;if(U.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${U.suffix}"`;if(U.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${U.includes}"`;if(U.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${U.pattern}`;return`Nevalida ${g[U.format]??v.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${v.divisor}`;case"unrecognized_keys":return`Nekonata${v.keys.length>1?"j":""} ŝlosilo${v.keys.length>1?"j":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${v.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${v.origin}`;default:return"Nevalida enigo"}}};function HD(){return{localeError:gI()}}var _I=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function w(v){return $[v]??null}let g={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Entrada inválida: se esperaba instanceof ${v.expected}, recibido ${D}`;return`Entrada inválida: se esperaba ${U}, recibido ${D}`}case"invalid_value":if(v.values.length===1)return`Entrada inválida: se esperaba ${k(v.values[0])}`;return`Opción inválida: se esperaba una de ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin),D=_[v.origin]??v.origin;if(G)return`Demasiado grande: se esperaba que ${D??"valor"} tuviera ${U}${v.maximum.toString()} ${G.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${D??"valor"} fuera ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin),D=_[v.origin]??v.origin;if(G)return`Demasiado pequeño: se esperaba que ${D} tuviera ${U}${v.minimum.toString()} ${G.unit}`;return`Demasiado pequeño: se esperaba que ${D} fuera ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Cadena inválida: debe comenzar con "${U.prefix}"`;if(U.format==="ends_with")return`Cadena inválida: debe terminar en "${U.suffix}"`;if(U.format==="includes")return`Cadena inválida: debe incluir "${U.includes}"`;if(U.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${U.pattern}`;return`Inválido ${g[U.format]??v.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${v.divisor}`;case"unrecognized_keys":return`Llave${v.keys.length>1?"s":""} desconocida${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Llave inválida en ${_[v.origin]??v.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${_[v.origin]??v.origin}`;default:return"Entrada inválida"}}};function qD(){return{localeError:_I()}}var UI=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function w(v){return $[v]??null}let g={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},_={nan:"NaN",number:"عدد",array:"آرایه"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`ورودی نامعتبر: میبایست instanceof ${v.expected} میبود، ${D} دریافت شد`;return`ورودی نامعتبر: میبایست ${U} میبود، ${D} دریافت شد`}case"invalid_value":if(v.values.length===1)return`ورودی نامعتبر: میبایست ${k(v.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${N(v.values,"|")} میبود`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${U}${v.maximum.toString()} ${G.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${U}${v.maximum.toString()} باشد`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`خیلی کوچک: ${v.origin} باید ${U}${v.minimum.toString()} ${G.unit} باشد`;return`خیلی کوچک: ${v.origin} باید ${U}${v.minimum.toString()} باشد`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`رشته نامعتبر: باید با "${U.prefix}" شروع شود`;if(U.format==="ends_with")return`رشته نامعتبر: باید با "${U.suffix}" تمام شود`;if(U.format==="includes")return`رشته نامعتبر: باید شامل "${U.includes}" باشد`;if(U.format==="regex")return`رشته نامعتبر: باید با الگوی ${U.pattern} مطابقت داشته باشد`;return`${g[U.format]??v.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${v.divisor} باشد`;case"unrecognized_keys":return`کلید${v.keys.length>1?"های":""} ناشناس: ${N(v.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${v.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${v.origin}`;default:return"ورودی نامعتبر"}}};function BD(){return{localeError:UI()}}var bI=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function w(v){return $[v]??null}let g={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Virheellinen tyyppi: odotettiin instanceof ${v.expected}, oli ${D}`;return`Virheellinen tyyppi: odotettiin ${U}, oli ${D}`}case"invalid_value":if(v.values.length===1)return`Virheellinen syöte: täytyy olla ${k(v.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Liian suuri: ${G.subject} täytyy olla ${U}${v.maximum.toString()} ${G.unit}`.trim();return`Liian suuri: arvon täytyy olla ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Liian pieni: ${G.subject} täytyy olla ${U}${v.minimum.toString()} ${G.unit}`.trim();return`Liian pieni: arvon täytyy olla ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${U.prefix}"`;if(U.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${U.suffix}"`;if(U.format==="includes")return`Virheellinen syöte: täytyy sisältää "${U.includes}"`;if(U.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${U.pattern}`;return`Virheellinen ${g[U.format]??v.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${v.divisor} monikerta`;case"unrecognized_keys":return`${v.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${N(v.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function ID(){return{localeError:bI()}}var GI=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function w(v){return $[v]??null}let g={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},_={nan:"NaN",number:"nombre",array:"tableau"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Entrée invalide : instanceof ${v.expected} attendu, ${D} reçu`;return`Entrée invalide : ${U} attendu, ${D} reçu`}case"invalid_value":if(v.values.length===1)return`Entrée invalide : ${k(v.values[0])} attendu`;return`Option invalide : une valeur parmi ${N(v.values,"|")} attendue`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Trop grand : ${v.origin??"valeur"} doit ${G.verb} ${U}${v.maximum.toString()} ${G.unit??"élément(s)"}`;return`Trop grand : ${v.origin??"valeur"} doit être ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Trop petit : ${v.origin} doit ${G.verb} ${U}${v.minimum.toString()} ${G.unit}`;return`Trop petit : ${v.origin} doit être ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Chaîne invalide : doit commencer par "${U.prefix}"`;if(U.format==="ends_with")return`Chaîne invalide : doit se terminer par "${U.suffix}"`;if(U.format==="includes")return`Chaîne invalide : doit inclure "${U.includes}"`;if(U.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${U.pattern}`;return`${g[U.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${N(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function LD(){return{localeError:GI()}}var DI=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function w(v){return $[v]??null}let g={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Entrée invalide : attendu instanceof ${v.expected}, reçu ${D}`;return`Entrée invalide : attendu ${U}, reçu ${D}`}case"invalid_value":if(v.values.length===1)return`Entrée invalide : attendu ${k(v.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"≤":"<",G=w(v.origin);if(G)return`Trop grand : attendu que ${v.origin??"la valeur"} ait ${U}${v.maximum.toString()} ${G.unit}`;return`Trop grand : attendu que ${v.origin??"la valeur"} soit ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?"≥":">",G=w(v.origin);if(G)return`Trop petit : attendu que ${v.origin} ait ${U}${v.minimum.toString()} ${G.unit}`;return`Trop petit : attendu que ${v.origin} soit ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Chaîne invalide : doit commencer par "${U.prefix}"`;if(U.format==="ends_with")return`Chaîne invalide : doit se terminer par "${U.suffix}"`;if(U.format==="includes")return`Chaîne invalide : doit inclure "${U.includes}"`;if(U.format==="regex")return`Chaîne invalide : doit correspondre au motif ${U.pattern}`;return`${g[U.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${N(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function VD(){return{localeError:DI()}}var JI=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},w={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},g=(X)=>X?$[X]:void 0,_=(X)=>{let Q=g(X);if(Q)return Q.label;return X??$.unknown.label},v=(X)=>`ה${_(X)}`,U=(X)=>{return(g(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},G=(X)=>{if(!X)return null;return w[X]??null},D={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},J={nan:"NaN"};return(X)=>{switch(X.code){case"invalid_type":{let Q=X.expected,Y=J[Q??""]??_(Q),q=M(X.input),L=J[q]??$[q]?.label??q;if(/^[A-Z]/.test(X.expected))return`קלט לא תקין: צריך להיות instanceof ${X.expected}, התקבל ${L}`;return`קלט לא תקין: צריך להיות ${Y}, התקבל ${L}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(X.values[0])}`;let Q=X.values.map((L)=>k(L));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Q[0]} או ${Q[1]}`;let Y=Q[Q.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Q.slice(0,-1).join(", ")} או ${Y}`}case"too_big":{let Q=G(X.origin),Y=v(X.origin??"value");if(X.origin==="string")return`${Q?.longLabel??"ארוך"} מדי: ${Y} צריכה להכיל ${X.maximum.toString()} ${Q?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){let F=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${Y} צריך להיות ${F}`}if(X.origin==="array"||X.origin==="set"){let F=X.origin==="set"?"צריכה":"צריך",H=X.inclusive?`${X.maximum} ${Q?.unit??""} או פחות`:`פחות מ-${X.maximum} ${Q?.unit??""}`;return`גדול מדי: ${Y} ${F} להכיל ${H}`.trim()}let q=X.inclusive?"<=":"<",L=U(X.origin??"value");if(Q?.unit)return`${Q.longLabel} מדי: ${Y} ${L} ${q}${X.maximum.toString()} ${Q.unit}`;return`${Q?.longLabel??"גדול"} מדי: ${Y} ${L} ${q}${X.maximum.toString()}`}case"too_small":{let Q=G(X.origin),Y=v(X.origin??"value");if(X.origin==="string")return`${Q?.shortLabel??"קצר"} מדי: ${Y} צריכה להכיל ${X.minimum.toString()} ${Q?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){let F=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${Y} צריך להיות ${F}`}if(X.origin==="array"||X.origin==="set"){let F=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){let V=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Y} ${F} להכיל ${V}`}let H=X.inclusive?`${X.minimum} ${Q?.unit??""} או יותר`:`יותר מ-${X.minimum} ${Q?.unit??""}`;return`קטן מדי: ${Y} ${F} להכיל ${H}`.trim()}let q=X.inclusive?">=":">",L=U(X.origin??"value");if(Q?.unit)return`${Q.shortLabel} מדי: ${Y} ${L} ${q}${X.minimum.toString()} ${Q.unit}`;return`${Q?.shortLabel??"קטן"} מדי: ${Y} ${L} ${q}${X.minimum.toString()}`}case"invalid_format":{let Q=X;if(Q.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Q.prefix}"`;if(Q.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Q.suffix}"`;if(Q.format==="includes")return`המחרוזת חייבת לכלול "${Q.includes}"`;if(Q.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Q.pattern}`;let Y=D[Q.format],q=Y?.label??Q.format,F=(Y?.gender??"m")==="f"?"תקינה":"תקין";return`${q} לא ${F}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${N(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${v(X.origin??"array")}`;default:return"קלט לא תקין"}}};function FD(){return{localeError:JI()}}var XI=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function w(v){return $[v]??null}let g={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},_={nan:"NaN",number:"szám",array:"tömb"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Érvénytelen bemenet: a várt érték instanceof ${v.expected}, a kapott érték ${D}`;return`Érvénytelen bemenet: a várt érték ${U}, a kapott érték ${D}`}case"invalid_value":if(v.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(v.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Túl nagy: ${v.origin??"érték"} mérete túl nagy ${U}${v.maximum.toString()} ${G.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${v.origin??"érték"} túl nagy: ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Túl kicsi: a bemeneti érték ${v.origin} mérete túl kicsi ${U}${v.minimum.toString()} ${G.unit}`;return`Túl kicsi: a bemeneti érték ${v.origin} túl kicsi ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Érvénytelen string: "${U.prefix}" értékkel kell kezdődnie`;if(U.format==="ends_with")return`Érvénytelen string: "${U.suffix}" értékkel kell végződnie`;if(U.format==="includes")return`Érvénytelen string: "${U.includes}" értéket kell tartalmaznia`;if(U.format==="regex")return`Érvénytelen string: ${U.pattern} mintának kell megfelelnie`;return`Érvénytelen ${g[U.format]??v.format}`}case"not_multiple_of":return`Érvénytelen szám: ${v.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${v.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${v.origin}`;default:return"Érvénytelen bemenet"}}};function jD(){return{localeError:XI()}}function A8($,w,g){return Math.abs($)===1?w:g}function V4($){if(!$)return"";let w=["ա","ե","ը","ի","ո","ու","օ"],g=$[$.length-1];return $+(w.includes(g)?"ն":"ը")}var QI=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function w(v){return $[v]??null}let g={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},_={nan:"NaN",number:"թիվ",array:"զանգված"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${v.expected}, ստացվել է ${D}`;return`Սխալ մուտքագրում․ սպասվում էր ${U}, ստացվել է ${D}`}case"invalid_value":if(v.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${k(v.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G){let D=Number(v.maximum),J=A8(D,G.unit.one,G.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${V4(v.origin??"արժեք")} կունենա ${U}${v.maximum.toString()} ${J}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${V4(v.origin??"արժեք")} լինի ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G){let D=Number(v.minimum),J=A8(D,G.unit.one,G.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${V4(v.origin)} կունենա ${U}${v.minimum.toString()} ${J}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${V4(v.origin)} լինի ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${U.prefix}"-ով`;if(U.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${U.suffix}"-ով`;if(U.format==="includes")return`Սխալ տող․ պետք է պարունակի "${U.includes}"`;if(U.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${U.pattern} ձևաչափին`;return`Սխալ ${g[U.format]??v.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${v.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${v.keys.length>1?"ներ":""}. ${N(v.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${V4(v.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${V4(v.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function KD(){return{localeError:QI()}}var YI=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function w(v){return $[v]??null}let g={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Input tidak valid: diharapkan instanceof ${v.expected}, diterima ${D}`;return`Input tidak valid: diharapkan ${U}, diterima ${D}`}case"invalid_value":if(v.values.length===1)return`Input tidak valid: diharapkan ${k(v.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Terlalu besar: diharapkan ${v.origin??"value"} memiliki ${U}${v.maximum.toString()} ${G.unit??"elemen"}`;return`Terlalu besar: diharapkan ${v.origin??"value"} menjadi ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Terlalu kecil: diharapkan ${v.origin} memiliki ${U}${v.minimum.toString()} ${G.unit}`;return`Terlalu kecil: diharapkan ${v.origin} menjadi ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`String tidak valid: harus dimulai dengan "${U.prefix}"`;if(U.format==="ends_with")return`String tidak valid: harus berakhir dengan "${U.suffix}"`;if(U.format==="includes")return`String tidak valid: harus menyertakan "${U.includes}"`;if(U.format==="regex")return`String tidak valid: harus sesuai pola ${U.pattern}`;return`${g[U.format]??v.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${v.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${v.origin}`;default:return"Input tidak valid"}}};function OD(){return{localeError:YI()}}var WI=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function w(v){return $[v]??null}let g={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},_={nan:"NaN",number:"númer",array:"fylki"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Rangt gildi: Þú slóst inn ${D} þar sem á að vera instanceof ${v.expected}`;return`Rangt gildi: Þú slóst inn ${D} þar sem á að vera ${U}`}case"invalid_value":if(v.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(v.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Of stórt: gert er ráð fyrir að ${v.origin??"gildi"} hafi ${U}${v.maximum.toString()} ${G.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${v.origin??"gildi"} sé ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Of lítið: gert er ráð fyrir að ${v.origin} hafi ${U}${v.minimum.toString()} ${G.unit}`;return`Of lítið: gert er ráð fyrir að ${v.origin} sé ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Ógildur strengur: verður að byrja á "${U.prefix}"`;if(U.format==="ends_with")return`Ógildur strengur: verður að enda á "${U.suffix}"`;if(U.format==="includes")return`Ógildur strengur: verður að innihalda "${U.includes}"`;if(U.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${U.pattern}`;return`Rangt ${g[U.format]??v.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${v.divisor}`;case"unrecognized_keys":return`Óþekkt ${v.keys.length>1?"ir lyklar":"ur lykill"}: ${N(v.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${v.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${v.origin}`;default:return"Rangt gildi"}}};function ND(){return{localeError:WI()}}var HI=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function w(v){return $[v]??null}let g={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"numero",array:"vettore"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Input non valido: atteso instanceof ${v.expected}, ricevuto ${D}`;return`Input non valido: atteso ${U}, ricevuto ${D}`}case"invalid_value":if(v.values.length===1)return`Input non valido: atteso ${k(v.values[0])}`;return`Opzione non valida: atteso uno tra ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Troppo grande: ${v.origin??"valore"} deve avere ${U}${v.maximum.toString()} ${G.unit??"elementi"}`;return`Troppo grande: ${v.origin??"valore"} deve essere ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Troppo piccolo: ${v.origin} deve avere ${U}${v.minimum.toString()} ${G.unit}`;return`Troppo piccolo: ${v.origin} deve essere ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Stringa non valida: deve iniziare con "${U.prefix}"`;if(U.format==="ends_with")return`Stringa non valida: deve terminare con "${U.suffix}"`;if(U.format==="includes")return`Stringa non valida: deve includere "${U.includes}"`;if(U.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${U.pattern}`;return`Invalid ${g[U.format]??v.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${v.divisor}`;case"unrecognized_keys":return`Chiav${v.keys.length>1?"i":"e"} non riconosciut${v.keys.length>1?"e":"a"}: ${N(v.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${v.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${v.origin}`;default:return"Input non valido"}}};function PD(){return{localeError:HI()}}var qI=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function w(v){return $[v]??null}let g={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},_={nan:"NaN",number:"数値",array:"配列"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`無効な入力: instanceof ${v.expected}が期待されましたが、${D}が入力されました`;return`無効な入力: ${U}が期待されましたが、${D}が入力されました`}case"invalid_value":if(v.values.length===1)return`無効な入力: ${k(v.values[0])}が期待されました`;return`無効な選択: ${N(v.values,"、")}のいずれかである必要があります`;case"too_big":{let U=v.inclusive?"以下である":"より小さい",G=w(v.origin);if(G)return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${G.unit??"要素"}${U}必要があります`;return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${U}必要があります`}case"too_small":{let U=v.inclusive?"以上である":"より大きい",G=w(v.origin);if(G)return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${G.unit}${U}必要があります`;return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${U}必要があります`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`無効な文字列: "${U.prefix}"で始まる必要があります`;if(U.format==="ends_with")return`無効な文字列: "${U.suffix}"で終わる必要があります`;if(U.format==="includes")return`無効な文字列: "${U.includes}"を含む必要があります`;if(U.format==="regex")return`無効な文字列: パターン${U.pattern}に一致する必要があります`;return`無効な${g[U.format]??v.format}`}case"not_multiple_of":return`無効な数値: ${v.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${v.keys.length>1?"群":""}: ${N(v.keys,"、")}`;case"invalid_key":return`${v.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${v.origin}内の無効な値`;default:return"無効な入力"}}};function kD(){return{localeError:qI()}}var BI=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function w(v){return $[v]??null}let g={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},_={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${v.expected}, მიღებული ${D}`;return`არასწორი შეყვანა: მოსალოდნელი ${U}, მიღებული ${D}`}case"invalid_value":if(v.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(v.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${N(v.values,"|")}-დან`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`ზედმეტად დიდი: მოსალოდნელი ${v.origin??"მნიშვნელობა"} ${G.verb} ${U}${v.maximum.toString()} ${G.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${v.origin??"მნიშვნელობა"} იყოს ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`ზედმეტად პატარა: მოსალოდნელი ${v.origin} ${G.verb} ${U}${v.minimum.toString()} ${G.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${v.origin} იყოს ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${U.prefix}"-ით`;if(U.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${U.suffix}"-ით`;if(U.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${U.includes}"-ს`;if(U.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${U.pattern}`;return`არასწორი ${g[U.format]??v.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${v.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${v.keys.length>1?"ები":"ი"}: ${N(v.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${v.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${v.origin}-ში`;default:return"არასწორი შეყვანა"}}};function nD(){return{localeError:BI()}}var II=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function w(v){return $[v]??null}let g={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},_={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${v.expected} ប៉ុន្តែទទួលបាន ${D}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${U} ប៉ុន្តែទទួលបាន ${D}`}case"invalid_value":if(v.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(v.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${U} ${v.maximum.toString()} ${G.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${U} ${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`តូចពេក៖ ត្រូវការ ${v.origin} ${U} ${v.minimum.toString()} ${G.unit}`;return`តូចពេក៖ ត្រូវការ ${v.origin} ${U} ${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${U.prefix}"`;if(U.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${U.suffix}"`;if(U.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${U.includes}"`;if(U.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${U.pattern}`;return`មិនត្រឹមត្រូវ៖ ${g[U.format]??v.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${v.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${N(v.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function vg(){return{localeError:II()}}function MD(){return vg()}var LI=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function w(v){return $[v]??null}let g={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`잘못된 입력: 예상 타입은 instanceof ${v.expected}, 받은 타입은 ${D}입니다`;return`잘못된 입력: 예상 타입은 ${U}, 받은 타입은 ${D}입니다`}case"invalid_value":if(v.values.length===1)return`잘못된 입력: 값은 ${k(v.values[0])} 이어야 합니다`;return`잘못된 옵션: ${N(v.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let U=v.inclusive?"이하":"미만",G=U==="미만"?"이어야 합니다":"여야 합니다",D=w(v.origin),J=D?.unit??"요소";if(D)return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()}${J} ${U}${G}`;return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()} ${U}${G}`}case"too_small":{let U=v.inclusive?"이상":"초과",G=U==="이상"?"이어야 합니다":"여야 합니다",D=w(v.origin),J=D?.unit??"요소";if(D)return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()}${J} ${U}${G}`;return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()} ${U}${G}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`잘못된 문자열: "${U.prefix}"(으)로 시작해야 합니다`;if(U.format==="ends_with")return`잘못된 문자열: "${U.suffix}"(으)로 끝나야 합니다`;if(U.format==="includes")return`잘못된 문자열: "${U.includes}"을(를) 포함해야 합니다`;if(U.format==="regex")return`잘못된 문자열: 정규식 ${U.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${g[U.format]??v.format}`}case"not_multiple_of":return`잘못된 숫자: ${v.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${N(v.keys,", ")}`;case"invalid_key":return`잘못된 키: ${v.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${v.origin}`;default:return"잘못된 입력"}}};function zD(){return{localeError:LI()}}var gg=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function S8($){let w=Math.abs($),g=w%10,_=w%100;if(_>=11&&_<=19||g===0)return"many";if(g===1)return"one";return"few"}var VI=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function w(v,U,G,D){let J=$[v]??null;if(J===null)return J;return{unit:J.unit[U],verb:J.verb[D][G?"inclusive":"notInclusive"]}}let g={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},_={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Gautas tipas ${D}, o tikėtasi - instanceof ${v.expected}`;return`Gautas tipas ${D}, o tikėtasi - ${U}`}case"invalid_value":if(v.values.length===1)return`Privalo būti ${k(v.values[0])}`;return`Privalo būti vienas iš ${N(v.values,"|")} pasirinkimų`;case"too_big":{let U=_[v.origin]??v.origin,G=w(v.origin,S8(Number(v.maximum)),v.inclusive??!1,"smaller");if(G?.verb)return`${gg(U??v.origin??"reikšmė")} ${G.verb} ${v.maximum.toString()} ${G.unit??"elementų"}`;let D=v.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${gg(U??v.origin??"reikšmė")} turi būti ${D} ${v.maximum.toString()} ${G?.unit}`}case"too_small":{let U=_[v.origin]??v.origin,G=w(v.origin,S8(Number(v.minimum)),v.inclusive??!1,"bigger");if(G?.verb)return`${gg(U??v.origin??"reikšmė")} ${G.verb} ${v.minimum.toString()} ${G.unit??"elementų"}`;let D=v.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${gg(U??v.origin??"reikšmė")} turi būti ${D} ${v.minimum.toString()} ${G?.unit}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Eilutė privalo prasidėti "${U.prefix}"`;if(U.format==="ends_with")return`Eilutė privalo pasibaigti "${U.suffix}"`;if(U.format==="includes")return`Eilutė privalo įtraukti "${U.includes}"`;if(U.format==="regex")return`Eilutė privalo atitikti ${U.pattern}`;return`Neteisingas ${g[U.format]??v.format}`}case"not_multiple_of":return`Skaičius privalo būti ${v.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${v.keys.length>1?"i":"as"} rakt${v.keys.length>1?"ai":"as"}: ${N(v.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let U=_[v.origin]??v.origin;return`${gg(U??v.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function fD(){return{localeError:VI()}}var FI=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function w(v){return $[v]??null}let g={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},_={nan:"NaN",number:"број",array:"низа"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Грешен внес: се очекува instanceof ${v.expected}, примено ${D}`;return`Грешен внес: се очекува ${U}, примено ${D}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${k(v.values[0])}`;return`Грешана опција: се очекува една ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Премногу голем: се очекува ${v.origin??"вредноста"} да има ${U}${v.maximum.toString()} ${G.unit??"елементи"}`;return`Премногу голем: се очекува ${v.origin??"вредноста"} да биде ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Премногу мал: се очекува ${v.origin} да има ${U}${v.minimum.toString()} ${G.unit}`;return`Премногу мал: се очекува ${v.origin} да биде ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Неважечка низа: мора да започнува со "${U.prefix}"`;if(U.format==="ends_with")return`Неважечка низа: мора да завршува со "${U.suffix}"`;if(U.format==="includes")return`Неважечка низа: мора да вклучува "${U.includes}"`;if(U.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${U.pattern}`;return`Invalid ${g[U.format]??v.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${N(v.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${v.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${v.origin}`;default:return"Грешен внес"}}};function AD(){return{localeError:FI()}}var jI=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function w(v){return $[v]??null}let g={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"nombor"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Input tidak sah: dijangka instanceof ${v.expected}, diterima ${D}`;return`Input tidak sah: dijangka ${U}, diterima ${D}`}case"invalid_value":if(v.values.length===1)return`Input tidak sah: dijangka ${k(v.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Terlalu besar: dijangka ${v.origin??"nilai"} ${G.verb} ${U}${v.maximum.toString()} ${G.unit??"elemen"}`;return`Terlalu besar: dijangka ${v.origin??"nilai"} adalah ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Terlalu kecil: dijangka ${v.origin} ${G.verb} ${U}${v.minimum.toString()} ${G.unit}`;return`Terlalu kecil: dijangka ${v.origin} adalah ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`String tidak sah: mesti bermula dengan "${U.prefix}"`;if(U.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${U.suffix}"`;if(U.format==="includes")return`String tidak sah: mesti mengandungi "${U.includes}"`;if(U.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${U.pattern}`;return`${g[U.format]??v.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${N(v.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${v.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${v.origin}`;default:return"Input tidak sah"}}};function SD(){return{localeError:jI()}}var KI=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function w(v){return $[v]??null}let g={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},_={nan:"NaN",number:"getal"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Ongeldige invoer: verwacht instanceof ${v.expected}, ontving ${D}`;return`Ongeldige invoer: verwacht ${U}, ontving ${D}`}case"invalid_value":if(v.values.length===1)return`Ongeldige invoer: verwacht ${k(v.values[0])}`;return`Ongeldige optie: verwacht één van ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin),D=v.origin==="date"?"laat":v.origin==="string"?"lang":"groot";if(G)return`Te ${D}: verwacht dat ${v.origin??"waarde"} ${U}${v.maximum.toString()} ${G.unit??"elementen"} ${G.verb}`;return`Te ${D}: verwacht dat ${v.origin??"waarde"} ${U}${v.maximum.toString()} is`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin),D=v.origin==="date"?"vroeg":v.origin==="string"?"kort":"klein";if(G)return`Te ${D}: verwacht dat ${v.origin} ${U}${v.minimum.toString()} ${G.unit} ${G.verb}`;return`Te ${D}: verwacht dat ${v.origin} ${U}${v.minimum.toString()} is`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Ongeldige tekst: moet met "${U.prefix}" beginnen`;if(U.format==="ends_with")return`Ongeldige tekst: moet op "${U.suffix}" eindigen`;if(U.format==="includes")return`Ongeldige tekst: moet "${U.includes}" bevatten`;if(U.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${U.pattern}`;return`Ongeldig: ${g[U.format]??v.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${v.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${v.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${v.origin}`;default:return"Ongeldige invoer"}}};function iD(){return{localeError:KI()}}var OI=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function w(v){return $[v]??null}let g={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"tall",array:"liste"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Ugyldig input: forventet instanceof ${v.expected}, fikk ${D}`;return`Ugyldig input: forventet ${U}, fikk ${D}`}case"invalid_value":if(v.values.length===1)return`Ugyldig verdi: forventet ${k(v.values[0])}`;return`Ugyldig valg: forventet en av ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`For stor(t): forventet ${v.origin??"value"} til å ha ${U}${v.maximum.toString()} ${G.unit??"elementer"}`;return`For stor(t): forventet ${v.origin??"value"} til å ha ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`For lite(n): forventet ${v.origin} til å ha ${U}${v.minimum.toString()} ${G.unit}`;return`For lite(n): forventet ${v.origin} til å ha ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Ugyldig streng: må starte med "${U.prefix}"`;if(U.format==="ends_with")return`Ugyldig streng: må ende med "${U.suffix}"`;if(U.format==="includes")return`Ugyldig streng: må inneholde "${U.includes}"`;if(U.format==="regex")return`Ugyldig streng: må matche mønsteret ${U.pattern}`;return`Ugyldig ${g[U.format]??v.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${N(v.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${v.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${v.origin}`;default:return"Ugyldig input"}}};function TD(){return{localeError:OI()}}var NI=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function w(v){return $[v]??null}let g={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},_={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Fâsit giren: umulan instanceof ${v.expected}, alınan ${D}`;return`Fâsit giren: umulan ${U}, alınan ${D}`}case"invalid_value":if(v.values.length===1)return`Fâsit giren: umulan ${k(v.values[0])}`;return`Fâsit tercih: mûteberler ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Fazla büyük: ${v.origin??"value"}, ${U}${v.maximum.toString()} ${G.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${v.origin??"value"}, ${U}${v.maximum.toString()} olmalıydı.`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Fazla küçük: ${v.origin}, ${U}${v.minimum.toString()} ${G.unit} sahip olmalıydı.`;return`Fazla küçük: ${v.origin}, ${U}${v.minimum.toString()} olmalıydı.`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Fâsit metin: "${U.prefix}" ile başlamalı.`;if(U.format==="ends_with")return`Fâsit metin: "${U.suffix}" ile bitmeli.`;if(U.format==="includes")return`Fâsit metin: "${U.includes}" ihtivâ etmeli.`;if(U.format==="regex")return`Fâsit metin: ${U.pattern} nakşına uymalı.`;return`Fâsit ${g[U.format]??v.format}`}case"not_multiple_of":return`Fâsit sayı: ${v.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`${v.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${v.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function RD(){return{localeError:NI()}}var PI=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function w(v){return $[v]??null}let g={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},_={nan:"NaN",number:"عدد",array:"ارې"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`ناسم ورودي: باید instanceof ${v.expected} وای, مګر ${D} ترلاسه شو`;return`ناسم ورودي: باید ${U} وای, مګر ${D} ترلاسه شو`}case"invalid_value":if(v.values.length===1)return`ناسم ورودي: باید ${k(v.values[0])} وای`;return`ناسم انتخاب: باید یو له ${N(v.values,"|")} څخه وای`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`ډیر لوی: ${v.origin??"ارزښت"} باید ${U}${v.maximum.toString()} ${G.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${v.origin??"ارزښت"} باید ${U}${v.maximum.toString()} وي`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`ډیر کوچنی: ${v.origin} باید ${U}${v.minimum.toString()} ${G.unit} ولري`;return`ډیر کوچنی: ${v.origin} باید ${U}${v.minimum.toString()} وي`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`ناسم متن: باید د "${U.prefix}" سره پیل شي`;if(U.format==="ends_with")return`ناسم متن: باید د "${U.suffix}" سره پای ته ورسيږي`;if(U.format==="includes")return`ناسم متن: باید "${U.includes}" ولري`;if(U.format==="regex")return`ناسم متن: باید د ${U.pattern} سره مطابقت ولري`;return`${g[U.format]??v.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${v.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${v.keys.length>1?"کلیډونه":"کلیډ"}: ${N(v.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${v.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${v.origin} کې`;default:return"ناسمه ورودي"}}};function CD(){return{localeError:PI()}}var kI=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function w(v){return $[v]??null}let g={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},_={nan:"NaN",number:"liczba",array:"tablica"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${v.expected}, otrzymano ${D}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${U}, otrzymano ${D}`}case"invalid_value":if(v.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(v.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Za duża wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${U}${v.maximum.toString()} ${G.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Za mała wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${U}${v.minimum.toString()} ${G.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${U.prefix}"`;if(U.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${U.suffix}"`;if(U.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${U.includes}"`;if(U.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${U.pattern}`;return`Nieprawidłow(y/a/e) ${g[U.format]??v.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${v.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${v.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${v.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function uD(){return{localeError:kI()}}var nI=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function w(v){return $[v]??null}let g={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN",number:"número",null:"nulo"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Tipo inválido: esperado instanceof ${v.expected}, recebido ${D}`;return`Tipo inválido: esperado ${U}, recebido ${D}`}case"invalid_value":if(v.values.length===1)return`Entrada inválida: esperado ${k(v.values[0])}`;return`Opção inválida: esperada uma das ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Muito grande: esperado que ${v.origin??"valor"} tivesse ${U}${v.maximum.toString()} ${G.unit??"elementos"}`;return`Muito grande: esperado que ${v.origin??"valor"} fosse ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Muito pequeno: esperado que ${v.origin} tivesse ${U}${v.minimum.toString()} ${G.unit}`;return`Muito pequeno: esperado que ${v.origin} fosse ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Texto inválido: deve começar com "${U.prefix}"`;if(U.format==="ends_with")return`Texto inválido: deve terminar com "${U.suffix}"`;if(U.format==="includes")return`Texto inválido: deve incluir "${U.includes}"`;if(U.format==="regex")return`Texto inválido: deve corresponder ao padrão ${U.pattern}`;return`${g[U.format]??v.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${v.divisor}`;case"unrecognized_keys":return`Chave${v.keys.length>1?"s":""} desconhecida${v.keys.length>1?"s":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Chave inválida em ${v.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${v.origin}`;default:return"Campo inválido"}}};function ED(){return{localeError:nI()}}function i8($,w,g,_){let v=Math.abs($),U=v%10,G=v%100;if(G>=11&&G<=19)return _;if(U===1)return w;if(U>=2&&U<=4)return g;return _}var MI=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function w(v){return $[v]??null}let g={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},_={nan:"NaN",number:"число",array:"массив"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Неверный ввод: ожидалось instanceof ${v.expected}, получено ${D}`;return`Неверный ввод: ожидалось ${U}, получено ${D}`}case"invalid_value":if(v.values.length===1)return`Неверный ввод: ожидалось ${k(v.values[0])}`;return`Неверный вариант: ожидалось одно из ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G){let D=Number(v.maximum),J=i8(D,G.unit.one,G.unit.few,G.unit.many);return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет иметь ${U}${v.maximum.toString()} ${J}`}return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G){let D=Number(v.minimum),J=i8(D,G.unit.one,G.unit.few,G.unit.many);return`Слишком маленькое значение: ожидалось, что ${v.origin} будет иметь ${U}${v.minimum.toString()} ${J}`}return`Слишком маленькое значение: ожидалось, что ${v.origin} будет ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Неверная строка: должна начинаться с "${U.prefix}"`;if(U.format==="ends_with")return`Неверная строка: должна заканчиваться на "${U.suffix}"`;if(U.format==="includes")return`Неверная строка: должна содержать "${U.includes}"`;if(U.format==="regex")return`Неверная строка: должна соответствовать шаблону ${U.pattern}`;return`Неверный ${g[U.format]??v.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспознанн${v.keys.length>1?"ые":"ый"} ключ${v.keys.length>1?"и":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${v.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${v.origin}`;default:return"Неверные входные данные"}}};function ZD(){return{localeError:MI()}}var zI=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function w(v){return $[v]??null}let g={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},_={nan:"NaN",number:"število",array:"tabela"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Neveljaven vnos: pričakovano instanceof ${v.expected}, prejeto ${D}`;return`Neveljaven vnos: pričakovano ${U}, prejeto ${D}`}case"invalid_value":if(v.values.length===1)return`Neveljaven vnos: pričakovano ${k(v.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} imelo ${U}${v.maximum.toString()} ${G.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Premajhno: pričakovano, da bo ${v.origin} imelo ${U}${v.minimum.toString()} ${G.unit}`;return`Premajhno: pričakovano, da bo ${v.origin} ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Neveljaven niz: mora se začeti z "${U.prefix}"`;if(U.format==="ends_with")return`Neveljaven niz: mora se končati z "${U.suffix}"`;if(U.format==="includes")return`Neveljaven niz: mora vsebovati "${U.includes}"`;if(U.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${U.pattern}`;return`Neveljaven ${g[U.format]??v.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${v.divisor}`;case"unrecognized_keys":return`Neprepoznan${v.keys.length>1?"i ključi":" ključ"}: ${N(v.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${v.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${v.origin}`;default:return"Neveljaven vnos"}}};function xD(){return{localeError:zI()}}var fI=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function w(v){return $[v]??null}let g={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},_={nan:"NaN",number:"antal",array:"lista"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Ogiltig inmatning: förväntat instanceof ${v.expected}, fick ${D}`;return`Ogiltig inmatning: förväntat ${U}, fick ${D}`}case"invalid_value":if(v.values.length===1)return`Ogiltig inmatning: förväntat ${k(v.values[0])}`;return`Ogiltigt val: förväntade en av ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`För stor(t): förväntade ${v.origin??"värdet"} att ha ${U}${v.maximum.toString()} ${G.unit??"element"}`;return`För stor(t): förväntat ${v.origin??"värdet"} att ha ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${U}${v.minimum.toString()} ${G.unit}`;return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Ogiltig sträng: måste börja med "${U.prefix}"`;if(U.format==="ends_with")return`Ogiltig sträng: måste sluta med "${U.suffix}"`;if(U.format==="includes")return`Ogiltig sträng: måste innehålla "${U.includes}"`;if(U.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${U.pattern}"`;return`Ogiltig(t) ${g[U.format]??v.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${N(v.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${v.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${v.origin??"värdet"}`;default:return"Ogiltig input"}}};function hD(){return{localeError:fI()}}var AI=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function w(v){return $[v]??null}let g={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${v.expected}, பெறப்பட்டது ${D}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${U}, பெறப்பட்டது ${D}`}case"invalid_value":if(v.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(v.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${N(v.values,"|")} இல் ஒன்று`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${U}${v.maximum.toString()} ${G.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${U}${v.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${U}${v.minimum.toString()} ${G.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${U}${v.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`தவறான சரம்: "${U.prefix}" இல் தொடங்க வேண்டும்`;if(U.format==="ends_with")return`தவறான சரம்: "${U.suffix}" இல் முடிவடைய வேண்டும்`;if(U.format==="includes")return`தவறான சரம்: "${U.includes}" ஐ உள்ளடக்க வேண்டும்`;if(U.format==="regex")return`தவறான சரம்: ${U.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${g[U.format]??v.format}`}case"not_multiple_of":return`தவறான எண்: ${v.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${v.keys.length>1?"கள்":""}: ${N(v.keys,", ")}`;case"invalid_key":return`${v.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${v.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function lD(){return{localeError:AI()}}var SI=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function w(v){return $[v]??null}let g={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},_={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${v.expected} แต่ได้รับ ${D}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${U} แต่ได้รับ ${D}`}case"invalid_value":if(v.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(v.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"ไม่เกิน":"น้อยกว่า",G=w(v.origin);if(G)return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${U} ${v.maximum.toString()} ${G.unit??"รายการ"}`;return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${U} ${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?"อย่างน้อย":"มากกว่า",G=w(v.origin);if(G)return`น้อยกว่ากำหนด: ${v.origin} ควรมี${U} ${v.minimum.toString()} ${G.unit}`;return`น้อยกว่ากำหนด: ${v.origin} ควรมี${U} ${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${U.prefix}"`;if(U.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${U.suffix}"`;if(U.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${U.includes}" อยู่ในข้อความ`;if(U.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${U.pattern}`;return`รูปแบบไม่ถูกต้อง: ${g[U.format]??v.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${v.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${N(v.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${v.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${v.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function cD(){return{localeError:SI()}}var iI=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function w(v){return $[v]??null}let g={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Geçersiz değer: beklenen instanceof ${v.expected}, alınan ${D}`;return`Geçersiz değer: beklenen ${U}, alınan ${D}`}case"invalid_value":if(v.values.length===1)return`Geçersiz değer: beklenen ${k(v.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Çok büyük: beklenen ${v.origin??"değer"} ${U}${v.maximum.toString()} ${G.unit??"öğe"}`;return`Çok büyük: beklenen ${v.origin??"değer"} ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Çok küçük: beklenen ${v.origin} ${U}${v.minimum.toString()} ${G.unit}`;return`Çok küçük: beklenen ${v.origin} ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Geçersiz metin: "${U.prefix}" ile başlamalı`;if(U.format==="ends_with")return`Geçersiz metin: "${U.suffix}" ile bitmeli`;if(U.format==="includes")return`Geçersiz metin: "${U.includes}" içermeli`;if(U.format==="regex")return`Geçersiz metin: ${U.pattern} desenine uymalı`;return`Geçersiz ${g[U.format]??v.format}`}case"not_multiple_of":return`Geçersiz sayı: ${v.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${v.keys.length>1?"lar":""}: ${N(v.keys,", ")}`;case"invalid_key":return`${v.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${v.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function yD(){return{localeError:iI()}}var TI=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function w(v){return $[v]??null}let g={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},_={nan:"NaN",number:"число",array:"масив"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Неправильні вхідні дані: очікується instanceof ${v.expected}, отримано ${D}`;return`Неправильні вхідні дані: очікується ${U}, отримано ${D}`}case"invalid_value":if(v.values.length===1)return`Неправильні вхідні дані: очікується ${k(v.values[0])}`;return`Неправильна опція: очікується одне з ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Занадто велике: очікується, що ${v.origin??"значення"} ${G.verb} ${U}${v.maximum.toString()} ${G.unit??"елементів"}`;return`Занадто велике: очікується, що ${v.origin??"значення"} буде ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Занадто мале: очікується, що ${v.origin} ${G.verb} ${U}${v.minimum.toString()} ${G.unit}`;return`Занадто мале: очікується, що ${v.origin} буде ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Неправильний рядок: повинен починатися з "${U.prefix}"`;if(U.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${U.suffix}"`;if(U.format==="includes")return`Неправильний рядок: повинен містити "${U.includes}"`;if(U.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${U.pattern}`;return`Неправильний ${g[U.format]??v.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${v.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${v.keys.length>1?"і":""}: ${N(v.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${v.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${v.origin}`;default:return"Неправильні вхідні дані"}}};function _g(){return{localeError:TI()}}function mD(){return _g()}var RI=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function w(v){return $[v]??null}let g={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},_={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`غلط ان پٹ: instanceof ${v.expected} متوقع تھا، ${D} موصول ہوا`;return`غلط ان پٹ: ${U} متوقع تھا، ${D} موصول ہوا`}case"invalid_value":if(v.values.length===1)return`غلط ان پٹ: ${k(v.values[0])} متوقع تھا`;return`غلط آپشن: ${N(v.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`بہت بڑا: ${v.origin??"ویلیو"} کے ${U}${v.maximum.toString()} ${G.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${v.origin??"ویلیو"} کا ${U}${v.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`بہت چھوٹا: ${v.origin} کے ${U}${v.minimum.toString()} ${G.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${v.origin} کا ${U}${v.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`غلط سٹرنگ: "${U.prefix}" سے شروع ہونا چاہیے`;if(U.format==="ends_with")return`غلط سٹرنگ: "${U.suffix}" پر ختم ہونا چاہیے`;if(U.format==="includes")return`غلط سٹرنگ: "${U.includes}" شامل ہونا چاہیے`;if(U.format==="regex")return`غلط سٹرنگ: پیٹرن ${U.pattern} سے میچ ہونا چاہیے`;return`غلط ${g[U.format]??v.format}`}case"not_multiple_of":return`غلط نمبر: ${v.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${v.keys.length>1?"ز":""}: ${N(v.keys,"، ")}`;case"invalid_key":return`${v.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${v.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function tD(){return{localeError:RI()}}var CI=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function w(v){return $[v]??null}let g={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},_={nan:"NaN",number:"raqam",array:"massiv"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${v.expected}, qabul qilingan ${D}`;return`Noto‘g‘ri kirish: kutilgan ${U}, qabul qilingan ${D}`}case"invalid_value":if(v.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${k(v.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Juda katta: kutilgan ${v.origin??"qiymat"} ${U}${v.maximum.toString()} ${G.unit} ${G.verb}`;return`Juda katta: kutilgan ${v.origin??"qiymat"} ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Juda kichik: kutilgan ${v.origin} ${U}${v.minimum.toString()} ${G.unit} ${G.verb}`;return`Juda kichik: kutilgan ${v.origin} ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Noto‘g‘ri satr: "${U.prefix}" bilan boshlanishi kerak`;if(U.format==="ends_with")return`Noto‘g‘ri satr: "${U.suffix}" bilan tugashi kerak`;if(U.format==="includes")return`Noto‘g‘ri satr: "${U.includes}" ni o‘z ichiga olishi kerak`;if(U.format==="regex")return`Noto‘g‘ri satr: ${U.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${g[U.format]??v.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${v.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${v.keys.length>1?"lar":""}: ${N(v.keys,", ")}`;case"invalid_key":return`${v.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${v.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function dD(){return{localeError:CI()}}var uI=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function w(v){return $[v]??null}let g={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},_={nan:"NaN",number:"số",array:"mảng"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${v.expected}, nhận được ${D}`;return`Đầu vào không hợp lệ: mong đợi ${U}, nhận được ${D}`}case"invalid_value":if(v.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(v.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${G.verb} ${U}${v.maximum.toString()} ${G.unit??"phần tử"}`;return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Quá nhỏ: mong đợi ${v.origin} ${G.verb} ${U}${v.minimum.toString()} ${G.unit}`;return`Quá nhỏ: mong đợi ${v.origin} ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${U.prefix}"`;if(U.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${U.suffix}"`;if(U.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${U.includes}"`;if(U.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${U.pattern}`;return`${g[U.format]??v.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${v.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${N(v.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${v.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${v.origin}`;default:return"Đầu vào không hợp lệ"}}};function oD(){return{localeError:uI()}}var EI=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function w(v){return $[v]??null}let g={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},_={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`无效输入:期望 instanceof ${v.expected},实际接收 ${D}`;return`无效输入:期望 ${U},实际接收 ${D}`}case"invalid_value":if(v.values.length===1)return`无效输入:期望 ${k(v.values[0])}`;return`无效选项:期望以下之一 ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`数值过大:期望 ${v.origin??"值"} ${U}${v.maximum.toString()} ${G.unit??"个元素"}`;return`数值过大:期望 ${v.origin??"值"} ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`数值过小:期望 ${v.origin} ${U}${v.minimum.toString()} ${G.unit}`;return`数值过小:期望 ${v.origin} ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`无效字符串:必须以 "${U.prefix}" 开头`;if(U.format==="ends_with")return`无效字符串:必须以 "${U.suffix}" 结尾`;if(U.format==="includes")return`无效字符串:必须包含 "${U.includes}"`;if(U.format==="regex")return`无效字符串:必须满足正则表达式 ${U.pattern}`;return`无效${g[U.format]??v.format}`}case"not_multiple_of":return`无效数字:必须是 ${v.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${N(v.keys,", ")}`;case"invalid_key":return`${v.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${v.origin} 中包含无效值(value)`;default:return"无效输入"}}};function rD(){return{localeError:EI()}}var ZI=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function w(v){return $[v]??null}let g={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},_={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`無效的輸入值:預期為 instanceof ${v.expected},但收到 ${D}`;return`無效的輸入值:預期為 ${U},但收到 ${D}`}case"invalid_value":if(v.values.length===1)return`無效的輸入值:預期為 ${k(v.values[0])}`;return`無效的選項:預期為以下其中之一 ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`數值過大:預期 ${v.origin??"值"} 應為 ${U}${v.maximum.toString()} ${G.unit??"個元素"}`;return`數值過大:預期 ${v.origin??"值"} 應為 ${U}${v.maximum.toString()}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`數值過小:預期 ${v.origin} 應為 ${U}${v.minimum.toString()} ${G.unit}`;return`數值過小:預期 ${v.origin} 應為 ${U}${v.minimum.toString()}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`無效的字串:必須以 "${U.prefix}" 開頭`;if(U.format==="ends_with")return`無效的字串:必須以 "${U.suffix}" 結尾`;if(U.format==="includes")return`無效的字串:必須包含 "${U.includes}"`;if(U.format==="regex")return`無效的字串:必須符合格式 ${U.pattern}`;return`無效的 ${g[U.format]??v.format}`}case"not_multiple_of":return`無效的數字:必須為 ${v.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${v.keys.length>1?"們":""}:${N(v.keys,"、")}`;case"invalid_key":return`${v.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${v.origin} 中有無效的值`;default:return"無效的輸入值"}}};function pD(){return{localeError:ZI()}}var xI=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function w(v){return $[v]??null}let g={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},_={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(v)=>{switch(v.code){case"invalid_type":{let U=_[v.expected]??v.expected,G=M(v.input),D=_[G]??G;if(/^[A-Z]/.test(v.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${v.expected}, àmọ̀ a rí ${D}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${U}, àmọ̀ a rí ${D}`}case"invalid_value":if(v.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(v.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${N(v.values,"|")}`;case"too_big":{let U=v.inclusive?"<=":"<",G=w(v.origin);if(G)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${v.origin??"iye"} ${G.verb} ${U}${v.maximum} ${G.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${U}${v.maximum}`}case"too_small":{let U=v.inclusive?">=":">",G=w(v.origin);if(G)return`Kéré ju: a ní láti jẹ́ pé ${v.origin} ${G.verb} ${U}${v.minimum} ${G.unit}`;return`Kéré ju: a ní láti jẹ́ ${U}${v.minimum}`}case"invalid_format":{let U=v;if(U.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${U.prefix}"`;if(U.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${U.suffix}"`;if(U.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${U.includes}"`;if(U.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${U.pattern}`;return`Aṣìṣe: ${g[U.format]??v.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${v.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${N(v.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${v.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${v.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function eD(){return{localeError:xI()}}var T8,Ug=Symbol("ZodOutput"),bg=Symbol("ZodInput");class aD{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...w){let g=w[0];if(this._map.set($,g),g&&typeof g==="object"&&"id"in g)this._idmap.set(g.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let w=this._map.get($);if(w&&typeof w==="object"&&"id"in w)this._idmap.delete(w.id);return this._map.delete($),this}get($){let w=$._zod.parent;if(w){let g={...this.get(w)??{}};delete g.id;let _={...g,...this._map.get($)};return Object.keys(_).length?_:void 0}return this._map.get($)}has($){return this._map.has($)}}function F4(){return new aD}(T8=globalThis).__zod_globalRegistry??(T8.__zod_globalRegistry=F4());var I$=globalThis.__zod_globalRegistry;function sD($,w){return new $({type:"string",...A(w)})}function $J($,w){return new $({type:"string",coerce:!0,...A(w)})}function nU($,w){return new $({type:"string",format:"email",check:"string_format",abort:!1,...A(w)})}function Gg($,w){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...A(w)})}function MU($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...A(w)})}function zU($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(w)})}function fU($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(w)})}function AU($,w){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(w)})}function Dg($,w){return new $({type:"string",format:"url",check:"string_format",abort:!1,...A(w)})}function SU($,w){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...A(w)})}function iU($,w){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(w)})}function TU($,w){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...A(w)})}function RU($,w){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(w)})}function CU($,w){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...A(w)})}function uU($,w){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...A(w)})}function EU($,w){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(w)})}function ZU($,w){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(w)})}function xU($,w){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(w)})}function wJ($,w){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...A(w)})}function hU($,w){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(w)})}function lU($,w){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(w)})}function cU($,w){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...A(w)})}function yU($,w){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...A(w)})}function mU($,w){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...A(w)})}function tU($,w){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...A(w)})}var Jg={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function vJ($,w){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(w)})}function gJ($,w){return new $({type:"string",format:"date",check:"string_format",...A(w)})}function _J($,w){return new $({type:"string",format:"time",check:"string_format",precision:null,...A(w)})}function UJ($,w){return new $({type:"string",format:"duration",check:"string_format",...A(w)})}function bJ($,w){return new $({type:"number",checks:[],...A(w)})}function GJ($,w){return new $({type:"number",coerce:!0,checks:[],...A(w)})}function DJ($,w){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...A(w)})}function JJ($,w){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...A(w)})}function XJ($,w){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...A(w)})}function QJ($,w){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...A(w)})}function YJ($,w){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...A(w)})}function WJ($,w){return new $({type:"boolean",...A(w)})}function HJ($,w){return new $({type:"boolean",coerce:!0,...A(w)})}function qJ($,w){return new $({type:"bigint",...A(w)})}function BJ($,w){return new $({type:"bigint",coerce:!0,...A(w)})}function IJ($,w){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...A(w)})}function LJ($,w){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...A(w)})}function VJ($,w){return new $({type:"symbol",...A(w)})}function FJ($,w){return new $({type:"undefined",...A(w)})}function jJ($,w){return new $({type:"null",...A(w)})}function KJ($){return new $({type:"any"})}function OJ($){return new $({type:"unknown"})}function NJ($,w){return new $({type:"never",...A(w)})}function PJ($,w){return new $({type:"void",...A(w)})}function kJ($,w){return new $({type:"date",...A(w)})}function nJ($,w){return new $({type:"date",coerce:!0,...A(w)})}function MJ($,w){return new $({type:"nan",...A(w)})}function l$($,w){return new qU({check:"less_than",...A(w),value:$,inclusive:!1})}function n$($,w){return new qU({check:"less_than",...A(w),value:$,inclusive:!0})}function c$($,w){return new BU({check:"greater_than",...A(w),value:$,inclusive:!1})}function j$($,w){return new BU({check:"greater_than",...A(w),value:$,inclusive:!0})}function j4($){return c$(0,$)}function K4($){return l$(0,$)}function O4($){return n$(0,$)}function N4($){return j$(0,$)}function Ww($,w){return new A2({check:"multiple_of",...A(w),value:$})}function Hw($,w){return new T2({check:"max_size",...A(w),maximum:$})}function y$($,w){return new R2({check:"min_size",...A(w),minimum:$})}function Pw($,w){return new C2({check:"size_equals",...A(w),size:$})}function kw($,w){return new u2({check:"max_length",...A(w),maximum:$})}function e$($,w){return new E2({check:"min_length",...A(w),minimum:$})}function nw($,w){return new Z2({check:"length_equals",...A(w),length:$})}function ow($,w){return new x2({check:"string_format",format:"regex",...A(w),pattern:$})}function rw($){return new h2({check:"string_format",format:"lowercase",...A($)})}function pw($){return new l2({check:"string_format",format:"uppercase",...A($)})}function ew($,w){return new c2({check:"string_format",format:"includes",...A(w),includes:$})}function aw($,w){return new y2({check:"string_format",format:"starts_with",...A(w),prefix:$})}function sw($,w){return new m2({check:"string_format",format:"ends_with",...A(w),suffix:$})}function P4($,w,g){return new t2({check:"property",property:$,schema:w,...A(g)})}function $v($,w){return new d2({check:"mime_type",mime:$,...A(w)})}function E$($){return new o2({check:"overwrite",tx:$})}function wv($){return E$((w)=>w.normalize($))}function vv(){return E$(($)=>$.trim())}function gv(){return E$(($)=>$.toLowerCase())}function _v(){return E$(($)=>$.toUpperCase())}function Uv(){return E$(($)=>o0($))}function zJ($,w,g){return new $({type:"array",element:w,...A(g)})}function lI($,w,g){return new $({type:"union",options:w,...A(g)})}function cI($,w,g){return new $({type:"union",options:w,inclusive:!1,...A(g)})}function yI($,w,g,_){return new $({type:"union",options:g,discriminator:w,...A(_)})}function mI($,w,g){return new $({type:"intersection",left:w,right:g})}function tI($,w,g,_){let v=g instanceof t;return new $({type:"tuple",items:w,rest:v?g:null,...A(v?_:g)})}function dI($,w,g,_){return new $({type:"record",keyType:w,valueType:g,...A(_)})}function oI($,w,g,_){return new $({type:"map",keyType:w,valueType:g,...A(_)})}function rI($,w,g){return new $({type:"set",valueType:w,...A(g)})}function pI($,w,g){let _=Array.isArray(w)?Object.fromEntries(w.map((v)=>[v,v])):w;return new $({type:"enum",entries:_,...A(g)})}function eI($,w,g){return new $({type:"enum",entries:w,...A(g)})}function aI($,w,g){return new $({type:"literal",values:Array.isArray(w)?w:[w],...A(g)})}function fJ($,w){return new $({type:"file",...A(w)})}function sI($,w){return new $({type:"transform",transform:w})}function $L($,w){return new $({type:"optional",innerType:w})}function wL($,w){return new $({type:"nullable",innerType:w})}function vL($,w,g){return new $({type:"default",innerType:w,get defaultValue(){return typeof g==="function"?g():p0(g)}})}function gL($,w,g){return new $({type:"nonoptional",innerType:w,...A(g)})}function _L($,w){return new $({type:"success",innerType:w})}function UL($,w,g){return new $({type:"catch",innerType:w,catchValue:typeof g==="function"?g:()=>g})}function bL($,w,g){return new $({type:"pipe",in:w,out:g})}function GL($,w){return new $({type:"readonly",innerType:w})}function DL($,w,g){return new $({type:"template_literal",parts:w,...A(g)})}function JL($,w){return new $({type:"lazy",getter:w})}function XL($,w){return new $({type:"promise",innerType:w})}function AJ($,w,g){let _=A(g);return _.abort??(_.abort=!0),new $({type:"custom",check:"custom",fn:w,..._})}function SJ($,w,g){return new $({type:"custom",check:"custom",fn:w,...A(g)})}function iJ($){let w=R8((g)=>{return g.addIssue=(_)=>{if(typeof _==="string")g.issues.push(W4(_,g.value,w._zod.def));else{let v=_;if(v.fatal)v.continue=!1;v.code??(v.code="custom"),v.input??(v.input=g.value),v.inst??(v.inst=w),v.continue??(v.continue=!w._zod.def.abort),g.issues.push(W4(v))}},$(g.value,g)});return w}function R8($,w){let g=new D$({check:"custom",...A(w)});return g._zod.check=$,g}function TJ($){let w=new D$({check:"describe"});return w._zod.onattach=[(g)=>{let _=I$.get(g)??{};I$.add(g,{..._,description:$})}],w._zod.check=()=>{},w}function RJ($){let w=new D$({check:"meta"});return w._zod.onattach=[(g)=>{let _=I$.get(g)??{};I$.add(g,{..._,...$})}],w._zod.check=()=>{},w}function CJ($,w){let g=A(w),_=g.truthy??["true","1","yes","on","y","enabled"],v=g.falsy??["false","0","no","off","n","disabled"];if(g.case!=="sensitive")_=_.map((L)=>typeof L==="string"?L.toLowerCase():L),v=v.map((L)=>typeof L==="string"?L.toLowerCase():L);let U=new Set(_),G=new Set(v),D=$.Codec??$g,J=$.Boolean??a6,Q=new($.String??Tv)({type:"string",error:g.error}),Y=new J({type:"boolean",error:g.error}),q=new D({type:"pipe",in:Q,out:Y,transform:(L,F)=>{let H=L;if(g.case!=="sensitive")H=H.toLowerCase();if(U.has(H))return!0;else if(G.has(H))return!1;else return F.issues.push({code:"invalid_value",expected:"stringbool",values:[...U,...G],input:F.value,inst:q,continue:!1}),{}},reverseTransform:(L,F)=>{if(L===!0)return _[0]||"true";else return v[0]||"false"},error:g.error});return q}function k4($,w,g,_={}){let v=A(_),U={...A(_),check:"string_format",type:"string",format:w,fn:typeof g==="function"?g:(D)=>g.test(D),...v};if(g instanceof RegExp)U.pattern=g;return new $(U)}function bv($){let w=$?.target??"draft-2020-12";if(w==="draft-4")w="draft-04";if(w==="draft-7")w="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??I$,target:w,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function _$($,w,g={path:[],schemaPath:[]}){var _;let v=$._zod.def,U=w.seen.get($);if(U){if(U.count++,g.schemaPath.includes($))U.cycle=g.path;return U.schema}let G={schema:{},count:1,cycle:void 0,path:g.path};w.seen.set($,G);let D=$._zod.toJSONSchema?.();if(D)G.schema=D;else{let Q={...g,schemaPath:[...g.schemaPath,$],path:g.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(w,G.schema,Q);else{let q=G.schema,L=w.processors[v.type];if(!L)throw Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);L($,w,q,Q)}let Y=$._zod.parent;if(Y){if(!G.ref)G.ref=Y;_$(Y,w,Q),w.seen.get(Y).isParent=!0}}let J=w.metadataRegistry.get($);if(J)Object.assign(G.schema,J);if(w.io==="input"&&M$($))delete G.schema.examples,delete G.schema.default;if(w.io==="input"&&G.schema._prefault)(_=G.schema).default??(_.default=G.schema._prefault);return delete G.schema._prefault,w.seen.get($).schema}function Gv($,w){let g=$.seen.get(w);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let _=new Map;for(let G of $.seen.entries()){let D=$.metadataRegistry.get(G[0])?.id;if(D){let J=_.get(D);if(J&&J!==G[0])throw Error(`Duplicate schema id "${D}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);_.set(D,G[0])}}let v=(G)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let Y=$.external.registry.get(G[0])?.id,q=$.external.uri??((F)=>F);if(Y)return{ref:q(Y)};let L=G[1].defId??G[1].schema.id??`schema${$.counter++}`;return G[1].defId=L,{defId:L,ref:`${q("__shared")}#/${D}/${L}`}}if(G[1]===g)return{ref:"#"};let X=`${"#"}/${D}/`,Q=G[1].schema.id??`__schema${$.counter++}`;return{defId:Q,ref:X+Q}},U=(G)=>{if(G[1].schema.$ref)return;let D=G[1],{ref:J,defId:X}=v(G);if(D.def={...D.schema},X)D.defId=X;let Q=D.schema;for(let Y in Q)delete Q[Y];Q.$ref=J};if($.cycles==="throw")for(let G of $.seen.entries()){let D=G[1];if(D.cycle)throw Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
|
|
41
177
|
|
|
42
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let _ of n.seen.entries()){let U=_[1];if(i===_[0]){w(_);continue}if(n.external){let l=n.external.registry.get(_[0])?.id;if(i!==_[0]&&l){w(_);continue}}if(n.metadataRegistry.get(_[0])?.id){w(_);continue}if(U.cycle){w(_);continue}if(U.count>1){if(n.reused==="ref"){w(_);continue}}}}function Av(n,i){let $=n.seen.get(i);if(!$)throw Error("Unprocessed schema. This is a bug in Zod.");let g=(_)=>{let U=n.seen.get(_);if(U.ref===null)return;let k=U.def??U.schema,l={...k},J=U.ref;if(U.ref=null,J){g(J);let j=n.seen.get(J),u=j.schema;if(u.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"))k.allOf=k.allOf??[],k.allOf.push(u);else Object.assign(k,u);if(Object.assign(k,l),_._zod.parent===J)for(let Y in k){if(Y==="$ref"||Y==="allOf")continue;if(!(Y in l))delete k[Y]}if(u.$ref)for(let Y in k){if(Y==="$ref"||Y==="allOf")continue;if(Y in j.def&&JSON.stringify(k[Y])===JSON.stringify(j.def[Y]))delete k[Y]}}let Q=_._zod.parent;if(Q&&Q!==J){g(Q);let j=n.seen.get(Q);if(j?.schema.$ref){if(k.$ref=j.schema.$ref,j.def)for(let u in k){if(u==="$ref"||u==="allOf")continue;if(u in j.def&&JSON.stringify(k[u])===JSON.stringify(j.def[u]))delete k[u]}}}n.override({zodSchema:_,jsonSchema:k,path:U.path??[]})};for(let _ of[...n.seen.entries()].reverse())g(_[0]);let v={};if(n.target==="draft-2020-12")v.$schema="https://json-schema.org/draft/2020-12/schema";else if(n.target==="draft-07")v.$schema="http://json-schema.org/draft-07/schema#";else if(n.target==="draft-04")v.$schema="http://json-schema.org/draft-04/schema#";else if(n.target==="openapi-3.0");if(n.external?.uri){let _=n.external.registry.get(i)?.id;if(!_)throw Error("Schema is missing an `id` property");v.$id=n.external.uri(_)}Object.assign(v,$.def??$.schema);let w=n.external?.defs??{};for(let _ of n.seen.entries()){let U=_[1];if(U.def&&U.defId)w[U.defId]=U.def}if(n.external);else if(Object.keys(w).length>0)if(n.target==="draft-2020-12")v.$defs=w;else v.definitions=w;try{let _=JSON.parse(JSON.stringify(v));return Object.defineProperty(_,"~standard",{value:{...i["~standard"],jsonSchema:{input:v$(i,"input",n.processors),output:v$(i,"output",n.processors)}},enumerable:!1,writable:!1}),_}catch(_){throw Error("Error converting schema to JSON.")}}function Gn(n,i){let $=i??{seen:new Set};if($.seen.has(n))return!1;$.seen.add(n);let g=n._zod.def;if(g.type==="transform")return!0;if(g.type==="array")return Gn(g.element,$);if(g.type==="set")return Gn(g.valueType,$);if(g.type==="lazy")return Gn(g.getter(),$);if(g.type==="promise"||g.type==="optional"||g.type==="nonoptional"||g.type==="nullable"||g.type==="readonly"||g.type==="default"||g.type==="prefault")return Gn(g.innerType,$);if(g.type==="intersection")return Gn(g.left,$)||Gn(g.right,$);if(g.type==="record"||g.type==="map")return Gn(g.keyType,$)||Gn(g.valueType,$);if(g.type==="pipe")return Gn(g.in,$)||Gn(g.out,$);if(g.type==="object"){for(let v in g.shape)if(Gn(g.shape[v],$))return!0;return!1}if(g.type==="union"){for(let v of g.options)if(Gn(v,$))return!0;return!1}if(g.type==="tuple"){for(let v of g.items)if(Gn(v,$))return!0;if(g.rest&&Gn(g.rest,$))return!0;return!1}return!1}var Bk=(n,i={})=>($)=>{let g=Mv({...$,processors:i});return y(n,g),Rv(g,n),Av(g,n)},v$=(n,i,$={})=>(g)=>{let{libraryOptions:v,target:w}=g??{},_=Mv({...v??{},target:w,io:i,processors:$});return y(n,_),Rv(_,n),Av(_,n)};var p9={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Fk=(n,i,$,g)=>{let v=$;v.type="string";let{minimum:w,maximum:_,format:U,patterns:k,contentEncoding:l}=n._zod.bag;if(typeof w==="number")v.minLength=w;if(typeof _==="number")v.maxLength=_;if(U){if(v.format=p9[U]??U,v.format==="")delete v.format;if(U==="time")delete v.format}if(l)v.contentEncoding=l;if(k&&k.size>0){let J=[...k];if(J.length===1)v.pattern=J[0].source;else if(J.length>1)v.allOf=[...J.map((Q)=>({...i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},Nk=(n,i,$,g)=>{let v=$,{minimum:w,maximum:_,format:U,multipleOf:k,exclusiveMaximum:l,exclusiveMinimum:J}=n._zod.bag;if(typeof U==="string"&&U.includes("int"))v.type="integer";else v.type="number";if(typeof J==="number")if(i.target==="draft-04"||i.target==="openapi-3.0")v.minimum=J,v.exclusiveMinimum=!0;else v.exclusiveMinimum=J;if(typeof w==="number"){if(v.minimum=w,typeof J==="number"&&i.target!=="draft-04")if(J>=w)delete v.minimum;else delete v.exclusiveMinimum}if(typeof l==="number")if(i.target==="draft-04"||i.target==="openapi-3.0")v.maximum=l,v.exclusiveMaximum=!0;else v.exclusiveMaximum=l;if(typeof _==="number"){if(v.maximum=_,typeof l==="number"&&i.target!=="draft-04")if(l<=_)delete v.maximum;else delete v.exclusiveMaximum}if(typeof k==="number")v.multipleOf=k},ck=(n,i,$,g)=>{$.type="boolean"},Pk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Sk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},zk=(n,i,$,g)=>{if(i.target==="openapi-3.0")$.type="string",$.nullable=!0,$.enum=[null];else $.type="null"},Mk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Rk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Ak=(n,i,$,g)=>{$.not={}},xk=(n,i,$,g)=>{},hk=(n,i,$,g)=>{},Ck=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Ek=(n,i,$,g)=>{let v=n._zod.def,w=Ai(v.entries);if(w.every((_)=>typeof _==="number"))$.type="number";if(w.every((_)=>typeof _==="string"))$.type="string";$.enum=w},ok=(n,i,$,g)=>{let v=n._zod.def,w=[];for(let _ of v.values)if(_===void 0){if(i.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof _==="bigint")if(i.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else w.push(Number(_));else w.push(_);if(w.length===0);else if(w.length===1){let _=w[0];if($.type=_===null?"null":typeof _,i.target==="draft-04"||i.target==="openapi-3.0")$.enum=[_];else $.const=_}else{if(w.every((_)=>typeof _==="number"))$.type="number";if(w.every((_)=>typeof _==="string"))$.type="string";if(w.every((_)=>typeof _==="boolean"))$.type="boolean";if(w.every((_)=>_===null))$.type="null";$.enum=w}},Tk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},Zk=(n,i,$,g)=>{let v=$,w=n._zod.pattern;if(!w)throw Error("Pattern not found in template literal");v.type="string",v.pattern=w.source},rk=(n,i,$,g)=>{let v=$,w={type:"string",format:"binary",contentEncoding:"binary"},{minimum:_,maximum:U,mime:k}=n._zod.bag;if(_!==void 0)w.minLength=_;if(U!==void 0)w.maxLength=U;if(k)if(k.length===1)w.contentMediaType=k[0],Object.assign(v,w);else Object.assign(v,w),v.anyOf=k.map((l)=>({contentMediaType:l}));else Object.assign(v,w)},mk=(n,i,$,g)=>{$.type="boolean"},yk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},dk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},ek=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},pk=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},ak=(n,i,$,g)=>{if(i.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},sk=(n,i,$,g)=>{let v=$,w=n._zod.def,{minimum:_,maximum:U}=n._zod.bag;if(typeof _==="number")v.minItems=_;if(typeof U==="number")v.maxItems=U;v.type="array",v.items=y(w.element,i,{...g,path:[...g.path,"items"]})},n0=(n,i,$,g)=>{let v=$,w=n._zod.def;v.type="object",v.properties={};let _=w.shape;for(let l in _)v.properties[l]=y(_[l],i,{...g,path:[...g.path,"properties",l]});let U=new Set(Object.keys(_)),k=new Set([...U].filter((l)=>{let J=w.shape[l]._zod;if(i.io==="input")return J.optin===void 0;else return J.optout===void 0}));if(k.size>0)v.required=Array.from(k);if(w.catchall?._zod.def.type==="never")v.additionalProperties=!1;else if(!w.catchall){if(i.io==="output")v.additionalProperties=!1}else if(w.catchall)v.additionalProperties=y(w.catchall,i,{...g,path:[...g.path,"additionalProperties"]})},R4=(n,i,$,g)=>{let v=n._zod.def,w=v.inclusive===!1,_=v.options.map((U,k)=>y(U,i,{...g,path:[...g.path,w?"oneOf":"anyOf",k]}));if(w)$.oneOf=_;else $.anyOf=_},v0=(n,i,$,g)=>{let v=n._zod.def,w=y(v.left,i,{...g,path:[...g.path,"allOf",0]}),_=y(v.right,i,{...g,path:[...g.path,"allOf",1]}),U=(l)=>("allOf"in l)&&Object.keys(l).length===1,k=[...U(w)?w.allOf:[w],...U(_)?_.allOf:[_]];$.allOf=k},i0=(n,i,$,g)=>{let v=$,w=n._zod.def;v.type="array";let _=i.target==="draft-2020-12"?"prefixItems":"items",U=i.target==="draft-2020-12"?"items":i.target==="openapi-3.0"?"items":"additionalItems",k=w.items.map((j,u)=>y(j,i,{...g,path:[...g.path,_,u]})),l=w.rest?y(w.rest,i,{...g,path:[...g.path,U,...i.target==="openapi-3.0"?[w.items.length]:[]]}):null;if(i.target==="draft-2020-12"){if(v.prefixItems=k,l)v.items=l}else if(i.target==="openapi-3.0"){if(v.items={anyOf:k},l)v.items.anyOf.push(l);if(v.minItems=k.length,!l)v.maxItems=k.length}else if(v.items=k,l)v.additionalItems=l;let{minimum:J,maximum:Q}=n._zod.bag;if(typeof J==="number")v.minItems=J;if(typeof Q==="number")v.maxItems=Q},$0=(n,i,$,g)=>{let v=$,w=n._zod.def;if(v.type="object",i.target==="draft-07"||i.target==="draft-2020-12")v.propertyNames=y(w.keyType,i,{...g,path:[...g.path,"propertyNames"]});v.additionalProperties=y(w.valueType,i,{...g,path:[...g.path,"additionalProperties"]});let _=w.keyType._zod.def;if(_.type==="enum"){let k=Ai(_.entries).filter((l)=>typeof l==="string"||typeof l==="number");if(k.length>0)v.required=k}},g0=(n,i,$,g)=>{let v=n._zod.def,w=y(v.innerType,i,g),_=i.seen.get(n);if(i.target==="openapi-3.0")_.ref=v.innerType,$.nullable=!0;else $.anyOf=[w,{type:"null"}]},w0=(n,i,$,g)=>{let v=n._zod.def;y(v.innerType,i,g);let w=i.seen.get(n);w.ref=v.innerType},_0=(n,i,$,g)=>{let v=n._zod.def;y(v.innerType,i,g);let w=i.seen.get(n);w.ref=v.innerType,$.default=JSON.parse(JSON.stringify(v.defaultValue))},b0=(n,i,$,g)=>{let v=n._zod.def;y(v.innerType,i,g);let w=i.seen.get(n);if(w.ref=v.innerType,i.io==="input")$._prefault=JSON.parse(JSON.stringify(v.defaultValue))},U0=(n,i,$,g)=>{let v=n._zod.def;y(v.innerType,i,g);let w=i.seen.get(n);w.ref=v.innerType;let _;try{_=v.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}$.default=_},k0=(n,i,$,g)=>{let v=n._zod.def,w=i.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;y(w,i,g);let _=i.seen.get(n);_.ref=w},l0=(n,i,$,g)=>{let v=n._zod.def;y(v.innerType,i,g);let w=i.seen.get(n);w.ref=v.innerType,$.readOnly=!0},D0=(n,i,$,g)=>{let v=n._zod.def;y(v.innerType,i,g);let w=i.seen.get(n);w.ref=v.innerType},A4=(n,i,$,g)=>{let v=n._zod.def;y(v.innerType,i,g);let w=i.seen.get(n);w.ref=v.innerType},J0=(n,i,$,g)=>{let v=n._zod.innerType;y(v,i,g);let w=i.seen.get(n);w.ref=v},M4={string:Fk,number:Nk,boolean:ck,bigint:Pk,symbol:Sk,null:zk,undefined:Mk,void:Rk,never:Ak,any:xk,unknown:hk,date:Ck,enum:Ek,literal:ok,nan:Tk,template_literal:Zk,file:rk,success:mk,custom:yk,function:dk,transform:ek,map:pk,set:ak,array:sk,object:n0,union:R4,intersection:v0,tuple:i0,record:$0,nullable:g0,nonoptional:w0,default:_0,prefault:b0,catch:U0,pipe:k0,readonly:l0,promise:D0,optional:A4,lazy:J0};function i$(n,i){if("_idmap"in n){let g=n,v=Mv({...i,processors:M4}),w={};for(let k of g._idmap.entries()){let[l,J]=k;y(J,v)}let _={},U={registry:g,uri:i?.uri,defs:w};v.external=U;for(let k of g._idmap.entries()){let[l,J]=k;Rv(v,J),_[l]=Av(v,J)}if(Object.keys(w).length>0){let k=v.target==="draft-2020-12"?"$defs":"definitions";_.__shared={[k]:w}}return{schemas:_}}let $=Mv({...i,processors:M4});return y(n,$),Rv($,n),Av($,n)}class X0{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(n){this.ctx.counter=n}get seen(){return this.ctx.seen}constructor(n){let i=n?.target??"draft-2020-12";if(i==="draft-4")i="draft-04";if(i==="draft-7")i="draft-07";this.ctx=Mv({processors:M4,target:i,...n?.metadata&&{metadata:n.metadata},...n?.unrepresentable&&{unrepresentable:n.unrepresentable},...n?.override&&{override:n.override},...n?.io&&{io:n.io}})}process(n,i={path:[],schemaPath:[]}){return y(n,this.ctx,i)}emit(n,i){if(i){if(i.cycles)this.ctx.cycles=i.cycles;if(i.reused)this.ctx.reused=i.reused;if(i.external)this.ctx.external=i.external}Rv(this.ctx,n);let $=Av(this.ctx,n),{"~standard":g,...v}=$;return v}}var ll={};var Vg={};Nn(Vg,{xor:()=>B6,xid:()=>s4,void:()=>f6,uuidv7:()=>Z4,uuidv6:()=>T4,uuidv4:()=>o4,uuid:()=>E4,url:()=>r4,unknown:()=>tn,union:()=>K$,undefined:()=>H6,ulid:()=>a4,uint64:()=>j6,uint32:()=>W6,tuple:()=>pg,transform:()=>B$,templateLiteral:()=>h6,symbol:()=>u6,superRefine:()=>Vw,success:()=>R6,stringbool:()=>y6,stringFormat:()=>l6,string:()=>o,strictObject:()=>K6,set:()=>P6,refine:()=>Hw,record:()=>pn,readonly:()=>Qw,promise:()=>C6,preprocess:()=>e6,prefault:()=>kw,pipe:()=>Di,partialRecord:()=>F6,optional:()=>ki,object:()=>$n,number:()=>Tv,nullish:()=>M6,nullable:()=>li,null:()=>hg,nonoptional:()=>lw,never:()=>L$,nativeEnum:()=>S6,nanoid:()=>d4,nan:()=>A6,meta:()=>r6,map:()=>c6,mac:()=>i6,looseRecord:()=>N6,looseObject:()=>O6,literal:()=>Cn,lazy:()=>Iw,ksuid:()=>n6,keyof:()=>L6,jwt:()=>k6,json:()=>d6,ipv6:()=>$6,ipv4:()=>v6,intersection:()=>dg,int64:()=>I6,int32:()=>Q6,int:()=>b$,instanceof:()=>m6,httpUrl:()=>m4,hostname:()=>D6,hex:()=>J6,hash:()=>X6,guid:()=>C4,function:()=>E6,float64:()=>t6,float32:()=>G6,file:()=>z6,exactOptional:()=>gw,enum:()=>O$,emoji:()=>y4,email:()=>h4,e164:()=>U6,discriminatedUnion:()=>Qi,describe:()=>Z6,date:()=>q6,custom:()=>T6,cuid2:()=>p4,cuid:()=>e4,codec:()=>x6,cidrv6:()=>w6,cidrv4:()=>g6,check:()=>o6,catch:()=>Xw,boolean:()=>en,bigint:()=>Y6,base64url:()=>b6,base64:()=>_6,array:()=>hn,any:()=>V6,_function:()=>E6,_default:()=>bw,_ZodString:()=>U$,ZodXor:()=>rg,ZodXID:()=>t$,ZodVoid:()=>Tg,ZodUnknown:()=>Eg,ZodUnion:()=>ti,ZodUndefined:()=>Ag,ZodUUID:()=>On,ZodURL:()=>Ji,ZodULID:()=>G$,ZodType:()=>R,ZodTuple:()=>eg,ZodTransform:()=>iw,ZodTemplateLiteral:()=>Ww,ZodSymbol:()=>Rg,ZodSuccess:()=>Dw,ZodStringFormat:()=>m,ZodString:()=>Cv,ZodSet:()=>sg,ZodRecord:()=>Wi,ZodReadonly:()=>tw,ZodPromise:()=>jw,ZodPrefault:()=>Uw,ZodPipe:()=>c$,ZodOptional:()=>F$,ZodObject:()=>Gi,ZodNumberFormat:()=>lv,ZodNumber:()=>ov,ZodNullable:()=>ww,ZodNull:()=>xg,ZodNonOptional:()=>N$,ZodNever:()=>og,ZodNanoID:()=>D$,ZodNaN:()=>Gw,ZodMap:()=>ag,ZodMAC:()=>Mg,ZodLiteral:()=>nw,ZodLazy:()=>Yw,ZodKSUID:()=>Q$,ZodJWT:()=>f$,ZodIntersection:()=>yg,ZodIPv6:()=>Y$,ZodIPv4:()=>W$,ZodGUID:()=>Ui,ZodFunction:()=>uw,ZodFile:()=>vw,ZodExactOptional:()=>$w,ZodEnum:()=>hv,ZodEmoji:()=>l$,ZodEmail:()=>k$,ZodE164:()=>V$,ZodDiscriminatedUnion:()=>mg,ZodDefault:()=>_w,ZodDate:()=>Xi,ZodCustomStringFormat:()=>Ev,ZodCustom:()=>Yi,ZodCodec:()=>P$,ZodCatch:()=>Jw,ZodCUID2:()=>X$,ZodCUID:()=>J$,ZodCIDRv6:()=>j$,ZodCIDRv4:()=>I$,ZodBoolean:()=>Zv,ZodBigIntFormat:()=>q$,ZodBigInt:()=>rv,ZodBase64URL:()=>H$,ZodBase64:()=>u$,ZodArray:()=>Zg,ZodAny:()=>Cg});var x4={};Nn(x4,{uppercase:()=>Lv,trim:()=>cv,toUpperCase:()=>Sv,toLowerCase:()=>Pv,startsWith:()=>Ov,slugify:()=>zv,size:()=>bv,regex:()=>fv,property:()=>si,positive:()=>di,overwrite:()=>Hn,normalize:()=>Nv,nonpositive:()=>pi,nonnegative:()=>ai,negative:()=>ei,multipleOf:()=>yn,minSize:()=>Kn,minLength:()=>An,mime:()=>Fv,maxSize:()=>dn,maxLength:()=>Uv,lte:()=>Xn,lt:()=>qn,lowercase:()=>qv,length:()=>kv,includes:()=>Kv,gte:()=>Un,gt:()=>Ln,endsWith:()=>Bv});var xv={};Nn(xv,{time:()=>Q0,duration:()=>W0,datetime:()=>G0,date:()=>t0,ZodISOTime:()=>w$,ZodISODuration:()=>_$,ZodISODateTime:()=>$$,ZodISODate:()=>g$});var $$=t("ZodISODateTime",(n,i)=>{nU.init(n,i),m.init(n,i)});function G0(n){return y1($$,n)}var g$=t("ZodISODate",(n,i)=>{vU.init(n,i),m.init(n,i)});function t0(n){return d1(g$,n)}var w$=t("ZodISOTime",(n,i)=>{iU.init(n,i),m.init(n,i)});function Q0(n){return e1(w$,n)}var _$=t("ZodISODuration",(n,i)=>{$U.init(n,i),m.init(n,i)});function W0(n){return p1(_$,n)}var Dl=(n,i)=>{wg.init(n,i),n.name="ZodError",Object.defineProperties(n,{format:{value:($)=>gi(n,$)},flatten:{value:($)=>$i(n,$)},addIssue:{value:($)=>{n.issues.push($),n.message=JSON.stringify(n.issues,xi,2)}},addIssues:{value:($)=>{n.issues.push(...$),n.message=JSON.stringify(n.issues,xi,2)}},isEmpty:{get(){return n.issues.length===0}}})},Y0=t("ZodError",Dl),ln=t("ZodError",Dl,{Parent:Error});var fg=Ei(ln),qg=oi(ln),Lg=Ti(ln),Kg=Zi(ln),Og=dw(ln),Bg=ew(ln),Fg=pw(ln),Ng=aw(ln),cg=sw(ln),Pg=n4(ln),Sg=v4(ln),zg=i4(ln);var R=t("ZodType",(n,i)=>{return M.init(n,i),Object.assign(n["~standard"],{jsonSchema:{input:v$(n,"input"),output:v$(n,"output")}}),n.toJSONSchema=Bk(n,{}),n.def=i,n.type=i.type,Object.defineProperty(n,"_def",{value:i}),n.check=(...$)=>{return n.clone(f.mergeDefs(i,{checks:[...i.checks??[],...$.map((g)=>typeof g==="function"?{_zod:{check:g,def:{check:"custom"},onattach:[]}}:g)]}),{parent:!0})},n.with=n.check,n.clone=($,g)=>bn(n,$,g),n.brand=()=>n,n.register=($,g)=>{return $.add(n,g),n},n.parse=($,g)=>fg(n,$,g,{callee:n.parse}),n.safeParse=($,g)=>Lg(n,$,g),n.parseAsync=async($,g)=>qg(n,$,g,{callee:n.parseAsync}),n.safeParseAsync=async($,g)=>Kg(n,$,g),n.spa=n.safeParseAsync,n.encode=($,g)=>Og(n,$,g),n.decode=($,g)=>Bg(n,$,g),n.encodeAsync=async($,g)=>Fg(n,$,g),n.decodeAsync=async($,g)=>Ng(n,$,g),n.safeEncode=($,g)=>cg(n,$,g),n.safeDecode=($,g)=>Pg(n,$,g),n.safeEncodeAsync=async($,g)=>Sg(n,$,g),n.safeDecodeAsync=async($,g)=>zg(n,$,g),n.refine=($,g)=>n.check(Hw($,g)),n.superRefine=($)=>n.check(Vw($)),n.overwrite=($)=>n.check(Hn($)),n.optional=()=>ki(n),n.exactOptional=()=>gw(n),n.nullable=()=>li(n),n.nullish=()=>ki(li(n)),n.nonoptional=($)=>lw(n,$),n.array=()=>hn(n),n.or=($)=>K$([n,$]),n.and=($)=>dg(n,$),n.transform=($)=>Di(n,B$($)),n.default=($)=>bw(n,$),n.prefault=($)=>kw(n,$),n.catch=($)=>Xw(n,$),n.pipe=($)=>Di(n,$),n.readonly=()=>Qw(n),n.describe=($)=>{let g=n.clone();return wn.add(g,{description:$}),g},Object.defineProperty(n,"description",{get(){return wn.get(n)?.description},configurable:!0}),n.meta=(...$)=>{if($.length===0)return wn.get(n);let g=n.clone();return wn.add(g,$[0]),g},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=($)=>$(n),n}),U$=t("_ZodString",(n,i)=>{_i.init(n,i),R.init(n,i),n._zod.processJSONSchema=(g,v,w)=>Fk(n,g,v,w);let $=n._zod.bag;n.format=$.format??null,n.minLength=$.minimum??null,n.maxLength=$.maximum??null,n.regex=(...g)=>n.check(fv(...g)),n.includes=(...g)=>n.check(Kv(...g)),n.startsWith=(...g)=>n.check(Ov(...g)),n.endsWith=(...g)=>n.check(Bv(...g)),n.min=(...g)=>n.check(An(...g)),n.max=(...g)=>n.check(Uv(...g)),n.length=(...g)=>n.check(kv(...g)),n.nonempty=(...g)=>n.check(An(1,...g)),n.lowercase=(g)=>n.check(qv(g)),n.uppercase=(g)=>n.check(Lv(g)),n.trim=()=>n.check(cv()),n.normalize=(...g)=>n.check(Nv(...g)),n.toLowerCase=()=>n.check(Pv()),n.toUpperCase=()=>n.check(Sv()),n.slugify=()=>n.check(zv())}),Cv=t("ZodString",(n,i)=>{_i.init(n,i),U$.init(n,i),n.email=($)=>n.check(Q4(k$,$)),n.url=($)=>n.check(ug(Ji,$)),n.jwt=($)=>n.check(z4(f$,$)),n.emoji=($)=>n.check(u4(l$,$)),n.guid=($)=>n.check(jg(Ui,$)),n.uuid=($)=>n.check(W4(On,$)),n.uuidv4=($)=>n.check(Y4(On,$)),n.uuidv6=($)=>n.check(I4(On,$)),n.uuidv7=($)=>n.check(j4(On,$)),n.nanoid=($)=>n.check(H4(D$,$)),n.guid=($)=>n.check(jg(Ui,$)),n.cuid=($)=>n.check(V4(J$,$)),n.cuid2=($)=>n.check(f4(X$,$)),n.ulid=($)=>n.check(q4(G$,$)),n.base64=($)=>n.check(c4(u$,$)),n.base64url=($)=>n.check(P4(H$,$)),n.xid=($)=>n.check(L4(t$,$)),n.ksuid=($)=>n.check(K4(Q$,$)),n.ipv4=($)=>n.check(O4(W$,$)),n.ipv6=($)=>n.check(B4(Y$,$)),n.cidrv4=($)=>n.check(F4(I$,$)),n.cidrv6=($)=>n.check(N4(j$,$)),n.e164=($)=>n.check(S4(V$,$)),n.datetime=($)=>n.check(G0($)),n.date=($)=>n.check(t0($)),n.time=($)=>n.check(Q0($)),n.duration=($)=>n.check(W0($))});function o(n){return Z1(Cv,n)}var m=t("ZodStringFormat",(n,i)=>{e.init(n,i),U$.init(n,i)}),k$=t("ZodEmail",(n,i)=>{Zb.init(n,i),m.init(n,i)});function h4(n){return Q4(k$,n)}var Ui=t("ZodGUID",(n,i)=>{ob.init(n,i),m.init(n,i)});function C4(n){return jg(Ui,n)}var On=t("ZodUUID",(n,i)=>{Tb.init(n,i),m.init(n,i)});function E4(n){return W4(On,n)}function o4(n){return Y4(On,n)}function T4(n){return I4(On,n)}function Z4(n){return j4(On,n)}var Ji=t("ZodURL",(n,i)=>{rb.init(n,i),m.init(n,i)});function r4(n){return ug(Ji,n)}function m4(n){return ug(Ji,{protocol:/^https?$/,hostname:Yn.domain,...f.normalizeParams(n)})}var l$=t("ZodEmoji",(n,i)=>{mb.init(n,i),m.init(n,i)});function y4(n){return u4(l$,n)}var D$=t("ZodNanoID",(n,i)=>{yb.init(n,i),m.init(n,i)});function d4(n){return H4(D$,n)}var J$=t("ZodCUID",(n,i)=>{db.init(n,i),m.init(n,i)});function e4(n){return V4(J$,n)}var X$=t("ZodCUID2",(n,i)=>{eb.init(n,i),m.init(n,i)});function p4(n){return f4(X$,n)}var G$=t("ZodULID",(n,i)=>{pb.init(n,i),m.init(n,i)});function a4(n){return q4(G$,n)}var t$=t("ZodXID",(n,i)=>{ab.init(n,i),m.init(n,i)});function s4(n){return L4(t$,n)}var Q$=t("ZodKSUID",(n,i)=>{sb.init(n,i),m.init(n,i)});function n6(n){return K4(Q$,n)}var W$=t("ZodIPv4",(n,i)=>{gU.init(n,i),m.init(n,i)});function v6(n){return O4(W$,n)}var Mg=t("ZodMAC",(n,i)=>{_U.init(n,i),m.init(n,i)});function i6(n){return m1(Mg,n)}var Y$=t("ZodIPv6",(n,i)=>{wU.init(n,i),m.init(n,i)});function $6(n){return B4(Y$,n)}var I$=t("ZodCIDRv4",(n,i)=>{bU.init(n,i),m.init(n,i)});function g6(n){return F4(I$,n)}var j$=t("ZodCIDRv6",(n,i)=>{UU.init(n,i),m.init(n,i)});function w6(n){return N4(j$,n)}var u$=t("ZodBase64",(n,i)=>{lU.init(n,i),m.init(n,i)});function _6(n){return c4(u$,n)}var H$=t("ZodBase64URL",(n,i)=>{DU.init(n,i),m.init(n,i)});function b6(n){return P4(H$,n)}var V$=t("ZodE164",(n,i)=>{JU.init(n,i),m.init(n,i)});function U6(n){return S4(V$,n)}var f$=t("ZodJWT",(n,i)=>{XU.init(n,i),m.init(n,i)});function k6(n){return z4(f$,n)}var Ev=t("ZodCustomStringFormat",(n,i)=>{GU.init(n,i),m.init(n,i)});function l6(n,i,$={}){return n$(Ev,n,i,$)}function D6(n){return n$(Ev,"hostname",Yn.hostname,n)}function J6(n){return n$(Ev,"hex",Yn.hex,n)}function X6(n,i){let $=i?.enc??"hex",g=`${n}_${$}`,v=Yn[g];if(!v)throw Error(`Unrecognized hash format: ${g}`);return n$(Ev,g,v,i)}var ov=t("ZodNumber",(n,i)=>{J4.init(n,i),R.init(n,i),n._zod.processJSONSchema=(g,v,w)=>Nk(n,g,v,w),n.gt=(g,v)=>n.check(Ln(g,v)),n.gte=(g,v)=>n.check(Un(g,v)),n.min=(g,v)=>n.check(Un(g,v)),n.lt=(g,v)=>n.check(qn(g,v)),n.lte=(g,v)=>n.check(Xn(g,v)),n.max=(g,v)=>n.check(Xn(g,v)),n.int=(g)=>n.check(b$(g)),n.safe=(g)=>n.check(b$(g)),n.positive=(g)=>n.check(Ln(0,g)),n.nonnegative=(g)=>n.check(Un(0,g)),n.negative=(g)=>n.check(qn(0,g)),n.nonpositive=(g)=>n.check(Xn(0,g)),n.multipleOf=(g,v)=>n.check(yn(g,v)),n.step=(g,v)=>n.check(yn(g,v)),n.finite=()=>n;let $=n._zod.bag;n.minValue=Math.max($.minimum??Number.NEGATIVE_INFINITY,$.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min($.maximum??Number.POSITIVE_INFINITY,$.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=($.format??"").includes("int")||Number.isSafeInteger($.multipleOf??0.5),n.isFinite=!0,n.format=$.format??null});function Tv(n){return a1(ov,n)}var lv=t("ZodNumberFormat",(n,i)=>{tU.init(n,i),ov.init(n,i)});function b$(n){return nk(lv,n)}function G6(n){return vk(lv,n)}function t6(n){return ik(lv,n)}function Q6(n){return $k(lv,n)}function W6(n){return gk(lv,n)}var Zv=t("ZodBoolean",(n,i)=>{Dg.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>ck(n,$,g,v)});function en(n){return wk(Zv,n)}var rv=t("ZodBigInt",(n,i)=>{X4.init(n,i),R.init(n,i),n._zod.processJSONSchema=(g,v,w)=>Pk(n,g,v,w),n.gte=(g,v)=>n.check(Un(g,v)),n.min=(g,v)=>n.check(Un(g,v)),n.gt=(g,v)=>n.check(Ln(g,v)),n.gte=(g,v)=>n.check(Un(g,v)),n.min=(g,v)=>n.check(Un(g,v)),n.lt=(g,v)=>n.check(qn(g,v)),n.lte=(g,v)=>n.check(Xn(g,v)),n.max=(g,v)=>n.check(Xn(g,v)),n.positive=(g)=>n.check(Ln(BigInt(0),g)),n.negative=(g)=>n.check(qn(BigInt(0),g)),n.nonpositive=(g)=>n.check(Xn(BigInt(0),g)),n.nonnegative=(g)=>n.check(Un(BigInt(0),g)),n.multipleOf=(g,v)=>n.check(yn(g,v));let $=n._zod.bag;n.minValue=$.minimum??null,n.maxValue=$.maximum??null,n.format=$.format??null});function Y6(n){return bk(rv,n)}var q$=t("ZodBigIntFormat",(n,i)=>{QU.init(n,i),rv.init(n,i)});function I6(n){return kk(q$,n)}function j6(n){return lk(q$,n)}var Rg=t("ZodSymbol",(n,i)=>{WU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>Sk(n,$,g,v)});function u6(n){return Dk(Rg,n)}var Ag=t("ZodUndefined",(n,i)=>{YU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>Mk(n,$,g,v)});function H6(n){return Jk(Ag,n)}var xg=t("ZodNull",(n,i)=>{IU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>zk(n,$,g,v)});function hg(n){return Xk(xg,n)}var Cg=t("ZodAny",(n,i)=>{jU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>xk(n,$,g,v)});function V6(){return Gk(Cg)}var Eg=t("ZodUnknown",(n,i)=>{uU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>hk(n,$,g,v)});function tn(){return tk(Eg)}var og=t("ZodNever",(n,i)=>{HU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>Ak(n,$,g,v)});function L$(n){return Qk(og,n)}var Tg=t("ZodVoid",(n,i)=>{VU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>Rk(n,$,g,v)});function f6(n){return Wk(Tg,n)}var Xi=t("ZodDate",(n,i)=>{fU.init(n,i),R.init(n,i),n._zod.processJSONSchema=(g,v,w)=>Ck(n,g,v,w),n.min=(g,v)=>n.check(Un(g,v)),n.max=(g,v)=>n.check(Xn(g,v));let $=n._zod.bag;n.minDate=$.minimum?new Date($.minimum):null,n.maxDate=$.maximum?new Date($.maximum):null});function q6(n){return Yk(Xi,n)}var Zg=t("ZodArray",(n,i)=>{qU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>sk(n,$,g,v),n.element=i.element,n.min=($,g)=>n.check(An($,g)),n.nonempty=($)=>n.check(An(1,$)),n.max=($,g)=>n.check(Uv($,g)),n.length=($,g)=>n.check(kv($,g)),n.unwrap=()=>n.element});function hn(n,i){return uk(Zg,n,i)}function L6(n){let i=n._zod.def.shape;return O$(Object.keys(i))}var Gi=t("ZodObject",(n,i)=>{LU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>n0(n,$,g,v),f.defineLazy(n,"shape",()=>{return i.shape}),n.keyof=()=>O$(Object.keys(n._zod.def.shape)),n.catchall=($)=>n.clone({...n._zod.def,catchall:$}),n.passthrough=()=>n.clone({...n._zod.def,catchall:tn()}),n.loose=()=>n.clone({...n._zod.def,catchall:tn()}),n.strict=()=>n.clone({...n._zod.def,catchall:L$()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=($)=>{return f.extend(n,$)},n.safeExtend=($)=>{return f.safeExtend(n,$)},n.merge=($)=>f.merge(n,$),n.pick=($)=>f.pick(n,$),n.omit=($)=>f.omit(n,$),n.partial=(...$)=>f.partial(F$,n,$[0]),n.required=(...$)=>f.required(N$,n,$[0])});function $n(n,i){let $={type:"object",shape:n??{},...f.normalizeParams(i)};return new Gi($)}function K6(n,i){return new Gi({type:"object",shape:n,catchall:L$(),...f.normalizeParams(i)})}function O6(n,i){return new Gi({type:"object",shape:n,catchall:tn(),...f.normalizeParams(i)})}var ti=t("ZodUnion",(n,i)=>{Jg.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>R4(n,$,g,v),n.options=i.options});function K$(n,i){return new ti({type:"union",options:n,...f.normalizeParams(i)})}var rg=t("ZodXor",(n,i)=>{ti.init(n,i),KU.init(n,i),n._zod.processJSONSchema=($,g,v)=>R4(n,$,g,v),n.options=i.options});function B6(n,i){return new rg({type:"union",options:n,inclusive:!1,...f.normalizeParams(i)})}var mg=t("ZodDiscriminatedUnion",(n,i)=>{ti.init(n,i),OU.init(n,i)});function Qi(n,i,$){return new mg({type:"union",options:i,discriminator:n,...f.normalizeParams($)})}var yg=t("ZodIntersection",(n,i)=>{BU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>v0(n,$,g,v)});function dg(n,i){return new yg({type:"intersection",left:n,right:i})}var eg=t("ZodTuple",(n,i)=>{G4.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>i0(n,$,g,v),n.rest=($)=>n.clone({...n._zod.def,rest:$})});function pg(n,i,$){let g=i instanceof M,v=g?$:i;return new eg({type:"tuple",items:n,rest:g?i:null,...f.normalizeParams(v)})}var Wi=t("ZodRecord",(n,i)=>{FU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>$0(n,$,g,v),n.keyType=i.keyType,n.valueType=i.valueType});function pn(n,i,$){return new Wi({type:"record",keyType:n,valueType:i,...f.normalizeParams($)})}function F6(n,i,$){let g=bn(n);return g._zod.values=void 0,new Wi({type:"record",keyType:g,valueType:i,...f.normalizeParams($)})}function N6(n,i,$){return new Wi({type:"record",keyType:n,valueType:i,mode:"loose",...f.normalizeParams($)})}var ag=t("ZodMap",(n,i)=>{NU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>pk(n,$,g,v),n.keyType=i.keyType,n.valueType=i.valueType,n.min=(...$)=>n.check(Kn(...$)),n.nonempty=($)=>n.check(Kn(1,$)),n.max=(...$)=>n.check(dn(...$)),n.size=(...$)=>n.check(bv(...$))});function c6(n,i,$){return new ag({type:"map",keyType:n,valueType:i,...f.normalizeParams($)})}var sg=t("ZodSet",(n,i)=>{cU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>ak(n,$,g,v),n.min=(...$)=>n.check(Kn(...$)),n.nonempty=($)=>n.check(Kn(1,$)),n.max=(...$)=>n.check(dn(...$)),n.size=(...$)=>n.check(bv(...$))});function P6(n,i){return new sg({type:"set",valueType:n,...f.normalizeParams(i)})}var hv=t("ZodEnum",(n,i)=>{PU.init(n,i),R.init(n,i),n._zod.processJSONSchema=(g,v,w)=>Ek(n,g,v,w),n.enum=i.entries,n.options=Object.values(i.entries);let $=new Set(Object.keys(i.entries));n.extract=(g,v)=>{let w={};for(let _ of g)if($.has(_))w[_]=i.entries[_];else throw Error(`Key ${_} not found in enum`);return new hv({...i,checks:[],...f.normalizeParams(v),entries:w})},n.exclude=(g,v)=>{let w={...i.entries};for(let _ of g)if($.has(_))delete w[_];else throw Error(`Key ${_} not found in enum`);return new hv({...i,checks:[],...f.normalizeParams(v),entries:w})}});function O$(n,i){let $=Array.isArray(n)?Object.fromEntries(n.map((g)=>[g,g])):n;return new hv({type:"enum",entries:$,...f.normalizeParams(i)})}function S6(n,i){return new hv({type:"enum",entries:n,...f.normalizeParams(i)})}var nw=t("ZodLiteral",(n,i)=>{SU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>ok(n,$,g,v),n.values=new Set(i.values),Object.defineProperty(n,"value",{get(){if(i.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return i.values[0]}})});function Cn(n,i){return new nw({type:"literal",values:Array.isArray(n)?n:[n],...f.normalizeParams(i)})}var vw=t("ZodFile",(n,i)=>{zU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>rk(n,$,g,v),n.min=($,g)=>n.check(Kn($,g)),n.max=($,g)=>n.check(dn($,g)),n.mime=($,g)=>n.check(Fv(Array.isArray($)?$:[$],g))});function z6(n){return Hk(vw,n)}var iw=t("ZodTransform",(n,i)=>{MU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>ek(n,$,g,v),n._zod.parse=($,g)=>{if(g.direction==="backward")throw new vi(n.constructor.name);$.addIssue=(w)=>{if(typeof w==="string")$.issues.push(f.issue(w,$.value,i));else{let _=w;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=$.value),_.inst??(_.inst=n),$.issues.push(f.issue(_))}};let v=i.transform($.value,$);if(v instanceof Promise)return v.then((w)=>{return $.value=w,$});return $.value=v,$}});function B$(n){return new iw({type:"transform",transform:n})}var F$=t("ZodOptional",(n,i)=>{t4.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>A4(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function ki(n){return new F$({type:"optional",innerType:n})}var $w=t("ZodExactOptional",(n,i)=>{RU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>A4(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function gw(n){return new $w({type:"optional",innerType:n})}var ww=t("ZodNullable",(n,i)=>{AU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>g0(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function li(n){return new ww({type:"nullable",innerType:n})}function M6(n){return ki(li(n))}var _w=t("ZodDefault",(n,i)=>{xU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>_0(n,$,g,v),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function bw(n,i){return new _w({type:"default",innerType:n,get defaultValue(){return typeof i==="function"?i():f.shallowClone(i)}})}var Uw=t("ZodPrefault",(n,i)=>{hU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>b0(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function kw(n,i){return new Uw({type:"prefault",innerType:n,get defaultValue(){return typeof i==="function"?i():f.shallowClone(i)}})}var N$=t("ZodNonOptional",(n,i)=>{CU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>w0(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function lw(n,i){return new N$({type:"nonoptional",innerType:n,...f.normalizeParams(i)})}var Dw=t("ZodSuccess",(n,i)=>{EU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>mk(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function R6(n){return new Dw({type:"success",innerType:n})}var Jw=t("ZodCatch",(n,i)=>{oU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>U0(n,$,g,v),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Xw(n,i){return new Jw({type:"catch",innerType:n,catchValue:typeof i==="function"?i:()=>i})}var Gw=t("ZodNaN",(n,i)=>{TU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>Tk(n,$,g,v)});function A6(n){return jk(Gw,n)}var c$=t("ZodPipe",(n,i)=>{ZU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>k0(n,$,g,v),n.in=i.in,n.out=i.out});function Di(n,i){return new c$({type:"pipe",in:n,out:i})}var P$=t("ZodCodec",(n,i)=>{c$.init(n,i),Xg.init(n,i)});function x6(n,i,$){return new P$({type:"pipe",in:n,out:i,transform:$.decode,reverseTransform:$.encode})}var tw=t("ZodReadonly",(n,i)=>{rU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>l0(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function Qw(n){return new tw({type:"readonly",innerType:n})}var Ww=t("ZodTemplateLiteral",(n,i)=>{mU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>Zk(n,$,g,v)});function h6(n,i){return new Ww({type:"template_literal",parts:n,...f.normalizeParams(i)})}var Yw=t("ZodLazy",(n,i)=>{eU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>J0(n,$,g,v),n.unwrap=()=>n._zod.def.getter()});function Iw(n){return new Yw({type:"lazy",getter:n})}var jw=t("ZodPromise",(n,i)=>{dU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>D0(n,$,g,v),n.unwrap=()=>n._zod.def.innerType});function C6(n){return new jw({type:"promise",innerType:n})}var uw=t("ZodFunction",(n,i)=>{yU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>dk(n,$,g,v)});function E6(n){return new uw({type:"function",input:Array.isArray(n?.input)?pg(n?.input):n?.input??hn(tn()),output:n?.output??tn()})}var Yi=t("ZodCustom",(n,i)=>{pU.init(n,i),R.init(n,i),n._zod.processJSONSchema=($,g,v)=>yk(n,$,g,v)});function o6(n){let i=new p({check:"custom"});return i._zod.check=n,i}function T6(n,i){return Vk(Yi,n??(()=>!0),i)}function Hw(n,i={}){return fk(Yi,n,i)}function Vw(n){return qk(n)}var Z6=Lk,r6=Kk;function m6(n,i={}){let $=new Yi({type:"custom",check:"custom",fn:(g)=>g instanceof n,abort:!0,...f.normalizeParams(i)});return $._zod.bag.Class=n,$._zod.check=(g)=>{if(!(g.value instanceof n))g.issues.push({code:"invalid_type",expected:n.name,input:g.value,inst:$,path:[...$._zod.def.path??[]]})},$}var y6=(...n)=>Ok({Codec:P$,Boolean:Zv,String:Cv},...n);function d6(n){let i=Iw(()=>{return K$([o(n),Tv(),en(),hg(),hn(i),pn(o(),i)])});return i}function e6(n,i){return Di(B$(n),i)}var Dv={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function I0(n){vn({customError:n})}function j0(){return vn().customError}var fw;(function(n){})(fw||(fw={}));var N={...Vg,...x4,iso:xv},n3=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function v3(n,i){let $=n.$schema;if($==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if($==="http://json-schema.org/draft-07/schema#")return"draft-7";if($==="http://json-schema.org/draft-04/schema#")return"draft-4";return i??"draft-2020-12"}function i3(n,i){if(!n.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let $=n.slice(1).split("/").filter(Boolean);if($.length===0)return i.rootSchema;let g=i.version==="draft-2020-12"?"$defs":"definitions";if($[0]===g){let v=$[1];if(!v||!i.defs[v])throw Error(`Reference not found: ${n}`);return i.defs[v]}throw Error(`Reference not found: ${n}`)}function Jl(n,i){if(n.not!==void 0){if(typeof n.not==="object"&&Object.keys(n.not).length===0)return N.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(n.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(n.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(n.if!==void 0||n.then!==void 0||n.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(n.dependentSchemas!==void 0||n.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(n.$ref){let v=n.$ref;if(i.refs.has(v))return i.refs.get(v);if(i.processing.has(v))return N.lazy(()=>{if(!i.refs.has(v))throw Error(`Circular reference not resolved: ${v}`);return i.refs.get(v)});i.processing.add(v);let w=i3(v,i),_=Dn(w,i);return i.refs.set(v,_),i.processing.delete(v),_}if(n.enum!==void 0){let v=n.enum;if(i.version==="openapi-3.0"&&n.nullable===!0&&v.length===1&&v[0]===null)return N.null();if(v.length===0)return N.never();if(v.length===1)return N.literal(v[0]);if(v.every((_)=>typeof _==="string"))return N.enum(v);let w=v.map((_)=>N.literal(_));if(w.length<2)return w[0];return N.union([w[0],w[1],...w.slice(2)])}if(n.const!==void 0)return N.literal(n.const);let $=n.type;if(Array.isArray($)){let v=$.map((w)=>{let _={...n,type:w};return Jl(_,i)});if(v.length===0)return N.never();if(v.length===1)return v[0];return N.union(v)}if(!$)return N.any();let g;switch($){case"string":{let v=N.string();if(n.format){let w=n.format;if(w==="email")v=v.check(N.email());else if(w==="uri"||w==="uri-reference")v=v.check(N.url());else if(w==="uuid"||w==="guid")v=v.check(N.uuid());else if(w==="date-time")v=v.check(N.iso.datetime());else if(w==="date")v=v.check(N.iso.date());else if(w==="time")v=v.check(N.iso.time());else if(w==="duration")v=v.check(N.iso.duration());else if(w==="ipv4")v=v.check(N.ipv4());else if(w==="ipv6")v=v.check(N.ipv6());else if(w==="mac")v=v.check(N.mac());else if(w==="cidr")v=v.check(N.cidrv4());else if(w==="cidr-v6")v=v.check(N.cidrv6());else if(w==="base64")v=v.check(N.base64());else if(w==="base64url")v=v.check(N.base64url());else if(w==="e164")v=v.check(N.e164());else if(w==="jwt")v=v.check(N.jwt());else if(w==="emoji")v=v.check(N.emoji());else if(w==="nanoid")v=v.check(N.nanoid());else if(w==="cuid")v=v.check(N.cuid());else if(w==="cuid2")v=v.check(N.cuid2());else if(w==="ulid")v=v.check(N.ulid());else if(w==="xid")v=v.check(N.xid());else if(w==="ksuid")v=v.check(N.ksuid())}if(typeof n.minLength==="number")v=v.min(n.minLength);if(typeof n.maxLength==="number")v=v.max(n.maxLength);if(n.pattern)v=v.regex(new RegExp(n.pattern));g=v;break}case"number":case"integer":{let v=$==="integer"?N.number().int():N.number();if(typeof n.minimum==="number")v=v.min(n.minimum);if(typeof n.maximum==="number")v=v.max(n.maximum);if(typeof n.exclusiveMinimum==="number")v=v.gt(n.exclusiveMinimum);else if(n.exclusiveMinimum===!0&&typeof n.minimum==="number")v=v.gt(n.minimum);if(typeof n.exclusiveMaximum==="number")v=v.lt(n.exclusiveMaximum);else if(n.exclusiveMaximum===!0&&typeof n.maximum==="number")v=v.lt(n.maximum);if(typeof n.multipleOf==="number")v=v.multipleOf(n.multipleOf);g=v;break}case"boolean":{g=N.boolean();break}case"null":{g=N.null();break}case"object":{let v={},w=n.properties||{},_=new Set(n.required||[]);for(let[k,l]of Object.entries(w)){let J=Dn(l,i);v[k]=_.has(k)?J:J.optional()}if(n.propertyNames){let k=Dn(n.propertyNames,i),l=n.additionalProperties&&typeof n.additionalProperties==="object"?Dn(n.additionalProperties,i):N.any();if(Object.keys(v).length===0){g=N.record(k,l);break}let J=N.object(v).passthrough(),Q=N.looseRecord(k,l);g=N.intersection(J,Q);break}if(n.patternProperties){let k=n.patternProperties,l=Object.keys(k),J=[];for(let j of l){let u=Dn(k[j],i),W=N.string().regex(new RegExp(j));J.push(N.looseRecord(W,u))}let Q=[];if(Object.keys(v).length>0)Q.push(N.object(v).passthrough());if(Q.push(...J),Q.length===0)g=N.object({}).passthrough();else if(Q.length===1)g=Q[0];else{let j=N.intersection(Q[0],Q[1]);for(let u=2;u<Q.length;u++)j=N.intersection(j,Q[u]);g=j}break}let U=N.object(v);if(n.additionalProperties===!1)g=U.strict();else if(typeof n.additionalProperties==="object")g=U.catchall(Dn(n.additionalProperties,i));else g=U.passthrough();break}case"array":{let{prefixItems:v,items:w}=n;if(v&&Array.isArray(v)){let _=v.map((k)=>Dn(k,i)),U=w&&typeof w==="object"&&!Array.isArray(w)?Dn(w,i):void 0;if(U)g=N.tuple(_).rest(U);else g=N.tuple(_);if(typeof n.minItems==="number")g=g.check(N.minLength(n.minItems));if(typeof n.maxItems==="number")g=g.check(N.maxLength(n.maxItems))}else if(Array.isArray(w)){let _=w.map((k)=>Dn(k,i)),U=n.additionalItems&&typeof n.additionalItems==="object"?Dn(n.additionalItems,i):void 0;if(U)g=N.tuple(_).rest(U);else g=N.tuple(_);if(typeof n.minItems==="number")g=g.check(N.minLength(n.minItems));if(typeof n.maxItems==="number")g=g.check(N.maxLength(n.maxItems))}else if(w!==void 0){let _=Dn(w,i),U=N.array(_);if(typeof n.minItems==="number")U=U.min(n.minItems);if(typeof n.maxItems==="number")U=U.max(n.maxItems);g=U}else g=N.array(N.any());break}default:throw Error(`Unsupported type: ${$}`)}if(n.description)g=g.describe(n.description);if(n.default!==void 0)g=g.default(n.default);return g}function Dn(n,i){if(typeof n==="boolean")return n?N.any():N.never();let $=Jl(n,i),g=n.type||n.enum!==void 0||n.const!==void 0;if(n.anyOf&&Array.isArray(n.anyOf)){let U=n.anyOf.map((l)=>Dn(l,i)),k=N.union(U);$=g?N.intersection($,k):k}if(n.oneOf&&Array.isArray(n.oneOf)){let U=n.oneOf.map((l)=>Dn(l,i)),k=N.xor(U);$=g?N.intersection($,k):k}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)$=g?$:N.any();else{let U=g?$:Dn(n.allOf[0],i),k=g?0:1;for(let l=k;l<n.allOf.length;l++)U=N.intersection(U,Dn(n.allOf[l],i));$=U}if(n.nullable===!0&&i.version==="openapi-3.0")$=N.nullable($);if(n.readOnly===!0)$=N.readonly($);let v={},w=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let U of w)if(U in n)v[U]=n[U];let _=["contentEncoding","contentMediaType","contentSchema"];for(let U of _)if(U in n)v[U]=n[U];for(let U of Object.keys(n))if(!n3.has(U))v[U]=n[U];if(Object.keys(v).length>0)i.registry.add($,v);return $}function p6(n,i){if(typeof n==="boolean")return n?N.any():N.never();let $=v3(n,i?.defaultTarget),g=n.$defs||n.definitions||{},v={version:$,defs:g,refs:new Map,processing:new Set,rootSchema:n,registry:i?.registry??wn};return Dn(n,v)}var Ii={};Nn(Ii,{string:()=>$3,number:()=>g3,date:()=>b3,boolean:()=>w3,bigint:()=>_3});function $3(n){return r1(Cv,n)}function g3(n){return s1(ov,n)}function w3(n){return _k(Zv,n)}function _3(n){return Uk(rv,n)}function b3(n){return Ik(Xi,n)}vn(Gg());var U3=S$;var Xl=S$??u0;if(typeof Xl.object!=="function")throw Error("Failed to resolve Zod namespace");var h=Xl;R_(b);var Wl=$n({}).passthrough().openapi({description:"Structured context for the error (varies by error code)"}),H0=$n({code:o().openapi({description:"Machine-stable error code from the error catalog",example:"session_not_found"}),message:o().openapi({description:"Human-readable error description",example:"The requested session does not exist."}),retryable:en().openapi({description:"Whether clients SHOULD retry this request",example:!1}),details:Wl.optional(),fix_hint:o().optional().openapi({description:"Actionable guidance for humans to resolve the error",example:"Verify the session ID is correct."})}).openapi("ErrorObject"),a6=$n({code:o().openapi({description:"Machine-stable warning code",example:"partial_data"}),message:o().openapi({description:"Human-readable warning description",example:"Some optional fields were unavailable."}),details:Wl.optional()}).openapi("ErrorWarning"),U7=$n({error:H0,trace_id:o().optional().openapi({description:"Distributed tracing correlation ID",example:"trace_abc123"}),request_id:o().openapi({description:"Unique request identifier",example:"req_xyz789"}),warnings:hn(a6).optional().openapi({description:"Non-fatal warnings returned alongside the error"})}).openapi("ErrorResponse"),Jv=o().min(1).max(64).regex(/^(?:[a-zA-Z0-9_-]+|[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)$/,'repo_id must be a configured repo id or an "owner/repo" identifier').openapi({description:'Repository identifier or canonical "owner/repo" handle',example:"acme/docs"}),En=o().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/,"git_sha must be 40 or 64 lowercase hex characters").openapi({description:"Full Git SHA (40 chars for SHA-1, 64 for SHA-256)",example:"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b"}),d=o().min(1).max(512).refine((n)=>!n.startsWith("/"),"file_path must be relative (no leading /)").refine((n)=>!n.includes(".."),"file_path must not contain path traversal (..)").refine((n)=>!n.includes("\x00"),"file_path must not contain NUL bytes").openapi({description:"Relative file path with no leading slash, traversal, or NUL bytes",example:"docs/guide.md"}),k3=$n({source_type:Cn("git"),repo_id:Jv,git_sha:En,file_path:d}).openapi("GitContentRef"),l3=$n({source_type:Cn("upload"),project_id:o().openapi({description:"Project identifier",example:"proj_docs"}),upload_batch_id:o().openapi({description:"Upload batch identifier",example:"upload_20260208"}),file_path:d.openapi({description:"Path to file in upload batch",example:"spec.md"})}).openapi("UploadContentRef"),ji=Qi("source_type",[k3,l3]).openapi("ContentRef"),D3=$n({type:Cn("session")}).openapi("SessionAnchor"),J3=$n({type:Cn("review")}).openapi("ReviewAnchor"),s6=o().regex(/^[a-z2-7]{16}$/,"block_id must be 16 lowercase base32 characters").openapi({description:"16-character lowercase base32 block identifier (truncated SHA-256)",example:"abcdefgh234567ab"}),X3=$n({type:Cn("block"),block_id:s6}).openapi("BlockAnchor"),G3=$n({type:Cn("range"),block_id:s6,start_offset:Tv().int().min(0).openapi({description:"Start byte offset within the block"}),end_offset:Tv().int().min(0).openapi({description:"End byte offset within the block"})}).openapi("RangeAnchor"),Xv=Qi("type",[D3,J3,X3,G3]).openapi("Anchor"),k7=o().optional().openapi({description:"Client-generated idempotency key for safe retries",example:"scope:install_abc:op_123"}),Yl=$n({limit:Ii.number().int().min(1).max(100).default(50).optional(),cursor:o().optional()}),l7=$n({next_cursor:o().nullable(),has_more:en()}),Gl=20,tl=64,Ql=256,t3=/^[a-zA-Z][a-zA-Z0-9_-]*$/,Gv=pn(o(),tn()).superRefine((n,i)=>{let $=Object.keys(n);if($.length>Gl){i.addIssue({code:Dv.custom,message:`Too many keys: ${$.length} exceeds maximum of ${Gl}`});return}for(let g of $){if(g.length<1||g.length>tl){i.addIssue({code:Dv.custom,message:`Key "${g}" length ${g.length} is outside range 1-${tl}`,path:[g]});continue}if(!t3.test(g))i.addIssue({code:Dv.custom,message:`Key "${g}" must start with a letter and contain only letters, digits, underscores, and hyphens`,path:[g]});let v=n[g];if(typeof v!=="string"){i.addIssue({code:Dv.custom,message:`Value for key "${g}" must be a string, got ${typeof v}`,path:[g]});continue}if(v.length>Ql)i.addIssue({code:Dv.custom,message:`Value for key "${g}" length ${v.length} exceeds maximum of ${Ql}`,path:[g]})}}).openapi("FlatJsonbMap"),D7=Gv.optional().default({});var Q3=$n({code:o(),message:o(),retryable:en(),details:pn(o(),tn()).optional(),fix_hint:o().optional()}),X7=$n({error:Q3,trace_id:o().optional(),request_id:o()}),W3=$n({code:o(),message:o().optional(),details:pn(o(),tn()).optional()}),G7=$n({data:tn().optional(),warnings:hn(W3).optional(),request_id:o()}),z$={UNAUTHORIZED:"unauthorized",TOKEN_EXPIRED:"token_expired",TOKEN_INVALID:"token_invalid",FORBIDDEN:"forbidden",STEP_UP_REQUIRED:"step_up_required",EXPORT_NOT_ALLOWED:"export_not_allowed",SESSION_READ_ONLY:"session_read_only",NOT_FOUND:"not_found",SESSION_NOT_FOUND:"session_not_found",THREAD_NOT_FOUND:"thread_not_found",COMMENT_NOT_FOUND:"comment_not_found",BLOCK_NOT_FOUND:"block_not_found",SOURCE_FILE_NOT_FOUND:"source_file_not_found",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotency_key_in_flight",VERSION_CONFLICT:"version_conflict",SOURCE_MISMATCH:"source_mismatch",PAYLOAD_TOO_LARGE:"payload_too_large",INVALID_ARGUMENT:"invalid_argument",INVALID_BLOCK_ID:"invalid_block_id",INVALID_ANCHOR:"invalid_anchor",INVALID_SHA:"invalid_sha",INVALID_PATH:"invalid_path",UNKNOWN_SCHEMA:"unknown_schema",VALIDATION_FAILED:"validation_failed",RATE_LIMITED:"rate_limited",DB_ERROR:"db_error",RENDER_ERROR:"render_error",STORAGE_ERROR:"storage_error",INTERNAL_ERROR:"internal_error",SOURCE_UNAVAILABLE:"source_unavailable",SOURCE_TIMEOUT:"source_timeout",SERVICE_UNAVAILABLE:"service_unavailable"};function Il(n){return[z$.IDEMPOTENCY_KEY_IN_FLIGHT,z$.RATE_LIMITED,z$.DB_ERROR,z$.SOURCE_UNAVAILABLE,z$.SOURCE_TIMEOUT,z$.SERVICE_UNAVAILABLE].includes(n)}var Hl=b.object({idempotency:b.enum(["always","keyed","none"]).optional(),retry_classification:b.enum(["safe","transient","manual"]).optional()}).openapi("AgentSurfaceRetrySemantics"),Y3=b.object({next_cursor:b.string().nullable().optional(),has_more:b.boolean().optional(),total:b.number().int().nonnegative().optional(),limit:b.number().int().positive().optional(),offset:b.number().int().nonnegative().optional()}).openapi("AgentSurfacePagination"),I3=b.object({artifact_kind:b.string().optional(),non_authoritative:b.boolean().optional(),status:b.string().optional(),target_type:b.string().optional(),target_id:b.string().optional(),provenance:b.object({source_type:b.string().optional(),source_label:b.string().optional(),source_model:b.string().optional()}).optional()}).openapi("AdvisorySurfaceSummary"),j3=b.object({ok:b.literal(!0),request_id:b.string(),result:b.unknown(),warnings:b.array(a6).optional(),pagination:Y3.optional(),advisory:I3.optional(),retry:Hl.optional()}).openapi("AgentSurfaceSuccessEnvelope"),u3=b.object({ok:b.literal(!1),error:H0,request_id:b.string(),warnings:b.array(a6).optional(),retry:Hl.optional()}).openapi("AgentSurfaceErrorEnvelope");function an(n){if(typeof n!=="object"||n===null||Array.isArray(n))return null;return n}function tv(n,i){let $=n[i];return typeof $==="string"&&$.trim().length>0?$:void 0}function Vl(n,i){let $=n[i];return typeof $==="boolean"?$:void 0}function V0(n,i){let $=n[i];if(typeof $!=="number"||!Number.isInteger($)||$<0)return;return $}function fl(n){if(!Array.isArray(n))return[];return n.flatMap((i)=>{if(typeof i==="string"&&i.trim().length>0)return[{code:"warning",message:i}];let $=an(i);if(!$)return[];let g=tv($,"message");if(!g)return[];let v=tv($,"code")??"warning",w=an($.details)??void 0;return[{code:v,message:g,...w?{details:w}:{}}]})}function jl(n){let i=an(n);if(!i)return;let $={},g=i.next_cursor;if(typeof g==="string"||g===null)$.next_cursor=g;if($.next_cursor===void 0&&(typeof i.cursor==="string"||i.cursor===null))$.next_cursor=i.cursor;let v=Vl(i,"has_more");if(v!==void 0)$.has_more=v;let w=V0(i,"total");if(w!==void 0)$.total=w;let _=V0(i,"limit");if(_!==void 0&&_>0)$.limit=_;let U=V0(i,"offset");if(U!==void 0)$.offset=U;return Object.keys($).length>0?$:void 0}function ul(n){let i=an(n);if(!i)return;let $=an(i.advisory_artifact)??an(i.advisory)??i,g=tv($,"artifact_kind"),v=Vl($,"non_authoritative"),w=tv($,"status"),_=an($.target),U=an($.provenance);if(g===void 0&&v===void 0&&_===null&&U===null)return;let k={};if(g!==void 0)k.artifact_kind=g;if(v!==void 0)k.non_authoritative=v;if(w!==void 0)k.status=w;if(_){let l=tv(_,"target_type"),J=tv(_,"target_id");if(l!==void 0)k.target_type=l;if(J!==void 0)k.target_id=J}if(U){let l={},J=tv(U,"source_type"),Q=tv(U,"source_label"),j=tv(U,"source_model");if(J!==void 0)l.source_type=J;if(Q!==void 0)l.source_label=Q;if(j!==void 0)l.source_model=j;if(Object.keys(l).length>0)k.provenance=l}return k}function ql(n){if(n.operation==="read")return"always";return n.hasIdempotencyKey?"keyed":"none"}function H3(n){if(typeof n.retryable==="boolean")return n.retryable;if(typeof n.errorCode==="string"&&Il(n.errorCode))return!0;if(n.statusCode===0||n.statusCode===429)return!0;return typeof n.statusCode==="number"&&n.statusCode>=500}function on(n){let i=ql(n);return{idempotency:i,retry_classification:i==="none"?"manual":"safe"}}function Ll(n){let i=ql(n);if(!H3(n))return{idempotency:i,retry_classification:"manual"};return{idempotency:i,retry_classification:i==="none"?"transient":"safe"}}function Kl(n,i,$){let g=fl(an(n)?.warnings),v={ok:!0,request_id:i,result:n,...g.length>0?{warnings:g}:{},...jl(n)?{pagination:jl(n)}:{},...ul(n)?{advisory:ul(n)}:{},...$?.retry?{retry:$.retry}:{}};return j3.parse(v),v}function Ol(n){let i=an(n.error.details)??void 0,$=fl(n.warnings),g={ok:!1,request_id:n.requestId,error:{code:n.error.code,message:n.error.message,retryable:n.error.retryable,request_id:n.requestId,...i?{details:i}:{},...n.error.fix_hint?{fix_hint:n.error.fix_hint}:{}},...$.length>0?{warnings:$}:{},...n.retry?{retry:n.retry}:{}};return u3.parse(g),g}var n_=b.enum(["content","rules"]).openapi("ReviewRole"),v_=b.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi("ReviewState"),Bl=b.enum(["draft","published","deprecated"]).openapi("ReviewPublicationStatus"),V3=b.enum(["git","upload"]).openapi("ReviewSourceType"),f0=b.enum(["reviewer","approver","observer","owner"]).openapi("ReviewParticipantRole"),Fl=b.enum(["read","comment","approve","admin"]).openapi("ReviewParticipantScope"),Nl=b.enum(["pending","invited","active","failed","bounced"]).openapi("ReviewParticipantInviteStatus"),cl=b.enum(["pending","delivered","failed","bounced"]).openapi("ReviewParticipantDeliveryState"),f3=b.enum(["not_started","in_progress","complete"]).openapi("ReviewParticipantReviewStatus"),q3=b.object({email:b.string().email(),name:b.string().max(256).optional(),role:f0,scopes:b.array(Fl).min(1)}).openapi("ReviewParticipantInput"),L3=b.object({participant_id:b.string(),email:b.string().email(),roles:b.array(f0),display_name:b.string().nullable(),joined_at:b.string().datetime().nullable(),last_seen_at:b.string().datetime().nullable(),invite_status:Nl,review_status:f3,review_completed_at:b.string().datetime().nullable(),magic_link_opened_at:b.string().datetime().nullable(),delivery_state:cl.nullable()}).openapi("ReviewParticipantSummary"),K3=b.object({participant_id:b.string(),email:b.string().email(),roles:b.array(f0),review_link_id:b.string(),scope:Fl,expires_at:b.string().datetime().nullable(),revoked_at:b.string().datetime().nullable(),invite_status:Nl,delivery_state:cl.nullable()}).openapi("ReviewInvitationSummary"),j7=b.object({repo_id:Jv.optional(),git_sha:En.optional(),file_path:d,document_type:b.enum(["markdown","pdf","image_set"]).default("markdown"),title:b.string().max(512).optional(),source_context:b.record(b.string(),b.unknown()).optional(),extra:b.record(b.string(),b.unknown()).optional(),role:n_.default("content"),applicability:Gv.optional(),properties:Gv.optional(),identity_restriction:b.enum(["open","participants_only","domain"]).default("open"),allowed_email_domains:b.array(b.string().min(1).max(253)).max(50).optional(),participants:b.array(q3).max(100).optional(),idempotency_key:b.string().max(256).optional(),supersedes_review_id:b.string().optional(),carry_forward_threads:b.boolean().optional(),carry_forward_filter:b.enum(["all","blocking","needs_changes"]).optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),content_body:b.string().max(1048576).optional(),focus_areas:b.array(b.string().max(100)).max(10).optional(),framing:b.string().max(1000).optional(),operator_name:b.string().max(200).optional()}).superRefine((n,i)=>{if(n.role!=="rules"&&n.applicability!==void 0&&Object.keys(n.applicability).length>0)i.addIssue({code:b.ZodIssueCode.custom,message:"applicability is only valid when role is 'rules'. Content reviews must not specify applicability.",path:["applicability"]});if(n.identity_restriction==="domain"&&(!Array.isArray(n.allowed_email_domains)||n.allowed_email_domains.length===0))i.addIssue({code:b.ZodIssueCode.custom,message:'allowed_email_domains is required and must be non-empty when identity_restriction is "domain"',path:["allowed_email_domains"]})}).openapi("CreateReviewRequest"),O3=b.object({review_id:b.string(),role:n_,state:v_,publication_status:Bl.nullable().optional(),title:b.string().nullable(),file_path:b.string(),block_count:b.number().int().nonnegative(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("ReviewSummary"),u7=b.object({review_id:b.string(),role:n_,state:v_,publication_status:Bl.nullable().optional(),source_type:V3,document_type:b.enum(["markdown","pdf","image_set"]),repo_id:b.string().nullable(),git_sha:b.string().nullable(),file_path:b.string(),title:b.string().nullable(),source_context:b.record(b.string(),b.unknown()).nullable(),extra:b.record(b.string(),b.unknown()).nullable(),identity_restriction:b.enum(["open","participants_only","domain"]),allowed_email_domains:b.array(b.string()).nullable(),applicability:b.record(b.string(),b.unknown()),properties:b.record(b.string(),b.unknown()),block_count:b.number().int().nonnegative(),root_review_id:b.string(),supersedes_review_id:b.string().nullable(),superseded_by_review_id:b.string().nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),participants:b.array(L3),invitations:b.array(K3),summary:b.object({total_threads:b.number().int().nonnegative(),open_threads:b.number().int().nonnegative(),blocking_threads:b.number().int().nonnegative(),resolved_threads:b.number().int().nonnegative(),total_findings:b.number().int().nonnegative().optional(),open_findings:b.number().int().nonnegative().optional(),blocking_findings:b.number().int().nonnegative().optional(),resolved_findings:b.number().int().nonnegative().optional()}),request_id:b.string()}).openapi("ReviewDetailResponse"),H7=b.object({role:n_.optional(),state:v_.optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(25)}).openapi("ListReviewsQuery"),V7=b.object({reviews:b.array(O3),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListReviewsResponse"),f7=b.object({state:v_}).openapi("PatchReviewRequest"),q7=b.object({git_sha:b.string().optional(),file_path:b.string().optional(),title:b.string().max(512).optional(),applicability:Gv.optional(),properties:Gv.optional(),idempotency_key:b.string().max(256).optional(),changes_summary:b.string().max(5000).optional(),carry_forward_threads:b.boolean().optional(),carry_forward_filter:b.enum(["all","blocking","needs_changes"]).optional()}).openapi("ReviseReviewRequest");var Pl=b.enum(["suggestion","needs_changes","blocking"]).openapi({description:"Thread severity level"}),Sl=b.enum(["inline","append","hero"]).openapi("CommentAttachmentPlacement"),zl=b.enum(["before","after"]).openapi("CommentAttachmentAnchorPosition"),B3=b.object({mime_type:b.string().min(1),width:b.number().int().nullable(),height:b.number().int().nullable(),blurhash:b.string().nullable()}).openapi("CommentAttachmentAsset"),q0=b.object({asset_id:b.string().min(1),sort_order:b.number().int().nonnegative(),placement:Sl,alt_text:b.string().max(500).nullable().optional(),caption:b.string().max(2000).nullable().optional(),anchor_block_id:b.string().nullable().optional(),anchor_position:zl.nullable().optional(),spatial_x:b.number().min(0).max(100).nullable().optional(),spatial_y:b.number().min(0).max(100).nullable().optional()}).openapi("CommentAttachmentRequest"),i_=b.object({asset_id:b.string().min(1),sort_order:b.number().int().nonnegative(),placement:Sl,alt_text:b.string().nullable(),caption:b.string().nullable(),anchor_block_id:b.string().nullable(),anchor_position:zl.nullable(),spatial_x:b.number().nullable(),spatial_y:b.number().nullable(),asset:B3}).openapi("CommentAttachmentResponse"),Ml=b.object({id:b.string().openapi({description:"Unique comment identifier",example:"cmt_xyz789"}),thread_id:b.string(),author_email:b.string().email(),author_name:b.string().nullable(),body_md:b.string().openapi({description:"Comment body in Markdown"}),body_html:b.string().openapi({description:"Rendered HTML of the comment body"}),created_at:b.string().datetime(),updated_at:b.string().datetime().nullable(),version:b.number().int().min(1).openapi({description:"Edit version (starts at 1)"})}).openapi("Comment"),O7=b.object({anchor:Xv.openapi({description:"Where this thread is anchored in the document"}),body_md:b.string().min(1).max(65536).openapi({description:"Initial comment body in Markdown (UTF-8, max 64KB)"}),severity:Pl.optional().default("suggestion")}).openapi("CreateThreadRequest"),Rl=b.object({id:b.string().openapi({description:"Unique thread identifier",example:"thr_abc123"}),session_id:b.string(),anchor:Xv,status:b.enum(["open","resolved"]).openapi({description:"Thread status"}),severity:Pl,created_at:b.string().datetime(),updated_at:b.string().datetime(),comment_count:b.number().int().min(1),comments:b.array(Ml).optional().openapi({description:"Comments in this thread (included on creation)"})}).openapi("Thread"),B7=Rl.openapi("CreateThreadResponse"),F7=b.object({body_md:b.string().min(1).max(65536).openapi({description:"Comment body in Markdown (UTF-8, max 64KB)"})}).openapi("CreateCommentRequest"),N7=Ml.openapi("CreateCommentResponse"),c7=b.object({status:b.enum(["open","resolved"])}).openapi("UpdateThreadStatusRequest"),P7=Rl.openapi("UpdateThreadStatusResponse"),S7=b.object({session_id:b.string(),thread_id:b.string()}),z7=b.object({session_id:b.string(),thread_id:b.string(),comment_id:b.string()});var qw=b.enum(["open","resolved","withdrawn","wont_fix"]).openapi("FindingStatus"),M$=b.enum(["suggestion","needs_changes","blocking"]).openapi("FindingSeverity"),F3=["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],L0=b.enum(F3).openapi("FindingDecisionState"),x7=b.object({anchor:Xv,body_md:b.string().min(1).max(65536),severity:M$.optional(),attachments:b.array(q0).max(50).optional(),idempotency_key:b.string().max(256).optional(),source_review_id:b.string().optional(),source_finding_id:b.string().optional()}).openapi("CreateFindingRequest"),h7=b.object({finding_id:b.string(),comment_id:b.string(),attachments:b.array(i_),request_id:b.string()}).openapi("CreateFindingResponse"),C7=b.object({status:qw.optional(),severity:M$.optional(),block_id:b.string().optional(),q:b.string().max(200).optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(50)}).openapi("ListFindingsQuery"),N3=b.object({finding_id:b.string(),status:qw,severity:M$.nullable(),anchor:Xv,comment_count:b.number().int().nonnegative(),body_preview:b.string().nullable().optional(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("FindingSummary"),E7=b.object({findings:b.array(N3),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListFindingsResponse"),c3=b.object({comment_id:b.string(),body_md:b.string(),author_name:b.string().nullable(),author_email:b.string().nullable(),attachments:b.array(i_),created_at:b.string().datetime()}).openapi("FindingComment"),P3=b.object({block_id:b.string(),block_key:b.string().nullable(),block_type:b.string(),properties:b.record(b.string(),b.unknown())}).openapi("FindingBlockContext"),S3=b.object({outcome:L0,decided_at:b.string().datetime(),decided_by:b.string().nullable()}).openapi("FindingDecision"),o7=b.object({finding_id:b.string(),review_id:b.string(),status:qw,severity:M$.nullable(),anchor:Xv,block_context:P3.nullable(),comments:b.array(c3),decision:S3.nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("FindingDetailResponse"),T7=b.object({status:qw.optional(),severity:M$.optional(),expected_version:b.number().int().positive().optional()}).openapi("PatchFindingRequest"),Z7=b.object({finding_id:b.string(),review_id:b.string(),status:qw,severity:M$.nullable(),version:b.number().int().positive(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("PatchFindingResponse"),r7=b.object({body_md:b.string().min(1).max(65536),attachments:b.array(q0).max(50).optional(),idempotency_key:b.string().max(256).optional()}).openapi("CreateFindingCommentRequest"),m7=b.object({comment_id:b.string(),attachments:b.array(i_),request_id:b.string()}).openapi("CreateFindingCommentResponse"),y7=b.object({state:L0,rationale_md:b.string().min(1).max(65536).optional(),expected_version:b.number().int().positive().optional()}).openapi("CreateFindingDecisionRequest"),d7=b.object({decision_id:b.string(),finding_id:b.string(),state:L0,request_id:b.string()}).openapi("CreateFindingDecisionResponse"),e7=b.object({evidence_type:b.string().min(1),evidence_json:b.record(b.string(),b.unknown()),dedupe_key:b.string().max(256).optional()}).openapi("CreateFindingEvidenceRequest"),p7=b.object({evidence_id:b.string(),finding_id:b.string(),type:b.string(),request_id:b.string()}).openapi("CreateFindingEvidenceResponse");var z3=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function sn(n,i){return n>>>i|n<<32-i}function xl(n){let i=new TextEncoder().encode(n),$=i.length+9+63>>6<<6>>>0,g=new Uint8Array($);g.set(i),g[i.length]=128;let v=i.length*8,w=new DataView(g.buffer);w.setUint32($-8,Math.floor(v/4294967296),!1),w.setUint32($-4,v>>>0,!1);let _=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],U=new Uint32Array(64);for(let k=0;k<$;k+=64){for(let O=0;O<16;O++)U[O]=w.getUint32(k+O*4,!1);for(let O=16;O<64;O++){let E=sn(U[O-15],7)^sn(U[O-15],18)^U[O-15]>>>3,T=sn(U[O-2],17)^sn(U[O-2],19)^U[O-2]>>>10;U[O]=(U[O-16]+E|0)+(U[O-7]+T|0)>>>0}let[l,J,Q,j,u,W,Y,B]=_;for(let O=0;O<64;O++){let E=sn(u,6)^sn(u,11)^sn(u,25),T=u&W^~u&Y,a=B+E+T+z3[O]+U[O]>>>0,s=sn(l,2)^sn(l,13)^sn(l,22),r=l&J^l&Q^J&Q,gn=s+r>>>0;B=Y,Y=W,W=u,u=j+a>>>0,j=Q,Q=J,J=l,l=a+gn>>>0}_[0]=_[0]+l>>>0,_[1]=_[1]+J>>>0,_[2]=_[2]+Q>>>0,_[3]=_[3]+j>>>0,_[4]=_[4]+u>>>0,_[5]=_[5]+W>>>0,_[6]=_[6]+Y>>>0,_[7]=_[7]+B>>>0}return _.map((k)=>k.toString(16).padStart(8,"0")).join("")}var $_=h.object({rule_session_id:h.string(),rule_block_id:h.string(),rule_block_key:h.string().optional(),strength:h.enum(["must","should","may","must_not"]),category:h.string(),rule_content:h.string(),rule_session_name:h.string(),applicability_match_reason:h.string().optional()}),M3=3600000,Al=86400000,R3=h.object({repo_id:h.string().nullable(),file_path:h.string().nullable(),review_id:h.string().nullable()}),A3=h.object({fetched_at:h.string(),server_etag:h.string(),latest_rule_session_updated_at:h.string().nullable(),contributing_session_count:h.number().int().nonnegative(),total_rule_count:h.number().int().nonnegative()}),x3=h.object({text:h.string(),json_payload:h.unknown().optional(),structured_payload:h.unknown().optional()}),h3=h.object({scope:R3,compiled_hash:h.string(),rules:h.array(h.object({source_review_id:h.string(),block_id:h.string(),block_index:h.number().int().nonnegative(),strength:h.enum(["must","should","may","must_not"]),category:h.string().nullable(),rule_text:h.string(),specificity:h.number().int().nonnegative(),applicability:h.record(h.string(),h.string())})),plain_text_bundle:h.string(),freshness:A3,rulepack_schema_version:h.literal("rulepack.v1"),renderings:x3.optional()});function C3(n,i){return xl(JSON.stringify({plain_text_bundle:n,rules:i}))}function g_(n){return xl(JSON.stringify({repo_id:n.repo_id,file_path:n.file_path,review_id:n.review_id}))}function K0(n){let i=typeof n.compiled_hash==="string"&&n.compiled_hash.length>0?n.compiled_hash:C3(n.plain_text_bundle,n.rules),$={scope:n.scope,compiled_hash:i,rules:n.rules,plain_text_bundle:n.plain_text_bundle,freshness:{fetched_at:n.fetched_at,server_etag:n.server_etag??`"rules:${i}"`,latest_rule_session_updated_at:n.freshness.latest_rule_session_updated_at,contributing_session_count:n.freshness.contributing_session_count,total_rule_count:n.freshness.total_rule_count},rulepack_schema_version:"rulepack.v1",...n.renderings?{renderings:n.renderings}:{}};return h3.parse($),$}function E3(n){let i=Math.max(0,Math.floor(n/1000));if(i<60)return`${i}s`;let $=Math.floor(i/60);if($<60)return`${$}m`;let g=Math.floor($/60);if(g<48)return`${g}h`;return`${Math.floor(g/24)}d`}function hl(n,i=new Date){let $=Date.parse(n);if(!Number.isFinite($))return{status:"confirmed_stale",age_ms:Number.POSITIVE_INFINITY,age_seconds:Number.POSITIVE_INFINITY,warning:"Using cached rules with an invalid fetched_at timestamp. Rules may have changed."};let g=Math.max(0,i.getTime()-$),v=Math.floor(g/1000);if(g<=M3)return{status:"fresh",age_ms:g,age_seconds:v,warning:null};let w=E3(g),_=g>Al?`Cached rules are over ${w} old. Strongly recommend reconnecting to verify rules are current.`:`Using cached rules (fetched ${w} ago). Rules may have changed.`;return{status:g>Al?"confirmed_stale":"presumed_stale",age_ms:g,age_seconds:v,warning:_}}var Cl=b.enum(["must","should","may","must_not"]).openapi("RuleStrength"),o3=b.enum(["error","warning","info"]).openapi("RuleCheckFindingSeverity"),T3=b.enum(["document"]).openapi("RuleCheckAnchorMode"),Z3=b.object({rule_text:b.string(),strength:Cl,category:b.string().nullable(),source_review_id:b.string(),block_id:b.string(),block_index:b.number().int().nonnegative(),specificity:b.number().int().nonnegative(),applicability:b.record(b.string(),b.string())}).openapi("MatchedRuleResponse"),El=b.object({latest_rule_session_updated_at:b.string().datetime().nullable(),contributing_session_count:b.number().int().nonnegative(),total_rule_count:b.number().int().nonnegative()}).openapi("RuleBundleFreshness"),$u=b.object({format:b.enum(["json","text","prompt"]).default("json"),limit:b.coerce.number().int().min(1).max(200).default(50),offset:b.coerce.number().int().nonnegative().default(0),collection_id:b.string().optional()}).openapi("ListRulesQuery"),gu=b.object({rules:b.array(Z3),total:b.number().int().nonnegative(),limit:b.number().int().positive(),offset:b.number().int().nonnegative(),freshness:El,compiled_hash:b.string(),request_id:b.string()}).openapi("ListRulesResponse"),wu=b.object({content:b.string().min(1).max(1048576),properties:Gv.optional().default({}),collection_id:b.string().optional(),idempotency_key:b.string().max(256).optional()}).strict().openapi("RuleCheckRequest"),r3=b.object({block_index:b.number().int().nonnegative(),severity:o3,message:b.string(),rule_ref:$_.optional()}).openapi("RuleCheckFinding"),m3=b.object({total:b.number().int().nonnegative(),blocking:b.number().int().nonnegative(),warnings:b.number().int().nonnegative(),suggestions:b.number().int().nonnegative()}).openapi("RuleCheckSummary"),_u=b.object({findings:b.array(r3),summary:m3,anchor_mode:T3.optional(),rules_evaluated:b.number().int().nonnegative(),freshness:El,compiled_hash:b.string(),request_id:b.string()}).openapi("RuleCheckResponse"),y3=b.object({source:b.enum(["manual","findings","external"]),source_review_id:b.string().optional(),source_label:b.string().max(256).optional()}).openapi("RuleImportProvenance"),bu=b.object({content:b.string().min(1).max(524288),title:b.string().max(512).optional(),applicability:Gv.optional(),provenance:y3.optional(),preview:b.boolean().default(!1),idempotency_key:b.string().max(256).optional()}).strict().openapi("RuleImportRequest"),ol=b.object({source:b.enum(["manual","findings","external"]),source_review_id:b.string().optional(),source_label:b.string().max(256).optional(),content_bytes:b.number().int().positive(),review_title:b.string().nullable()}).openapi("RuleImportMetadata"),Tl=b.object({block_index:b.number().int().nonnegative(),strength:Cl,category:b.string().nullable(),plaintext:b.string()}).openapi("ParsedRuleBlock"),d3=b.object({preview:b.literal(!0),parsed_rules:b.array(Tl),total_rules:b.number().int().nonnegative(),warnings:b.array(b.string()),import_metadata:ol,request_id:b.string()}).openapi("RuleImportPreviewResponse"),e3=b.object({preview:b.literal(!1),review_id:b.string(),state:b.literal("draft"),parsed_rules:b.array(Tl),total_rules:b.number().int().nonnegative(),warnings:b.array(b.string()),import_metadata:ol,request_id:b.string()}).openapi("RuleImportCreateResponse"),Uu=b.discriminatedUnion("preview",[d3,e3]);var O0=b.record(b.string(),b.unknown()).openapi("ProjectConfig"),p3=b.enum(["active","deleting","deleted"]).openapi("ProjectState"),Du=b.object({name:b.string().min(1).max(256),config:O0.optional()}).openapi("CreateProjectRequest"),Ju=b.object({name:b.string().min(1).max(256).optional(),config:O0.optional()}).openapi("UpdateProjectRequest"),Xu=b.object({cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListProjectsQuery"),a3=b.object({id:b.string(),status:b.string(),file_count:b.number().int().nonnegative(),total_size_bytes:b.number().int().nonnegative(),created_at:b.string().datetime()}).openapi("ProjectLatestBatch"),s3=b.object({id:b.string(),name:b.string(),state:p3,tenant_id:b.string(),config_hash:b.string().nullable(),config:O0.nullable(),created_by_user_id:b.string().nullable(),created_at:b.string().datetime(),latest_batch:a3.nullable().optional(),request_id:b.string()}).openapi("ProjectResponse"),Gu=b.object({items:b.array(s3.omit({request_id:!0})),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListProjectsResponse"),tu=b.object({project_id:b.string(),state:b.literal("deleting"),deletion_job_id:b.string(),request_id:b.string()}).openapi("DeleteProjectResponse"),Qu=b.object({from_path:d,to_path:d}).refine((n)=>n.from_path!==n.to_path,{message:"from_path and to_path must differ",path:["to_path"]}).openapi("CreateProjectMoveRequest"),Wu=b.object({id:b.string(),project_id:b.string(),from_path:d,to_path:d,declared_at:b.string().datetime(),request_id:b.string()}).openapi("ProjectMoveResponse");var B0=b.enum(["git","upload"]).openapi("SessionTemplateSourceType"),nW=b.object({participant_id:b.string().min(1).max(256),scope:b.enum(["read","comment","approve"])}).openapi("SessionTemplateParticipantConfig"),vW=b.object({slack_channel:b.string().max(256).optional(),email_participants:b.boolean().optional()}).openapi("SessionTemplateNotificationConfig"),Zl=b.object({participants:b.array(nW).max(100).optional(),checks_enabled:b.boolean().optional(),policy_enabled:b.boolean().optional(),steering_enabled:b.boolean().optional(),extra_json:b.record(b.string(),b.unknown()).optional(),notification_config:vW.optional()}).openapi("SessionTemplateConfig"),ju=b.object({name:b.string().min(1).max(256),description:b.string().max(4000).optional(),source_type:B0,repo_id:b.string().max(256).optional(),project_id:b.string().max(256).optional(),config:Zl}).openapi("CreateSessionTemplateRequest"),uu=b.object({source_type:B0.optional(),repo_id:b.string().optional(),project_id:b.string().optional(),include_archived:b.boolean().optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListSessionTemplatesQuery"),iW=b.object({id:b.string(),tenant_id:b.string(),name:b.string(),description:b.string().nullable(),source_type:B0,repo_id:b.string().nullable(),project_id:b.string().nullable(),config:Zl,created_by_user_id:b.string().nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),archived_at:b.string().datetime().nullable(),request_id:b.string()}).openapi("SessionTemplateResponse"),Hu=b.object({items:b.array(iW.omit({request_id:!0})),next_cursor:b.string().nullable(),request_id:b.string()}).openapi("ListSessionTemplatesResponse");var Lw=b.string().min(1).max(36).openapi("ReviewSetId"),R$=b.enum(["git","upload"]).openapi("ReviewSetSourceType"),w_=b.enum(["review_set","release_bundle","packet"]).openapi("ReviewSetKind"),rl=b.enum(["active","closed","archived","deleted"]).openapi("ReviewSetState"),$W=b.enum(["topo","lex","lex_fallback"]).openapi("ReviewSetOrderingMethod"),gW=b.enum(["reviewer","approver"]).openapi("ReviewSetParticipantRole"),wW=b.object({email:b.string().email(),roles:b.array(gW).min(1)}).openapi("ReviewSetParticipant"),_W=b.union([b.string(),b.object({review_id:b.string().optional(),session_id:b.string().optional(),required:b.boolean().optional()}).refine((n)=>typeof n.review_id==="string"||typeof n.session_id==="string",{message:"review_id is required for review entries",path:["review_id"]})]).openapi("ReviewSetSessionEntry"),bW=b.object({repo_id:Jv,git_sha:En,file_path:d,required:b.boolean().optional()}).openapi("ReviewSetGitFileEntry"),UW=b.object({project_id:b.string(),upload_batch_id:b.string(),file_path:d,required:b.boolean().optional()}).openapi("ReviewSetUploadFileEntry"),kW=b.union([bW,UW]).openapi("ReviewSetFileEntry"),lW=b.object({allow_mixed_shas:b.boolean().optional(),require_all_files_reviewed:b.boolean().optional()}).openapi("ReviewSetConfig"),qu=b.object({title:b.string().optional(),kind:w_.optional(),source_type:R$,reviews:b.array(_W).max(200).optional(),files:b.array(kW).max(200).optional(),participants:b.array(wW).max(100).optional(),recipe_json:b.record(b.string(),b.unknown()).optional(),config:lW.optional()}).openapi("CreateReviewSetRequest"),DW=b.object({review_id:b.string(),file_path:d,position:b.number().int().nonnegative(),required:b.boolean()}).openapi("ReviewSetItem"),JW=b.object({email:b.string().email(),roles:b.array(b.string()),review_url:b.string().url(),delivery:b.object({channel:b.literal("email"),state:b.literal("pending")})}).openapi("ReviewSetInvitation"),XW=b.object({review_id:b.string(),invitations:b.array(JW)}).openapi("ReviewSetPerFileLinks"),Lu=b.object({id:Lw,title:b.string(),kind:w_,state:b.literal("active"),source_type:R$,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),ordering_method:$W,items:b.array(DW),links:b.object({set_link:b.string().url()}),per_file_links:b.array(XW),event_id:b.string(),created_at:b.string().datetime(),request_id:b.string().nullable()}).openapi("CreateReviewSetResponse"),ml=b.object({id:Lw,title:b.string().nullable(),kind:w_,state:rl,source_type:R$,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),item_count:b.number().int().nonnegative(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("ReviewSetSummary"),Ku=b.object({source_type:R$.optional(),repo_id:Jv.optional(),git_sha:En.optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),kind:w_.optional(),state:rl.optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListReviewSetsQuery"),Ou=b.object({items:b.array(ml),next_cursor:b.string().nullable(),request_id:b.string()}).openapi("ListReviewSetsResponse"),Bu=b.object({title:b.string().min(1).max(4096).optional(),state:b.enum(["active","closed","archived"]).optional()}).refine((n)=>n.title!==void 0||n.state!==void 0,"At least one field must be provided").openapi("UpdateReviewSetRequest"),Fu=ml.extend({request_id:b.string()}).openapi("UpdateReviewSetResponse"),yl=b.enum(["pass","fail","warn"]).openapi("ReviewSetStatusVerdict"),dl=b.object({code:b.string(),message:b.string(),pointers:b.array(b.string())}).openapi("ReviewSetReasonCode"),GW=b.object({review_id:b.string(),file_path:d,required:b.boolean(),verdict:yl,reason_codes:b.array(dl)}).openapi("ReviewSetStatusItem"),tW=b.object({action:b.string(),review_id:b.string(),finding_id:b.string().optional(),approver_email:b.string().email().optional(),reason_code:b.string(),message:b.string()}).openapi("ReviewSetActionRequired"),Nu=b.object({review_set_id:Lw,verdict:yl,reason_codes:b.array(dl),items:b.array(GW),policy_snapshot_id:b.string().nullable(),actions_required:b.array(tW).optional(),request_id:b.string()}).openapi("GetReviewSetStatusResponse"),QW=b.enum(["blocked","needs_changes","suggestions","approved","not_started","in_progress"]).openapi("ReviewSetStatusIndicator"),WW=b.object({requested:b.boolean(),decided:b.boolean(),decision:b.enum(["approved","rejected","conditional","pending"])}).openapi("ReviewSetApprovalState"),YW=b.object({review_id:b.string(),role:b.enum(["content","rules"]),file_path:d,position:b.number().int().nonnegative(),required:b.boolean(),status_summary:b.object({review_state:b.string(),thread_counts:b.object({total:b.number().int().nonnegative(),open:b.number().int().nonnegative(),resolved:b.number().int().nonnegative()}),severity_counts:b.object({blocking:b.number().int().nonnegative(),needs_changes:b.number().int().nonnegative(),suggestion:b.number().int().nonnegative()}),has_system_findings:b.boolean(),approval_state:WW.nullable(),status_indicator:QW})}).openapi("ReviewSetOverviewItem"),el=b.object({total_items:b.number().int().nonnegative(),reviewed_items:b.number().int().nonnegative(),approved_items:b.number().int().nonnegative(),completion_pct:b.number().int().min(0).max(100)}).openapi("ReviewSetProgress"),cu=b.object({id:Lw,title:b.string().nullable(),kind:b.string(),state:b.string(),source_type:R$,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),snapshot_id:b.string().nullable(),ordering_method:b.string().nullable(),recipe_json:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),items:b.array(YW),progress:el,next_unresolved:b.object({review_id:b.string(),file_path:d,block_id:b.string().nullable()}).nullable(),links:b.object({set_link:b.string().url().nullable()}),request_id:b.string()}).openapi("GetReviewSetResponse"),IW=b.object({id:Lw,title:b.string().nullable(),kind:b.string(),state:b.string(),source_type:R$,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),snapshot_id:b.string().nullable(),ordering_method:b.string().nullable(),recipe_json:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("ReviewSetExportMetadata"),jW=b.object({review_id:b.string(),file_path:d,position:b.number().int().nonnegative(),required:b.boolean(),review_export:b.record(b.string(),b.unknown())}).openapi("ReviewSetExportItem"),uW=b.object({canonicalization:b.literal("jcs"),export_sha256:b.string().regex(/^[0-9a-f]{64}$/).nullable()}).openapi("ReviewSetExportIntegrity"),Pu=b.object({schema:b.literal("v2"),view_requested:b.string().nullable(),view_resolved:b.literal("review_set.v1"),set:IW,items:b.array(jW),progress:el,integrity:uW}).openapi("GetReviewSetExportResponse");var HW=b.object({id:b.string(),tenant_id:b.string(),name:b.string(),description:b.string().nullable(),color:b.string().nullable(),created_by:b.string(),created_at:b.string().datetime().nullable(),updated_at:b.string().datetime().nullable(),archived_at:b.string().datetime().nullable(),request_id:b.string()}).openapi("CollectionResponse"),Mu=b.object({name:b.string().min(1),description:b.string().nullable().optional(),color:b.string().nullable().optional()}).openapi("CreateCollectionRequest"),Ru=b.object({name:b.string().min(1).optional(),description:b.string().nullable().optional(),color:b.string().nullable().optional(),archived:b.boolean().optional()}).openapi("UpdateCollectionRequest"),Au=b.object({cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).optional(),include_archived:b.boolean().optional()}).openapi("ListCollectionsQuery"),VW=b.object({collection_id:b.string(),session_id:b.string(),added_at:b.string().datetime().nullable(),added_by:b.string(),request_id:b.string()}).openapi("CollectionSessionResponse"),xu=b.object({session_id:b.string()}).openapi("AddCollectionSessionRequest"),fW=b.object({id:b.string(),collection_id:b.string(),url:b.string().url(),title:b.string(),link_type:b.string(),created_by:b.string(),created_at:b.string().datetime().nullable(),request_id:b.string()}).openapi("CollectionSourceLinkResponse"),hu=b.object({url:b.string().url(),title:b.string(),link_type:b.string()}).openapi("CreateCollectionSourceLinkRequest"),Cu=b.object({items:b.array(HW.omit({request_id:!0})),cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListCollectionsResponse"),Eu=b.object({id:b.string(),tenant_id:b.string(),name:b.string(),description:b.string().nullable(),color:b.string().nullable(),created_by:b.string(),created_at:b.string().datetime().nullable(),updated_at:b.string().datetime().nullable(),archived_at:b.string().datetime().nullable(),source_links:b.array(fW.omit({request_id:!0})),sessions:b.array(VW.omit({request_id:!0})),request_id:b.string()}).openapi("CollectionDetailResponse"),ou=b.object({request_id:b.string()}).openapi("CollectionMutationAck");var pl=b.enum(["git","upload"]).openapi("CorpusSourceType"),qW=b.enum(["building","ready","failed"]).openapi("CorpusSnapshotStatus"),LW=b.enum(["frontmatter","marker","sidecar","auto"]).openapi("CorpusDocIdentityMode"),al=b.object({in_scope_globs:b.array(b.string().min(1)).min(1).optional(),exclude_globs:b.array(b.string().min(1)).optional(),max_files:b.number().int().positive().optional(),max_total_bytes:b.number().int().positive().optional(),max_snapshot_build_seconds:b.number().int().positive().optional(),doc_identity_mode:LW.optional(),include_external_links:b.boolean().optional()}).openapi("CorpusConfig"),ru=b.object({git_sha:En,corpus_config:al.optional()}).openapi("RequestGitSnapshot"),mu=b.object({upload_batch_id:b.string(),corpus_config:al.optional()}).openapi("RequestUploadSnapshot"),yu=b.object({snapshot_id:b.string(),status:qW,source_type:pl,repo_id:Jv.optional(),git_sha:En.optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),indexer_version:b.string(),config_hash:b.string(),snapshot_sha256:b.string().nullable().optional(),error_json:b.unknown().optional(),created_at:b.string().datetime(),request_id:b.string()}).openapi("CorpusSnapshotStatusResponse"),KW=b.object({source_path:d,source_doc_key:b.string().nullable(),source_block_id:b.string().nullable(),link_kind:b.string(),context:b.null()}).openapi("CorpusBacklinkItem"),du=b.object({snapshot_id:b.string(),file_path:d,anchor:b.string().nullable(),backlinks:b.array(KW),request_id:b.string()}).openapi("CorpusBacklinksResponse"),sl=b.object({file_path:d,doc_key:b.string().nullable(),doc_type:b.string().nullable(),title:b.string().nullable()}).openapi("CorpusRepoMapItem"),eu=b.object({snapshot_id:b.string(),git_sha:En,files:b.array(sl),request_id:b.string()}).openapi("CorpusGitRepoMapResponse"),pu=b.object({snapshot_id:b.string(),upload_batch_id:b.string(),files:b.array(sl),request_id:b.string()}).openapi("CorpusUploadRepoMapResponse"),OW=b.object({file_path:d,doc_key:b.string().nullable(),distance:b.number().int().positive(),link_kind:b.string(),via_path:d}).openapi("CorpusImpactRadiusItem"),au=b.object({snapshot_id:b.string(),session_id:b.string(),file_path:d,impacted_files:b.array(OW),request_id:b.string()}).openapi("CorpusImpactResponse"),su=b.object({target_file:d,anchor:b.string().nullable(),block_id:b.string(),plaintext:b.string(),html:b.string(),request_id:b.string()}).openapi("CorpusLinkPreviewResponse"),BW=b.object({file_path:d,doc_key:b.string().nullable(),violation_type:b.enum(["unknown_doc_type","missing_required_field","invalid_field_type","unknown_tag","unknown_category","invalid_locale"]),field:b.string(),expected:b.string(),actual:b.string(),message:b.string()}).openapi("CorpusTaxonomyViolation"),FW=b.object({file_path:d,doc_key:b.string().min(1).optional(),doc_type:b.string().min(1).optional(),title:b.string().optional(),source_content_sha256:b.string().regex(/^[0-9a-f]{64}$/),frontmatter:b.object({raw:b.record(b.string(),b.unknown()).nullable(),normalized:b.record(b.string(),b.unknown()).nullable()}).optional(),taxonomy_violations:b.array(BW).optional()}).openapi("CorpusSnapshotArtifactDoc"),NW=b.object({source_file_path:d,target_file_path:d.optional(),target_url:b.string().url().optional(),edge_type:b.enum(["link","image","include","xref"]),resolved:b.boolean()}).refine((n)=>n.target_file_path!==void 0!==(n.target_url!==void 0),{message:"exactly one of target_file_path or target_url must be present"}).openapi("CorpusSnapshotArtifactEdge"),nH=b.object({schema_version:b.literal("corpus_snapshot.v1"),snapshot_id:b.string(),source_type:pl,repo_id:Jv.optional(),git_sha:En.optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),scope:b.object({include_globs:b.array(b.string().min(1)).min(1),exclude_globs:b.array(b.string().min(1)).optional()}),status:b.literal("ready"),docs:b.array(FW),edges:b.array(NW),indexer_version:b.string(),config_hash:b.string(),created_at:b.string().datetime(),completed_at:b.string().datetime()}).openapi("CorpusSnapshotArtifact");var $H=b.object({content_ref:ji.openapi({description:"Reference to the content to review"}),participants:b.array(b.object({email:b.string().email(),name:b.string().optional(),role:b.enum(["reviewer","operator","observer"]).default("reviewer")})).optional().openapi({description:"Optional list of participants to invite"}),options:b.object({block_id_scheme:b.literal("v1").default("v1").optional(),render_profile:b.string().optional()}).optional(),operator_name:b.string().max(200).optional().openapi({description:"Name of the operator initiating the review"}),focus_areas:b.array(b.string().max(100)).max(10).optional().openapi({description:"Areas the reviewer should focus on"}),framing:b.string().max(1000).optional().openapi({description:"Context framing text shown to reviewers"}),carry_forward_threads:b.boolean().optional().openapi({description:"Whether to carry forward threads from the superseded session"}),carry_forward_filter:b.enum(["all","blocking","needs_changes"]).optional().openapi({description:"Filter for which threads to carry forward"})}).openapi("CreateSessionRequest"),cW=b.object({thread_id:b.string().openapi({description:"Thread ID to resolve"}),disposition:b.enum(["fixed","wont_fix","duplicate","by_design"]).openapi({description:"Resolution disposition"}),evidence:b.string().max(2000).optional().openapi({description:"Optional evidence or explanation"})}).openapi("ThreadResolution"),gH=b.object({git_sha:b.string().optional().openapi({description:"Git commit SHA for the new revision"}),file_path:b.string().optional().openapi({description:"File path (defaults to predecessor's)"}),title:b.string().max(512).optional().openapi({description:"Title for the new session"}),changes_summary:b.string().max(5000).optional().openapi({description:"Summary of changes for round-transition emails"}),resolutions:b.array(cW).optional().openapi({description:"Resolution manifest for predecessor threads"}),auto_read_only_on_supersede:b.boolean().default(!0).optional().openapi({description:"Whether to mark predecessor as read-only (default: true)"})}).openapi("SupersedeSessionRequest"),PW=b.object({block_id:b.string(),block_id_scheme:b.literal("v1"),block_index:b.number().int().min(0),block_type:b.string(),block_key:b.string().nullable(),block_key_source:b.enum(["marker","sidecar","auto"]).nullable(),start_line:b.number().int().min(1),end_line:b.number().int().min(1),start_offset:b.number().int().min(0),end_offset:b.number().int().min(0)}).openapi("BlockSummary"),nD=b.object({id:b.string().openapi({description:"Unique session identifier",example:"ses_abc123"}),created_at:b.string().datetime().openapi({description:"ISO 8601 timestamp of session creation"}),state:b.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi({description:"Current session lifecycle state"}),content_ref:ji,source_content_sha256:b.string().regex(/^[a-f0-9]{64}$/).openapi({description:"SHA-256 hash of canonical source content"}),block_count:b.number().int().min(0).openapi({description:"Number of blocks in the session"}),thread_count:b.number().int().min(0).openapi({description:"Total number of threads in the session"}),open_thread_count:b.number().int().min(0).openapi({description:"Number of open (unresolved) threads"})}).openapi("Session"),wH=nD.extend({blocks:b.array(PW).optional().openapi({description:"Block summaries (included on creation)"})}).openapi("CreateSessionResponse"),_H=b.object({session_id:b.string().openapi({description:"Session identifier",example:"ses_abc123"})}),bH=nD.openapi("GetSessionResponse"),UH=Yl.openapi("GetSessionBlocksQueryParams"),SW=b.object({block_id:b.string(),block_key:b.string().nullable(),block_key_source:b.enum(["marker","sidecar","auto"]).nullable(),block_index:b.number().int().min(0),block_type:b.string(),start_line:b.number().int().min(1),end_line:b.number().int().min(1),start_offset:b.number().int().min(0),end_offset:b.number().int().min(0)}).openapi("SessionBlockListItem"),kH=b.object({session_id:b.string(),block_id_scheme:b.literal("v1"),block_key_scheme:b.literal("v1"),total_blocks:b.number().int().min(0),blocks:b.array(SW),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("GetSessionBlocksResponse"),zW=b.object({block_id:b.string(),block_key:b.string().nullable().optional(),block_key_source:b.string().nullable().optional(),block_index:b.number().int(),block_type:b.string(),properties:b.record(b.string(),b.unknown()).nullable().optional(),html:b.string().openapi({description:"Rendered HTML for this block"}),start_line:b.number().int(),end_line:b.number().int(),start_offset:b.number().int().optional(),end_offset:b.number().int().optional()}).openapi("RenderBlock"),lH=b.object({session_id:b.string(),source_content_sha256:b.string(),blocks:b.array(zW),render_profile:b.string().nullable(),etag:b.string().openapi({description:"ETag for cache validation"})}).openapi("GetSessionRenderResponse"),MW=b.object({block_id:b.string(),thread_count:b.number().int().min(0),open_thread_count:b.number().int().min(0),has_unread:b.boolean().optional(),severity_max:b.enum(["suggestion","needs_changes","blocking"]).nullable()}).openapi("BlockAnnotation"),DH=b.object({session_id:b.string(),blocks:b.array(MW),updated_at:b.string().datetime()}).openapi("GetSessionAnnotationsResponse");var GH=b.object({token:b.string().openapi({description:"URL token from magic link",example:"tok_abc123xyz..."})}).openapi("ExchangeTokenRequest"),tH=b.object({access_token:b.string().openapi({description:"Short-lived access token for API requests"}),token_type:b.literal("Bearer"),expires_in:b.number().int().openapi({description:"Token lifetime in seconds",example:3600}),refresh_grant:b.boolean().optional().openapi({description:"Whether a refresh cookie was set"})}).openapi("ExchangeTokenResponse"),QH=b.object({access_token:b.string(),token_type:b.literal("Bearer"),expires_in:b.number().int()}).openapi("RefreshTokenResponse"),WH=b.object({email:b.string().email().openapi({description:"Email address to send OTP to"})}).openapi("SendOtpRequest"),YH=b.object({code:b.string().length(6).regex(/^\d{6}$/).openapi({description:"6-digit OTP code",example:"123456"})}).openapi("VerifyOtpRequest"),IH=b.object({access_token:b.string().openapi({description:"Access token with elevated verification tier"}),token_type:b.literal("Bearer"),expires_in:b.number().int(),verification_tier:b.enum(["step_up"]).openapi({description:"Verification tier achieved"})}).openapi("VerifyOtpResponse");var RW=["full","redacted","pseudonymous","block_window.v1","unresolved.v1","response_matrix.v1","delta_review.v1","corpus_context.v1"],AW=["repair_kit.v1"],xW={block_window:"block_window.v1",unresolved:"unresolved.v1",response_matrix:"response_matrix.v1",repair_kit:"repair_kit.v1",delta_review:"delta_review.v1",corpus_context:"corpus_context.v1"};function hW(n){if(RW.includes(n))return n;if(AW.includes(n))return n;let i=xW[n];if(i)return i;throw Error(`Unknown export view: ${n}`)}var CW=b.enum(["full","redacted","pseudonymous","block_window","block_window.v1","unresolved","unresolved.v1","response_matrix","response_matrix.v1","repair_kit","repair_kit.v1","delta_review","delta_review.v1","corpus_context","corpus_context.v1"]),EW=b.enum(["json","llm_prompt","llm_prompt.v1"]),VH=b.object({schema:b.literal("v2").default("v2"),view:CW.default("full"),format:EW.default("json"),allow_partial:b.boolean().default(!1),anchors:b.string().optional(),window_before:b.coerce.number().int().min(0).default(2),window_after:b.coerce.number().int().min(0).default(2),severity:b.string().optional(),tags:b.string().optional(),assignee:b.string().optional(),signed:b.boolean().optional(),include_derived_keys:b.boolean().optional()}).superRefine((n,i)=>{if(hW(n.view)==="block_window.v1"){if(!n.anchors||n.anchors.trim().length===0)i.addIssue({code:b.ZodIssueCode.custom,path:["anchors"],message:"anchors is required when view=block_window.v1"})}}),oW=b.object({block_id:b.string(),block_id_scheme:b.literal("v1"),block_index:b.number().int().min(0),block_type:b.string(),block_key:b.string().nullable(),block_key_source:b.enum(["marker","sidecar","auto"]).nullable(),start_line:b.number().int().min(1),end_line:b.number().int().min(1),start_offset:b.number().int().min(0),end_offset:b.number().int().min(0),plaintext_sha256:b.string().regex(/^[a-f0-9]{64}$/).nullable()}).openapi("ExportBlock"),TW=b.object({id:b.string(),author_email:b.string().email().nullable().optional(),author_name:b.string().nullable(),author_source:b.string().nullable().optional(),body_md:b.string(),created_at:b.string().datetime(),updated_at:b.string().datetime().nullable(),version:b.number().int().min(1)}).openapi("ExportComment"),ZW=b.object({id:b.string(),anchor:Xv,block_id:b.string().nullable().optional(),status:b.enum(["open","resolved"]),severity:b.enum(["suggestion","needs_changes","blocking"]),created_at:b.string().datetime(),updated_at:b.string().datetime().nullable().optional(),finding_id:b.string().nullable().optional(),rule_id:b.string().nullable().optional(),rule_fingerprint:b.string().nullable().optional(),check_run_id:b.string().nullable().optional(),rule_ref:$_.optional(),comments:b.array(TW)}).openapi("ExportThread"),rW=b.object({open_threads:b.number().int().nonnegative(),resolved_threads:b.number().int().nonnegative(),blocking_threads:b.number().int().nonnegative()}).openapi("ExportIssuePerAnchorStatus"),mW=b.object({anchor_id:b.string(),block_id:b.string().nullable(),anchor_type:b.enum(["session","block","range"]),linked_thread_ids:b.array(b.string()),per_anchor_status:rW}).openapi("ExportIssueAnchor"),yW=b.object({issue_id:b.string(),title:b.string(),status:b.string(),severity:b.string().nullable(),tags:b.array(b.string()),anchor_count:b.number().int().nonnegative(),thread_count:b.number().int().nonnegative(),anchors_in_this_session:b.array(mW)}).openapi("ExportIssue"),dW=b.object({disposition_id:b.string(),thread_id:b.string(),state:b.string(),rationale_md:b.string().nullable(),reason_code:b.string().nullable(),waiver_expires_at:b.string().datetime().nullable(),decided_by_participant_id:b.string().nullable(),decided_by_user_id:b.string().nullable(),decided_by_verification_level:b.string().nullable(),decided_by_display:b.string(),decided_at:b.string().datetime(),provenance_json:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().datetime()}).openapi("ExportDisposition"),eW=b.object({evidence_id:b.string(),thread_id:b.string(),evidence_type:b.string(),evidence_json:b.record(b.string(),b.unknown()),verification_status:b.string(),verification_tier:b.number().int().nullable(),verified_at:b.string().datetime().nullable(),verifier_version:b.string().nullable(),dedupe_key:b.string().nullable(),created_by_participant_id:b.string().nullable(),created_by_user_id:b.string().nullable(),created_by_verification_level:b.string().nullable(),created_by_display:b.string(),created_at:b.string().datetime()}).openapi("ExportEvidence"),pW=b.string().regex(/^[a-z][a-z0-9_.-]*$/),aW=b.string().regex(/^[a-z][a-z0-9_.-]*\.v[0-9]+$/),sW=b.object({schema_version:aW,authoritative:b.boolean()}).passthrough().openapi("ExtensionEnvelope");var n8=b.object({canonicalization:b.string(),export_sha256:b.string().regex(/^[a-f0-9]{64}$/).nullable(),export_full_sha256:b.string().regex(/^[a-f0-9]{64}$/).nullable().optional()}).passthrough().openapi("ExportIntegrity"),v8=b.object({section:b.enum(["threads","comments","approvals","proposed_changes","extensions"]),reason:b.enum(["db_timeout","permission_denied","section_disabled","internal_error"]),count_missing:b.number().int().min(0).optional()}).openapi("ExportIncompleteSection"),fH=b.object({schema_version:b.literal("export.v1"),exported_at:b.string().datetime(),view_requested:b.string().nullable().optional(),view_resolved:b.string().optional(),integrity:n8,partial:b.boolean().optional(),incomplete_sections:b.array(v8).optional(),session:b.object({id:b.string(),created_at:b.string().datetime(),status:b.enum(["active","closed","archived"]),content_ref:ji,source_content_sha256:b.string().regex(/^[a-f0-9]{64}$/),root_session_id:b.string().nullable().optional(),supersedes_session_id:b.string().nullable().optional()}),blocks:b.array(oW),threads:b.array(ZW),issues:b.array(yW).default([]).openapi({description:"Issue summaries with per-anchor status for anchors in this session"}),dispositions:b.array(dW).default([]).openapi({description:"Thread disposition log entries exported for audit/compliance workflows"}),evidence:b.array(eW).default([]).openapi({description:"Thread evidence records exported for audit/compliance workflows"}),approvals:b.object({}).passthrough().optional().openapi({description:"Approval state summary (M0.5+)"}),extensions:b.record(pW,sW).optional().openapi({description:"Optional extension envelopes keyed by namespace (extensions.{namespace})"}),metadata:b.object({export_view:b.string().optional(),integrity_hash:b.string().optional()}).optional()}).openapi("ExportResponse");var i8=b.object({code:b.string(),details:b.record(b.string(),b.unknown()).optional(),thread_ids:b.array(b.string()).optional(),approval_ids:b.array(b.string()).optional()}).openapi("PolicyReason"),$8=b.object({supersedes_session_id:b.string(),blocks_added:b.number().int().min(0),blocks_removed:b.number().int().min(0),blocks_changed:b.number().int().min(0),blocks_unchanged:b.number().int().min(0),orphaned_threads_count:b.number().int().min(0)}).openapi("BriefingDeltaSummary"),g8=b.object({verdict:b.enum(["pass","fail","warn"]),reasons:b.array(i8)}).openapi("BriefingPolicyStatus"),w8=b.object({thread_id:b.string(),block_id:b.string().nullable(),severity:b.string(),snippet:b.string().max(120),source:b.enum(["human","system","automation"]),has_disposition:b.boolean()}).openapi("BriefingBlockerItem"),_8=b.object({items:b.array(w8),total:b.number().int().min(0)}).openapi("BriefingBlockers"),b8=b.object({decision:b.enum(["approved","rejected","conditional"]),decided_by:b.string(),decided_at:b.string().datetime(),pending_conditions:b.number().int().min(0)}).openapi("BriefingApprovalDecision"),U8=b.object({requested:b.boolean(),decisions:b.array(b8),pending_count:b.number().int().min(0)}).openapi("BriefingApprovalsSummary"),k8=b.object({last_run_id:b.string(),status:b.enum(["completed","running","failed"]),total_findings:b.number().int().min(0),gating_findings:b.number().int().min(0),informational_findings:b.number().int().min(0)}).openapi("BriefingChecksSummary"),l8=b.object({total:b.number().int().min(0),unresolved:b.number().int().min(0),blocking:b.number().int().min(0),system_findings:b.number().int().min(0),human:b.number().int().min(0)}).openapi("BriefingThreadsSummary"),KH=b.object({schema_version:b.literal("briefing.v1"),session_id:b.string(),content_ref:ji,title:b.string().nullable(),created_at:b.string().datetime(),delta:$8.optional(),policy_status:g8,blockers:_8,approvals:U8,checks:k8.optional(),threads:l8,computed_at:b.string().datetime(),annotations_version:b.number().int().min(1)}).openapi("BriefingBundle");var D8=b.enum(["review","repo","tenant"]).openapi("SearchScope"),vD=b.enum(["fts","semantic"]).openapi({description:"`fts` is the canonical public search mode. `semantic` remains compatibility-only, non-authoritative retrieval and must not be treated as required launch behavior."}).openapi("SearchMode"),J8=b.enum(["review","block","finding","comment"]).openapi("SearchKind"),__=b.enum(["open","resolved","draft"]).openapi("SearchStatus"),iD=b.enum(["suggestion","needs_changes","blocking"]).openapi("SearchSeverity"),FH=b.object({q:b.string().trim().min(1),scope:D8.default("tenant").optional(),mode:vD.default("fts").optional().openapi({description:"Canonical public search uses `fts`. `semantic` is compatibility-only and may be disabled per tenant."}),review_id:b.string().trim().min(1).optional(),repo_id:b.string().trim().min(1).max(256).optional(),project_id:b.string().trim().min(1).max(256).optional(),model:b.string().trim().min(1).max(128).optional().openapi({description:"Compatibility-only semantic-search model hint. Canonical FTS callers should omit this field."}),min_score:b.coerce.number().min(0).max(1).optional().openapi({description:"Compatibility-only semantic-search threshold. Canonical FTS callers should omit this field."}),kind:b.string().trim().min(1).optional().openapi({description:"Single kind or comma-separated kinds"}),status:__.optional(),severity:iD.optional(),assignee:b.string().trim().min(1).optional(),tags:b.string().trim().min(1).optional().openapi({description:"Comma-separated tag list"}),from:b.string().datetime().optional(),to:b.string().datetime().optional(),filters:b.string().trim().min(1).optional().openapi({description:"JSON-encoded or key=value,key=value filter expression"}),cursor:b.string().min(1).optional(),limit:b.coerce.number().int().min(1).max(100).optional()}).strict().openapi("SearchQueryParams"),X8=b.discriminatedUnion("type",[b.object({type:b.literal("review")}).strict(),b.object({type:b.literal("block"),block_id:s6}).strict()]).openapi("SearchAnchor"),G8=b.object({schema_version:b.literal("anchor_ref.v1"),source_type:b.enum(["git","upload"]),repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),file_path:b.string().min(1),doc_key:b.string().nullable(),anchor:X8}).strict().openapi("SearchTarget"),t8=b.object({kind:J8,score:b.number(),entity_id:b.string().min(1),review_id:b.string().min(1),target:G8,snippet:b.string(),finding:b.object({finding_id:b.string().min(1),status:__,severity:iD.nullable(),assignee:b.string().nullable(),updated_at:b.string().datetime().nullable()}).strict().nullable().optional(),highlight_ranges:b.array(b.object({start:b.number().int().nonnegative(),end:b.number().int().positive()}).strict()),non_authoritative:b.literal(!0).optional(),provenance:b.object({model_id:b.string().min(1),model_version:b.string().min(1),similarity_score:b.number().min(0).max(1)}).strict().openapi({description:"Compatibility-only semantic-search provenance for non-authoritative results."}).optional()}).strict().openapi("SearchResult"),NH=b.object({results:b.array(t8),total_count:b.number().int().nonnegative(),cursor:b.string().nullable(),has_more:b.boolean(),metadata:b.object({search_mode:vD,model_id:b.string().min(1).optional(),model_version:b.string().min(1).optional()}).strict().openapi({description:"Canonical metadata reports `fts`. Semantic metadata fields are compatibility-only."}).optional(),request_id:b.string()}).strict().openapi("SearchResponse");var Q8=["properties","applicability"],$D=["ts_"],W8="^[a-z][a-z0-9_]{0,63}$",Y8=b.object({key:b.string(),targets:b.array(b.enum(Q8)).min(1),value_format:b.enum(["slug","string"]),description:b.string(),examples:b.array(b.string()).min(1)}).openapi("PropertyVocabularyEntry"),SH=b.object({naming:b.object({case:b.literal("snake_case"),key_pattern:b.string(),max_key_length:b.number().int().positive()}).openapi("PropertyVocabularyNaming"),reserved:b.object({canonical_keys:b.array(b.string()),internal_prefixes:b.array(b.string())}).openapi("PropertyVocabularyReserved"),tenant_extensions:b.object({allowed:b.boolean(),forbidden_prefixes:b.array(b.string()),discoverable:b.boolean(),notes:b.string()}).openapi("PropertyVocabularyTenantExtensions"),canonical_keys:b.array(Y8)}).openapi("PropertyVocabulary"),zH={naming:{case:"snake_case",key_pattern:W8,max_key_length:64},reserved:{canonical_keys:["client","content_type","source_kind","audience","market","surface"],internal_prefixes:[...$D]},tenant_extensions:{allowed:!0,forbidden_prefixes:[...$D],discoverable:!1,notes:"Tenant-defined keys are allowed but remain out-of-band until custom property-schema discovery lands."},canonical_keys:[{key:"client",targets:["properties","applicability"],value_format:"slug",description:"Brand, customer, product line, or account identifier used to scope rules and reviews.",examples:["acme","globex","internal_docs"]},{key:"content_type",targets:["properties","applicability"],value_format:"slug",description:"The kind of material under review, expressed as a stable slug rather than free-form prose.",examples:["landing_page","blog_post","ad_copy"]},{key:"source_kind",targets:["properties","applicability"],value_format:"slug",description:"The intake/source family for the reviewable artifact or the rule targeting it.",examples:["git","upload","paste"]},{key:"audience",targets:["properties","applicability"],value_format:"slug",description:"Intended reader or stakeholder audience segment for the reviewed content.",examples:["external","internal","partner"]},{key:"market",targets:["properties","applicability"],value_format:"slug",description:"Geographic, regulatory, or commercial market segment affected by the content or rule.",examples:["us","de","healthcare"]},{key:"surface",targets:["properties","applicability"],value_format:"slug",description:"Delivery surface or channel used for migration from legacy workstream language.",examples:["website","email","reddit"]}]};function A$(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;return n}function Bn(n,i){let $=n[i];if(typeof $!=="string")return;let g=$.trim();return g.length>0?g:void 0}function gD(n,i){let $=n[i];return typeof $==="string"?$:void 0}function I8(n,i){let $=n[i];return typeof $==="number"&&Number.isFinite($)?$:void 0}function j8(n,i){let $=n[i];return typeof $==="boolean"?$:void 0}function F0(n,i){return A$(n[i])??void 0}function N0(n){return Bn(n,"request_id")}function u8(n){if(Array.isArray(n))return{entries:n,record:null};let i=A$(n);if(!i)throw Error("Expected array or object list payload from upstream API");if(Array.isArray(i.data))return{entries:i.data,record:i};if(Array.isArray(i.items))return{entries:i.items,record:i};return{entries:[],record:i}}function H8(n,i){let{entries:$,record:g}=u8(n),w={data:$.flatMap((_)=>{let U=A$(_);if(!U)return[];let k=i(U);return k?[k]:[]})};if(g){let _=I8(g,"total");if(_!==void 0)w.total=_;let U=Bn(g,"next_cursor");if(U!==void 0)w.next_cursor=U;let k=j8(g,"has_more");if(k!==void 0)w.has_more=k;let l=N0(g);if(l!==void 0)w.request_id=l}return w}function V8(n){let i=Bn(n,"id");if(!i)return null;let $=F0(n,"proposed_content")??F0(n,"proposedContent"),g=Bn(n,"title")??$?.title,v=Bn(n,"source_type")??Bn(n,"sourceType"),w=Bn(n,"status"),_=Bn(n,"priority")??Bn($??{},"priority"),U=Bn(n,"created_at")??Bn(n,"createdAt"),k=typeof g==="string"&&g.trim().length>0?g.trim():void 0;if(!k||!v||!w||!_||!U)throw Error(`GCI list response missing required fields for id '${i}'`);return{...n,...$&&n.proposed_content===void 0?{proposed_content:$}:{},id:i,title:k,source_type:v,status:w,priority:_,created_at:U}}function b_(n){return H8(n,V8)}function wD(n){let i=A$(n);if(!i)throw Error("Expected object payload from upstream API");let $=F0(i,"data")??{...i},g=gD($,"prompt_fragment")??gD($,"prompt"),v=N0(i)??N0($),w={...$};if(g!==void 0)w.prompt_fragment=g;if(v!==void 0&&Bn(w,"request_id")===void 0)w.request_id=v;return w}function _D(n){let i=n.rules;if(Array.isArray(i))return i.filter((w)=>w!==null&&typeof w==="object");let $=[],g=n.active_rules;if(Array.isArray(g))for(let w of g){let _=A$(w);if(!_)continue;$.push({id:_.artifact_id,title:_.artifact_type,kind:"artifact",content:_.severity})}let v=n.check_rules;if(Array.isArray(v))for(let w of v){let _=A$(w);if(!_)continue;let{pattern:U,assertion_config:k}=_,l=typeof _.message_template==="string"?_.message_template:typeof _.rule_id==="string"?_.rule_id:null,J=typeof U==="string"?U:typeof k==="string"?k:l;if(typeof J!=="string")continue;$.push({id:_.rule_id,title:_.message_template,kind:_.rule_type,content:J,scope:_.source_artifact_id})}return $}function c0(n){return wD(n)}function P0(n){return _D(n)}var S0=/^[A-Za-z0-9+/]*={0,2}$/,U_="local";function Kw(n){if(typeof n!=="object"||n===null||Array.isArray(n))return null;return n}function f8(n,i,$){let g=Kw(n);if(!g)return i;let v=g.ok===!0&&"result"in g,w=v?Kw(g.result):g,_=w!==null?{...w}:{result:v?g.result:n};_.ok=!0,_.request_id=i.request_id;let U=v&&Array.isArray(g.warnings)?g.warnings:i.warnings;if(U!==void 0)_.warnings=U;let k=(v?Kw(g.pagination):null)??i.pagination;if(k!==void 0)_.pagination=k;let l=(v?Kw(g.advisory):null)??i.advisory;if(l!==void 0)_.advisory=l;let J=$?.retry??(v?Kw(g.retry):null);if(J!==null&&J!==void 0)_.retry=J;else if(i.retry!==void 0)_.retry=i.retry;return _}function H(n,i,$){let g=Kl(n,i,$),v=f8(n,g,$);return{content:[{type:"text",text:JSON.stringify(v,null,2)}]}}function G(n,i){let $=n.status===0||n.status>=500||n.status===429,g=Ol({requestId:n.requestId,error:{code:n.code,message:n.message,retryable:$,details:n.details,fix_hint:n.fixHint},retry:i?.operation?Ll({operation:i.operation,hasIdempotencyKey:i.hasIdempotencyKey,retryable:$,statusCode:n.status,errorCode:n.code}):{retry_classification:$?"transient":"manual"}});return{content:[{type:"text",text:JSON.stringify(g,null,2)}],isError:!0}}function mv(n,i,$,g){return new D(n,i,$,g?.requestId??U_,g?.details,g?.fixHint)}function kD(n,i){if(n instanceof D)return n;let $=i?.message??(n instanceof Error?n.message:String(n));return mv(i?.status??500,i?.code??"internal_error",$,i)}function _n(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("Expected object payload from upstream API");let i=n,$=i.data;if($&&typeof $==="object"&&!Array.isArray($))return $;return i}var lD=1e7;function bD(n){if(typeof n==="string"){let v=n.trim();return v.length>0?v:null}if(!n||typeof n!=="object"||Array.isArray(n))return null;let i=n,$=i.base64??i.content_base64??i.content??i.data??i.bytes;if(typeof $!=="string")return null;let g=$.trim();return g.length>0?g:null}function UD(n){if(typeof n==="string"){let g=n.trim();return g.length>0?g:null}if(!n||typeof n!=="object"||Array.isArray(n))return null;let i=n,$=i.path??i.file_path??i.filename??i.file_name??i.name;if(typeof $==="string"&&$.trim().length>0)return $.trim();return null}function DD(n){if(n===void 0||n===null)return{assets:{}};let i={};if(Array.isArray(n)){for(let[g,v]of n.entries()){let w=UD(v),_=bD(v);if(!w||!_)return{error:new D(422,"invalid_argument",`inline_assets[${g}] requires both a path and base64 payload`,"local")};i[w]=_}return{assets:i}}if(typeof n!=="object")return{error:new D(422,"invalid_argument","inline_assets must be an object map or array","local")};let $=Object.entries(n);for(let[g,v]of $){let w=v&&typeof v==="object"&&!Array.isArray(v)?UD(v):g,_=bD(v);if(!w||!_)return{error:new D(422,"invalid_argument",`inline_assets entry '${g}' requires base64 content`,"local")};i[w]=_}return{assets:i}}function JD(n){if(!n||n.length===0)return"Asset path is empty";if(n.includes("\x00"))return"Asset path contains NUL byte";let i=n.replace(/\\/g,"/");if(i.startsWith("/"))return"Asset path must be relative (no leading /)";if(i.includes(".."))return"Asset path must not contain '..'";return null}function z0(n){let i=n.replace(/\s+/g,"");if(i.length===0)return new Uint8Array;if(i.length%4!==0||!S0.test(i))return null;let $=Buffer.from(i,"base64"),g=i.replace(/=+$/,""),v=$.toString("base64").replace(/=+$/,"");if(g!==v)return null;return Uint8Array.from($)}var q8=await Promise.resolve().then(() => y0(Q_(),1)),XD=q8.version,L8={Server:c_,StdioServerTransport:S_,CallToolRequestSchema:O_,ListToolsRequestSchema:K_};function k_(n){return{content:n.content.map((i)=>({type:i.type,text:i.text})),...n.isError===void 0?{}:{isError:n.isError}}}async function GD(n,i=L8){let $=new i.Server({name:"typescape",version:XD},{capabilities:{tools:{}}});$.setRequestHandler(i.ListToolsRequestSchema,async()=>{return{tools:n.getTools().map((w)=>({name:w.name,description:w.description,inputSchema:w.inputSchema}))}}),$.setRequestHandler(i.CallToolRequestSchema,async(v)=>{let{name:w,arguments:_}=v.params,U=n.getHandler(w);if(!U)return k_(G(mv(404,"not_found",`Unknown tool: ${w}`,{details:{tool:w},fixHint:"Use tools/list to inspect the registered Typescape tools."})));try{if(_===void 0)return k_(G(mv(400,"invalid_request",`Missing arguments payload for tool: ${w}`,{details:{tool:w},fixHint:"Provide an arguments object for the tool call, even if it is empty."})));let k=await U(_);return k_(k)}catch(k){return k_(G(kD(k)))}});let g=new i.StdioServerTransport;await $.connect(g),process.stderr.write(`Typescape MCP server v${XD} started
|
|
43
|
-
`)}var K8=300000;function tD(n){let i=null;return{async getCapabilities(){let $=Date.now();if(i&&$-i.fetchedAt<K8)return i.features;try{let g=await n.get("/me/capabilities");if(!g.body.features||typeof g.body.features!=="object")throw Error("Capabilities response missing features object");return i={features:g.body.features,fetchedAt:$},i.features}catch(g){if(g instanceof D)throw g;throw g}},featureDisabledResult($){return G(mv(403,"feature_disabled",`Feature '${$}' is not enabled on this server`,{details:{feature:$}}))}}}var O8=__.options.filter((n)=>n!=="draft"),QD={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier (short slug, e.g. 'typescape'; not a GitHub path like 'org/repo')"},git_sha:{type:"string",description:"Concrete 40-hex Git commit SHA (agent must resolve; no symbolic refs)"},file_path:{type:"string",description:"Path to the source document (required)"},filename:{type:"string",description:'PDF filename when document_type is "pdf" (optional; defaults to the file_path basename)'},project_id:{type:"string",description:"Upload project ID for upload-backed reviews (requires upload_batch_id)"},upload_batch_id:{type:"string",description:"Upload batch ID for upload-backed reviews (requires project_id)"},title:{type:"string",description:"Review title (optional)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},name:{type:"string"},role:{type:"string",enum:["reviewer","approver","observer","owner"]},scopes:{type:"array",minItems:1,items:{type:"string",enum:["read","comment","approve","admin"]}}},required:["email","role"]},description:"Participants to invite (optional). Scopes are optional and default by role."},reviewer_emails:{type:"array",items:{type:"string"},description:"Legacy alias for participants. Each email is invited as a reviewer."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},identity_restriction:{type:"string",enum:["open","participants_only","domain"],description:'Identity verification mode for OTP step-up. "open" (default) accepts any email. "participants_only": only invited participant emails. "domain": only emails from allowed_email_domains.'},allowed_email_domains:{type:"array",items:{type:"string"},description:'Allowed email domains when identity_restriction is "domain" (e.g., ["acme.com", "example.org"])'},operator_name:{type:"string",maxLength:200,description:"Name of the operator initiating the review (optional)"},focus_areas:{type:"array",items:{type:"string",maxLength:100},maxItems:10,description:"Areas the reviewer should focus on (optional)"},framing:{type:"string",maxLength:1000,description:"Context framing text shown to reviewers (optional)"},carry_forward_findings:{type:"boolean",description:"Whether to carry forward findings from the superseded review (optional)"},carry_forward_filter:{type:"string",enum:["all","blocking","needs_changes"],description:"Filter for which findings to carry forward (optional)"},content_body:{type:"string",maxLength:1048576,description:"Inline Markdown content (alternative to repo_id+git_sha). Creates an upload-backed review automatically."},inline_assets:{oneOf:[{type:"object",additionalProperties:{oneOf:[{type:"string"},{type:"object",properties:{base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}]}},{type:"array",items:{type:"object",properties:{path:{type:"string"},file_path:{type:"string"},filename:{type:"string"},file_name:{type:"string"},name:{type:"string"},base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}}],description:'Companion assets as either a map of relative path => base64 content, or a list of asset objects. Map example: { "images/fig.png": "iVBORw0KGgo..." }. Array example: [{ "path": "images/fig.png", "base64": "iVBORw0KGgo..." }]. Total decoded size must be <= 10MB.'},document_type:{type:"string",enum:["markdown","image_set","pdf"],description:'Document type (default: "markdown"). Use "image_set" for image-only reviews or "pdf" for PDF reviews.'},asset_resolution_mode:{type:"string",enum:["strict","warn"],description:'Asset resolution mode (default: "strict"). Use "warn" to create upload-backed reviews even if some referenced assets are missing.'},filenames:{type:"array",items:{type:"string"},minItems:1,maxItems:100,description:'Ordered list of image filenames (required when document_type is "image_set"). Each filename must be a relative path. Supported formats: PNG, JPEG, WebP, GIF, SVG.'},purpose:{type:"string",enum:["review","rules"],description:'Review purpose (default: "review"). Use "rules" to create a rule review that feeds the rules governance pipeline.'},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map). Used when purpose=rules or for rule-aware content reviews."}},required:["file_path"]},WD={type:"object",properties:{review_id:{type:"string",description:"ID of the review to revise (the predecessor, e.g., rev_01HXYZ...)"},git_sha:{type:"string",description:"Concrete 40-hex Git commit SHA for the new revision (agent must resolve; no symbolic refs)"},content_body:{type:"string",description:"Inline Markdown content for upload-backed revised reviews (alternative to git_sha/upload_batch_id)"},project_id:{type:"string",description:"Upload project ID for upload-backed revised reviews (required with upload_batch_id)"},upload_batch_id:{type:"string",description:"Upload batch ID for upload-backed revised reviews (alternative to git_sha/content_body)"},file_path:{type:"string",description:"Path to the source document (optional; defaults to predecessor's file_path)"},document_type:{type:"string",enum:["markdown","image_set","pdf"],description:"Document type for revision (optional; defaults to predecessor document_type)"},filename:{type:"string",description:"PDF filename for document_type=pdf revisions (optional; defaults to file_path)"},filenames:{type:"array",items:{type:"string"},minItems:1,description:"Ordered image filenames for document_type=image_set revisions"},title:{type:"string",description:"Title for the new review (optional; defaults to predecessor's title)"},changes_summary:{type:"string",maxLength:5000,description:"Summary of changes for round-transition emails and the superseded banner (optional)"},resolutions:{type:"array",items:{type:"object",properties:{finding_id:{type:"string",description:"Finding ID from the predecessor review"},disposition:{type:"string",enum:["fixed","wont_fix","duplicate","by_design"],description:"How the finding was resolved"},evidence:{type:"string",maxLength:2000,description:"Optional evidence or explanation for the resolution"}},required:["finding_id","disposition"]},description:"Resolution manifest for findings from the predecessor review (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id"]},YD={type:"object",properties:{review_id:{type:"string",description:"Review ID to export (e.g., rev_01HXYZ...)"},schema:{type:"string",default:"v2",description:"Export schema version (default: v2). Explicit retired or unknown schema values fail with machine-readable API errors."},view:{type:"string",description:"Export view variant (optional). Values: redacted, response_matrix.v1, delta_review.v1"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},include_rule_context:{type:"boolean",description:"Include rule context metadata in the export (rule_context block with compiled_hash, policy_snapshot_id, and source rule refs). Default: false."}},required:["review_id"]},ID={type:"object",properties:{review_id:{type:"string",description:"Review ID to fetch the handoff bundle for"},include_rules:{type:"boolean",description:"Whether to include rule context (default: true)"},include_lineage:{type:"boolean",description:"Whether to include lineage summaries (default: true)"},include_advisory:{type:"boolean",description:"Whether to include advisory artifacts (default: true)"},include_blocks:{type:"boolean",description:"Whether to include block slices (default: true)"},max_rules:{type:"number",description:"Maximum number of structured rules to inline"}},required:["review_id"]},jD={type:"object",properties:{repo_id:{type:"string",description:"Filter reviews by repository identifier (short slug, e.g. 'typescape'; optional)"},state:{type:"string",description:"Filter by review state: active, closed, archived (optional)"},file_paths:{type:"string",description:"Comma-separated list of file paths to filter by (optional)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of reviews to return (optional, default: 20)"},root_review_id:{type:"string",description:"Filter by supersede chain root review ID (optional, e.g., rev_...)"},supersedes_review_id:{type:"string",description:"Filter by immediate predecessor review ID (optional, e.g., rev_...)"},has_successor:{type:"boolean",description:"If true, return only reviews that have been superseded; if false, only chain heads (optional)"},q:{type:"string",description:"Search query for title/file path (alias: search, optional)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:[]},uD={type:"object",properties:{review_id:{type:"string",description:"Review ID to retrieve (e.g., rev_01HXYZ...)"}},required:["review_id"]},HD={type:"object",properties:{review_id:{type:"string",description:"Review ID to render (e.g., rev_01HXYZ...)"},include_plaintext:{type:"boolean",description:"Include plaintext representation alongside HTML (optional, default: false)"}},required:["review_id"]},VD={type:"object",properties:{review_id:{type:"string",description:"Review ID to list findings for (e.g., rev_01HXYZ...)"},block_id:{type:"string",description:"Filter findings by block_id anchor (optional)"},status:{type:"string",description:"Filter findings by status: open, resolved, all (optional, default: all)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of findings to return (optional, default: 50)"},q:{type:"string",description:"Search query across finding id, block id, and comment text (optional; alias: search)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:["review_id"]},M0={type:"object",properties:{review_id:{type:"string",description:"Review ID (e.g., rev_01HXYZ...)"}},required:["review_id"]},fD={type:"object",properties:{query:{type:"string",description:"Search query text for reviews (title/file path)."},limit:{type:"number",description:"Maximum reviews to return (optional, default: 20)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["query"]},qD={type:"object",properties:{review_id:{type:"string",description:"Review ID to search within."},query:{type:"string",description:"Search query text for findings/comments."},block_id:{type:"string",description:"Optional block filter."},status:{type:"string",enum:O8,description:"Optional status filter: open | resolved."},limit:{type:"number",description:"Maximum findings to return (optional, default: 50)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","query"]};var LD=["typescape_create_review","typescape_revise_review","typescape_export_review","typescape_get_handoff","typescape_list_reviews","typescape_get_review","typescape_get_render","typescape_list_findings","typescape_search_reviews","typescape_search_findings","typescape_close_review","typescape_reopen_review"],B8="markdown",F8="open",N8="strict";function c8(n){if(n==="approver")return["read","comment","approve"];if(n==="observer")return["read"];if(n==="owner")return["read","comment","approve","admin"];return["read","comment"]}function P8(n){return n.map((i)=>{let $=i.scopes&&i.scopes.length>0?[...new Set(i.scopes)]:c8(i.role);return{email:i.email,...i.name?{name:i.name}:{},role:i.role,scopes:$}})}function S8(n,i){let $=[];if(Array.isArray(n))$.push(...n);if(Array.isArray(i))for(let w of i){if(typeof w!=="string")continue;let _=w.trim();if(_.length===0)continue;$.push({email:_,role:"reviewer"})}let g=new Set,v=[];for(let w of $){if(!w||typeof w.email!=="string")continue;let _=w.email.trim();if(_.length===0)continue;let U=_.toLowerCase();if(g.has(U))continue;g.add(U),v.push({...w,email:_})}return v}function z8(n){if(!Array.isArray(n))return[];let i=new Set,$=[];for(let g of n){if(typeof g!=="string")continue;let v=g.trim().toLowerCase();if(v.length===0)continue;if(i.has(v))continue;i.add(v),$.push(v)}return $}function M8(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;let i=n.id;return typeof i==="string"&&i.length>0?i:null}function R8(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;let i=n;if(typeof i.id==="string"&&i.id.length>0)return i.id;let $=i.project;if($&&typeof $==="object"&&!Array.isArray($)&&typeof $.id==="string")return $.id;return null}function A8(n){if(!n||typeof n!=="object"||Array.isArray(n))return null;let i=n;if(typeof i.upload_batch_id==="string"&&i.upload_batch_id.length>0)return i.upload_batch_id;let $=i.upload;if($&&typeof $==="object"&&!Array.isArray($)&&typeof $.upload_batch_id==="string")return $.upload_batch_id;return null}function x8(n){let i=DD(n.inline_assets);if("error"in i)return i.error;let $=i.assets;if(!n.file_path)return new D(400,"missing_param","Missing required parameter: file_path","local");let g=typeof n.repo_id==="string"&&n.repo_id.length>0,v=typeof n.git_sha==="string"&&n.git_sha.length>0,w=typeof n.project_id==="string"&&n.project_id.length>0,_=typeof n.upload_batch_id==="string"&&n.upload_batch_id.length>0,U=g&&v,k=w&&_,l=!!n.content_body,J=Object.keys($).length>0;if(g&&!v||!g&&v)return new D(422,"invalid_argument","Both repo_id and git_sha are required for git-backed reviews","local");if(w&&!_||!w&&_)return new D(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed reviews","local");if(n.document_type!==void 0&&n.document_type!=="markdown"&&n.document_type!=="image_set"&&n.document_type!=="pdf")return new D(422,"invalid_argument",`Unsupported document_type: ${n.document_type}. Supported values: "markdown", "image_set", "pdf".`,"local");if(n.asset_resolution_mode!==void 0&&n.asset_resolution_mode!=="strict"&&n.asset_resolution_mode!=="warn")return new D(422,"invalid_argument",`Unsupported asset_resolution_mode: ${n.asset_resolution_mode}. Supported values: "strict", "warn".`,"local");let Q=n.document_type??B8,j=n.identity_restriction??F8,u=n.asset_resolution_mode??N8,W=Q==="image_set",Y=Q==="pdf";if(W){if(!J&&!k)return new D(400,"image_set_empty","image_set reviews require inline_assets or upload-batch input (project_id + upload_batch_id)","local");if(k&&(!n.filenames||n.filenames.length===0))return new D(400,"missing_param",'document_type "image_set" with upload-batch mode requires filenames.',"local");let r=new Set([".png",".jpg",".jpeg",".webp",".gif",".svg"]);if(J){for(let gn of Object.keys($)){let yv=gn.slice(gn.lastIndexOf(".")).toLowerCase();if(!r.has(yv))return new D(422,"unsupported_media_type",`Unsupported image format for image_set: ${gn}. Supported extensions: ${[...r].join(", ")}`,"local")}if(Object.keys($).length>100)return new D(422,"image_set_limit_exceeded",`Image set has ${Object.keys($).length} images, exceeding the maximum of 100`,"local")}}if(Y){if(U)return new D(422,"invalid_argument",'document_type "pdf" is only supported with upload-backed sources (inline_assets or project_id+upload_batch_id).',"local");if(l)return new D(422,"invalid_argument",'document_type "pdf" does not support content_body; provide inline_assets with one .pdf file.',"local");if(!J&&!k)return new D(400,"missing_param",'document_type "pdf" requires either inline_assets with one .pdf file, or upload-batch input (project_id + upload_batch_id).',"local");if(J&&k)return new D(422,"invalid_argument",'document_type "pdf" cannot mix inline_assets and upload-batch inputs.',"local");if(J&&Object.keys($).length!==1)return new D(422,"invalid_argument",'document_type "pdf" requires exactly one inline asset.',"local");if(J){let[r]=Object.keys($);if(!r)return new D(400,"missing_param",'document_type "pdf" requires inline_assets with exactly one .pdf file.',"local");if(r.slice(r.lastIndexOf(".")).toLowerCase()!==".pdf")return new D(422,"unsupported_media_type",`Unsupported PDF format: ${r}. Supported extension: .pdf`,"local");if(n.file_path!==r)return new D(422,"invalid_argument",`For document_type "pdf", file_path must match inline_assets key: ${r}`,"local")}}let B=[U,l,k].filter(Boolean).length;if(!W&&!Y&&B===0)return new D(400,"missing_param","Provide one source mode: (repo_id + git_sha), (content_body), or (project_id + upload_batch_id)","local");if(B>1)return new D(422,"ambiguous_review_input","Cannot mix source modes: choose exactly one of git-backed, inline content_body, or upload-backed.","local");if(!W&&n.filenames&&n.filenames.length>0)return new D(422,"invalid_argument","filenames is only valid when document_type is image_set.","local");if(!Y&&n.filename&&n.filename.trim().length>0)return new D(422,"invalid_argument",'filename is only valid when document_type is "pdf".',"local");if(j==="domain"&&(!n.allowed_email_domains||n.allowed_email_domains.length===0))return new D(422,"invalid_argument",'allowed_email_domains is required when identity_restriction is "domain"',"local");if(Object.keys($).length>0){if(!l&&!W&&!Y)return new D(422,"invalid_argument","inline_assets requires content_body (inline mode)","local");let r=0;for(let[gn,yv]of Object.entries($)){let r0=JD(gn);if(r0)return new D(422,"invalid_argument",`${r0}: ${gn}`,"local");let m0=z0(yv);if(m0===null)return new D(422,"invalid_argument",`Invalid base64 content for asset: ${gn}`,"local");r+=m0.byteLength}if(r>lD)return new D(413,"inline_payload_too_large",`Total decoded inline assets (${r} bytes) exceed 10MB limit. Use the Typescape CLI with upload batch for larger payloads.`,"local")}let O={file_path:n.file_path,document_type:Q,identity_restriction:j,asset_resolution_mode:u};if(U)O.repo_id=n.repo_id,O.git_sha=n.git_sha;if(k)O.project_id=n.project_id,O.upload_batch_id=n.upload_batch_id;if(l)O.content_body=n.content_body;if(Object.keys($).length>0)O.inline_assets=$;let E=S8(n.participants,n.reviewer_emails);if(E.length>0)O.participants=P8(E);if(n.title!==void 0)O.title=n.title;if(n.allowed_email_domains!==void 0&&n.allowed_email_domains.length>0)O.allowed_email_domains=n.allowed_email_domains;if(n.operator_name!==void 0)O.operator_name=n.operator_name;if(n.focus_areas!==void 0&&n.focus_areas.length>0)O.focus_areas=n.focus_areas;if(n.framing!==void 0)O.framing=n.framing;if(n.carry_forward_findings!==void 0)O.carry_forward_findings=n.carry_forward_findings;if(n.carry_forward_filter!==void 0)O.carry_forward_filter=n.carry_forward_filter;if(Y)O.filename=n.filename?.trim()||n.file_path.split("/").filter(Boolean).at(-1)||n.file_path;if(W)O.filenames=n.filenames&&n.filenames.length>0?n.filenames:Object.keys($).sort();if(n.purpose!==void 0)O.purpose=n.purpose;if(n.properties!==void 0)O.properties=n.properties;let T={};if(n.idempotency_key)T["Idempotency-Key"]=n.idempotency_key;if(n.expected_version)T["If-Match"]=n.expected_version;let a=z8(n.reviewer_emails),s=Y&&J?(()=>{let r=Object.entries($)[0];if(!r)return null;let[gn,yv]=r;return gn&&yv?{assetPath:gn,base64Content:yv}:null})():null;return{body:O,headers:T,reviewerEmails:a,pdfInlineFallback:s}}async function h8(n,i,$){let g=Array.isArray($.invitations)?$.invitations:[];if(i.length===0||g.length>0)return g;let v=M8($.review);if(!v)throw new D(500,"invalid_upstream_response","Review create response missing review.id; cannot invite reviewer_emails","local");let w=await n.post(`/reviews/${encodeURIComponent(v)}/participants`,{body:{participants:i.map((U)=>({email:U,role:"reviewer"}))}}),_=Array.isArray(w.body.invitations)?w.body.invitations:[];if(_.length>0)return _;throw new D(502,"invalid_upstream_response","Reviewer invitation follow-up returned no invitations",w.requestId)}async function KD(n,i,$){return n.post("/reviews",{body:i,headers:$})}async function C8(n,i){if(!i.pdfInlineFallback)throw new D(500,"invalid_local_state","PDF fallback requires exactly one inline asset","local");let $=z0(i.pdfInlineFallback.base64Content);if($===null)throw new D(422,"invalid_argument",`Invalid base64 content for asset: ${i.pdfInlineFallback.assetPath}`,"local");let g=await n.post("/projects",{body:{name:`MCP Upload ${i.pdfInlineFallback.assetPath}`}}),v=R8(g.body);if(!v)throw new D(502,"invalid_upstream_response","Project create response missing project id",g.requestId);let w=new FormData;w.append(i.pdfInlineFallback.assetPath,new Blob([$],{type:"application/pdf"}),i.pdfInlineFallback.assetPath);let _=await n.postFormData(`/projects/${encodeURIComponent(v)}/upload`,w),U=A8(_.body);if(!U)throw new D(502,"invalid_upstream_response","Upload response missing upload_batch_id",_.requestId);let k={...i.body,project_id:v,upload_batch_id:U};return delete k.inline_assets,KD(n,k,i.headers)}async function E8(n,i){let $=async(g)=>{let v=await h8(n,i.reviewerEmails,g.body);return H({review:g.body.review,invitations:v},g.requestId)};try{let g=await KD(n,i.body,i.headers);return await $(g)}catch(g){if(g instanceof D&&i.pdfInlineFallback&&g.code==="feature_disabled"&&g.details?.feature==="inline_assets_enabled")try{let v=await C8(n,i);return await $(v)}catch(v){if(v instanceof D)return G(v);throw v}if(g instanceof D)return G(g);throw g}}function o8(n){if(!n.review_id)return new D(400,"missing_param","Missing required parameter: review_id","local");let i=typeof n.git_sha==="string"&&n.git_sha.length>0,$=typeof n.content_body==="string"&&n.content_body.length>0,g=typeof n.upload_batch_id==="string"&&n.upload_batch_id.length>0,v=typeof n.project_id==="string"&&n.project_id.length>0;if(v&&!g||!v&&g)return new D(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed revision","local");let w=[i,$,g].filter(Boolean).length;if(w===0)return new D(400,"missing_param","One of git_sha, content_body, or upload_batch_id is required","local");if(w>1)return new D(422,"invalid_argument","git_sha, content_body, and upload_batch_id are mutually exclusive","local");let _=i?n.git_sha:void 0;if(_&&!/^[a-f0-9]{40}$/i.test(_))return new D(400,"invalid_param",`Invalid git_sha format: must be a 40-character hex string, got "${n.git_sha}"`,"local");let U={};if(_)U.git_sha=_.toLowerCase();if($)U.content_body=n.content_body;if(g)U.project_id=n.project_id,U.upload_batch_id=n.upload_batch_id;if(n.file_path!==void 0)U.file_path=n.file_path;if(n.document_type!==void 0)U.document_type=n.document_type;if(n.filename!==void 0)U.filename=n.filename;else if(n.document_type==="pdf"&&n.file_path!==void 0)U.filename=n.file_path;if(n.filenames!==void 0&&n.filenames.length>0)U.filenames=n.filenames;if(n.title!==void 0)U.title=n.title;if(n.changes_summary!==void 0)U.changes_summary=n.changes_summary;if(n.resolutions!==void 0&&n.resolutions.length>0)U.resolutions=n.resolutions;let k={};if(n.idempotency_key)k["Idempotency-Key"]=n.idempotency_key;return{reviewId:n.review_id,body:U,headers:k}}async function T8(n,i){try{let $=await n.post(`/reviews/${encodeURIComponent(i.reviewId)}/revise`,{body:i.body,headers:i.headers});return H($.body,$.requestId)}catch($){if($ instanceof D)return G($);throw $}}function OD(n,i){let $=new Map;function g(W){let Y=W.indexOf("#");if(Y===-1)throw new D(500,"invalid_review_url","Review link URL is missing fragment token","local");return W.slice(Y+1)}async function v(W){let Y=$.get(W);if(Y&&Y.expiresAtMs>Date.now())return Y.token;let B=await i.get(`/sessions/${W}/participants`,{query:{role:"reviewer"}}),O=B.body.items?.[0]?.participant_id;if(!O)O=(await i.get(`/sessions/${W}/participants`,{query:{limit:"1"}})).body.items?.[0]?.participant_id;if(!O)throw new D(422,"no_participants","No participants available to mint a render token",B.requestId);let E=await i.post(`/sessions/${W}/links`,{body:{participant_id:O,scope:"read",single_use:!0,url_token_ttl_minutes:60}}),T=E.body.url;if(!T||typeof T!=="string")throw new D(500,"invalid_link_response","Failed to mint review link for render",E.requestId);let a=await i.post("/auth/exchange",{body:{url_token:g(T)}}),s=a.body.session_access_token,r=a.body.expires_in_seconds;if(!s||typeof s!=="string")throw new D(500,"token_exchange_failed","Failed to exchange review link for review access token",a.requestId);let gn=typeof r==="number"&&Number.isFinite(r)?Math.max(0,Math.trunc(r)-30)*1000:300000;return $.set(W,{token:s,expiresAtMs:Date.now()+gn}),s}let w={name:"typescape_create_review",description:"Create a new Typescape review for Markdown, image-set, or PDF content. Supports three source modes: (1) git-backed with repo_id+git_sha, (2) inline with content_body and optional inline_assets (base64), or (3) upload-backed with project_id+upload_batch_id. Returns the review ID and any invitations sent.",inputSchema:QD};n.register(w,async(W)=>{let Y=x8(W);if(Y instanceof D)return G(Y);return E8(i,Y)});let _={name:"typescape_revise_review",description:"Compatibility-only helper for product-owned revise flows. Preferred pattern: external agent revises content, then create a new Typescape review pinned to a newer revision, superseding an existing review. The predecessor becomes read-only and unresolved findings are carried forward to the new review. Supports git revision (git_sha) and upload revision (content_body or upload_batch_id+project_id).",inputSchema:WD};n.register(_,async(W)=>{let Y=o8(W);if(Y instanceof D)return G(Y);return T8(i,Y)});let U={name:"typescape_export_review",description:"Export all feedback from a Typescape review as structured JSON. Returns the full export document including findings, comments, and anchors.",inputSchema:YD};n.register(U,async(W)=>{let Y=W;if(!Y.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));let O={schema:typeof Y.schema==="string"&&Y.schema.trim().length>0?Y.schema.trim():"v2"};if(Y.view)O.view=Y.view;if(Y.include_rule_context)O.include_rule_context="true";let E={};if(Y.expected_version)E["If-Match"]=Y.expected_version;try{let T=await i.get(`/reviews/${Y.review_id}/export`,{query:O,headers:E});return H(T.body,T.requestId)}catch(T){if(T instanceof D)return G(T);throw T}});let k={name:"typescape_get_handoff",description:"Fetch the canonical agent handoff bundle for a Typescape review. Returns review state, findings, lineage, rules, artifacts, and next actions in one read-only package.",inputSchema:ID};n.register(k,async(W)=>{let Y=W;if(!Y.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));let B={};if(typeof Y.include_rules==="boolean")B.include_rules=Y.include_rules?"true":"false";if(typeof Y.include_lineage==="boolean")B.include_lineage=Y.include_lineage?"true":"false";if(typeof Y.include_advisory==="boolean")B.include_advisory=Y.include_advisory?"true":"false";if(typeof Y.include_blocks==="boolean")B.include_blocks=Y.include_blocks?"true":"false";if(typeof Y.max_rules==="number")B.max_rules=String(Y.max_rules);try{let O=await i.get(`/reviews/${encodeURIComponent(Y.review_id)}/handoff`,{query:B});return H(O.body,O.requestId)}catch(O){if(O instanceof D)return G(O);throw O}});let l={name:"typescape_list_reviews",description:"List Typescape reviews with optional filters. Returns paginated review summaries. Use cursor from previous response for pagination.",inputSchema:jD};n.register(l,async(W)=>{let Y=W,B={};if(Y.repo_id)B.repo_id=Y.repo_id;if(Y.state)B.state=Y.state;if(Y.file_paths)B.file_paths=Y.file_paths;if(Y.cursor)B.cursor=Y.cursor;if(Y.limit!==void 0)B.limit=String(Y.limit);if(Y.root_review_id)B.root_review_id=Y.root_review_id;if(Y.supersedes_review_id)B.supersedes_review_id=Y.supersedes_review_id;if(Y.has_successor!==void 0)B.has_successor=Y.has_successor?"true":"false";let O=Y.q??Y.search;if(O)B.q=O;try{let E=await i.get("/reviews",{query:B});return H(E.body,E.requestId)}catch(E){if(E instanceof D)return G(E);throw E}});let J={name:"typescape_get_review",description:"Get details of a specific Typescape review. Returns full review metadata including participants, stats, and provenance.",inputSchema:uD};n.register(J,async(W)=>{let Y=W;if(!Y.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{let B=await i.get(`/reviews/${encodeURIComponent(Y.review_id)}`);return H(B.body,B.requestId)}catch(B){if(B instanceof D)return G(B);throw B}});let Q={name:"typescape_get_render",description:"Get the rendered content of a review. Returns immutable block-level HTML structure with block_ids for anchoring.",inputSchema:HD};n.register(Q,async(W)=>{let Y=W;if(!Y.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));let B={};if(Y.include_plaintext)B.include_plaintext="true";try{let O=await v(Y.review_id),E=await i.get(`/sessions/${Y.review_id}/render`,{query:B,headers:{Authorization:`Bearer ${O}`}});return H(E.body,E.requestId)}catch(O){if(O instanceof D)return G(O);throw O}});let j={name:"typescape_list_findings",description:"List findings (review comments) for a review. Optionally filter by block_id anchor or finding status. Returns paginated finding list with comments.",inputSchema:VD},u=async(W)=>{if(!W.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));let Y={};if(W.block_id)Y.block_id=W.block_id;if(W.status)Y.status=W.status;if(W.cursor)Y.cursor=W.cursor;if(W.limit!==void 0)Y.limit=String(W.limit);let B=W.q??W.search;if(B)Y.q=B;try{let O=await i.get(`/reviews/${encodeURIComponent(W.review_id)}/findings`,{query:Y});return H(O.body,O.requestId)}catch(O){if(O instanceof D)return G(O);throw O}};n.register(j,async(W)=>{return u(W)}),n.register({name:"typescape_search_reviews",description:"Search reviews by title/file path using server-side query matching.",inputSchema:fD},async(W)=>{let Y=W,B=typeof Y.query==="string"?Y.query.trim():"";if(!B)return G(new D(400,"missing_param","Missing required parameter: query","local"));let O={q:B};if(Y.limit!==void 0)O.limit=String(Y.limit);if(Y.cursor)O.cursor=Y.cursor;try{let E=await i.get("/reviews",{query:O});return H(E.body,E.requestId)}catch(E){if(E instanceof D)return G(E);throw E}}),n.register({name:"typescape_search_findings",description:"Search findings/comments within a review using server-side query matching.",inputSchema:qD},async(W)=>{let Y=W,B=typeof Y.query==="string"?Y.query.trim():"";if(!Y.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!B)return G(new D(400,"missing_param","Missing required parameter: query","local"));return u({review_id:Y.review_id,q:B,block_id:Y.block_id,status:Y.status,limit:Y.limit,cursor:Y.cursor})}),n.register({name:"typescape_close_review",description:"Close an active review, making it read-only for reviewers.",inputSchema:M0},async(W)=>{let Y=W;if(!Y.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{let B=await i.post(`/reviews/${encodeURIComponent(Y.review_id)}/close`,{body:{}});return H(B.body,B.requestId)}catch(B){if(B instanceof D)return G(B);throw B}}),n.register({name:"typescape_reopen_review",description:"Reopen a closed review and return it to active state.",inputSchema:M0},async(W)=>{let Y=W;if(!Y.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{let B=await i.post(`/reviews/${encodeURIComponent(Y.review_id)}/reopen`,{body:{}});return H(B.body,B.requestId)}catch(B){if(B instanceof D)return G(B);throw B}})}var BD={type:"object",properties:{review_id:{type:"string",description:"Review ID to export response matrix for (e.g., sess_01HXYZ...)"}},required:["review_id"]},FD={type:"object",properties:{review_id:{type:"string",description:"Review ID to create finding in (e.g., sess_01HXYZ...)"},body_md:{type:"string",description:"Finding body in Markdown"},body:{type:"string",description:"Compatibility alias for body_md"},block_id:{type:"string",description:"Block ID to anchor finding to (optional; omit for review-level)"},anchor:{type:"object",properties:{type:{type:"string",enum:["session","block","range"],description:"Anchor type (default: session if no block_id, block if block_id provided)"},start_offset:{type:"number",description:"Start offset for range anchor"},end_offset:{type:"number",description:"End offset for range anchor"}},description:"Anchor details (optional)"},severity:{type:"string",enum:["suggestion","needs_changes","blocking"],description:"Thread severity. Note: 'blocking' from automation is coerced to 'needs_changes' per Ch 11 L6250"},tags:{type:"array",items:{type:"string"},description:"Tags for categorization (optional)"},suggestion:{type:"object",properties:{type:{type:"string",enum:["replace","insert","delete"]}},description:"Suggested change (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","body_md"]},ND={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to post comment to"},body_md:{type:"string",description:"Comment body in Markdown"},body:{type:"string",description:"Compatibility alias for body_md"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","finding_id","body_md"]},cD={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to resolve"},decision:{type:"object",properties:{state:{type:"string",enum:["accepted","rejected","deferred","duplicate","needs_more_info"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["state"],description:"Decision to record with resolution (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},PD={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to reopen"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},SD={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to record decision for"},state:{type:"string",enum:["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["review_id","finding_id","state"]},zD={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to attach evidence to"},evidence_type:{type:"string",enum:["commit","proposed_change","pr","attestation","external_ticket","note"],description:"Evidence type (required). Determines which additional fields are relevant."},commit_sha:{type:"string",description:"Git commit SHA (for evidence_type=commit)"},repo_url:{type:"string",description:"Repository URL (for evidence_type=commit)"},message:{type:"string",description:"Commit message (for evidence_type=commit)"},proposed_change_id:{type:"string",description:"Proposed change ID (for evidence_type=proposed_change)"},patch_sha256:{type:"string",description:"Patch SHA256 (for evidence_type=proposed_change)"},pr_url:{type:"string",description:"PR URL (for evidence_type=pr)"},pr_number:{type:"number",description:"PR number (for evidence_type=pr)"},attestation_id:{type:"string",description:"Attestation ID (for evidence_type=attestation)"},attestor:{type:"string",description:"Attestor identity (optional, for attestation type)"},ticket_url:{type:"string",description:"Ticket URL (for evidence_type=external_ticket)"},ticket_id:{type:"string",description:"Ticket ID (for evidence_type=external_ticket)"},system:{type:"string",description:"Ticket system (for evidence_type=external_ticket)"},note_md:{type:"string",description:"Note text (for evidence_type=note)"},body_md:{type:"string",description:"Markdown evidence body (alias for note_md/text; useful for attestation/external_ticket notes)"},dedupe_key:{type:"string",description:"Optional idempotency/deduplication key for evidence attach"}},required:["review_id","finding_id","evidence_type"]},MD={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to fetch latest decision for."}},required:["review_id","finding_id"]},RD={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to list evidence for."},limit:{type:"number",description:"Maximum evidence entries to return (optional)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","finding_id"]};var xD=["typescape_export_response_matrix","typescape_create_finding","typescape_post_comment","typescape_resolve_finding","typescape_reopen_finding","typescape_record_decision","typescape_attach_evidence","typescape_get_decision","typescape_list_evidence"],R0=on({operation:"read"});function x$(n){return on({operation:"write",hasIdempotencyKey:n})}var Z8="X-Typescape-If-Match";function AD(n,i,$){if(!n)return;if(/^[1-9]\d*$/.test(n)){i.expected_version=Number.parseInt(n,10);return}$[Z8]=n}function hD(n,i){n.register({name:"typescape_export_response_matrix",description:"Export the response matrix for a review. Returns per-finding decision and evidence summary.",inputSchema:BD},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{let v=await i.get(`/reviews/${g.review_id}/export`,{query:{view:"response_matrix.v1"}});return H(v.body,v.requestId,{retry:R0})}catch(v){if(v instanceof D)return G(v,{operation:"read"});throw v}}),n.register({name:"typescape_create_finding",description:"Create a new finding (comment) on a review. Optionally anchor to a specific block_id. Agent-created findings are tagged source='automation'. Severity 'blocking' is coerced to 'needs_changes' for automation sources.",inputSchema:FD},async($)=>{let g=$,v=g.body_md??g.body;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!v)return G(new D(400,"missing_param","Missing required parameter: body_md","local"));let w={body_md:v,source:"automation"},_=typeof g.block_id==="string"?g.block_id.trim():void 0;if(_)w.block_id=_;if(g.anchor!==void 0)w.anchor=g.anchor;else if(_)w.anchor={type:"block"};if(g.severity!==void 0)w.severity=g.severity;if(g.tags!==void 0)w.tags=g.tags;if(g.suggestion!==void 0)w.suggestion=g.suggestion;let U={};if(g.idempotency_key)U["Idempotency-Key"]=g.idempotency_key;try{let k=await i.post(`/reviews/${encodeURIComponent(g.review_id)}/findings`,{body:w,headers:U});return H(k.body,k.requestId,{retry:x$(Boolean(g.idempotency_key))})}catch(k){if(k instanceof D)return G(k,{operation:"write",hasIdempotencyKey:Boolean(g.idempotency_key)});throw k}}),n.register({name:"typescape_post_comment",description:"Post a comment (reply) to an existing finding. Returns the created comment with its ID.",inputSchema:ND},async($)=>{let g=$,v=g.body_md??g.body;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!g.finding_id)return G(new D(400,"missing_param","Missing required parameter: finding_id","local"));if(!v)return G(new D(400,"missing_param","Missing required parameter: body_md","local"));let w={body_md:v,source:"automation"},_={};if(g.idempotency_key)_["Idempotency-Key"]=g.idempotency_key;try{let U=await i.post(`/reviews/${encodeURIComponent(g.review_id)}/findings/${encodeURIComponent(g.finding_id)}/comments`,{body:w,headers:_});return H(U.body,U.requestId,{retry:x$(Boolean(g.idempotency_key))})}catch(U){if(U instanceof D)return G(U,{operation:"write",hasIdempotencyKey:Boolean(g.idempotency_key)});throw U}}),n.register({name:"typescape_resolve_finding",description:"Resolve (close) a finding. Optionally include a decision. Use expected_version or if_match for optimistic concurrency.",inputSchema:cD},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!g.finding_id)return G(new D(400,"missing_param","Missing required parameter: finding_id","local"));let v=g.decision===void 0?{status:"resolved"}:{disposition:g.decision},w={};AD(g.expected_version??g.if_match,v,w);try{let _=g.decision===void 0?await i.patch(`/reviews/${encodeURIComponent(g.review_id)}/findings/${encodeURIComponent(g.finding_id)}`,{body:v,headers:w}):await i.post(`/sessions/${g.review_id}/threads/${g.finding_id}/resolve`,{body:v,headers:w});return H(_.body,_.requestId,{retry:x$(!1)})}catch(_){if(_ instanceof D)return G(_,{operation:"write"});throw _}}),n.register({name:"typescape_reopen_finding",description:"Reopen a previously resolved finding. Use expected_version or if_match for optimistic concurrency.",inputSchema:PD},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!g.finding_id)return G(new D(400,"missing_param","Missing required parameter: finding_id","local"));let v={},w={};AD(g.expected_version??g.if_match,v,w);try{v.status="open";let _=await i.patch(`/reviews/${encodeURIComponent(g.review_id)}/findings/${encodeURIComponent(g.finding_id)}`,{body:v,headers:w});return H(_.body,_.requestId,{retry:x$(!1)})}catch(_){if(_ instanceof D)return G(_,{operation:"write"});throw _}}),n.register({name:"typescape_record_decision",description:"Record a decision (decision) on a finding. Decisions track how feedback was addressed. Note: recording a resolving decision may automatically resolve the finding.",inputSchema:SD},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!g.finding_id)return G(new D(400,"missing_param","Missing required parameter: finding_id","local"));if(!g.state)return G(new D(400,"missing_param","Missing required parameter: state","local"));let v={state:g.state};if(g.rationale_md!==void 0)v.rationale_md=g.rationale_md;try{let w=await i.post(`/reviews/${encodeURIComponent(g.review_id)}/findings/${encodeURIComponent(g.finding_id)}/decision`,{body:v});return H(w.body,w.requestId,{retry:x$(!1)})}catch(w){if(w instanceof D)return G(w,{operation:"write"});throw w}}),n.register({name:"typescape_attach_evidence",description:"Attach evidence to a finding. Evidence proves that feedback was addressed (e.g., commit SHA, proposed change, PR URL, or attestation).",inputSchema:zD},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!g.finding_id)return G(new D(400,"missing_param","Missing required parameter: finding_id","local"));let v,w;if(g.evidence_type){v=g.evidence_type.trim(),w={};let U=["commit_sha","repo_url","message","proposed_change_id","patch_sha256","pr_url","pr_number","attestation_id","attestor","ticket_url","ticket_id","system","note_md","body_md"];for(let k of U)if(g[k]!==void 0)w[k]=g[k];if(g.body_md!==void 0)w.body=g.body_md,w.text=g.body_md;else if(g.note_md!==void 0)w.body=g.note_md,w.text=g.note_md}else if(g.evidence)v=typeof g.evidence.type==="string"?g.evidence.type.trim():"",w={...g.evidence},delete w.type;else return G(new D(400,"missing_param","Missing required parameter: evidence_type","local"));if(!v)return G(new D(422,"invalid_argument","evidence_type is required","local"));let _={evidence_type:v,evidence_json:w};if(g.dedupe_key)_.dedupe_key=g.dedupe_key;try{let U=await i.post(`/reviews/${encodeURIComponent(g.review_id)}/findings/${encodeURIComponent(g.finding_id)}/evidence`,{body:_});return H(U.body,U.requestId,{retry:x$(!1)})}catch(U){if(U instanceof D)return G(U,{operation:"write"});throw U}}),n.register({name:"typescape_get_decision",description:"Get the latest decision for a specific finding.",inputSchema:MD},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!g.finding_id)return G(new D(400,"missing_param","Missing required parameter: finding_id","local"));try{let v=await i.get(`/reviews/${encodeURIComponent(g.review_id)}/findings/${encodeURIComponent(g.finding_id)}/decision`);return H(v.body,v.requestId,{retry:R0})}catch(v){if(v instanceof D)return G(v,{operation:"read"});throw v}}),n.register({name:"typescape_list_evidence",description:"List evidence entries attached to a finding.",inputSchema:RD},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!g.finding_id)return G(new D(400,"missing_param","Missing required parameter: finding_id","local"));let v={};if(g.limit!==void 0)v.limit=String(g.limit);if(g.cursor)v.cursor=g.cursor;try{let w=await i.get(`/reviews/${encodeURIComponent(g.review_id)}/findings/${encodeURIComponent(g.finding_id)}/evidence`,{query:v});return H(w.body,w.requestId,{retry:R0})}catch(w){if(w instanceof D)return G(w,{operation:"read"});throw w}})}var l_=["file","doc","pr","custom"],CD=new Set(l_),ED={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review set"},title:{type:"string",description:"Review set title (optional)"},kind:{type:"string",enum:["review_set","release_bundle","packet"],description:"Kind of review set (optional, default: review_set)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},role:{type:"string",enum:["reviewer","approver"]},roles:{type:"array",items:{type:"string",enum:["reviewer","approver"]},minItems:1}},required:["email"]},description:"Participants to invite (optional). Supports role (single) or roles (array)."},reviews:{type:"array",items:{oneOf:[{type:"string"},{type:"object",properties:{review_id:{type:"string"},session_id:{type:"string"},required:{type:"boolean"}},anyOf:[{required:["review_id"]},{required:["session_id"]}],additionalProperties:!1}]},minItems:1,description:"Review IDs (or review entry objects) to include in this review set."},files:{type:"array",items:{type:"object",properties:{repo_id:{type:"string"},git_sha:{type:"string"},project_id:{type:"string"},upload_batch_id:{type:"string"},file_path:{type:"string"},required:{type:"boolean"}},required:["file_path"],additionalProperties:!1},minItems:1,description:"File entries for git or upload source types (must include file_path plus source identifiers)."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["source_type"]},oD={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to export"},schema:{type:"string",description:"Export schema version (optional, default: v2). Canonical first-party review-set export uses schema=v2."},view:{type:"string",description:"Export view variant (optional). Values: full, redacted, response_matrix.v1, etc."}},required:["review_set_id"]},TD={type:"object",properties:{limit:{type:"number",description:"Maximum number of review sets to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},ZD={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to retrieve"}},required:["review_set_id"]},rD={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review ref"},repo_id:{type:"string",description:"Repository identifier (required for git source_type; short slug, e.g. 'typescape')"},project_id:{type:"string",description:"Project identifier (required for upload source_type; omit for git)"},kind:{type:"string",enum:l_,description:"Review ref kind"},key:{type:"string",description:"Review ref key (e.g., file path, doc slug, PR number, custom name)"},head_session_id:{type:"string",description:"Session ID to use as the initial head (required, e.g., sess_01HXYZ...)"}},required:["source_type","kind","key","head_session_id"]},mD={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to resolve"}},required:["review_ref_id"]},yD={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to advance"},head_session_id:{type:"string",description:"New head review ID to advance to"},expected_head_session_id:{type:"string",description:"Expected current head for optimistic concurrency (optional)"}},required:["review_ref_id","head_session_id"]},dD={type:"object",properties:{review_id:{type:"string",description:"Review ID to request approval for"},approver_emails:{type:"array",items:{type:"string"},description:"Email addresses of approvers"},message:{type:"string",description:"Message to include with the approval request (optional)"},notify:{type:"object",properties:{email:{type:"boolean"},slack:{type:"boolean"}},description:"Notification channels (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","approver_emails"]},eD={type:"object",properties:{review_id:{type:"string",description:"Review ID to get status for"},simulate:{type:"boolean",description:"Run policy evaluation without side effects (optional)"},wait:{type:"number",description:"Long-poll timeout in seconds (optional)"}},required:["review_id"]},pD={type:"object",properties:{review_id:{type:"string",description:"Review ID to run checks against"}},required:["review_id"]},aD={type:"object",properties:{},additionalProperties:!1},sD={type:"object",properties:{},additionalProperties:!1},nJ={type:"object",properties:{},additionalProperties:!1};var vJ=["typescape_create_review_set","typescape_export_review_set","typescape_list_review_sets","typescape_get_review_set","typescape_create_review_ref","typescape_resolve_review_ref","typescape_advance_review_ref","typescape_request_approval","typescape_get_status","typescape_run_checks","typescape_account_usage","typescape_account_plan","typescape_get_capabilities"];function r8(n){return n.replace(/\bSession\b/g,"Review").replace(/\bsession\b/g,"review").replace(/\bThread\b/g,"Finding").replace(/\bthread\b/g,"finding")}function A0(n){if(Array.isArray(n))return n.map((g)=>A0(g));if(n===null||typeof n!=="object")return n;let i=new Map([["session_id","review_id"],["thread_id","finding_id"],["thread_ids","finding_ids"]]),$=Object.entries(n).map(([g,v])=>{let w=i.get(g)??g,_=typeof v==="string"&&(g==="description"||g==="message")?r8(v):A0(v);return[w,_]});return Object.fromEntries($)}function iJ(n,i,$){n.register({name:"typescape_create_review_set",description:"Create a new review set (multi-file review pack). Requires features.review_sets to be enabled.",inputSchema:ED},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).review_sets)return $.featureDisabledResult("review_sets")}catch(J){if(J instanceof D)return G(J);throw J}if(!v.source_type)return G(new D(400,"missing_param","Missing required parameter: source_type","local"));if(v.source_type!=="git"&&v.source_type!=="upload")return G(new D(422,"invalid_argument","source_type must be one of: git, upload","local"));let w=Array.isArray(v.reviews)&&v.reviews.length>0?v.reviews:Array.isArray(v.sessions)&&v.sessions.length>0?v.sessions:void 0,_=Array.isArray(w)&&w.length>0,U=Array.isArray(v.files)&&v.files.length>0;if(!_&&!U)return G(new D(400,"missing_param","At least one of reviews[] or files[] is required","local"));let k={source_type:v.source_type};if(v.title!==void 0)k.title=v.title;if(v.kind!==void 0)k.kind=v.kind;if(_)k.reviews=w;if(U)k.files=v.files;if(v.participants!==void 0)k.participants=v.participants.map((J)=>{if(Array.isArray(J.roles)&&J.roles.length>0)return{email:J.email,roles:J.roles};if(J.role)return{email:J.email,roles:[J.role]};return J});let l={};if(v.idempotency_key)l["Idempotency-Key"]=v.idempotency_key;try{let J=await i.post("/review-sets",{body:k,headers:l});return H(J.body,J.requestId)}catch(J){if(J instanceof D)return G(J);throw J}}),n.register({name:"typescape_export_review_set",description:"Export feedback from a review set. Requires features.review_sets to be enabled.",inputSchema:oD},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).review_sets)return $.featureDisabledResult("review_sets")}catch(U){if(U instanceof D)return G(U);throw U}if(!v.review_set_id)return G(new D(400,"missing_param","Missing required parameter: review_set_id","local"));let _={schema:typeof v.schema==="string"&&v.schema.trim().length>0?v.schema.trim():"v2"};if(v.view)_.view=v.view;try{let U=await i.get(`/review-sets/${encodeURIComponent(v.review_set_id)}/export`,{query:_});return H(U.body,U.requestId)}catch(U){if(U instanceof D)return G(U);throw U}}),n.register({name:"typescape_list_review_sets",description:"List review sets with optional cursor pagination. Requires features.review_sets to be enabled. Returns an array of review sets with pagination metadata.",inputSchema:TD},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).review_sets)return $.featureDisabledResult("review_sets")}catch(_){if(_ instanceof D)return G(_);throw _}let w={};if(v.limit!==void 0)w.limit=String(v.limit);if(v.cursor!==void 0)w.cursor=v.cursor;try{let _=await i.get("/review-sets",{query:w});return H(_.body,_.requestId)}catch(_){if(_ instanceof D)return G(_);throw _}}),n.register({name:"typescape_get_review_set",description:"Get a review set by ID. Returns the review set details including status, review memberships, and configuration. Requires features.review_sets to be enabled.",inputSchema:ZD},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).review_sets)return $.featureDisabledResult("review_sets")}catch(w){if(w instanceof D)return G(w);throw w}if(!v.review_set_id)return G(new D(400,"missing_param","Missing required parameter: review_set_id","local"));try{let w=await i.get(`/review-sets/${encodeURIComponent(v.review_set_id)}`);return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_create_review_ref",description:"Create a stable review reference that tracks HEAD review for doc/file/PR/custom keys. Always available (core primitive).",inputSchema:rD},async(g)=>{let v=g;if(!v.source_type)return G(new D(400,"missing_param","Missing required parameter: source_type","local"));if(!v.kind)return G(new D(400,"missing_param","Missing required parameter: kind","local"));if(!v.key)return G(new D(400,"missing_param","Missing required parameter: key","local"));if(!v.head_session_id)return G(new D(400,"missing_param","Missing required parameter: head_session_id","local"));let w=v.kind.trim().toLowerCase();if(!CD.has(w))return G(new D(400,"invalid_param",`Invalid parameter: kind must be one of ${l_.join(", ")}`,"local"));let _={source_type:v.source_type,kind:w,key:v.key,head_session_id:v.head_session_id};if(v.repo_id!==void 0)_.repo_id=v.repo_id;if(v.project_id!==void 0)_.project_id=v.project_id;try{let U=await i.post("/review-refs",{body:_});return H(U.body,U.requestId)}catch(U){if(U instanceof D)return G(U);throw U}}),n.register({name:"typescape_resolve_review_ref",description:"Resolve a review ref to its current head review. Returns the head review ID and pinned content details.",inputSchema:mD},async(g)=>{let v=g;if(!v.review_ref_id)return G(new D(400,"missing_param","Missing required parameter: review_ref_id","local"));try{let w=await i.get(`/review-refs/${encodeURIComponent(v.review_ref_id)}/resolve`);return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_advance_review_ref",description:"Advance a review ref to a new head review. Use expected_head_session_id for optimistic concurrency.",inputSchema:yD},async(g)=>{let v=g;if(!v.review_ref_id)return G(new D(400,"missing_param","Missing required parameter: review_ref_id","local"));if(!v.head_session_id)return G(new D(400,"missing_param","Missing required parameter: head_session_id","local"));let w={head_session_id:v.head_session_id};if(v.expected_head_session_id!==void 0)w.expected_head_session_id=v.expected_head_session_id;try{let _=await i.post(`/review-refs/${encodeURIComponent(v.review_ref_id)}/advance`,{body:w});return H(_.body,_.requestId)}catch(_){if(_ instanceof D)return G(_);throw _}}),n.register({name:"typescape_request_approval",description:"Request approval for a review from specified approvers. Sends notifications via configured channels.",inputSchema:dD},async(g)=>{let v=g;if(!v.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!v.approver_emails||v.approver_emails.length===0)return G(new D(400,"missing_param","Missing required parameter: approver_emails","local"));let w={approver_emails:v.approver_emails};if(v.message!==void 0)w.message=v.message;if(v.notify!==void 0)w.notify=v.notify;let _={};if(v.idempotency_key)_["Idempotency-Key"]=v.idempotency_key;try{let U=await i.post(`/reviews/${encodeURIComponent(v.review_id)}/request-approval`,{body:w,headers:_});return H(U.body,U.requestId)}catch(U){if(U instanceof D)return G(U);throw U}}),n.register({name:"typescape_get_status",description:"Get the policy verdict for a review. Returns pass/fail/needs_review with reasons. Requires features.policy to be enabled.",inputSchema:eD},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).policy)return $.featureDisabledResult("policy")}catch(_){if(_ instanceof D)return G(_);throw _}if(!v.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));let w={};if(v.simulate)w.simulate="true";if(v.wait!==void 0)w.wait=String(v.wait);try{let _=await i.get(`/reviews/${encodeURIComponent(v.review_id)}/status`,{query:w});return H(A0(_.body),_.requestId)}catch(_){if(_ instanceof D)return G(_);throw _}}),n.register({name:"typescape_run_checks",description:"Trigger quality checks (DocLint) for a review. Returns the check run ID. Requires features.checks to be enabled.",inputSchema:pD},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).checks)return $.featureDisabledResult("checks")}catch(w){if(w instanceof D)return G(w);throw w}if(!v.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{let w=await i.post(`/reviews/${encodeURIComponent(v.review_id)}/run-checks`,{body:{}});return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_account_usage",description:"Get account usage and quota information (reviews used/limit, remaining, and billing period).",inputSchema:aD},async()=>{try{let g=await i.get("/account/usage");return H(g.body,g.requestId)}catch(g){if(g instanceof D)return G(g);throw g}}),n.register({name:"typescape_account_plan",description:"Get account plan details (plan name/id, status, and limits metadata).",inputSchema:sD},async()=>{try{let g=await i.get("/account/plan");return H(g.body,g.requestId)}catch(g){if(g instanceof D)return G(g);throw g}}),n.register({name:"typescape_get_capabilities",description:"Get authenticated capabilities and effective feature flags. Returns the same payload shape as GET /v1/me/capabilities.",inputSchema:nJ},async()=>{try{let g=await i.get("/me/capabilities");return H(g.body,g.requestId)}catch(g){if(g instanceof D)return G(g);throw g}})}var $J=["typescape_request_snapshot","typescape_get_snapshot","typescape_list_backlinks","typescape_get_impact"],m8={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier to build a corpus snapshot for"}},required:["repo_id"]},y8={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"}},required:["repo_id","git_sha"]},d8={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"},path:{type:"string",description:"Target file path to query backlinks for"},anchor:{type:"string",description:"Optional anchor within the file to narrow backlinks"}},required:["repo_id","git_sha","path"]},e8={type:"object",properties:{review_id:{type:"string",description:"Review identifier to compute impact radius for"}},required:["review_id"]};function gJ(n,i,$){n.register({name:"typescape_request_snapshot",description:"Request a corpus snapshot build for a repository. Returns the snapshot ID and build status. The snapshot builds "+"asynchronously — use typescape_get_snapshot to poll for completion. "+"Requires features.corpus_snapshots to be enabled.",inputSchema:m8},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).corpus_snapshots)return $.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof D)return G(w);throw w}if(!v.repo_id)return G(new D(400,"missing_param","Missing required parameter: repo_id","local"));try{let w=await i.post(`/repos/${encodeURIComponent(v.repo_id)}/snapshots`,{body:{}});return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_get_snapshot",description:"Get corpus snapshot metadata for a Git repo at a specific commit. Returns snapshot status, config hash, and source type. Requires features.corpus_snapshots to be enabled.",inputSchema:y8},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).corpus_snapshots)return $.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof D)return G(w);throw w}if(!v.repo_id)return G(new D(400,"missing_param","Missing required parameter: repo_id","local"));if(!v.git_sha)return G(new D(400,"missing_param","Missing required parameter: git_sha","local"));try{let w=await i.get(`/repos/${encodeURIComponent(v.repo_id)}/snapshots/${encodeURIComponent(v.git_sha)}`);return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_list_backlinks",description:"List inbound backlinks for a target file (and optional anchor) within a corpus snapshot. Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:d8},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).corpus_snapshots)return $.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof D)return G(w);throw w}if(!v.repo_id)return G(new D(400,"missing_param","Missing required parameter: repo_id","local"));if(!v.git_sha)return G(new D(400,"missing_param","Missing required parameter: git_sha","local"));if(!v.path)return G(new D(400,"missing_param","Missing required parameter: path","local"));try{let w=new URLSearchParams({path:v.path});if(v.anchor)w.set("anchor",v.anchor);let _=await i.get(`/repos/${encodeURIComponent(v.repo_id)}/snapshots/${encodeURIComponent(v.git_sha)}/backlinks?${w}`);return H(_.body,_.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_get_impact",description:"Compute the impact radius for a review: which other files are affected by changes to the review's target file (via backlinks). Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:e8},async(g)=>{let v=g;try{if(!(await $.getCapabilities()).corpus_snapshots)return $.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof D)return G(w);throw w}if(!v.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{let w=await i.get(`/reviews/${encodeURIComponent(v.review_id)}/impact`);return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}})}var JJ=["typescape_get_rules","typescape_rules_pack","typescape_check_content","typescape_import_rules","typescape_propose_rule","typescape_list_rule_proposals","typescape_list_rule_proposals_legacy","typescape_rules_dashboard","typescape_promote_rule_proposal","typescape_decide_rule_proposal"],Fn=on({operation:"read"}),x0=new Map;function D_(n){return on({operation:"write",hasIdempotencyKey:n})}function wJ(n){return n.status===0||n.status===429||n.status>=500}function _J(n){return{repo_id:typeof n.repo_id==="string"&&n.repo_id.trim().length>0?n.repo_id.trim():null,review_id:typeof n.review_id==="string"&&n.review_id.trim().length>0?n.review_id.trim():null,file_path:typeof n.file_path==="string"&&n.file_path.trim().length>0?n.file_path.trim():null}}function bJ(n,i){if(n.repo_id)return`/repos/${encodeURIComponent(n.repo_id)}/steering-pack?${i}`;return`/sessions/${encodeURIComponent(n.review_id)}/steering-pack?${i}`}function J_(n,i){let $=hl(n.freshness.fetched_at);return{...i,cache_status:$.status,cache_age_seconds:$.age_seconds,cache_compiled_hash:n.compiled_hash,...$.warning?{warnings:[{code:"cached_rules",message:$.warning}],cache_warning:$.warning}:{}}}function h0(n){if(!n||typeof n!=="object"||Array.isArray(n))return;let i=n.request_id;return typeof i==="string"?i:void 0}function C0(n){let i=n.compiledHash===void 0?null:n.compiledHash;return{rules:n.rules,compiled_hash:i,freshness:n.freshness,...n.requestId?{request_id:n.requestId}:{},...n.cacheMetadata??{}}}function XJ(n){if(!Array.isArray(n))return[];return n.filter((i)=>typeof i==="object"&&i!==null&&!Array.isArray(i))}function p8(n){if(!n||typeof n!=="object"||Array.isArray(n))return{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:0};let i=n;return{latest_rule_session_updated_at:typeof i.latest_rule_session_updated_at==="string"?i.latest_rule_session_updated_at:null,contributing_session_count:typeof i.contributing_session_count==="number"&&Number.isFinite(i.contributing_session_count)?i.contributing_session_count:0,total_rule_count:typeof i.total_rule_count==="number"&&Number.isFinite(i.total_rule_count)?i.total_rule_count:0}}function a8(n){if(!n||typeof n!=="object"||Array.isArray(n))return{};let i={};for(let[$,g]of Object.entries(n))if(typeof g==="string"&&g.length>0)i[$]=g;return i}function GJ(n,i,$){try{return _n(n)}catch{throw new D(502,"invalid_upstream_response",$,i)}}function UJ(n){let i=new URLSearchParams({format:n.format}),$=Object.entries(n.contentProperties).sort(([g],[v])=>g.localeCompare(v));for(let[g,v]of $)i.set(g,v);return`/rules?${i.toString()}`}async function s8(n){let i=await n.api.get(`/reviews/${encodeURIComponent(n.reviewId)}`),$=GJ(i.body,i.requestId,"Review detail response was not an object"),g=a8($.properties),v=typeof $.repo_id==="string"&&$.repo_id.length>0?$.repo_id:null,w=typeof $.file_path==="string"&&$.file_path.length>0?$.file_path:null,_=n.filePath??w;if(v)g.repo_id=v;if(_)g.file_path=_;return{reviewId:n.reviewId,repoId:v,filePath:_,contentProperties:g}}async function kJ(n){let i=new URLSearchParams({format:"text.v1"}),$=new URLSearchParams({format:"prompt_fragment.v1"});if(n.scope.file_path)i.set("file_path",n.scope.file_path),$.set("file_path",n.scope.file_path);if(n.policySnapshotId)i.set("policy_snapshot_id",n.policySnapshotId),$.set("policy_snapshot_id",n.policySnapshotId);if(n.tokenBudget!==void 0&&n.tokenBudget!==null)$.set("token_budget",String(n.tokenBudget));let[g,v]=await Promise.all([n.api.getText(bJ(n.scope,i)),n.api.get(bJ(n.scope,$))]),w=c0(v.body),_=P0(w),U=K0({scope:n.scope,rules:[],plain_text_bundle:g.body,freshness:{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:_.length},compiled_hash:typeof w.compiled_hash==="string"?w.compiled_hash:void 0,fetched_at:new Date().toISOString(),renderings:{text:g.body,json_payload:w,structured_payload:_}});return x0.set(g_(n.scope),U),{text:g.body,normalizedBody:w,structuredPayload:C0({rules:_,compiledHash:typeof w.compiled_hash==="string"?w.compiled_hash:null,freshness:{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:_.length},requestId:h0(w)})}}async function lJ(n){let i=await s8({api:n.api,reviewId:n.reviewId,filePath:n.filePath}),[$,g]=await Promise.all([n.api.getText(UJ({format:"text",contentProperties:i.contentProperties})),n.api.get(UJ({format:"json",contentProperties:i.contentProperties}))]),v=GJ(g.body,g.requestId,"Rules response payload was not an object"),w=XJ(v.rules),_=p8(v.freshness),U=h0(v),k=U===void 0?g.requestId:U,l=typeof v.compiled_hash==="string"?v.compiled_hash:null,J={...v,prompt_fragment:$.body,request_id:k},Q=C0({rules:w,compiledHash:l,freshness:_,requestId:k}),j=K0({scope:{repo_id:i.repoId,review_id:i.reviewId,file_path:i.filePath},rules:[],plain_text_bundle:$.body,freshness:_,compiled_hash:l??void 0,fetched_at:new Date().toISOString(),renderings:{text:$.body,json_payload:J,structured_payload:w}});return x0.set(g_({repo_id:i.repoId,review_id:i.reviewId,file_path:i.filePath}),j),{text:$.body,normalizedBody:J,structuredPayload:Q}}function DJ(n,i){let $=x0.get(g_(n));if(!$)return null;if(i==="text")return J_($,{text:$.plain_text_bundle,format:"text",cached:!0});if(i==="structured"){let v=XJ($.renderings?.structured_payload);return J_($,{...C0({rules:v,compiledHash:$.compiled_hash,freshness:$.freshness,requestId:h0($.renderings?.json_payload)}),cached:!0})}if(i==="prompt_fragment"){let v=$.renderings?.json_payload;if(v&&typeof v==="object"&&!Array.isArray(v))return J_($,{...v,non_authoritative:!0,compatibility_only:!0,cached:!0});return null}let g=$.renderings?.json_payload;if(!g||typeof g!=="object"||Array.isArray(g))return null;return J_($,{...g,cached:!0})}var nY={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},review_id:{type:"string",description:"Review identifier. Use for upload-backed reviews or when repo_id is not known."},policy_snapshot_id:{type:"string",description:"Optional policy snapshot ID used to compile rules context"},file_path:{type:"string",description:"Optional file path to scope rules"},path:{type:"string",description:"Alias for file_path. If both are provided, file_path takes precedence."},format:{type:"string",enum:["text","structured","prompt_fragment"],description:'Output format: "text" returns the canonical plain-text rule bundle, "structured" returns governed JSON rules (authoritative), and "prompt_fragment" returns a compatibility prompt-shaped text view. Default: text.'},token_budget:{type:"number",description:"Maximum token count for prompt_fragment format (100-10000, default 2000)",minimum:100,maximum:1e4}}},vY={type:"object",properties:{source_type:{type:"string",enum:["thread","doc_review","slack","email","interview","automation","admin"],description:"How this rule was discovered"},source_ref:{type:"string",description:"Stable source reference (URL, message ID, document path). Required for non-thread source types."},source_excerpt:{type:"string",description:"Optional short excerpt from source context"},proposed_type:{type:"string",enum:["claim","knowledge","voice","constraint","steering_rule"],description:"Proposed rule type (default: constraint for non-thread rule proposals)"},proposed_content:{type:"object",additionalProperties:!0,description:"Structured proposed content payload"},related_item_ids:{type:"array",items:{type:"string",pattern:"^gci_[0-9A-HJKMNP-TV-Z]{26}$"},description:"Related rule proposal IDs (gci_<26-char ULID>)"},title:{type:"string",description:"Backward-compatible alias used to populate proposed_content.title"},content:{type:"string",description:"Backward-compatible alias used to populate proposed_content.content"},rationale:{type:"string",description:"Why this should become a rule"},target_document:{type:"string",description:"Target canonical document path"},priority:{type:"string",enum:["low","medium","high","critical"],description:"Priority level (default: medium)"},finding_id:{type:"string",description:"Source finding ID (required when source_type is 'thread')"},tags:{type:"array",items:{type:"string"},description:"Classification tags"}},required:["source_type"]},iY={type:"object",properties:{status:{type:"string",enum:["pending","in_review","needs_revision","approved","rejected","published"],description:"Filter by lifecycle status (default: pending)"},limit:{type:"number",default:20,description:"Maximum number of results"}}},$Y={type:"object",properties:{status:{type:"string",enum:["proposed","accepted","rejected","superseded"],description:"Filter by status (default: all)"},kind:{type:"string",enum:["terminology","style","structure","claim_policy","evidence_policy","voice","constraint"],description:"Filter by rule kind"},limit:{type:"number",default:20,description:"Maximum number of results"}}},gY={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier for rules-pack lookup."},review_id:{type:"string",description:"Review identifier for rules-pack lookup when repo is unknown."},file_path:{type:"string",description:"Optional file path scope for rule selection."},path:{type:"string",description:"Alias for file_path."},format:{type:"string",enum:["text","prompt","structured","json"],description:'Output format. "text" returns the canonical plain-text rule bundle, "prompt" is a compatibility alias, "structured" returns normalized rules, and "json" returns the raw pack payload.'},token_budget:{type:"number",description:"Optional token budget for prompt_fragment generation."}}},wY={type:"object",properties:{content:{type:"string",description:"Markdown content to check against applicable rules (max 1MB)."},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map, e.g. { doc_type: 'procedure' })."},collection_id:{type:"string",description:"Optional collection ID to scope rule matching."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},_Y={type:"object",properties:{content:{type:"string",description:"Rule markdown content to import (max 512KB). Each list item is a rule block."},title:{type:"string",description:"Human-readable title for the imported rule review (optional)."},applicability:{type:"object",additionalProperties:{type:"string"},description:"Applicability selector for rule matching (flat key-value map, optional)."},provenance:{type:"object",properties:{source:{type:"string",enum:["manual","findings","external"],description:"Import source classification."},source_review_id:{type:"string",description:"Source review ID when imported from findings."},source_label:{type:"string",description:"Human-readable source label."}},description:"Provenance metadata for finding-seeded imports (optional)."},preview:{type:"boolean",description:"If true, returns a preview without creating a review (dry run). Default: false."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},bY={type:"object",properties:{include_degraded:{type:"boolean",default:!0,description:"Include degraded rule details"}}},UY={type:"object",properties:{gci_id:{type:"string",description:"Rule proposal ID to promote (must be in 'approved' status)"},repo_id:{type:"string",description:"Repository ID where the rule proposal should be created"},kind:{type:"string",enum:["terminology","style","structure","claim_policy","evidence_policy","voice","constraint"],description:"Rule kind for the proposal"},reviewer_notes:{type:"string",description:"Optional reviewer notes recorded on publish"}},required:["gci_id","repo_id"]},kY={type:"object",properties:{proposal_id:{type:"string",description:"Proposal ID to act on"},decision:{type:"string",enum:["accept","reject","deprecate"],description:"Decision to apply"},notes:{type:"string",description:"Decision rationale. Alias for reviewer_notes/reason for compatibility."},reviewer_notes:{type:"string",description:"Decision rationale for accept/reject actions"},reason:{type:"string",description:"Required reason for deprecate action"}},required:["proposal_id","decision"]};function tJ(n,i,$){n.register({name:"typescape_get_rules",description:'Canonical rules-first discovery surface for repository or review context. format="text" returns the canonical plain-text rule bundle. format="structured" returns the deterministic rulepack with compiled hash and freshness metadata. format="prompt_fragment" returns a compatibility prompt-shaped text view. Requires rules to be enabled.',inputSchema:nY},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(u){if(u instanceof D)return G(u);throw u}let U=typeof _.repo_id==="string"&&_.repo_id.length>0,k=typeof _.review_id==="string"&&_.review_id.length>0;if(!U&&!k)return G(new D(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let l=_.format==="structured"?"structured":_.format==="prompt_fragment"?"prompt_fragment":"text",J=typeof _.file_path==="string"&&_.file_path.trim().length>0?_.file_path.trim():typeof _.path==="string"&&_.path.trim().length>0?_.path.trim():null,Q=(u)=>{let W=new URLSearchParams({format:u});if(J)W.set("file_path",J);if(_.policy_snapshot_id)W.set("policy_snapshot_id",_.policy_snapshot_id);if(_.token_budget!==void 0&&_.token_budget!==null)W.set("token_budget",String(_.token_budget));return W},j=_J({repo_id:U?_.repo_id:void 0,review_id:k?_.review_id:void 0,file_path:J});try{let u=k&&!U?await lJ({api:i,reviewId:_.review_id,filePath:J}):await kJ({api:i,scope:j,tokenBudget:_.token_budget,policySnapshotId:_.policy_snapshot_id});if(l==="text")return H({text:u.text,format:"text"},u.normalizedBody.request_id??"missing_request_id",{retry:Fn});let W={...u.normalizedBody};if(W.prompt_fragment&&l==="prompt_fragment")W.non_authoritative=!0,W.compatibility_only=!0;if(l==="structured")W.rules=u.structuredPayload.rules,W.compiled_hash=u.structuredPayload.compiled_hash,W.freshness=u.structuredPayload.freshness;return H(W,W.request_id??"missing_request_id",{retry:Fn})}catch(u){if(u instanceof D){if(wJ(u)){let W=DJ(j,l);if(W)return H(W,u.requestId,{retry:Fn})}return G(u,{operation:"read"})}throw u}}),n.register({name:"typescape_rules_pack",description:"Compatibility-only alias for typescape_get_rules. Prefer typescape_get_rules in new harnesses and workflows.",inputSchema:gY},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(j){if(j instanceof D)return G(j);throw j}let U=typeof _.repo_id==="string"?_.repo_id.trim():"",k=typeof _.review_id==="string"?_.review_id.trim():"";if(!U&&!k)return G(new D(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let l=_.format??"text",J=typeof _.file_path==="string"&&_.file_path.trim().length>0?_.file_path.trim():typeof _.path==="string"&&_.path.trim().length>0?_.path.trim():null,Q=_J({repo_id:U,review_id:k,file_path:J});try{let j=k&&!U?await lJ({api:i,reviewId:k,filePath:J}):await kJ({api:i,scope:Q,tokenBudget:_.token_budget});if(l==="text")return H({text:j.text,format:"text"},j.normalizedBody.request_id??"missing_request_id",{retry:Fn});let u=j.normalizedBody;if(l==="structured")return H(j.structuredPayload,u.request_id??"missing_request_id",{retry:Fn});if(l==="json")return H(u,u.request_id??"missing_request_id",{retry:Fn});let W=typeof u.prompt==="string"?u.prompt:typeof u.prompt_fragment==="string"?u.prompt_fragment:null;if(!W)throw new D(502,"invalid_upstream_response","Rules pack response is missing prompt content",u.request_id??"missing_request_id");return H({prompt:W,prompt_fragment:W,compatibility_only:!0},u.request_id??"missing_request_id",{retry:Fn})}catch(j){if(j instanceof D){let u=l==="prompt"?"prompt_fragment":l;if(wJ(j)){let W=DJ(Q,u);if(W)return H(W,j.requestId,{retry:Fn})}return G(j,{operation:"read"})}throw j}}),n.register({name:"typescape_check_content",description:"Check markdown content against applicable rules (pre-submission advisory). Returns advisory findings with severity and rule references. Requires rules to be enabled.",inputSchema:wY},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(k){if(k instanceof D)return G(k);throw k}if(!_.content||_.content.length===0)return G(new D(400,"missing_param","Missing required parameter: content","local"));let U={content:_.content};if(_.properties!==void 0)U.properties=_.properties;if(_.collection_id!==void 0)U.collection_id=_.collection_id;if(_.idempotency_key!==void 0)U.idempotency_key=_.idempotency_key;try{let k=await i.post("/rules/check",{body:U});return H(k.body,k.requestId,{retry:Fn})}catch(k){if(k instanceof D)return G(k,{operation:"read"});throw k}}),n.register({name:"typescape_import_rules",description:"Import rules from markdown content, creating a draft rule review. Each list item in the markdown becomes a rule block. Set preview=true for a dry run. Returns the review ID and parsed rules. Requires rules to be enabled.",inputSchema:_Y},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(l){if(l instanceof D)return G(l);throw l}if(!_.content||_.content.length===0)return G(new D(400,"missing_param","Missing required parameter: content","local"));let U={content:_.content};if(_.title!==void 0)U.title=_.title;if(_.applicability!==void 0)U.applicability=_.applicability;if(_.provenance!==void 0)U.provenance=_.provenance;if(_.preview!==void 0)U.preview=_.preview;if(_.idempotency_key!==void 0)U.idempotency_key=_.idempotency_key;let k={};if(_.idempotency_key)k["Idempotency-Key"]=_.idempotency_key;try{let l=await i.post("/rules/import",{body:U,headers:k});return H(l.body,l.requestId,{retry:D_(Boolean(_.idempotency_key))})}catch(l){if(l instanceof D)return G(l,{operation:"write",hasIdempotencyKey:Boolean(_.idempotency_key)});throw l}});let g=/^gci_[0-9A-HJKMNP-TV-Z]{26}$/;n.register({name:"typescape_propose_rule",description:"Create a rule proposal from observed patterns, thread feedback, or automated analysis. Rule proposals flow through the rules governance pipeline. Requires features.rules.",inputSchema:vY},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(k){if(k instanceof D)return G(k);throw k}if(!_.source_type)return G(new D(400,"missing_param","Missing required parameter: source_type","local"));if(_.source_type==="thread"&&!_.finding_id)return G(new D(422,"invalid_argument","finding_id is required when source_type is 'thread'","local"));if(_.related_item_ids){let k=_.related_item_ids.findIndex((l)=>!g.test(l));if(k>=0)return G(new D(422,"invalid_argument",`related_item_ids[${k}] must be a valid rule proposal id (gci_<26-char ULID>)`,"local"))}let U={};if(_.proposed_content!==void 0){if(typeof _.proposed_content!=="object"||_.proposed_content===null||Array.isArray(_.proposed_content))return G(new D(422,"invalid_argument","proposed_content must be an object when provided","local"));Object.assign(U,_.proposed_content)}if(_.title!==void 0&&U.title===void 0)U.title=_.title;if(_.content!==void 0&&U.content===void 0)U.content=_.content;if(_.target_document!==void 0&&U.target_document===void 0)U.target_document=_.target_document;if(_.priority!==void 0&&U.priority===void 0)U.priority=_.priority;if(_.tags!==void 0&&U.tags===void 0)U.tags=_.tags;try{let k=_.source_type==="thread"?"/steering/gcis/from-thread":"/steering/gcis",l=_.source_type==="thread"?{finding_id:_.finding_id,..._.proposed_type?{proposed_type:_.proposed_type}:{},..._.rationale!==void 0?{rationale:_.rationale}:{},...Object.keys(U).length>0?{proposed_content:U}:{}}:{source_type:_.source_type,..._.source_ref?{source_ref:_.source_ref}:{},..._.proposed_type?{proposed_type:_.proposed_type}:{},...Object.keys(U).length>0?{proposed_content:U}:{},..._.tags!==void 0?{tags:_.tags}:{},..._.source_excerpt!==void 0?{source_excerpt:_.source_excerpt}:{},..._.rationale!==void 0?{rationale:_.rationale}:{},..._.related_item_ids!==void 0?{related_item_ids:_.related_item_ids}:{}},J=await i.post(k,{body:l});return H(_n(J.body),J.requestId,{retry:D_(!1)})}catch(k){if(k instanceof D)return G(k,{operation:"write"});throw k}}),n.register({name:"typescape_list_rule_proposals",description:"Canonical rule proposal listing surface. Use to monitor the rules governance pipeline. Requires features.rules.",inputSchema:iY},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(U){if(U instanceof D)return G(U);throw U}try{let U={};if(_.status)U.status=_.status;if(_.limit!==void 0&&_.limit!==null)U.limit=String(_.limit);let k=new URLSearchParams(U).toString(),l=await i.get(`/steering/gcis${k?`?${k}`:""}`);return H(b_(l.body),l.requestId,{retry:Fn})}catch(U){if(U instanceof D)return G(U,{operation:"read"});throw U}}),n.register({name:"typescape_list_rule_proposals_legacy",description:"Compatibility-only legacy proposal listing surface. Use typescape_list_rule_proposals in new harnesses. Requires features.rules.",inputSchema:$Y},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(U){if(U instanceof D)return G(U);throw U}try{let U={};if(_.status)U.status=_.status;if(_.kind)U.kind=_.kind;if(_.limit!==void 0&&_.limit!==null)U.limit=String(_.limit);let k=new URLSearchParams(U).toString(),l=await i.get(`/steering/proposals${k?`?${k}`:""}`);return H(l.body,l.requestId,{retry:Fn})}catch(U){if(U instanceof D)return G(U,{operation:"read"});throw U}}),n.register({name:"typescape_rules_dashboard",description:"Get aggregate rules health metrics: active rule count, average health, degraded rules. Requires features.rules.",inputSchema:bY},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(U){if(U instanceof D)return G(U);throw U}try{let U=_.include_degraded!==!1,k,l;try{let J=await i.get("/steering/dashboard/summary");k=J.requestId,l={..._n(J.body)}}catch(J){if(!(J instanceof D))throw J;let Q=await i.get("/steering/dashboard/rules?limit=1&offset=0"),j=_n(Q.body),u=typeof j.total==="number"?j.total:typeof j.total_rules==="number"?j.total_rules:0;k=Q.requestId,l={summary_unavailable:{code:J.code,message:J.message,request_id:J.requestId},rule_health:{total_rules:u}}}if(U){let J=await i.get("/steering/dashboard/degradation"),Q=_n(J.body),j=Array.isArray(Q.degraded_rules)?Q.degraded_rules:Array.isArray(Q.data)?Q.data:null;if(!Array.isArray(j))throw new D(502,"invalid_upstream_response","degraded_rules must be an array",J.requestId);l.degraded_rules=j}return H(l,k,{retry:Fn})}catch(U){if(U instanceof D)return G(U,{operation:"read"});throw U}}),n.register({name:"typescape_promote_rule_proposal",description:"Convert an approved rule proposal into a rule for operator acceptance. Requires features.rules.",inputSchema:UY},async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(k){if(k instanceof D)return G(k);throw k}if(!_.gci_id)return G(new D(400,"missing_param","Missing required parameter: gci_id","local"));let U={};if(_.kind!==void 0)U.kind=_.kind;if(_.scope!==void 0)U.scope=_.scope;if(_.content_override!==void 0)U.content_override=_.content_override;try{let k=await i.post(`/steering/gcis/${encodeURIComponent(_.gci_id)}/publish`,{body:U});return H(k.body,k.requestId,{retry:D_(!1)})}catch(k){if(k instanceof D)return G(k,{operation:"write"});throw k}});let v=async(w)=>{let _=w;try{if(!(await $.getCapabilities()).rules)return $.featureDisabledResult("rules")}catch(J){if(J instanceof D)return G(J);throw J}if(!_.proposal_id)return G(new D(400,"missing_param","Missing required parameter: proposal_id","local"));if(!_.decision)return G(new D(400,"missing_param","Missing required parameter: decision","local"));if(_.decision==="reject"&&!_.notes)return G(new D(422,"invalid_argument","notes is required when decision is 'reject'","local"));let k={accept:"activate",reject:"reject",deprecate:"deprecate"}[_.decision],l={};if(_.notes!==void 0)l.notes=_.notes;try{let J=await i.post(`/steering/proposals/${encodeURIComponent(_.proposal_id)}/${k}`,{body:l});return H(J.body,J.requestId,{retry:D_(!1)})}catch(J){if(J instanceof D)return G(J,{operation:"write"});throw J}};n.register({name:"typescape_decide_rule_proposal",description:"Accept, reject, or deprecate a rule proposal. Accepting activates the rule immediately. Requires features.rules.",inputSchema:kY},async(w)=>{return v(w)})}var QJ=["typescape_list_repos","typescape_connect_repo","typescape_repo_branches","typescape_upload_reviewer_asset"];function lY(n){switch(n){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"bin"}}var DY=5242880,JY=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function WJ(n,i){let $={name:"typescape_list_repos",description:"List connected repositories in the workspace. Returns paginated list of repos with their origin URLs and metadata.",inputSchema:{type:"object",properties:{include_archived:{type:"boolean",description:"Include archived repositories (default: false)"},limit:{type:"number",description:"Maximum repos to return (1-100, default: 50)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}}};n.register($,async(_)=>{let U=_,k={};if(U.include_archived)k.include_archived="true";if(U.limit!==void 0)k.limit=String(U.limit);if(U.cursor)k.cursor=U.cursor;try{let l=await i.get("/repos",{query:k});return H(l.body,l.requestId)}catch(l){if(l instanceof D)return G(l);throw l}});let g={name:"typescape_connect_repo",description:"Connect a Git repository by its origin URL. If the URL is a GitHub repo and a GitHub App installation exists, it will be automatically linked for branch/file browsing.",inputSchema:{type:"object",properties:{origin_url:{type:"string",description:"Git remote URL (HTTPS or SSH), e.g. https://github.com/acme/docs"},display_name:{type:"string",description:"Human-readable display name (optional, auto-derived from URL)"}},required:["origin_url"]}};n.register(g,async(_)=>{let U=_;if(!U.origin_url)return G(new D(400,"missing_param","Missing required parameter: origin_url","local"));let k={origin_url:U.origin_url};if(U.display_name)k.display_name=U.display_name;try{let l=await i.post("/repos",{body:k});return H(l.body,l.requestId)}catch(l){if(l instanceof D)return G(l);throw l}});let v={name:"typescape_repo_branches",description:"List branches for a connected repository. Requires a GitHub App installation to be linked to the repo. Returns branch names and their head SHAs.",inputSchema:{type:"object",properties:{repo_id:{type:"string",description:"Repository ID (e.g. repo_abc123)"}},required:["repo_id"]}};n.register(v,async(_)=>{let U=_;if(!U.repo_id)return G(new D(400,"missing_param","Missing required parameter: repo_id","local"));try{let k=await i.get(`/repos/${encodeURIComponent(U.repo_id)}/branches`);return H(k.body,k.requestId)}catch(k){if(k instanceof D)return G(k);throw k}});let w={name:"typescape_upload_reviewer_asset",description:"Upload a reviewer asset (image) to a review. Accepts base64-encoded image data (PNG, JPEG, GIF, WebP). Maximum size: 5MB. For larger files, use the CLI or web UI.",inputSchema:{type:"object",properties:{review_id:{type:"string",description:"Review ID to upload the asset to"},base64_content:{type:"string",description:"Base64-encoded image data"},mime_type:{type:"string",enum:["image/png","image/jpeg","image/gif","image/webp"],description:"MIME type of the image"},alt_text:{type:"string",description:"Alt text for the image (optional)"},filename:{type:"string",description:"Original filename (optional)"}},required:["review_id","base64_content","mime_type"]}};n.register(w,async(_)=>{let U=_;if(!U.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));if(!U.base64_content)return G(new D(400,"missing_param","Missing required parameter: base64_content","local"));if(!U.mime_type)return G(new D(400,"missing_param","Missing required parameter: mime_type","local"));if(!JY.has(U.mime_type))return G(new D(415,"unsupported_media_type",`Unsupported MIME type "${U.mime_type}". Allowed: PNG, JPEG, GIF, WebP.`,"local"));if(!S0.test(U.base64_content))return G(new D(400,"invalid_base64","base64_content is not valid base64-encoded data","local"));let k;try{let Q=Buffer.from(U.base64_content,"base64");k=new Uint8Array(Q)}catch{return G(new D(400,"invalid_base64","Failed to decode base64_content","local"))}if(k.byteLength>DY){let Q=(k.byteLength/1048576).toFixed(1);return G(new D(413,"asset_too_large",`Image is ${Q}MB, exceeding the 5MB MCP limit. Use the CLI ("typescape asset upload") or web UI for larger files.`,"local"))}let l=new Blob([k],{type:U.mime_type}),J=new FormData;if(J.append("file",l,U.filename||`upload.${lY(U.mime_type)}`),J.append("mime_type",U.mime_type),U.alt_text)J.append("alt_text",U.alt_text);try{let Q=await i.postFormData(`/sessions/${encodeURIComponent(U.review_id)}/reviewer-assets`,J);return H(Q.body,Q.requestId)}catch(Q){if(Q instanceof D)return G(Q);throw Q}})}var YJ=["typescape_create_collection","typescape_add_review_to_collection"],XY={type:"object",properties:{name:{type:"string",description:"Collection name (1-100 characters, unique per tenant among non-archived collections)"},description:{type:"string",description:"Optional Markdown description (max 2000 characters)"},color:{type:"string",description:"Optional hex color (e.g., #12A594)"}},required:["name"]},GY={type:"object",properties:{collection_id:{type:"string",description:"Collection ID (e.g., col_01HXYZ...)"},review_id:{type:"string",description:"Review ID to add (opaque identifier)"}},required:["collection_id","review_id"]};function IJ(n,i,$){n.register({name:"typescape_create_collection",description:"Create a new collection to group related reviews. Requires collections_enabled feature flag. Returns the created collection with its ID.",inputSchema:XY},async(g)=>{let v=g;if(!v.name)return G(new D(400,"missing_param","Missing required parameter: name","local"));try{if(!(await $.getCapabilities()).collections_enabled)return $.featureDisabledResult("collections_enabled")}catch(_){if(_ instanceof D)return G(_);throw _}let w={name:v.name};if(v.description!==void 0)w.description=v.description;if(v.color!==void 0)w.color=v.color;try{let _=await i.post("/collections",{body:w});return H(_n(_.body),_.requestId)}catch(_){if(_ instanceof D)return G(_);throw _}}),n.register({name:"typescape_add_review_to_collection",description:"Add a review to an existing collection. Idempotent: re-adding an already-present review is a no-op. Requires collections_enabled feature flag.",inputSchema:GY},async(g)=>{let v=g;if(!v.collection_id)return G(new D(400,"missing_param","Missing required parameter: collection_id","local"));if(!v.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{if(!(await $.getCapabilities()).collections_enabled)return $.featureDisabledResult("collections_enabled")}catch(w){if(w instanceof D)return G(w);throw w}try{let w=await i.post(`/collections/${encodeURIComponent(v.collection_id)}/sessions`,{body:{session_id:v.review_id}});return H(_n(w.body),w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}})}var jJ={type:"object",properties:{artifact_kind:{type:"string",description:"Advisory artifact kind: recommendation, classification, contradiction, synthesis, proposal, or challenge"},kind:{type:"string",description:"Compatibility alias for artifact_kind"},target_type:{type:"string",enum:["review","finding","rule_review","rule_block","review_set"],description:"Type of entity this advisory targets"},target_id:{type:"string",description:"ID of the target entity (e.g., sess_01HXYZ... or finding ID)"},review_id:{type:"string",description:"Review scope for this advisory (optional; enables review-scoped queries)"},body_md:{type:"string",description:"Advisory body in Markdown (required, max 64KB)"},body:{type:"string",description:"Compatibility alias for body_md"},source_type:{type:"string",enum:["human","agent"],description:"Provenance source type (default: agent)"},source_label:{type:"string",description:"Label identifying the source (e.g., agent name or tool)"},submitted_by:{type:"string",description:"Identity of the submitter (agent ID or user ID)"},confidence:{type:"number",description:"Confidence score between 0 and 1 (optional)"},severity_hint:{type:"string",description:"Severity hint: suggestion, needs_changes, blocking (optional)"},structured_data:{type:"object",description:"Machine-readable structured data payload (optional)"},evidence_refs:{type:"array",items:{type:"string"},description:"References to supporting evidence (optional)"},basis:{type:"object",properties:{export_sha256:{type:"string",description:"SHA256 of export used as basis"},rulepack_sha256:{type:"string",description:"SHA256 of rulepack used"},source_content_sha256:{type:"string",description:"SHA256 of source content"},basis_review_ids:{type:"array",items:{type:"string"},description:"Review IDs used as basis"},basis_finding_ids:{type:"array",items:{type:"string"},description:"Finding IDs used as basis"}},description:"Deterministic inputs the advisory was derived from (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["artifact_kind","target_type","target_id","body_md","source_label","submitted_by"]},uJ={type:"object",properties:{review_id:{type:"string",description:"Filter by review ID (optional)"},target_type:{type:"string",enum:["review","finding","rule_review","rule_block","review_set"],description:"Filter by target type (optional)"},target_id:{type:"string",description:"Filter by target ID (optional)"},artifact_kind:{type:"string",description:"Filter by artifact kind (optional)"},status:{type:"string",enum:["submitted","adopted","rejected","superseded"],description:"Filter by status (optional)"},submitted_by:{type:"string",description:"Filter by submitter identity (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},HJ={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to retrieve"}},required:["artifact_id"]},VJ={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to adopt"},rationale:{type:"string",description:"Rationale for adoption (optional)"},adoption_review_id:{type:"string",description:"Review ID associated with adoption (optional)"},adoption_proposed_change_id:{type:"string",description:"Proposed change ID associated with adoption (optional)"}},required:["artifact_id"]},fJ={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to reject"},rejection_reason:{type:"string",description:"Reason for rejection (required)"}},required:["artifact_id","rejection_reason"]};var LJ=["typescape_submit_advisory","typescape_list_advisories","typescape_get_advisory","typescape_adopt_advisory","typescape_reject_advisory"],qJ=on({operation:"read"});function E0(n){return on({operation:"write",hasIdempotencyKey:n})}function tY(n){if(!n)return;return{...n,export_sha256:n.export_sha256??n.export_hash,rulepack_sha256:n.rulepack_sha256??n.rulepack_hash,source_content_sha256:n.source_content_sha256??n.source_hash}}function KJ(n,i){n.register({name:"typescape_submit_advisory",description:"Submit an advisory artifact (recommendation, classification, challenge, etc.) targeting a review, finding, or rule entity. Advisory artifacts are non-authoritative and require explicit adoption. Supports idempotency keys for safe retries.",inputSchema:jJ},async($)=>{let g=$,v=g.artifact_kind??g.kind,w=g.body_md??g.body,_=tY(g.basis);if(!v)return G(new D(400,"missing_param","Missing required parameter: artifact_kind","local"));if(!g.target_type)return G(new D(400,"missing_param","Missing required parameter: target_type","local"));if(!g.target_id)return G(new D(400,"missing_param","Missing required parameter: target_id","local"));if(!w)return G(new D(400,"missing_param","Missing required parameter: body_md","local"));if(!g.source_label)return G(new D(400,"missing_param","Missing required parameter: source_label","local"));if(!g.submitted_by)return G(new D(400,"missing_param","Missing required parameter: submitted_by","local"));let U={artifact_kind:v,target:{target_type:g.target_type,target_id:g.target_id},provenance:{source_type:g.source_type??"agent",source_label:g.source_label,submitted_by:g.submitted_by,submitted_at:new Date().toISOString()},payload:{body_md:w,...g.confidence!==void 0&&{confidence:g.confidence},...g.severity_hint!==void 0&&{severity_hint:g.severity_hint},...g.structured_data!==void 0&&{structured_data:g.structured_data},...g.evidence_refs!==void 0&&{evidence_refs:g.evidence_refs}}};if(g.review_id)U.review_id=g.review_id;if(_)U.basis=_;if(g.idempotency_key)U.idempotency_key=g.idempotency_key;let k={};if(g.idempotency_key)k["Idempotency-Key"]=g.idempotency_key;try{let l=await i.post("/advisory-artifacts",{body:U,headers:k});return H(l.body,l.requestId,{retry:E0(Boolean(g.idempotency_key))})}catch(l){if(l instanceof D)return G(l,{operation:"write",hasIdempotencyKey:Boolean(g.idempotency_key)});throw l}}),n.register({name:"typescape_list_advisories",description:"List advisory artifacts with optional filters. Filter by review, target, kind, status, or submitter.",inputSchema:uJ},async($)=>{let g=$,v={};if(g.review_id)v.review_id=g.review_id;if(g.target_type)v.target_type=g.target_type;if(g.target_id)v.target_id=g.target_id;if(g.artifact_kind)v.artifact_kind=g.artifact_kind;if(g.status)v.status=g.status;if(g.submitted_by)v.submitted_by=g.submitted_by;if(g.limit!==void 0)v.limit=String(g.limit);if(g.offset!==void 0)v.offset=String(g.offset);try{let w=await i.get("/advisory-artifacts",{query:v});return H(w.body,w.requestId,{retry:qJ})}catch(w){if(w instanceof D)return G(w,{operation:"read"});throw w}}),n.register({name:"typescape_get_advisory",description:"Get a single advisory artifact by ID. Returns full artifact with provenance, payload, and adoption state.",inputSchema:HJ},async($)=>{let g=$;if(!g.artifact_id)return G(new D(400,"missing_param","Missing required parameter: artifact_id","local"));try{let v=await i.get(`/advisory-artifacts/${encodeURIComponent(g.artifact_id)}`);return H(v.body,v.requestId,{retry:qJ})}catch(v){if(v instanceof D)return G(v,{operation:"read"});throw v}}),n.register({name:"typescape_adopt_advisory",description:"Adopt an advisory artifact, transitioning it from 'submitted' to 'adopted'. "+"Adoption is an explicit act — advisory artifacts never silently become authoritative.",inputSchema:VJ},async($)=>{let g=$;if(!g.artifact_id)return G(new D(400,"missing_param","Missing required parameter: artifact_id","local"));let v={};if(g.rationale)v.rationale=g.rationale;if(g.adoption_review_id)v.adoption_review_id=g.adoption_review_id;if(g.adoption_proposed_change_id)v.adoption_proposed_change_id=g.adoption_proposed_change_id;try{let w=await i.post(`/advisory-artifacts/${encodeURIComponent(g.artifact_id)}/adopt`,{body:v});return H(w.body,w.requestId,{retry:E0(!1)})}catch(w){if(w instanceof D)return G(w,{operation:"write"});throw w}}),n.register({name:"typescape_reject_advisory",description:"Reject an advisory artifact with a reason. Transitions from 'submitted' to 'rejected'. Terminal state.",inputSchema:fJ},async($)=>{let g=$;if(!g.artifact_id)return G(new D(400,"missing_param","Missing required parameter: artifact_id","local"));if(!g.rejection_reason)return G(new D(400,"missing_param","Missing required parameter: rejection_reason","local"));let v={rejection_reason:g.rejection_reason};try{let w=await i.post(`/advisory-artifacts/${encodeURIComponent(g.artifact_id)}/reject`,{body:v});return H(w.body,w.requestId,{retry:E0(!1)})}catch(w){if(w instanceof D)return G(w,{operation:"write"});throw w}})}var OJ={type:"object",properties:{artifact_id:{type:"string",description:"Filter by advisory artifact ID (optional)"},action_type:{type:"string",enum:["advisory_submit","advisory_adopt","advisory_reject","advisory_supersede","revision_recommend"],description:"Filter by action type (optional)"},actor_id:{type:"string",description:"Filter by actor ID (optional)"},actor_type:{type:"string",enum:["agent","human","system"],description:"Filter by actor type (optional)"},review_id:{type:"string",description:"Filter by review scope (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},BJ={type:"object",properties:{receipt_id:{type:"string",description:"Action receipt ID to retrieve"}},required:["receipt_id"]},FJ={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to list receipts for"}},required:["artifact_id"]};var NJ=["typescape_list_action_receipts","typescape_get_action_receipt","typescape_list_artifact_receipts"],o0=on({operation:"read"});function cJ(n,i){n.register({name:"typescape_list_action_receipts",description:"List action receipts with optional filters. Filter by artifact, action type, actor, or review scope. Receipts capture basis attestation and tool metadata for advisory operations.",inputSchema:OJ},async($)=>{let g=$,v={};if(g.artifact_id)v.artifact_id=g.artifact_id;if(g.action_type)v.action_type=g.action_type;if(g.actor_id)v.actor_id=g.actor_id;if(g.actor_type)v.actor_type=g.actor_type;if(g.review_id)v.review_id=g.review_id;if(g.limit!==void 0)v.limit=String(g.limit);if(g.offset!==void 0)v.offset=String(g.offset);try{let w=await i.get("/action-receipts",{query:v});return H(w.body,w.requestId,{retry:o0})}catch(w){if(w instanceof D)return G(w,{operation:"read"});throw w}}),n.register({name:"typescape_get_action_receipt",description:"Get a single action receipt by ID. Returns full receipt with basis snapshot, tool metadata, and result summary.",inputSchema:BJ},async($)=>{let g=$;if(!g.receipt_id)return G(new D(400,"missing_param","Missing required parameter: receipt_id","local"));try{let v=await i.get(`/action-receipts/${encodeURIComponent(g.receipt_id)}`);return H(v.body,v.requestId,{retry:o0})}catch(v){if(v instanceof D)return G(v,{operation:"read"});throw v}}),n.register({name:"typescape_list_artifact_receipts",description:"List all action receipts for a specific advisory artifact. Shows the full execution journal for an artifact's lifecycle.",inputSchema:FJ},async($)=>{let g=$;if(!g.artifact_id)return G(new D(400,"missing_param","Missing required parameter: artifact_id","local"));try{let v=await i.get(`/advisory-artifacts/${encodeURIComponent(g.artifact_id)}/receipts`);return H(v.body,v.requestId,{retry:o0})}catch(v){if(v instanceof D)return G(v,{operation:"read"});throw v}})}var PJ=["typescape_create_project","typescape_list_projects","typescape_get_project","typescape_update_project"],QY={type:"object",properties:{name:{type:"string",description:"Project name (required, 1-200 characters)"},description:{type:"string",description:"Optional project description (Markdown, max 2000 characters)"}},required:["name"]},WY={type:"object",properties:{limit:{type:"number",description:"Maximum number of projects to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},YY={type:"object",properties:{project_id:{type:"string",description:"Project ID (e.g., prj_01HXYZ...)"}},required:["project_id"]},IY={type:"object",properties:{project_id:{type:"string",description:"Project ID to update"},name:{type:"string",description:"New project name (1-200 characters)"},description:{type:"string",description:"New project description (Markdown, max 2000 characters)"}},required:["project_id"]};function SJ(n,i){n.register({name:"typescape_create_project",description:"Create a new project for organizing document-upload-based reviews. Returns the created project with its ID.",inputSchema:QY},async($)=>{let g=$;if(!g.name)return G(new D(400,"missing_param","Missing required parameter: name","local"));let v={name:g.name};if(g.description!==void 0)v.description=g.description;try{let w=await i.post("/projects",{body:v});return H(_n(w.body),w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_list_projects",description:"List projects with optional cursor pagination. Returns an array of projects with pagination metadata.",inputSchema:WY},async($)=>{let g=$,v={};if(g.limit!==void 0)v.limit=String(g.limit);if(g.cursor!==void 0)v.cursor=g.cursor;try{let w=await i.get("/projects",{query:v});return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_get_project",description:"Get a project by ID. Returns the project details including configuration.",inputSchema:YY},async($)=>{let g=$;if(!g.project_id)return G(new D(400,"missing_param","Missing required parameter: project_id","local"));try{let v=await i.get(`/projects/${encodeURIComponent(g.project_id)}`);return H(_n(v.body),v.requestId)}catch(v){if(v instanceof D)return G(v);throw v}}),n.register({name:"typescape_update_project",description:"Update a project's name or description. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:IY},async($)=>{let g=$;if(!g.project_id)return G(new D(400,"missing_param","Missing required parameter: project_id","local"));let v={};if(g.name!==void 0)v.name=g.name;if(g.description!==void 0)v.description=g.description;try{let w=await i.request("PATCH",`/projects/${encodeURIComponent(g.project_id)}`,{body:v});return H(_n(w.body),w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}})}var zJ=["typescape_create_template","typescape_list_templates","typescape_get_template"],jY={type:"object",properties:{name:{type:"string",description:"Template name (required, 1-200 characters)"},description:{type:"string",description:"Optional template description"},source_type:{type:"string",enum:["git","upload"],description:"Source type for reviews created from this template (default: git)"},repo_id:{type:"string",description:"Repository ID (required when source_type is git)"},project_id:{type:"string",description:"Project ID (required when source_type is upload)"},config:{type:"object",description:"Optional configuration object for the template (e.g., default participants, rules, settings)"}},required:["name"]},uY={type:"object",properties:{limit:{type:"number",description:"Maximum number of templates to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},HY={type:"object",properties:{template_id:{type:"string",description:"Template ID (e.g., tpl_01HXYZ...)"}},required:["template_id"]};function MJ(n,i){n.register({name:"typescape_create_template",description:"Create a review template for repeatable review creation. Templates capture default settings so operators don't re-specify parameters each time. Returns the created template with its ID.",inputSchema:jY},async($)=>{let g=$;if(!g.name)return G(new D(400,"missing_param","Missing required parameter: name","local"));let v={name:g.name};if(g.description!==void 0)v.description=g.description;if(g.source_type!==void 0)v.source_type=g.source_type;if(g.repo_id!==void 0)v.repo_id=g.repo_id;if(g.project_id!==void 0)v.project_id=g.project_id;if(g.config!==void 0)v.config=g.config;try{let w=await i.post("/session-templates",{body:v});return H(_n(w.body),w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_list_templates",description:"List review templates with optional cursor pagination. Returns an array of templates with pagination metadata.",inputSchema:uY},async($)=>{let g=$,v={};if(g.limit!==void 0)v.limit=String(g.limit);if(g.cursor!==void 0)v.cursor=g.cursor;try{let w=await i.get("/session-templates",{query:v});return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_get_template",description:"Get a review template by ID. Returns the template details including configuration.",inputSchema:HY},async($)=>{let g=$;if(!g.template_id)return G(new D(400,"missing_param","Missing required parameter: template_id","local"));try{let v=await i.get(`/session-templates/${encodeURIComponent(g.template_id)}`);return H(_n(v.body),v.requestId)}catch(v){if(v instanceof D)return G(v);throw v}})}var RJ=["typescape_list_issues","typescape_get_issue","typescape_update_issue"],VY={type:"object",properties:{session_id:{type:"string",description:"Review/session ID to list issues for (required)"},status:{type:"string",enum:["open","closed","all"],description:"Filter by issue status (default: all)"},severity:{type:"string",enum:["critical","high","medium","low","info"],description:"Filter by severity level"},limit:{type:"number",description:"Maximum number of issues to return (default: 20, max: 100)"},offset:{type:"number",description:"Offset for pagination (default: 0)"}},required:["session_id"]},fY={type:"object",properties:{issue_id:{type:"string",description:"Issue ID (e.g., iss_01HXYZ...)"}},required:["issue_id"]},qY={type:"object",properties:{issue_id:{type:"string",description:"Issue ID to update"},status:{type:"string",enum:["open","closed"],description:"New status for the issue"},assignee:{type:"string",description:"User ID or email to assign the issue to (null to unassign)"},priority:{type:"string",enum:["critical","high","medium","low"],description:"New priority level"}},required:["issue_id"]};function AJ(n,i){n.register({name:"typescape_list_issues",description:"List issues for a review. Supports filtering by status and severity, with offset-based pagination. Returns issues ordered by creation time descending.",inputSchema:VY},async($)=>{let g=$;if(!g.session_id)return G(new D(400,"missing_param","Missing required parameter: session_id","local"));let v={};if(g.status!==void 0)v.status=g.status;if(g.severity!==void 0)v.severity=g.severity;if(g.limit!==void 0)v.limit=String(g.limit);if(g.offset!==void 0)v.offset=String(g.offset);try{let w=await i.get("/issues",{query:{...v,session_id:g.session_id}});return H(w.body,w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}}),n.register({name:"typescape_get_issue",description:"Get an issue by ID. Returns the full issue details including anchors, associated threads, and current status.",inputSchema:fY},async($)=>{let g=$;if(!g.issue_id)return G(new D(400,"missing_param","Missing required parameter: issue_id","local"));try{let v=await i.get(`/issues/${encodeURIComponent(g.issue_id)}`);return H(_n(v.body),v.requestId)}catch(v){if(v instanceof D)return G(v);throw v}}),n.register({name:"typescape_update_issue",description:"Update an issue's status, assignee, or priority. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:qY},async($)=>{let g=$;if(!g.issue_id)return G(new D(400,"missing_param","Missing required parameter: issue_id","local"));let v={};if(g.status!==void 0)v.status=g.status;if(g.assignee!==void 0)v.assignee=g.assignee;if(g.priority!==void 0)v.priority=g.priority;try{let w=await i.request("PATCH",`/issues/${encodeURIComponent(g.issue_id)}`,{body:v});return H(_n(w.body),w.requestId)}catch(w){if(w instanceof D)return G(w);throw w}})}var xJ=["typescape_list_webhooks","typescape_create_webhook","typescape_delete_webhook"],LY={type:"object",properties:{status:{type:"string",description:"Filter by webhook status. One of: active, paused, disabled."},limit:{type:"integer",description:"Maximum number of results to return (default 25)."}},required:[]},KY={type:"object",properties:{url:{type:"string",description:"The HTTPS URL to deliver webhook events to."},events:{type:"array",items:{type:"string"},description:'Array of event types to subscribe to (e.g., ["review.created", "thread.resolved"]).'},description:{type:"string",description:"Optional human-readable description of the webhook."}},required:["url","events"]},OY={type:"object",properties:{webhook_id:{type:"string",description:"The webhook subscription ID to delete."}},required:["webhook_id"]};function hJ(n,i){n.register({name:"typescape_list_webhooks",description:"List webhook subscriptions for the current tenant. Use this to audit which external systems receive event notifications and verify delivery targets before creating new subscriptions. Returns subscription details including URL, events, and status.",inputSchema:LY},async($)=>{let g=$;try{let v=new URLSearchParams;if(g.status)v.set("status",g.status);if(g.limit)v.set("limit",String(g.limit));let w=v.toString(),_=w?`/webhooks?${w}`:"/webhooks",U=await i.get(_);return H(U.body,U.requestId)}catch(v){if(v instanceof D)return G(v);throw v}}),n.register({name:"typescape_create_webhook",description:"Create a new webhook subscription to receive event notifications at an HTTPS endpoint. Common events include review.created, thread.resolved, and check_run.completed. Use this to integrate Typescape with external CI/CD pipelines or notification systems.",inputSchema:KY},async($)=>{let g=$;if(!g.url)return G(new D(400,"missing_param","Missing required parameter: url","local"));if(!g.events||g.events.length===0)return G(new D(400,"missing_param","Missing required parameter: events (must be a non-empty array)","local"));try{let v=await i.post("/webhooks",{body:{url:g.url,events:g.events,description:g.description}});return H(v.body,v.requestId)}catch(v){if(v instanceof D)return G(v);throw v}}),n.register({name:"typescape_delete_webhook",description:"Delete a webhook subscription by ID, permanently stopping all deliveries to the target URL. Use typescape_list_webhooks first to find the subscription ID. This action cannot be undone.",inputSchema:OY},async($)=>{let g=$;if(!g.webhook_id)return G(new D(400,"missing_param","Missing required parameter: webhook_id","local"));try{let v=await i.request("DELETE",`/webhooks/${encodeURIComponent(g.webhook_id)}`,{});return H({deleted:!0,webhook_id:g.webhook_id},v.requestId)}catch(v){if(v instanceof D)return G(v);throw v}})}var CJ=["typescape_list_events"],BY={type:"object",properties:{review_id:{type:"string",description:"Review (session) ID to list events for."},cursor:{type:"string",description:"Pagination cursor from a previous response. Events after this cursor are returned."},limit:{type:"integer",description:"Maximum number of events to return (default 50)."}},required:["review_id"]};function EJ(n,i){n.register({name:"typescape_list_events",description:"List timeline events for a review. Use this to monitor review activity without re-fetching full review data. Returns an ordered list of events (comments, thread changes, status changes, check completions) with cursor-based pagination. Pass the cursor from the previous response for efficient incremental polling.",inputSchema:BY},async($)=>{let g=$;if(!g.review_id)return G(new D(400,"missing_param","Missing required parameter: review_id","local"));try{let v=new URLSearchParams;if(g.cursor)v.set("cursor",g.cursor);if(g.limit)v.set("limit",String(g.limit));let w=v.toString(),_=`/sessions/${encodeURIComponent(g.review_id)}/events${w?`?${w}`:""}`,U=await i.get(_);return H(U.body,U.requestId)}catch(v){if(v instanceof D)return G(v);throw v}})}var oJ=`---
|
|
178
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let G of $.seen.entries()){let D=G[1];if(w===G[0]){U(G);continue}if($.external){let X=$.external.registry.get(G[0])?.id;if(w!==G[0]&&X){U(G);continue}}if($.metadataRegistry.get(G[0])?.id){U(G);continue}if(D.cycle){U(G);continue}if(D.count>1){if($.reused==="ref"){U(G);continue}}}}function Dv($,w){let g=$.seen.get(w);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let _=(G)=>{let D=$.seen.get(G);if(D.ref===null)return;let J=D.def??D.schema,X={...J},Q=D.ref;if(D.ref=null,Q){_(Q);let q=$.seen.get(Q),L=q.schema;if(L.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))J.allOf=J.allOf??[],J.allOf.push(L);else Object.assign(J,L);if(Object.assign(J,X),G._zod.parent===Q)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(!(H in X))delete J[H]}if(L.$ref)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(H in q.def&&JSON.stringify(J[H])===JSON.stringify(q.def[H]))delete J[H]}}let Y=G._zod.parent;if(Y&&Y!==Q){_(Y);let q=$.seen.get(Y);if(q?.schema.$ref){if(J.$ref=q.schema.$ref,q.def)for(let L in J){if(L==="$ref"||L==="allOf")continue;if(L in q.def&&JSON.stringify(J[L])===JSON.stringify(q.def[L]))delete J[L]}}}$.override({zodSchema:G,jsonSchema:J,path:D.path??[]})};for(let G of[...$.seen.entries()].reverse())_(G[0]);let v={};if($.target==="draft-2020-12")v.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")v.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")v.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let G=$.external.registry.get(w)?.id;if(!G)throw Error("Schema is missing an `id` property");v.$id=$.external.uri(G)}Object.assign(v,g.def??g.schema);let U=$.external?.defs??{};for(let G of $.seen.entries()){let D=G[1];if(D.def&&D.defId)U[D.defId]=D.def}if($.external);else if(Object.keys(U).length>0)if($.target==="draft-2020-12")v.$defs=U;else v.definitions=U;try{let G=JSON.parse(JSON.stringify(v));return Object.defineProperty(G,"~standard",{value:{...w["~standard"],jsonSchema:{input:n4(w,"input",$.processors),output:n4(w,"output",$.processors)}},enumerable:!1,writable:!1}),G}catch(G){throw Error("Error converting schema to JSON.")}}function M$($,w){let g=w??{seen:new Set};if(g.seen.has($))return!1;g.seen.add($);let _=$._zod.def;if(_.type==="transform")return!0;if(_.type==="array")return M$(_.element,g);if(_.type==="set")return M$(_.valueType,g);if(_.type==="lazy")return M$(_.getter(),g);if(_.type==="promise"||_.type==="optional"||_.type==="nonoptional"||_.type==="nullable"||_.type==="readonly"||_.type==="default"||_.type==="prefault")return M$(_.innerType,g);if(_.type==="intersection")return M$(_.left,g)||M$(_.right,g);if(_.type==="record"||_.type==="map")return M$(_.keyType,g)||M$(_.valueType,g);if(_.type==="pipe")return M$(_.in,g)||M$(_.out,g);if(_.type==="object"){for(let v in _.shape)if(M$(_.shape[v],g))return!0;return!1}if(_.type==="union"){for(let v of _.options)if(M$(v,g))return!0;return!1}if(_.type==="tuple"){for(let v of _.items)if(M$(v,g))return!0;if(_.rest&&M$(_.rest,g))return!0;return!1}return!1}var uJ=($,w={})=>(g)=>{let _=bv({...g,processors:w});return _$($,_),Gv(_,$),Dv(_,$)},n4=($,w,g={})=>(_)=>{let{libraryOptions:v,target:U}=_??{},G=bv({...v??{},target:U,io:w,processors:g});return _$($,G),Gv(G,$),Dv(G,$)};var QL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},EJ=($,w,g,_)=>{let v=g;v.type="string";let{minimum:U,maximum:G,format:D,patterns:J,contentEncoding:X}=$._zod.bag;if(typeof U==="number")v.minLength=U;if(typeof G==="number")v.maxLength=G;if(D){if(v.format=QL[D]??D,v.format==="")delete v.format;if(D==="time")delete v.format}if(X)v.contentEncoding=X;if(J&&J.size>0){let Q=[...J];if(Q.length===1)v.pattern=Q[0].source;else if(Q.length>1)v.allOf=[...Q.map((Y)=>({...w.target==="draft-07"||w.target==="draft-04"||w.target==="openapi-3.0"?{type:"string"}:{},pattern:Y.source}))]}},ZJ=($,w,g,_)=>{let v=g,{minimum:U,maximum:G,format:D,multipleOf:J,exclusiveMaximum:X,exclusiveMinimum:Q}=$._zod.bag;if(typeof D==="string"&&D.includes("int"))v.type="integer";else v.type="number";if(typeof Q==="number")if(w.target==="draft-04"||w.target==="openapi-3.0")v.minimum=Q,v.exclusiveMinimum=!0;else v.exclusiveMinimum=Q;if(typeof U==="number"){if(v.minimum=U,typeof Q==="number"&&w.target!=="draft-04")if(Q>=U)delete v.minimum;else delete v.exclusiveMinimum}if(typeof X==="number")if(w.target==="draft-04"||w.target==="openapi-3.0")v.maximum=X,v.exclusiveMaximum=!0;else v.exclusiveMaximum=X;if(typeof G==="number"){if(v.maximum=G,typeof X==="number"&&w.target!=="draft-04")if(X<=G)delete v.maximum;else delete v.exclusiveMaximum}if(typeof J==="number")v.multipleOf=J},xJ=($,w,g,_)=>{g.type="boolean"},hJ=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},lJ=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},cJ=($,w,g,_)=>{if(w.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},yJ=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},mJ=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},tJ=($,w,g,_)=>{g.not={}},dJ=($,w,g,_)=>{},oJ=($,w,g,_)=>{},rJ=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},pJ=($,w,g,_)=>{let v=$._zod.def,U=X4(v.entries);if(U.every((G)=>typeof G==="number"))g.type="number";if(U.every((G)=>typeof G==="string"))g.type="string";g.enum=U},eJ=($,w,g,_)=>{let v=$._zod.def,U=[];for(let G of v.values)if(G===void 0){if(w.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof G==="bigint")if(w.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else U.push(Number(G));else U.push(G);if(U.length===0);else if(U.length===1){let G=U[0];if(g.type=G===null?"null":typeof G,w.target==="draft-04"||w.target==="openapi-3.0")g.enum=[G];else g.const=G}else{if(U.every((G)=>typeof G==="number"))g.type="number";if(U.every((G)=>typeof G==="string"))g.type="string";if(U.every((G)=>typeof G==="boolean"))g.type="boolean";if(U.every((G)=>G===null))g.type="null";g.enum=U}},aJ=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},sJ=($,w,g,_)=>{let v=g,U=$._zod.pattern;if(!U)throw Error("Pattern not found in template literal");v.type="string",v.pattern=U.source},$9=($,w,g,_)=>{let v=g,U={type:"string",format:"binary",contentEncoding:"binary"},{minimum:G,maximum:D,mime:J}=$._zod.bag;if(G!==void 0)U.minLength=G;if(D!==void 0)U.maxLength=D;if(J)if(J.length===1)U.contentMediaType=J[0],Object.assign(v,U);else Object.assign(v,U),v.anyOf=J.map((X)=>({contentMediaType:X}));else Object.assign(v,U)},w9=($,w,g,_)=>{g.type="boolean"},v9=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},g9=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},_9=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},U9=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},b9=($,w,g,_)=>{if(w.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},G9=($,w,g,_)=>{let v=g,U=$._zod.def,{minimum:G,maximum:D}=$._zod.bag;if(typeof G==="number")v.minItems=G;if(typeof D==="number")v.maxItems=D;v.type="array",v.items=_$(U.element,w,{..._,path:[..._.path,"items"]})},D9=($,w,g,_)=>{let v=g,U=$._zod.def;v.type="object",v.properties={};let G=U.shape;for(let X in G)v.properties[X]=_$(G[X],w,{..._,path:[..._.path,"properties",X]});let D=new Set(Object.keys(G)),J=new Set([...D].filter((X)=>{let Q=U.shape[X]._zod;if(w.io==="input")return Q.optin===void 0;else return Q.optout===void 0}));if(J.size>0)v.required=Array.from(J);if(U.catchall?._zod.def.type==="never")v.additionalProperties=!1;else if(!U.catchall){if(w.io==="output")v.additionalProperties=!1}else if(U.catchall)v.additionalProperties=_$(U.catchall,w,{..._,path:[..._.path,"additionalProperties"]})},oU=($,w,g,_)=>{let v=$._zod.def,U=v.inclusive===!1,G=v.options.map((D,J)=>_$(D,w,{..._,path:[..._.path,U?"oneOf":"anyOf",J]}));if(U)g.oneOf=G;else g.anyOf=G},J9=($,w,g,_)=>{let v=$._zod.def,U=_$(v.left,w,{..._,path:[..._.path,"allOf",0]}),G=_$(v.right,w,{..._,path:[..._.path,"allOf",1]}),D=(X)=>("allOf"in X)&&Object.keys(X).length===1,J=[...D(U)?U.allOf:[U],...D(G)?G.allOf:[G]];g.allOf=J},X9=($,w,g,_)=>{let v=g,U=$._zod.def;v.type="array";let G=w.target==="draft-2020-12"?"prefixItems":"items",D=w.target==="draft-2020-12"?"items":w.target==="openapi-3.0"?"items":"additionalItems",J=U.items.map((q,L)=>_$(q,w,{..._,path:[..._.path,G,L]})),X=U.rest?_$(U.rest,w,{..._,path:[..._.path,D,...w.target==="openapi-3.0"?[U.items.length]:[]]}):null;if(w.target==="draft-2020-12"){if(v.prefixItems=J,X)v.items=X}else if(w.target==="openapi-3.0"){if(v.items={anyOf:J},X)v.items.anyOf.push(X);if(v.minItems=J.length,!X)v.maxItems=J.length}else if(v.items=J,X)v.additionalItems=X;let{minimum:Q,maximum:Y}=$._zod.bag;if(typeof Q==="number")v.minItems=Q;if(typeof Y==="number")v.maxItems=Y},Q9=($,w,g,_)=>{let v=g,U=$._zod.def;if(v.type="object",w.target==="draft-07"||w.target==="draft-2020-12")v.propertyNames=_$(U.keyType,w,{..._,path:[..._.path,"propertyNames"]});v.additionalProperties=_$(U.valueType,w,{..._,path:[..._.path,"additionalProperties"]});let G=U.keyType._zod.def;if(G.type==="enum"){let J=X4(G.entries).filter((X)=>typeof X==="string"||typeof X==="number");if(J.length>0)v.required=J}},Y9=($,w,g,_)=>{let v=$._zod.def,U=_$(v.innerType,w,_),G=w.seen.get($);if(w.target==="openapi-3.0")G.ref=v.innerType,g.nullable=!0;else g.anyOf=[U,{type:"null"}]},W9=($,w,g,_)=>{let v=$._zod.def;_$(v.innerType,w,_);let U=w.seen.get($);U.ref=v.innerType},H9=($,w,g,_)=>{let v=$._zod.def;_$(v.innerType,w,_);let U=w.seen.get($);U.ref=v.innerType,g.default=JSON.parse(JSON.stringify(v.defaultValue))},q9=($,w,g,_)=>{let v=$._zod.def;_$(v.innerType,w,_);let U=w.seen.get($);if(U.ref=v.innerType,w.io==="input")g._prefault=JSON.parse(JSON.stringify(v.defaultValue))},B9=($,w,g,_)=>{let v=$._zod.def;_$(v.innerType,w,_);let U=w.seen.get($);U.ref=v.innerType;let G;try{G=v.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=G},I9=($,w,g,_)=>{let v=$._zod.def,U=w.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;_$(U,w,_);let G=w.seen.get($);G.ref=U},L9=($,w,g,_)=>{let v=$._zod.def;_$(v.innerType,w,_);let U=w.seen.get($);U.ref=v.innerType,g.readOnly=!0},V9=($,w,g,_)=>{let v=$._zod.def;_$(v.innerType,w,_);let U=w.seen.get($);U.ref=v.innerType},rU=($,w,g,_)=>{let v=$._zod.def;_$(v.innerType,w,_);let U=w.seen.get($);U.ref=v.innerType},F9=($,w,g,_)=>{let v=$._zod.innerType;_$(v,w,_);let U=w.seen.get($);U.ref=v},dU={string:EJ,number:ZJ,boolean:xJ,bigint:hJ,symbol:lJ,null:cJ,undefined:yJ,void:mJ,never:tJ,any:dJ,unknown:oJ,date:rJ,enum:pJ,literal:eJ,nan:aJ,template_literal:sJ,file:$9,success:w9,custom:v9,function:g9,transform:_9,map:U9,set:b9,array:G9,object:D9,union:oU,intersection:J9,tuple:X9,record:Q9,nullable:Y9,nonoptional:W9,default:H9,prefault:q9,catch:B9,pipe:I9,readonly:L9,promise:V9,optional:rU,lazy:F9};function M4($,w){if("_idmap"in $){let _=$,v=bv({...w,processors:dU}),U={};for(let J of _._idmap.entries()){let[X,Q]=J;_$(Q,v)}let G={},D={registry:_,uri:w?.uri,defs:U};v.external=D;for(let J of _._idmap.entries()){let[X,Q]=J;Gv(v,Q),G[X]=Dv(v,Q)}if(Object.keys(U).length>0){let J=v.target==="draft-2020-12"?"$defs":"definitions";G.__shared={[J]:U}}return{schemas:G}}let g=bv({...w,processors:dU});return _$($,g),Gv(g,$),Dv(g,$)}class j9{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let w=$?.target??"draft-2020-12";if(w==="draft-4")w="draft-04";if(w==="draft-7")w="draft-07";this.ctx=bv({processors:dU,target:w,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,w={path:[],schemaPath:[]}){return _$($,this.ctx,w)}emit($,w){if(w){if(w.cycles)this.ctx.cycles=w.cycles;if(w.reused)this.ctx.reused=w.reused;if(w.external)this.ctx.external=w.external}Gv(this.ctx,$);let g=Dv(this.ctx,$),{"~standard":_,...v}=g;return v}}var C8={};var Xg={};p$(Xg,{xor:()=>xb,xid:()=>Xb,void:()=>Rb,uuidv7:()=>vb,uuidv6:()=>wb,uuidv4:()=>$b,uuid:()=>sU,url:()=>gb,unknown:()=>K$,union:()=>zw,undefined:()=>ib,ulid:()=>Jb,uint64:()=>Ab,uint32:()=>Mb,tuple:()=>yv,transform:()=>s4,templateLiteral:()=>eb,symbol:()=>Sb,superRefine:()=>J_,success:()=>ob,stringbool:()=>U1,stringFormat:()=>jb,string:()=>O,strictObject:()=>Eb,set:()=>yb,refine:()=>D_,record:()=>qw,readonly:()=>v_,promise:()=>ab,preprocess:()=>G1,prefault:()=>rg,pipe:()=>Zv,partialRecord:()=>hb,optional:()=>uv,object:()=>T,number:()=>X$,nullish:()=>db,nullable:()=>Ev,null:()=>ng,nonoptional:()=>pg,never:()=>a4,nativeEnum:()=>mb,nanoid:()=>bb,nan:()=>rb,meta:()=>g1,map:()=>cb,mac:()=>Wb,looseRecord:()=>lb,looseObject:()=>Zb,literal:()=>Y$,lazy:()=>U_,ksuid:()=>Qb,keyof:()=>ub,jwt:()=>Fb,json:()=>b1,ipv6:()=>Hb,ipv4:()=>Yb,intersection:()=>Cg,int64:()=>fb,int32:()=>nb,int:()=>i4,instanceof:()=>_1,httpUrl:()=>_b,hostname:()=>Kb,hex:()=>Ob,hash:()=>Nb,guid:()=>aU,function:()=>sb,float64:()=>kb,float32:()=>Pb,file:()=>tb,exactOptional:()=>yg,enum:()=>s,emoji:()=>Ub,email:()=>eU,e164:()=>Vb,discriminatedUnion:()=>fw,describe:()=>v1,date:()=>Cb,custom:()=>w1,cuid2:()=>Db,cuid:()=>Gb,codec:()=>pb,cidrv6:()=>Bb,cidrv4:()=>qb,check:()=>$1,catch:()=>sg,boolean:()=>J$,bigint:()=>zb,base64url:()=>Lb,base64:()=>Ib,array:()=>v$,any:()=>Tb,_function:()=>sb,_default:()=>dg,_ZodString:()=>T4,ZodXor:()=>ig,ZodXID:()=>h4,ZodVoid:()=>Ag,ZodUnknown:()=>zg,ZodUnion:()=>cv,ZodUndefined:()=>Pg,ZodUUID:()=>m$,ZodURL:()=>xv,ZodULID:()=>x4,ZodType:()=>d,ZodTuple:()=>ug,ZodTransform:()=>lg,ZodTemplateLiteral:()=>g_,ZodSymbol:()=>Ng,ZodSuccess:()=>eg,ZodStringFormat:()=>g$,ZodString:()=>Qv,ZodSet:()=>Zg,ZodRecord:()=>mv,ZodReadonly:()=>w_,ZodPromise:()=>b_,ZodPrefault:()=>og,ZodPipe:()=>v6,ZodOptional:()=>$6,ZodObject:()=>lv,ZodNumberFormat:()=>Mw,ZodNumber:()=>Wv,ZodNullable:()=>mg,ZodNull:()=>kg,ZodNonOptional:()=>w6,ZodNever:()=>fg,ZodNanoID:()=>u4,ZodNaN:()=>$_,ZodMap:()=>Eg,ZodMAC:()=>Og,ZodLiteral:()=>xg,ZodLazy:()=>__,ZodKSUID:()=>l4,ZodJWT:()=>p4,ZodIntersection:()=>Rg,ZodIPv6:()=>y4,ZodIPv4:()=>c4,ZodGUID:()=>Cv,ZodFunction:()=>G_,ZodFile:()=>hg,ZodExactOptional:()=>cg,ZodEnum:()=>Xv,ZodEmoji:()=>C4,ZodEmail:()=>R4,ZodE164:()=>r4,ZodDiscriminatedUnion:()=>Tg,ZodDefault:()=>tg,ZodDate:()=>hv,ZodCustomStringFormat:()=>Yv,ZodCustom:()=>tv,ZodCodec:()=>g6,ZodCatch:()=>ag,ZodCUID2:()=>Z4,ZodCUID:()=>E4,ZodCIDRv6:()=>t4,ZodCIDRv4:()=>m4,ZodBoolean:()=>Hv,ZodBigIntFormat:()=>e4,ZodBigInt:()=>qv,ZodBase64URL:()=>o4,ZodBase64:()=>d4,ZodArray:()=>Sg,ZodAny:()=>Mg});var pU={};p$(pU,{uppercase:()=>pw,trim:()=>vv,toUpperCase:()=>_v,toLowerCase:()=>gv,startsWith:()=>aw,slugify:()=>Uv,size:()=>Pw,regex:()=>ow,property:()=>P4,positive:()=>j4,overwrite:()=>E$,normalize:()=>wv,nonpositive:()=>O4,nonnegative:()=>N4,negative:()=>K4,multipleOf:()=>Ww,minSize:()=>y$,minLength:()=>e$,mime:()=>$v,maxSize:()=>Hw,maxLength:()=>kw,lte:()=>n$,lt:()=>l$,lowercase:()=>rw,length:()=>nw,includes:()=>ew,gte:()=>j$,gt:()=>c$,endsWith:()=>sw});var Jv={};p$(Jv,{time:()=>N9,duration:()=>P9,datetime:()=>K9,date:()=>O9,ZodISOTime:()=>A4,ZodISODuration:()=>S4,ZodISODateTime:()=>z4,ZodISODate:()=>f4});var z4=j("ZodISODateTime",($,w)=>{DG.init($,w),g$.init($,w)});function K9($){return vJ(z4,$)}var f4=j("ZodISODate",($,w)=>{JG.init($,w),g$.init($,w)});function O9($){return gJ(f4,$)}var A4=j("ZodISOTime",($,w)=>{XG.init($,w),g$.init($,w)});function N9($){return _J(A4,$)}var S4=j("ZodISODuration",($,w)=>{QG.init($,w),g$.init($,w)});function P9($){return UJ(S4,$)}var u8=($,w)=>{t6.init($,w),$.name="ZodError",Object.defineProperties($,{format:{value:(g)=>Sv($,g)},flatten:{value:(g)=>Av($,g)},addIssue:{value:(g)=>{$.issues.push(g),$.message=JSON.stringify($.issues,Q4,2)}},addIssues:{value:(g)=>{$.issues.push(...g),$.message=JSON.stringify($.issues,Q4,2)}},isEmpty:{get(){return $.issues.length===0}}})},k9=j("ZodError",u8),O$=j("ZodError",u8,{Parent:Error});var Qg=H4(O$),Yg=q4(O$),Wg=B4(O$),Hg=I4(O$),qg=bU(O$),Bg=GU(O$),Ig=DU(O$),Lg=JU(O$),Vg=XU(O$),Fg=QU(O$),jg=YU(O$),Kg=WU(O$);var d=j("ZodType",($,w)=>{return t.init($,w),Object.assign($["~standard"],{jsonSchema:{input:n4($,"input"),output:n4($,"output")}}),$.toJSONSchema=uJ($,{}),$.def=w,$.type=w.type,Object.defineProperty($,"_def",{value:w}),$.check=(...g)=>{return $.clone(n.mergeDefs(w,{checks:[...w.checks??[],...g.map((_)=>typeof _==="function"?{_zod:{check:_,def:{check:"custom"},onattach:[]}}:_)]}),{parent:!0})},$.with=$.check,$.clone=(g,_)=>F$($,g,_),$.brand=()=>$,$.register=(g,_)=>{return g.add($,_),$},$.parse=(g,_)=>Qg($,g,_,{callee:$.parse}),$.safeParse=(g,_)=>Wg($,g,_),$.parseAsync=async(g,_)=>Yg($,g,_,{callee:$.parseAsync}),$.safeParseAsync=async(g,_)=>Hg($,g,_),$.spa=$.safeParseAsync,$.encode=(g,_)=>qg($,g,_),$.decode=(g,_)=>Bg($,g,_),$.encodeAsync=async(g,_)=>Ig($,g,_),$.decodeAsync=async(g,_)=>Lg($,g,_),$.safeEncode=(g,_)=>Vg($,g,_),$.safeDecode=(g,_)=>Fg($,g,_),$.safeEncodeAsync=async(g,_)=>jg($,g,_),$.safeDecodeAsync=async(g,_)=>Kg($,g,_),$.refine=(g,_)=>$.check(D_(g,_)),$.superRefine=(g)=>$.check(J_(g)),$.overwrite=(g)=>$.check(E$(g)),$.optional=()=>uv($),$.exactOptional=()=>yg($),$.nullable=()=>Ev($),$.nullish=()=>uv(Ev($)),$.nonoptional=(g)=>pg($,g),$.array=()=>v$($),$.or=(g)=>zw([$,g]),$.and=(g)=>Cg($,g),$.transform=(g)=>Zv($,s4(g)),$.default=(g)=>dg($,g),$.prefault=(g)=>rg($,g),$.catch=(g)=>sg($,g),$.pipe=(g)=>Zv($,g),$.readonly=()=>v_($),$.describe=(g)=>{let _=$.clone();return I$.add(_,{description:g}),_},Object.defineProperty($,"description",{get(){return I$.get($)?.description},configurable:!0}),$.meta=(...g)=>{if(g.length===0)return I$.get($);let _=$.clone();return I$.add(_,g[0]),_},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(g)=>g($),$}),T4=j("_ZodString",($,w)=>{Tv.init($,w),d.init($,w),$._zod.processJSONSchema=(_,v,U)=>EJ($,_,v,U);let g=$._zod.bag;$.format=g.format??null,$.minLength=g.minimum??null,$.maxLength=g.maximum??null,$.regex=(..._)=>$.check(ow(..._)),$.includes=(..._)=>$.check(ew(..._)),$.startsWith=(..._)=>$.check(aw(..._)),$.endsWith=(..._)=>$.check(sw(..._)),$.min=(..._)=>$.check(e$(..._)),$.max=(..._)=>$.check(kw(..._)),$.length=(..._)=>$.check(nw(..._)),$.nonempty=(..._)=>$.check(e$(1,..._)),$.lowercase=(_)=>$.check(rw(_)),$.uppercase=(_)=>$.check(pw(_)),$.trim=()=>$.check(vv()),$.normalize=(..._)=>$.check(wv(..._)),$.toLowerCase=()=>$.check(gv()),$.toUpperCase=()=>$.check(_v()),$.slugify=()=>$.check(Uv())}),Qv=j("ZodString",($,w)=>{Tv.init($,w),T4.init($,w),$.email=(g)=>$.check(nU(R4,g)),$.url=(g)=>$.check(Dg(xv,g)),$.jwt=(g)=>$.check(tU(p4,g)),$.emoji=(g)=>$.check(SU(C4,g)),$.guid=(g)=>$.check(Gg(Cv,g)),$.uuid=(g)=>$.check(MU(m$,g)),$.uuidv4=(g)=>$.check(zU(m$,g)),$.uuidv6=(g)=>$.check(fU(m$,g)),$.uuidv7=(g)=>$.check(AU(m$,g)),$.nanoid=(g)=>$.check(iU(u4,g)),$.guid=(g)=>$.check(Gg(Cv,g)),$.cuid=(g)=>$.check(TU(E4,g)),$.cuid2=(g)=>$.check(RU(Z4,g)),$.ulid=(g)=>$.check(CU(x4,g)),$.base64=(g)=>$.check(cU(d4,g)),$.base64url=(g)=>$.check(yU(o4,g)),$.xid=(g)=>$.check(uU(h4,g)),$.ksuid=(g)=>$.check(EU(l4,g)),$.ipv4=(g)=>$.check(ZU(c4,g)),$.ipv6=(g)=>$.check(xU(y4,g)),$.cidrv4=(g)=>$.check(hU(m4,g)),$.cidrv6=(g)=>$.check(lU(t4,g)),$.e164=(g)=>$.check(mU(r4,g)),$.datetime=(g)=>$.check(K9(g)),$.date=(g)=>$.check(O9(g)),$.time=(g)=>$.check(N9(g)),$.duration=(g)=>$.check(P9(g))});function O($){return sD(Qv,$)}var g$=j("ZodStringFormat",($,w)=>{b$.init($,w),T4.init($,w)}),R4=j("ZodEmail",($,w)=>{s2.init($,w),g$.init($,w)});function eU($){return nU(R4,$)}var Cv=j("ZodGUID",($,w)=>{e2.init($,w),g$.init($,w)});function aU($){return Gg(Cv,$)}var m$=j("ZodUUID",($,w)=>{a2.init($,w),g$.init($,w)});function sU($){return MU(m$,$)}function $b($){return zU(m$,$)}function wb($){return fU(m$,$)}function vb($){return AU(m$,$)}var xv=j("ZodURL",($,w)=>{$G.init($,w),g$.init($,w)});function gb($){return Dg(xv,$)}function _b($){return Dg(xv,{protocol:/^https?$/,hostname:i$.domain,...n.normalizeParams($)})}var C4=j("ZodEmoji",($,w)=>{wG.init($,w),g$.init($,w)});function Ub($){return SU(C4,$)}var u4=j("ZodNanoID",($,w)=>{vG.init($,w),g$.init($,w)});function bb($){return iU(u4,$)}var E4=j("ZodCUID",($,w)=>{gG.init($,w),g$.init($,w)});function Gb($){return TU(E4,$)}var Z4=j("ZodCUID2",($,w)=>{_G.init($,w),g$.init($,w)});function Db($){return RU(Z4,$)}var x4=j("ZodULID",($,w)=>{UG.init($,w),g$.init($,w)});function Jb($){return CU(x4,$)}var h4=j("ZodXID",($,w)=>{bG.init($,w),g$.init($,w)});function Xb($){return uU(h4,$)}var l4=j("ZodKSUID",($,w)=>{GG.init($,w),g$.init($,w)});function Qb($){return EU(l4,$)}var c4=j("ZodIPv4",($,w)=>{YG.init($,w),g$.init($,w)});function Yb($){return ZU(c4,$)}var Og=j("ZodMAC",($,w)=>{HG.init($,w),g$.init($,w)});function Wb($){return wJ(Og,$)}var y4=j("ZodIPv6",($,w)=>{WG.init($,w),g$.init($,w)});function Hb($){return xU(y4,$)}var m4=j("ZodCIDRv4",($,w)=>{qG.init($,w),g$.init($,w)});function qb($){return hU(m4,$)}var t4=j("ZodCIDRv6",($,w)=>{BG.init($,w),g$.init($,w)});function Bb($){return lU(t4,$)}var d4=j("ZodBase64",($,w)=>{LG.init($,w),g$.init($,w)});function Ib($){return cU(d4,$)}var o4=j("ZodBase64URL",($,w)=>{VG.init($,w),g$.init($,w)});function Lb($){return yU(o4,$)}var r4=j("ZodE164",($,w)=>{FG.init($,w),g$.init($,w)});function Vb($){return mU(r4,$)}var p4=j("ZodJWT",($,w)=>{jG.init($,w),g$.init($,w)});function Fb($){return tU(p4,$)}var Yv=j("ZodCustomStringFormat",($,w)=>{KG.init($,w),g$.init($,w)});function jb($,w,g={}){return k4(Yv,$,w,g)}function Kb($){return k4(Yv,"hostname",i$.hostname,$)}function Ob($){return k4(Yv,"hex",i$.hex,$)}function Nb($,w){let g=w?.enc??"hex",_=`${$}_${g}`,v=i$[_];if(!v)throw Error(`Unrecognized hash format: ${_}`);return k4(Yv,_,v,w)}var Wv=j("ZodNumber",($,w)=>{OU.init($,w),d.init($,w),$._zod.processJSONSchema=(_,v,U)=>ZJ($,_,v,U),$.gt=(_,v)=>$.check(c$(_,v)),$.gte=(_,v)=>$.check(j$(_,v)),$.min=(_,v)=>$.check(j$(_,v)),$.lt=(_,v)=>$.check(l$(_,v)),$.lte=(_,v)=>$.check(n$(_,v)),$.max=(_,v)=>$.check(n$(_,v)),$.int=(_)=>$.check(i4(_)),$.safe=(_)=>$.check(i4(_)),$.positive=(_)=>$.check(c$(0,_)),$.nonnegative=(_)=>$.check(j$(0,_)),$.negative=(_)=>$.check(l$(0,_)),$.nonpositive=(_)=>$.check(n$(0,_)),$.multipleOf=(_,v)=>$.check(Ww(_,v)),$.step=(_,v)=>$.check(Ww(_,v)),$.finite=()=>$;let g=$._zod.bag;$.minValue=Math.max(g.minimum??Number.NEGATIVE_INFINITY,g.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(g.maximum??Number.POSITIVE_INFINITY,g.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(g.format??"").includes("int")||Number.isSafeInteger(g.multipleOf??0.5),$.isFinite=!0,$.format=g.format??null});function X$($){return bJ(Wv,$)}var Mw=j("ZodNumberFormat",($,w)=>{OG.init($,w),Wv.init($,w)});function i4($){return DJ(Mw,$)}function Pb($){return JJ(Mw,$)}function kb($){return XJ(Mw,$)}function nb($){return QJ(Mw,$)}function Mb($){return YJ(Mw,$)}var Hv=j("ZodBoolean",($,w)=>{a6.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>xJ($,g,_,v)});function J$($){return WJ(Hv,$)}var qv=j("ZodBigInt",($,w)=>{NU.init($,w),d.init($,w),$._zod.processJSONSchema=(_,v,U)=>hJ($,_,v,U),$.gte=(_,v)=>$.check(j$(_,v)),$.min=(_,v)=>$.check(j$(_,v)),$.gt=(_,v)=>$.check(c$(_,v)),$.gte=(_,v)=>$.check(j$(_,v)),$.min=(_,v)=>$.check(j$(_,v)),$.lt=(_,v)=>$.check(l$(_,v)),$.lte=(_,v)=>$.check(n$(_,v)),$.max=(_,v)=>$.check(n$(_,v)),$.positive=(_)=>$.check(c$(BigInt(0),_)),$.negative=(_)=>$.check(l$(BigInt(0),_)),$.nonpositive=(_)=>$.check(n$(BigInt(0),_)),$.nonnegative=(_)=>$.check(j$(BigInt(0),_)),$.multipleOf=(_,v)=>$.check(Ww(_,v));let g=$._zod.bag;$.minValue=g.minimum??null,$.maxValue=g.maximum??null,$.format=g.format??null});function zb($){return qJ(qv,$)}var e4=j("ZodBigIntFormat",($,w)=>{NG.init($,w),qv.init($,w)});function fb($){return IJ(e4,$)}function Ab($){return LJ(e4,$)}var Ng=j("ZodSymbol",($,w)=>{PG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>lJ($,g,_,v)});function Sb($){return VJ(Ng,$)}var Pg=j("ZodUndefined",($,w)=>{kG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>yJ($,g,_,v)});function ib($){return FJ(Pg,$)}var kg=j("ZodNull",($,w)=>{nG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>cJ($,g,_,v)});function ng($){return jJ(kg,$)}var Mg=j("ZodAny",($,w)=>{MG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>dJ($,g,_,v)});function Tb(){return KJ(Mg)}var zg=j("ZodUnknown",($,w)=>{zG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>oJ($,g,_,v)});function K$(){return OJ(zg)}var fg=j("ZodNever",($,w)=>{fG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>tJ($,g,_,v)});function a4($){return NJ(fg,$)}var Ag=j("ZodVoid",($,w)=>{AG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>mJ($,g,_,v)});function Rb($){return PJ(Ag,$)}var hv=j("ZodDate",($,w)=>{SG.init($,w),d.init($,w),$._zod.processJSONSchema=(_,v,U)=>rJ($,_,v,U),$.min=(_,v)=>$.check(j$(_,v)),$.max=(_,v)=>$.check(n$(_,v));let g=$._zod.bag;$.minDate=g.minimum?new Date(g.minimum):null,$.maxDate=g.maximum?new Date(g.maximum):null});function Cb($){return kJ(hv,$)}var Sg=j("ZodArray",($,w)=>{iG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>G9($,g,_,v),$.element=w.element,$.min=(g,_)=>$.check(e$(g,_)),$.nonempty=(g)=>$.check(e$(1,g)),$.max=(g,_)=>$.check(kw(g,_)),$.length=(g,_)=>$.check(nw(g,_)),$.unwrap=()=>$.element});function v$($,w){return zJ(Sg,$,w)}function ub($){let w=$._zod.def.shape;return s(Object.keys(w))}var lv=j("ZodObject",($,w)=>{TG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>D9($,g,_,v),n.defineLazy($,"shape",()=>{return w.shape}),$.keyof=()=>s(Object.keys($._zod.def.shape)),$.catchall=(g)=>$.clone({...$._zod.def,catchall:g}),$.passthrough=()=>$.clone({...$._zod.def,catchall:K$()}),$.loose=()=>$.clone({...$._zod.def,catchall:K$()}),$.strict=()=>$.clone({...$._zod.def,catchall:a4()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(g)=>{return n.extend($,g)},$.safeExtend=(g)=>{return n.safeExtend($,g)},$.merge=(g)=>n.merge($,g),$.pick=(g)=>n.pick($,g),$.omit=(g)=>n.omit($,g),$.partial=(...g)=>n.partial($6,$,g[0]),$.required=(...g)=>n.required(w6,$,g[0])});function T($,w){let g={type:"object",shape:$??{},...n.normalizeParams(w)};return new lv(g)}function Eb($,w){return new lv({type:"object",shape:$,catchall:a4(),...n.normalizeParams(w)})}function Zb($,w){return new lv({type:"object",shape:$,catchall:K$(),...n.normalizeParams(w)})}var cv=j("ZodUnion",($,w)=>{s6.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>oU($,g,_,v),$.options=w.options});function zw($,w){return new cv({type:"union",options:$,...n.normalizeParams(w)})}var ig=j("ZodXor",($,w)=>{cv.init($,w),RG.init($,w),$._zod.processJSONSchema=(g,_,v)=>oU($,g,_,v),$.options=w.options});function xb($,w){return new ig({type:"union",options:$,inclusive:!1,...n.normalizeParams(w)})}var Tg=j("ZodDiscriminatedUnion",($,w)=>{cv.init($,w),CG.init($,w)});function fw($,w,g){return new Tg({type:"union",options:w,discriminator:$,...n.normalizeParams(g)})}var Rg=j("ZodIntersection",($,w)=>{uG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>J9($,g,_,v)});function Cg($,w){return new Rg({type:"intersection",left:$,right:w})}var ug=j("ZodTuple",($,w)=>{PU.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>X9($,g,_,v),$.rest=(g)=>$.clone({...$._zod.def,rest:g})});function yv($,w,g){let _=w instanceof t,v=_?g:w;return new ug({type:"tuple",items:$,rest:_?w:null,...n.normalizeParams(v)})}var mv=j("ZodRecord",($,w)=>{EG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>Q9($,g,_,v),$.keyType=w.keyType,$.valueType=w.valueType});function qw($,w,g){return new mv({type:"record",keyType:$,valueType:w,...n.normalizeParams(g)})}function hb($,w,g){let _=F$($);return _._zod.values=void 0,new mv({type:"record",keyType:_,valueType:w,...n.normalizeParams(g)})}function lb($,w,g){return new mv({type:"record",keyType:$,valueType:w,mode:"loose",...n.normalizeParams(g)})}var Eg=j("ZodMap",($,w)=>{ZG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>U9($,g,_,v),$.keyType=w.keyType,$.valueType=w.valueType,$.min=(...g)=>$.check(y$(...g)),$.nonempty=(g)=>$.check(y$(1,g)),$.max=(...g)=>$.check(Hw(...g)),$.size=(...g)=>$.check(Pw(...g))});function cb($,w,g){return new Eg({type:"map",keyType:$,valueType:w,...n.normalizeParams(g)})}var Zg=j("ZodSet",($,w)=>{xG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>b9($,g,_,v),$.min=(...g)=>$.check(y$(...g)),$.nonempty=(g)=>$.check(y$(1,g)),$.max=(...g)=>$.check(Hw(...g)),$.size=(...g)=>$.check(Pw(...g))});function yb($,w){return new Zg({type:"set",valueType:$,...n.normalizeParams(w)})}var Xv=j("ZodEnum",($,w)=>{hG.init($,w),d.init($,w),$._zod.processJSONSchema=(_,v,U)=>pJ($,_,v,U),$.enum=w.entries,$.options=Object.values(w.entries);let g=new Set(Object.keys(w.entries));$.extract=(_,v)=>{let U={};for(let G of _)if(g.has(G))U[G]=w.entries[G];else throw Error(`Key ${G} not found in enum`);return new Xv({...w,checks:[],...n.normalizeParams(v),entries:U})},$.exclude=(_,v)=>{let U={...w.entries};for(let G of _)if(g.has(G))delete U[G];else throw Error(`Key ${G} not found in enum`);return new Xv({...w,checks:[],...n.normalizeParams(v),entries:U})}});function s($,w){let g=Array.isArray($)?Object.fromEntries($.map((_)=>[_,_])):$;return new Xv({type:"enum",entries:g,...n.normalizeParams(w)})}function mb($,w){return new Xv({type:"enum",entries:$,...n.normalizeParams(w)})}var xg=j("ZodLiteral",($,w)=>{lG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>eJ($,g,_,v),$.values=new Set(w.values),Object.defineProperty($,"value",{get(){if(w.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return w.values[0]}})});function Y$($,w){return new xg({type:"literal",values:Array.isArray($)?$:[$],...n.normalizeParams(w)})}var hg=j("ZodFile",($,w)=>{cG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>$9($,g,_,v),$.min=(g,_)=>$.check(y$(g,_)),$.max=(g,_)=>$.check(Hw(g,_)),$.mime=(g,_)=>$.check($v(Array.isArray(g)?g:[g],_))});function tb($){return fJ(hg,$)}var lg=j("ZodTransform",($,w)=>{yG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>_9($,g,_,v),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new zv($.constructor.name);g.addIssue=(U)=>{if(typeof U==="string")g.issues.push(n.issue(U,g.value,w));else{let G=U;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=g.value),G.inst??(G.inst=$),g.issues.push(n.issue(G))}};let v=w.transform(g.value,g);if(v instanceof Promise)return v.then((U)=>{return g.value=U,g});return g.value=v,g}});function s4($){return new lg({type:"transform",transform:$})}var $6=j("ZodOptional",($,w)=>{kU.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>rU($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function uv($){return new $6({type:"optional",innerType:$})}var cg=j("ZodExactOptional",($,w)=>{mG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>rU($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function yg($){return new cg({type:"optional",innerType:$})}var mg=j("ZodNullable",($,w)=>{tG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>Y9($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function Ev($){return new mg({type:"nullable",innerType:$})}function db($){return uv(Ev($))}var tg=j("ZodDefault",($,w)=>{dG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>H9($,g,_,v),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function dg($,w){return new tg({type:"default",innerType:$,get defaultValue(){return typeof w==="function"?w():n.shallowClone(w)}})}var og=j("ZodPrefault",($,w)=>{oG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>q9($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function rg($,w){return new og({type:"prefault",innerType:$,get defaultValue(){return typeof w==="function"?w():n.shallowClone(w)}})}var w6=j("ZodNonOptional",($,w)=>{rG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>W9($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function pg($,w){return new w6({type:"nonoptional",innerType:$,...n.normalizeParams(w)})}var eg=j("ZodSuccess",($,w)=>{pG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>w9($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function ob($){return new eg({type:"success",innerType:$})}var ag=j("ZodCatch",($,w)=>{eG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>B9($,g,_,v),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function sg($,w){return new ag({type:"catch",innerType:$,catchValue:typeof w==="function"?w:()=>w})}var $_=j("ZodNaN",($,w)=>{aG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>aJ($,g,_,v)});function rb($){return MJ($_,$)}var v6=j("ZodPipe",($,w)=>{sG.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>I9($,g,_,v),$.in=w.in,$.out=w.out});function Zv($,w){return new v6({type:"pipe",in:$,out:w})}var g6=j("ZodCodec",($,w)=>{v6.init($,w),$g.init($,w)});function pb($,w,g){return new g6({type:"pipe",in:$,out:w,transform:g.decode,reverseTransform:g.encode})}var w_=j("ZodReadonly",($,w)=>{$D.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>L9($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function v_($){return new w_({type:"readonly",innerType:$})}var g_=j("ZodTemplateLiteral",($,w)=>{wD.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>sJ($,g,_,v)});function eb($,w){return new g_({type:"template_literal",parts:$,...n.normalizeParams(w)})}var __=j("ZodLazy",($,w)=>{_D.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>F9($,g,_,v),$.unwrap=()=>$._zod.def.getter()});function U_($){return new __({type:"lazy",getter:$})}var b_=j("ZodPromise",($,w)=>{gD.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>V9($,g,_,v),$.unwrap=()=>$._zod.def.innerType});function ab($){return new b_({type:"promise",innerType:$})}var G_=j("ZodFunction",($,w)=>{vD.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>g9($,g,_,v)});function sb($){return new G_({type:"function",input:Array.isArray($?.input)?yv($?.input):$?.input??v$(K$()),output:$?.output??K$()})}var tv=j("ZodCustom",($,w)=>{UD.init($,w),d.init($,w),$._zod.processJSONSchema=(g,_,v)=>v9($,g,_,v)});function $1($){let w=new D$({check:"custom"});return w._zod.check=$,w}function w1($,w){return AJ(tv,$??(()=>!0),w)}function D_($,w={}){return SJ(tv,$,w)}function J_($){return iJ($)}var v1=TJ,g1=RJ;function _1($,w={}){let g=new tv({type:"custom",check:"custom",fn:(_)=>_ instanceof $,abort:!0,...n.normalizeParams(w)});return g._zod.bag.Class=$,g._zod.check=(_)=>{if(!(_.value instanceof $))_.issues.push({code:"invalid_type",expected:$.name,input:_.value,inst:g,path:[...g._zod.def.path??[]]})},g}var U1=(...$)=>CJ({Codec:g6,Boolean:Hv,String:Qv},...$);function b1($){let w=U_(()=>{return zw([O($),X$(),J$(),ng(),v$(w),qw(O(),w)])});return w}function G1($,w){return Zv(s4($),w)}var z$={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function n9($){Q$({customError:$})}function M9(){return Q$().customError}var X_;(function($){})(X_||(X_={}));var R={...Xg,...pU,iso:Jv},HL=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function qL($,w){let g=$.$schema;if(g==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(g==="http://json-schema.org/draft-07/schema#")return"draft-7";if(g==="http://json-schema.org/draft-04/schema#")return"draft-4";return w??"draft-2020-12"}function BL($,w){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let g=$.slice(1).split("/").filter(Boolean);if(g.length===0)return w.rootSchema;let _=w.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===_){let v=g[1];if(!v||!w.defs[v])throw Error(`Reference not found: ${$}`);return w.defs[v]}throw Error(`Reference not found: ${$}`)}function E8($,w){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return R.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let v=$.$ref;if(w.refs.has(v))return w.refs.get(v);if(w.processing.has(v))return R.lazy(()=>{if(!w.refs.has(v))throw Error(`Circular reference not resolved: ${v}`);return w.refs.get(v)});w.processing.add(v);let U=BL(v,w),G=N$(U,w);return w.refs.set(v,G),w.processing.delete(v),G}if($.enum!==void 0){let v=$.enum;if(w.version==="openapi-3.0"&&$.nullable===!0&&v.length===1&&v[0]===null)return R.null();if(v.length===0)return R.never();if(v.length===1)return R.literal(v[0]);if(v.every((G)=>typeof G==="string"))return R.enum(v);let U=v.map((G)=>R.literal(G));if(U.length<2)return U[0];return R.union([U[0],U[1],...U.slice(2)])}if($.const!==void 0)return R.literal($.const);let g=$.type;if(Array.isArray(g)){let v=g.map((U)=>{let G={...$,type:U};return E8(G,w)});if(v.length===0)return R.never();if(v.length===1)return v[0];return R.union(v)}if(!g)return R.any();let _;switch(g){case"string":{let v=R.string();if($.format){let U=$.format;if(U==="email")v=v.check(R.email());else if(U==="uri"||U==="uri-reference")v=v.check(R.url());else if(U==="uuid"||U==="guid")v=v.check(R.uuid());else if(U==="date-time")v=v.check(R.iso.datetime());else if(U==="date")v=v.check(R.iso.date());else if(U==="time")v=v.check(R.iso.time());else if(U==="duration")v=v.check(R.iso.duration());else if(U==="ipv4")v=v.check(R.ipv4());else if(U==="ipv6")v=v.check(R.ipv6());else if(U==="mac")v=v.check(R.mac());else if(U==="cidr")v=v.check(R.cidrv4());else if(U==="cidr-v6")v=v.check(R.cidrv6());else if(U==="base64")v=v.check(R.base64());else if(U==="base64url")v=v.check(R.base64url());else if(U==="e164")v=v.check(R.e164());else if(U==="jwt")v=v.check(R.jwt());else if(U==="emoji")v=v.check(R.emoji());else if(U==="nanoid")v=v.check(R.nanoid());else if(U==="cuid")v=v.check(R.cuid());else if(U==="cuid2")v=v.check(R.cuid2());else if(U==="ulid")v=v.check(R.ulid());else if(U==="xid")v=v.check(R.xid());else if(U==="ksuid")v=v.check(R.ksuid())}if(typeof $.minLength==="number")v=v.min($.minLength);if(typeof $.maxLength==="number")v=v.max($.maxLength);if($.pattern)v=v.regex(new RegExp($.pattern));_=v;break}case"number":case"integer":{let v=g==="integer"?R.number().int():R.number();if(typeof $.minimum==="number")v=v.min($.minimum);if(typeof $.maximum==="number")v=v.max($.maximum);if(typeof $.exclusiveMinimum==="number")v=v.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")v=v.gt($.minimum);if(typeof $.exclusiveMaximum==="number")v=v.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")v=v.lt($.maximum);if(typeof $.multipleOf==="number")v=v.multipleOf($.multipleOf);_=v;break}case"boolean":{_=R.boolean();break}case"null":{_=R.null();break}case"object":{let v={},U=$.properties||{},G=new Set($.required||[]);for(let[J,X]of Object.entries(U)){let Q=N$(X,w);v[J]=G.has(J)?Q:Q.optional()}if($.propertyNames){let J=N$($.propertyNames,w),X=$.additionalProperties&&typeof $.additionalProperties==="object"?N$($.additionalProperties,w):R.any();if(Object.keys(v).length===0){_=R.record(J,X);break}let Q=R.object(v).passthrough(),Y=R.looseRecord(J,X);_=R.intersection(Q,Y);break}if($.patternProperties){let J=$.patternProperties,X=Object.keys(J),Q=[];for(let q of X){let L=N$(J[q],w),F=R.string().regex(new RegExp(q));Q.push(R.looseRecord(F,L))}let Y=[];if(Object.keys(v).length>0)Y.push(R.object(v).passthrough());if(Y.push(...Q),Y.length===0)_=R.object({}).passthrough();else if(Y.length===1)_=Y[0];else{let q=R.intersection(Y[0],Y[1]);for(let L=2;L<Y.length;L++)q=R.intersection(q,Y[L]);_=q}break}let D=R.object(v);if($.additionalProperties===!1)_=D.strict();else if(typeof $.additionalProperties==="object")_=D.catchall(N$($.additionalProperties,w));else _=D.passthrough();break}case"array":{let{prefixItems:v,items:U}=$;if(v&&Array.isArray(v)){let G=v.map((J)=>N$(J,w)),D=U&&typeof U==="object"&&!Array.isArray(U)?N$(U,w):void 0;if(D)_=R.tuple(G).rest(D);else _=R.tuple(G);if(typeof $.minItems==="number")_=_.check(R.minLength($.minItems));if(typeof $.maxItems==="number")_=_.check(R.maxLength($.maxItems))}else if(Array.isArray(U)){let G=U.map((J)=>N$(J,w)),D=$.additionalItems&&typeof $.additionalItems==="object"?N$($.additionalItems,w):void 0;if(D)_=R.tuple(G).rest(D);else _=R.tuple(G);if(typeof $.minItems==="number")_=_.check(R.minLength($.minItems));if(typeof $.maxItems==="number")_=_.check(R.maxLength($.maxItems))}else if(U!==void 0){let G=N$(U,w),D=R.array(G);if(typeof $.minItems==="number")D=D.min($.minItems);if(typeof $.maxItems==="number")D=D.max($.maxItems);_=D}else _=R.array(R.any());break}default:throw Error(`Unsupported type: ${g}`)}if($.description)_=_.describe($.description);if($.default!==void 0)_=_.default($.default);return _}function N$($,w){if(typeof $==="boolean")return $?R.any():R.never();let g=E8($,w),_=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let D=$.anyOf.map((X)=>N$(X,w)),J=R.union(D);g=_?R.intersection(g,J):J}if($.oneOf&&Array.isArray($.oneOf)){let D=$.oneOf.map((X)=>N$(X,w)),J=R.xor(D);g=_?R.intersection(g,J):J}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)g=_?g:R.any();else{let D=_?g:N$($.allOf[0],w),J=_?0:1;for(let X=J;X<$.allOf.length;X++)D=R.intersection(D,N$($.allOf[X],w));g=D}if($.nullable===!0&&w.version==="openapi-3.0")g=R.nullable(g);if($.readOnly===!0)g=R.readonly(g);let v={},U=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let D of U)if(D in $)v[D]=$[D];let G=["contentEncoding","contentMediaType","contentSchema"];for(let D of G)if(D in $)v[D]=$[D];for(let D of Object.keys($))if(!HL.has(D))v[D]=$[D];if(Object.keys(v).length>0)w.registry.add(g,v);return g}function D1($,w){if(typeof $==="boolean")return $?R.any():R.never();let g=qL($,w?.defaultTarget),_=$.$defs||$.definitions||{},v={version:g,defs:_,refs:new Map,processing:new Set,rootSchema:$,registry:w?.registry??I$};return N$($,v)}var s$={};p$(s$,{string:()=>IL,number:()=>LL,date:()=>jL,boolean:()=>VL,bigint:()=>FL});function IL($){return $J(Qv,$)}function LL($){return GJ(Wv,$)}function VL($){return HJ(Hv,$)}function FL($){return BJ(qv,$)}function jL($){return nJ(hv,$)}Q$(wg());var KL=_6;var Z8=_6??z9;if(typeof Z8.object!=="function")throw Error("Failed to resolve Zod namespace");var p=Z8;var x8=T({code:O(),message:O(),retryable:J$(),details:qw(O(),K$()).optional(),fix_hint:O().optional()}),OL=T({error:x8,trace_id:O().optional(),request_id:O()}),h8=T({code:O(),message:O().optional(),details:qw(O(),K$()).optional()}),NL=T({data:K$().optional(),warnings:v$(h8).optional(),request_id:O()}),o={UNAUTHORIZED:"unauthorized",TOKEN_EXPIRED:"token_expired",TOKEN_INVALID:"token_invalid",FORBIDDEN:"forbidden",STEP_UP_REQUIRED:"step_up_required",EXPORT_NOT_ALLOWED:"export_not_allowed",SESSION_READ_ONLY:"session_read_only",NOT_FOUND:"not_found",SESSION_NOT_FOUND:"session_not_found",THREAD_NOT_FOUND:"thread_not_found",COMMENT_NOT_FOUND:"comment_not_found",BLOCK_NOT_FOUND:"block_not_found",SOURCE_FILE_NOT_FOUND:"source_file_not_found",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotency_key_in_flight",VERSION_CONFLICT:"version_conflict",SOURCE_MISMATCH:"source_mismatch",PAYLOAD_TOO_LARGE:"payload_too_large",INVALID_ARGUMENT:"invalid_argument",INVALID_BLOCK_ID:"invalid_block_id",INVALID_ANCHOR:"invalid_anchor",INVALID_SHA:"invalid_sha",INVALID_PATH:"invalid_path",UNKNOWN_SCHEMA:"unknown_schema",VALIDATION_FAILED:"validation_failed",RATE_LIMITED:"rate_limited",DB_ERROR:"db_error",RENDER_ERROR:"render_error",STORAGE_ERROR:"storage_error",INTERNAL_ERROR:"internal_error",SOURCE_UNAVAILABLE:"source_unavailable",SOURCE_TIMEOUT:"source_timeout",SERVICE_UNAVAILABLE:"service_unavailable"};function U6($){return[o.IDEMPOTENCY_KEY_IN_FLIGHT,o.RATE_LIMITED,o.DB_ERROR,o.SOURCE_UNAVAILABLE,o.SOURCE_TIMEOUT,o.SERVICE_UNAVAILABLE].includes($)}var PL=T({DATABASE_URL:O().min(1,"DATABASE_URL is required"),DATABASE_URL_DIRECT:O().optional()}),kL=T({GIT_PROVIDER:s(["github","gitlab","local"]).default("github"),GITHUB_TOKEN:O().optional(),GITLAB_TOKEN:O().optional(),TYPESCAPE_GIT_ROOT:O().optional()}),nL=T({ARTIFACT_STORE_TYPE:s(["s3","filesystem"]).default("s3"),R2_ACCOUNT_ID:O().optional(),R2_ACCESS_KEY_ID:O().optional(),R2_SECRET_ACCESS_KEY:O().optional(),R2_BUCKET_NAME:O().optional(),R2_ENDPOINT:O().url().optional(),TYPESCAPE_ARTIFACTS_PATH:O().optional()}),ML=T({TYPESCAPE_SERVER_SECRET:O().min(32,"TYPESCAPE_SERVER_SECRET must be at least 32 characters"),SESSION_SECRET:O().min(32,"SESSION_SECRET must be at least 32 characters"),CRON_SECRET:O().optional()}),zL=T({TYPESCAPE_PORTAL_ORIGIN:O().url().default("http://localhost:5173"),TYPESCAPE_BASE_URL:O().url().default("http://localhost:3000")}),fL=T({SMTP_HOST:O().optional(),SMTP_PORT:s$.number().int().positive().optional(),SMTP_USER:O().optional(),SMTP_PASS:O().optional(),SMTP_FROM:O().optional()}),AL=T({PORT:s$.number().int().positive().default(3000),METRICS_PORT:s$.number().int().positive().default(9090),NODE_ENV:s(["development","staging","production"]).default("development"),LOG_LEVEL:s(["trace","debug","info","warn","error"]).default("info"),TYPESCAPE_ROLE:s(["api","worker","ingest","combined"]).default("combined")}),SL=T({OTEL_EXPORTER_OTLP_ENDPOINT:O().url().optional(),OTEL_SERVICE_NAME:O().optional(),FEATURE_FLAGS:O().optional()}),iL=PL.merge(kL).merge(nL).merge(ML).merge(zL).merge(fL).merge(AL).merge(SL);import{Buffer as TL}from"node:buffer";var RL=/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/,CL=/^[a-f0-9]{64}$/,c8=/^(?:[A-Za-z0-9+/]+={0,2})$/,uL=24;var y8="gitstate.v1",m8="xchacha20poly1305",f9=["session.created","session.state_changed","thread.created","comment.created","comment.edited","approval.requested","approval.decided","disposition.created","participant.added","participant.removed","participant.redacted"],EL=new Set(f9),ZL=s(f9),t8=T({ciphertext:O().min(1).regex(c8,"ciphertext must be base64"),nonce:O().min(1).regex(c8,"nonce must be base64").refine(($)=>{try{return YV($).byteLength===uL}catch{return!1}},"nonce must decode to 24 bytes"),key_id:O().min(1)}).strict(),Bw=zw([O(),t8]),xL=s(["operator","reviewer","system","automation","unknown"]),A9=T({actor_type:xL,user_id:O().optional(),participant_id:O().optional(),verification_level:X$().int().min(0).optional(),email:Bw.optional(),display_name:Bw.optional()}).strict(),d8=O().regex(/^ev_/,"event_id must start with ev_"),o8=X$().int().min(1),hL=T({title:O().nullable(),state:O(),block_id_scheme:O(),render_profile:O().nullable(),config_hash:O()}).strict(),lL=T({from_state:O(),to_state:O()}).strict(),cL=T({type:s(["block","session"]),block_id:O().optional(),start_offset:X$().int().min(0).optional(),end_offset:X$().int().min(0).optional()}).strict().superRefine(($,w)=>{if($.type==="block"&&!$.block_id)w.addIssue({code:z$.custom,message:"anchor.block_id is required for block anchors",path:["block_id"]})}),yL=T({thread_id:O(),anchor:cL,body_md:Bw,body_html:Bw.optional(),severity:O(),tags:v$(O())}).strict(),mL=T({thread_id:O(),comment_id:O(),body_md:Bw,body_html:Bw.optional()}).strict(),tL=T({thread_id:O(),comment_id:O(),version:X$().int().min(1),body_md:Bw,body_html:Bw.optional()}).strict(),dL=T({approval_request_id:O(),requested_by_id:O().optional(),approver_participant_ids:v$(O()).optional()}).strict(),oL=T({approval_request_id:O(),decision:s(["approved","rejected","conditional"]),verification_level:X$().int().min(0),decided_by_id:O().optional()}).strict(),rL=T({evidence_id:O().optional(),type:O(),uri:O().optional(),notes:O().optional()}).strict(),pL=T({thread_id:O(),disposition_id:O(),state:O(),reason_code:O().optional(),evidence:v$(rL).optional()}).strict(),eL=T({participant_id:O(),roles:v$(O()),email:Bw.optional(),display_name:Bw.optional()}).strict(),aL=T({participant_id:O()}).strict(),sL=T({participant_id:O(),redacted_at:O().datetime(),reason:O().optional()}).strict();function $w($,w){return T({event_id:d8,event_seq:o8,type:Y$($),occurred_at:O().datetime(),actor:A9,data:w}).strict()}var $V=$w("session.created",hL),wV=$w("session.state_changed",lL),vV=$w("thread.created",yL),gV=$w("comment.created",mL),_V=$w("comment.edited",tL),UV=$w("approval.requested",dL),bV=$w("approval.decided",oL),GV=$w("disposition.created",pL),DV=$w("participant.added",eL),JV=$w("participant.removed",aL),XV=$w("participant.redacted",sL),r8=fw("type",[$V,wV,vV,gV,_V,UV,bV,GV,DV,JV,XV]),p8=T({event_id:d8,event_seq:o8,type:O().min(1),occurred_at:O().datetime(),actor:A9,data:K$()}).strict().refine(($)=>!EL.has($.type),{message:"unknown event type expected",path:["type"]}),e8=zw([r8,p8]),a8=T({alg:Y$(m8),key_id:O().min(1)}).strict(),QV=T({schema_version:Y$(y8),session_id:O().min(1),repo_id:O().min(1),git_sha:O().regex(RL,"git_sha must be 40 or 64 hex"),file_path:O().min(1),source_content_sha256:O().regex(CL,"source_content_sha256 must be sha256 hex"),tenant_id:O().min(1),encrypted_bodies:J$(),include_emails:J$(),encryption:a8.optional(),flushed_at:O().datetime(),flushed_through_event_seq:X$().int().min(0),events:v$(e8)}).strict().superRefine(($,w)=>{if($.encrypted_bodies&&!$.encryption)w.addIssue({code:z$.custom,path:["encryption"],message:"encryption is required when encrypted_bodies=true"});if(!$.encrypted_bodies&&$.encryption)w.addIssue({code:z$.custom,path:["encryption"],message:"encryption must be omitted when encrypted_bodies=false"});let g=0;for(let _=0;_<$.events.length;_+=1){let v=$.events[_];if(v.event_seq<=g)w.addIssue({code:z$.custom,path:["events",_,"event_seq"],message:"events must be sorted by event_seq ascending"});g=v.event_seq}if($.flushed_through_event_seq<g)w.addIssue({code:z$.custom,path:["flushed_through_event_seq"],message:"flushed_through_event_seq must be >= highest event_seq in events"})});function YV($){return new Uint8Array(TL.from($,"base64"))}var S9="1";var WV=s(["email"]),i9=s(["session.created","thread.created","thread.escalated","thread.assigned","comment.created","decision.recorded","approval.requested","approval.escalated","approval.decided","participant.invited","reminder_sent","rule.challenged","rule.published_impact","rule.superseded_impact","rule.deprecated_impact"]),HV=s(["invite","reminder","mention","approval_request","approval_decided","digest"]),qV=s(["pending","delivered","failed","bounced"]),s8=s(["email","none"]),$Q=s(["immediate","hourly","daily"]);var GE=T({new_thread:J$().optional(),reply_to_mine:J$().optional(),mention:J$().optional(),approval_request:J$().optional()}).strict(),BV=T({new_thread:J$(),reply_to_mine:J$(),mention:J$(),approval_request:J$()}).strict(),IV="email",LV="immediate",VV=Object.freeze({new_thread:!1,reply_to_mine:!0,mention:!0,approval_request:!0});var DE=T({channel_preference:s8,digest_mode:$Q,notify_on:BV}).strict(),JE=Object.freeze({channel_preference:IV,digest_mode:LV,notify_on:{...VV}});var FV=T({review_link_id:O().min(1),recipient_participant_id:O().min(1),session_id:O().min(1),event_type:i9,event_id:O().min(1),channel:Y$("email"),custom_message:O().trim().min(1).max(2000).nullable().optional(),response_redaction_version:Y$(S9).optional()}).strict();var wQ=s(["fixed","wont_fix","needs_clarification"]),vQ=T({line_range:yv([X$().int().positive(),X$().int().positive()])}),gQ=T({thread_id:O().regex(/^thrd_/),disposition:wQ,evidence:O().min(1).max(2000),changes_ref:vQ.optional()}),jV=T({version:Y$("1"),session_id:O().regex(/^sess_/),resolutions:v$(gQ).min(1),changes_summary:O().max(1000).optional()});var _Q=["session.created","comment.created","approval.requested","approval.decided","thread.resolved","thread.reopened"],UQ=s(_Q),KV=s(["active","paused","revoked"]),bQ=v$(UQ),OV=T({url:O().url().startsWith("https://"),events_json:bQ,secret_key_id:O().min(1)});var Cn=S3(),un=M_(),En=B3(),y3=z_(),Zn=W_(),Nv=$$(),xn=Vv(),hn=q$(),ln=jv(),cn=Kv(),CZ=t1(),yn=h3(),mn=l3(),tn=c3(),r1=WY(),HY=Q_();var dn=Cn.Composer,on=un.Document,rn=En.Schema,pn=y3.YAMLError,en=y3.YAMLParseError,an=y3.YAMLWarning,sn=Zn.Alias,$M=Nv.isAlias,wM=Nv.isCollection,vM=Nv.isDocument,gM=Nv.isMap,_M=Nv.isNode,UM=Nv.isPair,bM=Nv.isScalar,GM=Nv.isSeq,DM=xn.Pair,JM=hn.Scalar,XM=ln.YAMLMap,QM=cn.YAMLSeq;var YM=yn.Lexer,WM=mn.LineCounter,HM=tn.Parser,m3=r1.parse,qM=r1.parseAllDocuments,BM=r1.parseDocument,IM=r1.stringify,LM=HY.visit,VM=HY.visitAsync;var FM=["string","string[]","number","boolean","enum","date"],BY=s(FM),jM=/^[a-zA-Z0-9_-]+$/,t3=T({field:O().min(1),type:BY,values:v$(O().min(1)).optional()}).refine(($)=>{if($.type==="enum")return $.values!==void 0&&$.values.length>0;return $.values===void 0},{message:"enum fields must provide non-empty 'values' array; non-enum fields must not"}),IY=T({name:O().min(1).regex(jM,"doc_type name must be alphanumeric, hyphens, or underscores"),description:O().optional(),required_fields:v$(t3).default([]),optional_fields:v$(t3).default([])}),LY=T({allowed:v$(O().min(1)).default([]),enforce:J$().default(!1)}),VY=T({allowed:v$(O().min(1)).default([]),enforce:J$().default(!1)}),FY=T({default:O().min(1),allowed:v$(O().min(1)).default([]),enforce:J$().default(!1)}),qY=["taxonomy.v1"],KM=T({schema_version:O().refine(($)=>qY.includes($),`schema_version must be one of: ${qY.join(", ")}`),doc_types:v$(IY).default([]),tags:LY.optional(),categories:VY.optional(),locale:FY.optional()}).passthrough().refine(($)=>{let w=$.doc_types.map((g)=>g.name);return new Set(w).size===w.length},{message:"Duplicate doc_type names are not allowed"}).refine(($)=>{let w=$.tags?.allowed??[];return new Set(w).size===w.length},{message:"Duplicate tag names are not allowed"}).refine(($)=>{let w=$.categories?.allowed??[];return new Set(w).size===w.length},{message:"Duplicate category names are not allowed"});var jY="v1",KY=["terminology","style","tone","claim_evidence","citation","structure","constraint","formatting","accuracy","clarity","completeness","other"],OY=s(KY),NY=s(["rules","llm","hybrid","human_override"]),OM=T({taxonomy_version:Y$(jY),primary_type:OY,subtype:O().min(1).optional(),confidence:X$().min(0).max(1),source:NY,classifier_version:O().min(1),non_authoritative:Y$(!0)});var NM=/^freshness\.v\d+$/,PY=s(["glob","doc_type"]),R_=s(["info","warning","blocking"]),kY=T({name:O().min(1),match_mode:PY,match_pattern:O().min(1),max_days_since_approval:X$().int().positive(),severity:R_,never_reviewed_severity:R_}).strict(),nY=T({max_days_since_approval:X$().int().positive(),severity:R_,never_reviewed_severity:R_}).strict(),PM=T({schema_version:O().regex(NM,"schema_version must match format freshness.v{major} (e.g., freshness.v1)"),rules:v$(kY).default([]),defaults:nY}).strict().superRefine(($,w)=>{let g=new Set;$.rules.forEach((_,v)=>{if(g.has(_.name))w.addIssue({code:"custom",message:`Duplicate rule name: "${_.name}"`,path:["rules",v,"name"]});g.add(_.name)})});var lZ=T({freshness:T({rules_file:O().min(1).optional()}).passthrough().optional()}).passthrough();var R$={free:{sessions_per_month:15,active_repos:1},pro:{sessions_per_month:100,active_repos:10},scale:{sessions_per_month:500,active_repos:50}},MY={free:{plan_id:"free",sessions_used:1,sessions_limit:R$.free.sessions_per_month,sessions_remaining:R$.free.sessions_per_month-1,active_repos:1,active_repos_limit:R$.free.active_repos,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"},pro:{plan_id:"pro",sessions_used:7,sessions_limit:15,sessions_remaining:8,active_repos:2,active_repos_limit:5,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"},scale:{plan_id:"scale",sessions_used:120,sessions_limit:R$.scale.sessions_per_month,sessions_remaining:R$.scale.sessions_per_month-120,active_repos:12,active_repos_limit:R$.scale.active_repos,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"}},zY={free:{plan_id:"free",plan_name:"Free",status:"trialing",trial_ends_at:"2026-03-05T00:00:00.000Z",cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:R$.free,upgrade_url:"https://example.com/billing",request_id:"req_plan"},pro:{plan_id:"pro",plan_name:"Pro",status:"active",trial_ends_at:null,cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:R$.pro,upgrade_url:"https://example.com/billing",request_id:"req_plan"},scale:{plan_id:"scale",plan_name:"Scale",status:"active",trial_ends_at:null,cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:R$.scale,upgrade_url:"https://example.com/billing",request_id:"req_plan"}};function d3($){let w=zY[$],g=MY[$];return{plan:{id:w.plan_id,name:w.plan_name,status:w.status,trial_ends_at:w.trial_ends_at,cancel_at_period_end:w.cancel_at_period_end},usage:{sessions_used:g.sessions_used,sessions_limit:g.sessions_limit,sessions_remaining:g.sessions_remaining,active_repos:g.active_repos,active_repos_limit:g.active_repos_limit},billing_period:{start:w.current_period_start,end:w.current_period_end,resets_at:g.resets_at},upgrade_url:w.upgrade_url,request_id:"req_summary"}}var nM={free:d3("free"),pro:d3("pro"),scale:d3("scale")},MM={free:{plan_id:"free",plan_name:"Free",status:"trialing",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:"2026-03-05T00:00:00.000Z",cancel_at_period_end:!1,usage:{sessions_used:1,sessions_limit:10,active_repos:1,active_repos_limit:3},polar_customer_id:"cus_123",polar_subscription_id:null,request_id:"req_subscription"},pro:{plan_id:"pro",plan_name:"Pro",status:"active",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:null,cancel_at_period_end:!1,usage:{sessions_used:8,sessions_limit:R$.pro.sessions_per_month,active_repos:3,active_repos_limit:R$.pro.active_repos},polar_customer_id:"cus_123",polar_subscription_id:"sub_123",request_id:"req_subscription"},scale:{plan_id:"scale",plan_name:"Scale",status:"active",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:null,cancel_at_period_end:!1,usage:{sessions_used:1,sessions_limit:R$.scale.sessions_per_month,active_repos:1,active_repos_limit:R$.scale.active_repos},polar_customer_id:"cus_123",polar_subscription_id:"sub_live",request_id:"req_subscription"}};var zM=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Vw($,w){return $>>>w|$<<32-w}function AY($){let w=new TextEncoder().encode($),g=w.length+9+63>>6<<6>>>0,_=new Uint8Array(g);_.set(w),_[w.length]=128;let v=w.length*8,U=new DataView(_.buffer);U.setUint32(g-8,Math.floor(v/4294967296),!1),U.setUint32(g-4,v>>>0,!1);let G=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],D=new Uint32Array(64);for(let J=0;J<g;J+=64){for(let K=0;K<16;K++)D[K]=U.getUint32(J+K*4,!1);for(let K=16;K<64;K++){let f=Vw(D[K-15],7)^Vw(D[K-15],18)^D[K-15]>>>3,S=Vw(D[K-2],17)^Vw(D[K-2],19)^D[K-2]>>>10;D[K]=(D[K-16]+f|0)+(D[K-7]+S|0)>>>0}let[X,Q,Y,q,L,F,H,V]=G;for(let K=0;K<64;K++){let f=Vw(L,6)^Vw(L,11)^Vw(L,25),S=L&F^~L&H,u=V+f+S+zM[K]+D[K]>>>0,Z=Vw(X,2)^Vw(X,13)^Vw(X,22),i=X&Q^X&Y^Q&Y,c=Z+i>>>0;V=H,H=F,F=L,L=q+u>>>0,q=Y,Y=Q,Q=X,X=u+c>>>0}G[0]=G[0]+X>>>0,G[1]=G[1]+Q>>>0,G[2]=G[2]+Y>>>0,G[3]=G[3]+q>>>0,G[4]=G[4]+L>>>0,G[5]=G[5]+F>>>0,G[6]=G[6]+H>>>0,G[7]=G[7]+V>>>0}return G.map((J)=>J.toString(16).padStart(8,"0")).join("")}var p1=p.object({rule_session_id:p.string(),rule_block_id:p.string(),rule_block_key:p.string().optional(),strength:p.enum(["must","should","may","must_not"]),category:p.string(),rule_content:p.string(),rule_session_name:p.string(),applicability_match_reason:p.string().optional()}),fM=3600000,fY=86400000,AM=p.object({repo_id:p.string().nullable(),file_path:p.string().nullable(),review_id:p.string().nullable()}),SM=p.object({fetched_at:p.string(),server_etag:p.string(),latest_rule_session_updated_at:p.string().nullable(),contributing_session_count:p.number().int().nonnegative(),total_rule_count:p.number().int().nonnegative()}),iM=p.object({text:p.string(),json_payload:p.unknown().optional(),structured_payload:p.unknown().optional()}),TM=p.object({scope:AM,compiled_hash:p.string(),rules:p.array(p.object({source_review_id:p.string(),block_id:p.string(),block_index:p.number().int().nonnegative(),strength:p.enum(["must","should","may","must_not"]),category:p.string().nullable(),rule_text:p.string(),specificity:p.number().int().nonnegative(),applicability:p.record(p.string(),p.string())})),plain_text_bundle:p.string(),freshness:SM,rulepack_schema_version:p.literal("rulepack.v1"),renderings:iM.optional()});function RM($,w){return AY(JSON.stringify({plain_text_bundle:$,rules:w}))}function e1($){return AY(JSON.stringify({repo_id:$.repo_id,file_path:$.file_path,review_id:$.review_id}))}function o3($){let w=typeof $.compiled_hash==="string"&&$.compiled_hash.length>0?$.compiled_hash:RM($.plain_text_bundle,$.rules),g={scope:$.scope,compiled_hash:w,rules:$.rules,plain_text_bundle:$.plain_text_bundle,freshness:{fetched_at:$.fetched_at,server_etag:$.server_etag??`"rules:${w}"`,latest_rule_session_updated_at:$.freshness.latest_rule_session_updated_at,contributing_session_count:$.freshness.contributing_session_count,total_rule_count:$.freshness.total_rule_count},rulepack_schema_version:"rulepack.v1",...$.renderings?{renderings:$.renderings}:{}};return TM.parse(g),g}function CM($){let w=Math.max(0,Math.floor($/1000));if(w<60)return`${w}s`;let g=Math.floor(w/60);if(g<60)return`${g}m`;let _=Math.floor(g/60);if(_<48)return`${_}h`;return`${Math.floor(_/24)}d`}function SY($,w=new Date){let g=Date.parse($);if(!Number.isFinite(g))return{status:"confirmed_stale",age_ms:Number.POSITIVE_INFINITY,age_seconds:Number.POSITIVE_INFINITY,warning:"Using cached rules with an invalid fetched_at timestamp. Rules may have changed."};let _=Math.max(0,w.getTime()-g),v=Math.floor(_/1000);if(_<=fM)return{status:"fresh",age_ms:_,age_seconds:v,warning:null};let U=CM(_),G=_>fY?`Cached rules are over ${U} old. Strongly recommend reconnecting to verify rules are current.`:`Using cached rules (fetched ${U} ago). Rules may have changed.`;return{status:_>fY?"confirmed_stale":"presumed_stale",age_ms:_,age_seconds:v,warning:G}}class W extends Error{status;code;requestId;details;fixHint;name="ApiError";constructor($,w,g,_,v,U){super(g);this.status=$;this.code=w;this.requestId=_;this.details=v;this.fixHint=U}}var V$=2,gw=3,iw=4,iY=5,nh={network_error:{exitCode:gw,mcpRetry:"transient"},request_timeout:{exitCode:gw,mcpRetry:"transient"},invalid_response:{exitCode:iw,mcpRetry:"transient"},quota_exceeded:{exitCode:V$,mcpRetry:"manual"},[o.UNAUTHORIZED]:{exitCode:gw,mcpRetry:"manual"},[o.TOKEN_EXPIRED]:{exitCode:gw,mcpRetry:"manual"},[o.TOKEN_INVALID]:{exitCode:gw,mcpRetry:"manual"},[o.FORBIDDEN]:{exitCode:gw,mcpRetry:"manual"},[o.STEP_UP_REQUIRED]:{exitCode:gw,mcpRetry:"manual"},[o.EXPORT_NOT_ALLOWED]:{exitCode:gw,mcpRetry:"manual"},[o.SESSION_READ_ONLY]:{exitCode:gw,mcpRetry:"manual"},[o.NOT_FOUND]:{exitCode:V$,mcpRetry:"manual"},[o.SESSION_NOT_FOUND]:{exitCode:V$,mcpRetry:"manual"},[o.THREAD_NOT_FOUND]:{exitCode:V$,mcpRetry:"manual"},[o.COMMENT_NOT_FOUND]:{exitCode:V$,mcpRetry:"manual"},[o.BLOCK_NOT_FOUND]:{exitCode:V$,mcpRetry:"manual"},[o.SOURCE_FILE_NOT_FOUND]:{exitCode:V$,mcpRetry:"manual"},[o.IDEMPOTENCY_KEY_IN_FLIGHT]:{exitCode:iY,mcpRetry:"transient"},[o.VERSION_CONFLICT]:{exitCode:V$,mcpRetry:"manual"},[o.SOURCE_MISMATCH]:{exitCode:V$,mcpRetry:"manual"},[o.PAYLOAD_TOO_LARGE]:{exitCode:V$,mcpRetry:"manual"},[o.INVALID_ARGUMENT]:{exitCode:V$,mcpRetry:"manual"},[o.INVALID_BLOCK_ID]:{exitCode:V$,mcpRetry:"manual"},[o.INVALID_ANCHOR]:{exitCode:V$,mcpRetry:"manual"},[o.INVALID_SHA]:{exitCode:V$,mcpRetry:"manual"},[o.INVALID_PATH]:{exitCode:V$,mcpRetry:"manual"},[o.UNKNOWN_SCHEMA]:{exitCode:V$,mcpRetry:"manual"},[o.VALIDATION_FAILED]:{exitCode:V$,mcpRetry:"manual"},[o.RATE_LIMITED]:{exitCode:gw,mcpRetry:"transient"},[o.DB_ERROR]:{exitCode:iw,mcpRetry:"transient"},[o.RENDER_ERROR]:{exitCode:iw,mcpRetry:"transient"},[o.STORAGE_ERROR]:{exitCode:iw,mcpRetry:"transient"},[o.INTERNAL_ERROR]:{exitCode:iw,mcpRetry:"transient"},[o.SOURCE_UNAVAILABLE]:{exitCode:iw,mcpRetry:"transient"},[o.SOURCE_TIMEOUT]:{exitCode:iw,mcpRetry:"transient"},[o.SERVICE_UNAVAILABLE]:{exitCode:iw,mcpRetry:"transient"}};var a1={maxAttempts:3,baseDelayMs:200,maxDelayMs:1000,jitterFactor:0.25,retryableStatusCodes:[429,502,503]};function r3($,w){let g=Math.min(w.baseDelayMs*Math.pow(2,$),w.maxDelayMs),_=g*w.jitterFactor*(Math.random()*2-1);return Math.max(0,Math.round(g+_))}function TY($,w,g){let _=$.headers.get("Retry-After");if(_){let v=parseInt(_,10);if(!Number.isNaN(v)&&v>0)return v*1000;let U=new Date(_);if(!Number.isNaN(U.getTime())){let G=U.getTime()-Date.now();if(G>0)return G}}return r3(w,g)}function RY($,w,g,_){if(!_.retryableStatusCodes.includes(w))return!1;if($==="GET"||$==="PUT")return!0;return g}function CY($,w){if($==="GET"||$==="PUT")return!0;return w}async function s1($,w,g=!1,_=a1){let v=null,U=null,G=0,D=!1;for(let J=0;J<_.maxAttempts;J++){G=J+1;try{let X=await $();if(v=X,D=!1,X.ok||!RY(w,X.status,g,_))return{response:X,error:null,attempts:J+1,wasNetworkError:!1,exhaustedRetries:!1,lastStatus:X.status};if(J<_.maxAttempts-1){let Q=TY(X,J,_);await new Promise((Y)=>setTimeout(Y,Q))}}catch(X){if(U=X instanceof Error?X:Error(String(X)),D=!0,v=null,J<_.maxAttempts-1&&CY(w,g)){let Q=r3(J,_);await new Promise((Y)=>setTimeout(Y,Q));continue}break}}if(U)return{response:null,error:U,attempts:G,wasNetworkError:!0,exhaustedRetries:!0,lastStatus:0};if(!v)throw Error("Retry invariant violated: missing final response");return{response:v,error:U,attempts:G,wasNetworkError:D,exhaustedRetries:!0,lastStatus:v.status}}var $4=30000,uM="/v1",EM="typescape-api-client/0.0.1";function uY($){return typeof FormData<"u"&&$ instanceof FormData}function p3($,w,g,_){let v=`${$}${w}${g}`;if(_&&Object.keys(_).length>0)v+=`?${new URLSearchParams(_).toString()}`;return v}function e3($,w,g){return{Authorization:`Bearer ${$}`,Accept:"application/json","User-Agent":w,...g}}function ZY($){let w=Object.entries($).find(([g])=>g.toLowerCase()==="idempotency-key")?.[1];return typeof w==="string"&&w.trim().length>0}function $0($,w){let g=w;if(g&&typeof g.request_id==="string"&&g.request_id.trim().length>0)return g.request_id;let _=$.headers.get("X-Request-Id");if(typeof _==="string"&&_.trim().length>0)return _;return"unknown_request_id"}function xY($,w){let g=$.error?.code;if(typeof g!=="string"||g.trim().length===0)throw new W(0,"invalid_response","Error response missing error.code",w);let _=$.error?.message;if(g!=="quota_exceeded"&&(typeof _!=="string"||_.trim().length===0))throw new W(0,"invalid_response","Error response missing error.message",w);return new W(0,g,typeof _==="string"?_:"",w,$.error?.details,$.error?.fix_hint)}async function EY($,w,g,_,v,U){let G=ZY(U),D=await s1(()=>fetch($,{...w,signal:AbortSignal.timeout(g)}),_,G,v);if(D.error){if(D.error instanceof DOMException&&(D.error.name==="TimeoutError"||D.error.name==="AbortError")){let L=Math.round(g/1000);throw new W(0,"request_timeout",`Request timed out after ${L}s. Check your network connection and server URL.`,"unknown")}throw new W(0,"network_error",`Network error: ${D.error.message} (${D.attempts} attempt${D.attempts===1?"":"s"})`,"unknown")}let J=D.response;if(!J)throw new W(0,"network_error",`Network error: request failed (${D.attempts} attempt${D.attempts===1?"":"s"})`,"unknown");let X=J.headers.get("Content-Type");if(!X)throw new W(J.status,"invalid_response","Response missing Content-Type header","unknown");if(!X.toLowerCase().includes("application/json"))throw new W(J.status,"invalid_response",`Expected JSON response but received Content-Type: ${X}`,"unknown");let Q;try{Q=await J.json()}catch(q){throw new W(J.status,"invalid_response",`Failed to parse JSON response: ${q instanceof Error?q.message:String(q)}`,"unknown")}let Y=$0(J,Q);if(!J.ok){let L=xY(Q,Y);throw new W(J.status,L.code,L.message+(D.exhaustedRetries&&D.attempts>1?` (${D.attempts} attempts, retries exhausted)`:""),Y,L.details,L.fixHint)}return{status:J.status,body:Q,requestId:Y}}async function ZM($,w,g,_,v,U){let G=ZY(U),D=await s1(()=>fetch($,{...w,signal:AbortSignal.timeout(g)}),_,G,v);if(D.error){if(D.error instanceof DOMException&&(D.error.name==="TimeoutError"||D.error.name==="AbortError")){let q=Math.round(g/1000);throw new W(0,"request_timeout",`Request timed out after ${q}s. Check your network connection and server URL.`,"unknown")}throw new W(0,"network_error",`Network error: ${D.error.message} (${D.attempts} attempt${D.attempts===1?"":"s"})`,"unknown")}let J=D.response;if(!J)throw new W(0,"network_error","Request failed","unknown");let X=J.headers.get("Content-Type");if(!X)throw new W(J.status,"invalid_response","Response missing Content-Type header","unknown");if(X.toLowerCase().includes("application/json")){let Y;try{Y=await J.json()}catch(L){throw new W(J.status,"invalid_response",`Failed to parse JSON response: ${L instanceof Error?L.message:String(L)}`,"unknown")}let q=$0(J,Y);if(!J.ok){let L=xY(Y,q);throw new W(J.status,L.code,L.message,q,L.details,L.fixHint)}throw new W(J.status,"invalid_response","Expected text response but received JSON payload",q)}let Q;try{Q=await J.text()}catch(Y){throw new W(J.status,"invalid_response",`Failed to read text response: ${Y instanceof Error?Y.message:String(Y)}`,$0(J,null))}return{status:J.status,body:Q,requestId:$0(J,null)}}function a3($){let w=$.baseUrl.replace(/\/$/,""),g=$.apiPrefix??uM,_=$.timeoutMs??$4,v=$.userAgent??EM,U=$.retryPolicy??a1;function G(D,J,X={}){let Q=p3(w,g,J,X.query),Y=e3($.apiKey,v,X.headers);if(X.body!==void 0&&!uY(X.body))Y["Content-Type"]="application/json";let q=X.body!==void 0?uY(X.body)?X.body:JSON.stringify(X.body):void 0;return EY(Q,{method:D,headers:Y,body:q},_,D,U,Y)}return{get(D,J){return G("GET",D,J)},getText(D,J){let X=p3(w,g,D,J?.query),Q=e3($.apiKey,v,{Accept:"text/plain, application/json",...J?.headers});return ZM(X,{method:"GET",headers:Q},_,"GET",U,Q)},post(D,J){return G("POST",D,J)},postFormData(D,J,X){let Q=p3(w,g,D,X?.query),Y=e3($.apiKey,v,X?.headers);return EY(Q,{method:"POST",headers:Y,body:J},_,"POST",U,Y)},put(D,J){return G("PUT",D,J)},patch(D,J){return G("PATCH",D,J)},delete(D,J){return G("DELETE",D,J)},request:G}}var xM=typeof s3.default.version==="string"?s3.default.version:"0.0.0",hM=`typescape-mcp/${xM}`;function hY($,w,g=$4){return a3({baseUrl:$,apiKey:w,timeoutMs:g,userAgent:hM})}var w$;(function($){$.assertEqual=(v)=>v;function w(v){}$.assertIs=w;function g(v){throw Error()}$.assertNever=g,$.arrayToEnum=(v)=>{let U={};for(let G of v)U[G]=G;return U},$.getValidEnumValues=(v)=>{let U=$.objectKeys(v).filter((D)=>typeof v[v[D]]!=="number"),G={};for(let D of U)G[D]=v[D];return $.objectValues(G)},$.objectValues=(v)=>{return $.objectKeys(v).map(function(U){return v[U]})},$.objectKeys=typeof Object.keys==="function"?(v)=>Object.keys(v):(v)=>{let U=[];for(let G in v)if(Object.prototype.hasOwnProperty.call(v,G))U.push(G);return U},$.find=(v,U)=>{for(let G of v)if(U(G))return G;return},$.isInteger=typeof Number.isInteger==="function"?(v)=>Number.isInteger(v):(v)=>typeof v==="number"&&isFinite(v)&&Math.floor(v)===v;function _(v,U=" | "){return v.map((G)=>typeof G==="string"?`'${G}'`:G).join(U)}$.joinValues=_,$.jsonStringifyReplacer=(v,U)=>{if(typeof U==="bigint")return U.toString();return U}})(w$||(w$={}));var wX;(function($){$.mergeShapes=(w,g)=>{return{...w,...g}}})(wX||(wX={}));var h=w$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Rw=($)=>{switch(typeof $){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN($)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":if(Array.isArray($))return h.array;if($===null)return h.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return h.promise;if(typeof Map<"u"&&$ instanceof Map)return h.map;if(typeof Set<"u"&&$ instanceof Set)return h.set;if(typeof Date<"u"&&$ instanceof Date)return h.date;return h.object;default:return h.unknown}},z=w$.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),lM=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class Z$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(g)=>{this.issues=[...this.issues,g]},this.addIssues=(g=[])=>{this.issues=[...this.issues,...g]};let w=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,w);else this.__proto__=w;this.name="ZodError",this.issues=$}format($){let w=$||function(v){return v.message},g={_errors:[]},_=(v)=>{for(let U of v.issues)if(U.code==="invalid_union")U.unionErrors.map(_);else if(U.code==="invalid_return_type")_(U.returnTypeError);else if(U.code==="invalid_arguments")_(U.argumentsError);else if(U.path.length===0)g._errors.push(w(U));else{let G=g,D=0;while(D<U.path.length){let J=U.path[D];if(D!==U.path.length-1)G[J]=G[J]||{_errors:[]};else G[J]=G[J]||{_errors:[]},G[J]._errors.push(w(U));G=G[J],D++}}};return _(this),g}static assert($){if(!($ instanceof Z$))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,w$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(w)=>w.message){let w={},g=[];for(let _ of this.issues)if(_.path.length>0)w[_.path[0]]=w[_.path[0]]||[],w[_.path[0]].push($(_));else g.push($(_));return{formErrors:g,fieldErrors:w}}get formErrors(){return this.flatten()}}Z$.create=($)=>{return new Z$($)};var F6=($,w)=>{let g;switch($.code){case z.invalid_type:if($.received===h.undefined)g="Required";else g=`Expected ${$.expected}, received ${$.received}`;break;case z.invalid_literal:g=`Invalid literal value, expected ${JSON.stringify($.expected,w$.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:g=`Unrecognized key(s) in object: ${w$.joinValues($.keys,", ")}`;break;case z.invalid_union:g="Invalid input";break;case z.invalid_union_discriminator:g=`Invalid discriminator value. Expected ${w$.joinValues($.options)}`;break;case z.invalid_enum_value:g=`Invalid enum value. Expected ${w$.joinValues($.options)}, received '${$.received}'`;break;case z.invalid_arguments:g="Invalid function arguments";break;case z.invalid_return_type:g="Invalid function return type";break;case z.invalid_date:g="Invalid date";break;case z.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(g=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")g=`${g} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)g=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)g=`Invalid input: must end with "${$.validation.endsWith}"`;else w$.assertNever($.validation);else if($.validation!=="regex")g=`Invalid ${$.validation}`;else g="Invalid";break;case z.too_small:if($.type==="array")g=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")g=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")g=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")g=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else g="Invalid input";break;case z.too_big:if($.type==="array")g=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")g=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")g=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")g=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")g=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else g="Invalid input";break;case z.custom:g="Invalid input";break;case z.invalid_intersection_types:g="Intersection results could not be merged";break;case z.not_multiple_of:g=`Number must be a multiple of ${$.multipleOf}`;break;case z.not_finite:g="Number must be finite";break;default:g=w.defaultError,w$.assertNever($)}return{message:g}},yY=F6;function cM($){yY=$}function w0(){return yY}var v0=($)=>{let{data:w,path:g,errorMaps:_,issueData:v}=$,U=[...g,...v.path||[]],G={...v,path:U};if(v.message!==void 0)return{...v,path:U,message:v.message};let D="",J=_.filter((X)=>!!X).slice().reverse();for(let X of J)D=X(G,{data:w,defaultError:D}).message;return{...v,path:U,message:D}},yM=[];function C($,w){let g=w0(),_=v0({issueData:w,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,g,g===F6?void 0:F6].filter((v)=>!!v)});$.common.issues.push(_)}class P${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,w){let g=[];for(let _ of w){if(_.status==="aborted")return m;if(_.status==="dirty")$.dirty();g.push(_.value)}return{status:$.value,value:g}}static async mergeObjectAsync($,w){let g=[];for(let _ of w){let v=await _.key,U=await _.value;g.push({key:v,value:U})}return P$.mergeObjectSync($,g)}static mergeObjectSync($,w){let g={};for(let _ of w){let{key:v,value:U}=_;if(v.status==="aborted")return m;if(U.status==="aborted")return m;if(v.status==="dirty")$.dirty();if(U.status==="dirty")$.dirty();if(v.value!=="__proto__"&&(typeof U.value<"u"||_.alwaysSet))g[v.value]=U.value}return{status:$.value,value:g}}}var m=Object.freeze({status:"aborted"}),L6=($)=>({status:"dirty",value:$}),f$=($)=>({status:"valid",value:$}),vX=($)=>$.status==="aborted",gX=($)=>$.status==="dirty",w4=($)=>$.status==="valid",E_=($)=>typeof Promise<"u"&&$ instanceof Promise;function g0($,w,g,_){if(g==="a"&&!_)throw TypeError("Private accessor was defined without a getter");if(typeof w==="function"?$!==w||!_:!w.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?_:g==="a"?_.call($):_?_.value:w.get($)}function mY($,w,g,_,v){if(_==="m")throw TypeError("Private method is not writable");if(_==="a"&&!v)throw TypeError("Private accessor was defined without a setter");if(typeof w==="function"?$!==w||!v:!w.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return _==="a"?v.call($,g):v?v.value=g:w.set($,g),g}var l;(function($){$.errToObj=(w)=>typeof w==="string"?{message:w}:w||{},$.toString=(w)=>typeof w==="string"?w:w===null||w===void 0?void 0:w.message})(l||(l={}));var C_,u_;class Gw{constructor($,w,g,_){this._cachedPath=[],this.parent=$,this.data=w,this._path=g,this._key=_}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var lY=($,w)=>{if(w4(w))return{success:!0,data:w.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let g=new Z$($.common.issues);return this._error=g,this._error}}}};function r($){if(!$)return{};let{errorMap:w,invalid_type_error:g,required_error:_,description:v}=$;if(w&&(g||_))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(w)return{errorMap:w,description:v};return{errorMap:(G,D)=>{var J,X;let{message:Q}=$;if(G.code==="invalid_enum_value")return{message:Q!==null&&Q!==void 0?Q:D.defaultError};if(typeof D.data>"u")return{message:(J=Q!==null&&Q!==void 0?Q:_)!==null&&J!==void 0?J:D.defaultError};if(G.code!=="invalid_type")return{message:D.defaultError};return{message:(X=Q!==null&&Q!==void 0?Q:g)!==null&&X!==void 0?X:D.defaultError}},description:v}}class e{get description(){return this._def.description}_getType($){return Rw($.data)}_getOrReturnCtx($,w){return w||{common:$.parent.common,data:$.data,parsedType:Rw($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new P$,ctx:{common:$.parent.common,data:$.data,parsedType:Rw($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let w=this._parse($);if(E_(w))throw Error("Synchronous parse encountered promise.");return w}_parseAsync($){let w=this._parse($);return Promise.resolve(w)}parse($,w){let g=this.safeParse($,w);if(g.success)return g.data;throw g.error}safeParse($,w){var g;let _={common:{issues:[],async:(g=w===null||w===void 0?void 0:w.async)!==null&&g!==void 0?g:!1,contextualErrorMap:w===null||w===void 0?void 0:w.errorMap},path:(w===null||w===void 0?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Rw($)},v=this._parseSync({data:$,path:_.path,parent:_});return lY(_,v)}"~validate"($){var w,g;let _={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Rw($)};if(!this["~standard"].async)try{let v=this._parseSync({data:$,path:[],parent:_});return w4(v)?{value:v.value}:{issues:_.common.issues}}catch(v){if((g=(w=v===null||v===void 0?void 0:v.message)===null||w===void 0?void 0:w.toLowerCase())===null||g===void 0?void 0:g.includes("encountered"))this["~standard"].async=!0;_.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:_}).then((v)=>w4(v)?{value:v.value}:{issues:_.common.issues})}async parseAsync($,w){let g=await this.safeParseAsync($,w);if(g.success)return g.data;throw g.error}async safeParseAsync($,w){let g={common:{issues:[],contextualErrorMap:w===null||w===void 0?void 0:w.errorMap,async:!0},path:(w===null||w===void 0?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Rw($)},_=this._parse({data:$,path:g.path,parent:g}),v=await(E_(_)?_:Promise.resolve(_));return lY(g,v)}refine($,w){let g=(_)=>{if(typeof w==="string"||typeof w>"u")return{message:w};else if(typeof w==="function")return w(_);else return w};return this._refinement((_,v)=>{let U=$(_),G=()=>v.addIssue({code:z.custom,...g(_)});if(typeof Promise<"u"&&U instanceof Promise)return U.then((D)=>{if(!D)return G(),!1;else return!0});if(!U)return G(),!1;else return!0})}refinement($,w){return this._refinement((g,_)=>{if(!$(g))return _.addIssue(typeof w==="function"?w(g,_):w),!1;else return!0})}_refinement($){return new o$({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(w)=>this["~validate"](w)}}optional(){return bw.create(this,this._def)}nullable(){return Cw.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Uw.create(this)}promise(){return U4.create(this,this._def)}or($){return N6.create([this,$],this._def)}and($){return P6.create(this,$,this._def)}transform($){return new o$({...r(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:$}})}default($){let w=typeof $==="function"?$:()=>$;return new z6({...r(this._def),innerType:this,defaultValue:w,typeName:y.ZodDefault})}brand(){return new U0({typeName:y.ZodBranded,type:this,...r(this._def)})}catch($){let w=typeof $==="function"?$:()=>$;return new f6({...r(this._def),innerType:this,catchValue:w,typeName:y.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return y_.create(this,$)}readonly(){return A6.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var mM=/^c[^\s-]{8,}$/i,tM=/^[0-9a-z]+$/,dM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,oM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,rM=/^[a-z0-9_-]{21}$/i,pM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,eM=/^[-+]?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)?)??$/,aM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$X,$z=/^(?:(?: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])$/,wz=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,vz=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,gz=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tY="((\\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])))",bz=new RegExp(`^${tY}$`);function dY($){let w="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if($.precision)w=`${w}\\.\\d{${$.precision}}`;else if($.precision==null)w=`${w}(\\.\\d+)?`;return w}function Gz($){return new RegExp(`^${dY($)}$`)}function oY($){let w=`${tY}T${dY($)}`,g=[];if(g.push($.local?"Z?":"Z"),$.offset)g.push("([+-]\\d{2}:?\\d{2})");return w=`${w}(${g.join("|")})`,new RegExp(`^${w}$`)}function Dz($,w){if((w==="v4"||!w)&&$z.test($))return!0;if((w==="v6"||!w)&&vz.test($))return!0;return!1}function Jz($,w){if(!pM.test($))return!1;try{let[g]=$.split("."),_=g.replace(/-/g,"+").replace(/_/g,"/").padEnd(g.length+(4-g.length%4)%4,"="),v=JSON.parse(atob(_));if(typeof v!=="object"||v===null)return!1;if(!v.typ||!v.alg)return!1;if(w&&v.alg!==w)return!1;return!0}catch(g){return!1}}function Xz($,w){if((w==="v4"||!w)&&wz.test($))return!0;if((w==="v6"||!w)&&gz.test($))return!0;return!1}class _w extends e{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==h.string){let v=this._getOrReturnCtx($);return C(v,{code:z.invalid_type,expected:h.string,received:v.parsedType}),m}let g=new P$,_=void 0;for(let v of this._def.checks)if(v.kind==="min"){if($.data.length<v.value)_=this._getOrReturnCtx($,_),C(_,{code:z.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),g.dirty()}else if(v.kind==="max"){if($.data.length>v.value)_=this._getOrReturnCtx($,_),C(_,{code:z.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),g.dirty()}else if(v.kind==="length"){let U=$.data.length>v.value,G=$.data.length<v.value;if(U||G){if(_=this._getOrReturnCtx($,_),U)C(_,{code:z.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message});else if(G)C(_,{code:z.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message});g.dirty()}}else if(v.kind==="email"){if(!aM.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"email",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="emoji"){if(!$X)$X=new RegExp(sM,"u");if(!$X.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"emoji",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="uuid"){if(!oM.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"uuid",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="nanoid"){if(!rM.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"nanoid",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="cuid"){if(!mM.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"cuid",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="cuid2"){if(!tM.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"cuid2",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="ulid"){if(!dM.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"ulid",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="url")try{new URL($.data)}catch(U){_=this._getOrReturnCtx($,_),C(_,{validation:"url",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="regex"){if(v.regex.lastIndex=0,!v.regex.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"regex",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="trim")$.data=$.data.trim();else if(v.kind==="includes"){if(!$.data.includes(v.value,v.position))_=this._getOrReturnCtx($,_),C(_,{code:z.invalid_string,validation:{includes:v.value,position:v.position},message:v.message}),g.dirty()}else if(v.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(v.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(v.kind==="startsWith"){if(!$.data.startsWith(v.value))_=this._getOrReturnCtx($,_),C(_,{code:z.invalid_string,validation:{startsWith:v.value},message:v.message}),g.dirty()}else if(v.kind==="endsWith"){if(!$.data.endsWith(v.value))_=this._getOrReturnCtx($,_),C(_,{code:z.invalid_string,validation:{endsWith:v.value},message:v.message}),g.dirty()}else if(v.kind==="datetime"){if(!oY(v).test($.data))_=this._getOrReturnCtx($,_),C(_,{code:z.invalid_string,validation:"datetime",message:v.message}),g.dirty()}else if(v.kind==="date"){if(!bz.test($.data))_=this._getOrReturnCtx($,_),C(_,{code:z.invalid_string,validation:"date",message:v.message}),g.dirty()}else if(v.kind==="time"){if(!Gz(v).test($.data))_=this._getOrReturnCtx($,_),C(_,{code:z.invalid_string,validation:"time",message:v.message}),g.dirty()}else if(v.kind==="duration"){if(!eM.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"duration",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="ip"){if(!Dz($.data,v.version))_=this._getOrReturnCtx($,_),C(_,{validation:"ip",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="jwt"){if(!Jz($.data,v.alg))_=this._getOrReturnCtx($,_),C(_,{validation:"jwt",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="cidr"){if(!Xz($.data,v.version))_=this._getOrReturnCtx($,_),C(_,{validation:"cidr",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="base64"){if(!_z.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"base64",code:z.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="base64url"){if(!Uz.test($.data))_=this._getOrReturnCtx($,_),C(_,{validation:"base64url",code:z.invalid_string,message:v.message}),g.dirty()}else w$.assertNever(v);return{status:g.value,value:$.data}}_regex($,w,g){return this.refinement((_)=>$.test(_),{validation:w,code:z.invalid_string,...l.errToObj(g)})}_addCheck($){return new _w({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...l.errToObj($)})}url($){return this._addCheck({kind:"url",...l.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...l.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...l.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...l.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...l.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...l.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...l.errToObj($)})}base64($){return this._addCheck({kind:"base64",...l.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...l.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...l.errToObj($)})}ip($){return this._addCheck({kind:"ip",...l.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...l.errToObj($)})}datetime($){var w,g;if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof($===null||$===void 0?void 0:$.precision)>"u"?null:$===null||$===void 0?void 0:$.precision,offset:(w=$===null||$===void 0?void 0:$.offset)!==null&&w!==void 0?w:!1,local:(g=$===null||$===void 0?void 0:$.local)!==null&&g!==void 0?g:!1,...l.errToObj($===null||$===void 0?void 0:$.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof($===null||$===void 0?void 0:$.precision)>"u"?null:$===null||$===void 0?void 0:$.precision,...l.errToObj($===null||$===void 0?void 0:$.message)})}duration($){return this._addCheck({kind:"duration",...l.errToObj($)})}regex($,w){return this._addCheck({kind:"regex",regex:$,...l.errToObj(w)})}includes($,w){return this._addCheck({kind:"includes",value:$,position:w===null||w===void 0?void 0:w.position,...l.errToObj(w===null||w===void 0?void 0:w.message)})}startsWith($,w){return this._addCheck({kind:"startsWith",value:$,...l.errToObj(w)})}endsWith($,w){return this._addCheck({kind:"endsWith",value:$,...l.errToObj(w)})}min($,w){return this._addCheck({kind:"min",value:$,...l.errToObj(w)})}max($,w){return this._addCheck({kind:"max",value:$,...l.errToObj(w)})}length($,w){return this._addCheck({kind:"length",value:$,...l.errToObj(w)})}nonempty($){return this.min(1,l.errToObj($))}trim(){return new _w({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _w({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _w({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let w of this._def.checks)if(w.kind==="min"){if($===null||w.value>$)$=w.value}return $}get maxLength(){let $=null;for(let w of this._def.checks)if(w.kind==="max"){if($===null||w.value<$)$=w.value}return $}}_w.create=($)=>{var w;return new _w({checks:[],typeName:y.ZodString,coerce:(w=$===null||$===void 0?void 0:$.coerce)!==null&&w!==void 0?w:!1,...r($)})};function Qz($,w){let g=($.toString().split(".")[1]||"").length,_=(w.toString().split(".")[1]||"").length,v=g>_?g:_,U=parseInt($.toFixed(v).replace(".","")),G=parseInt(w.toFixed(v).replace(".",""));return U%G/Math.pow(10,v)}class kv extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==h.number){let v=this._getOrReturnCtx($);return C(v,{code:z.invalid_type,expected:h.number,received:v.parsedType}),m}let g=void 0,_=new P$;for(let v of this._def.checks)if(v.kind==="int"){if(!w$.isInteger($.data))g=this._getOrReturnCtx($,g),C(g,{code:z.invalid_type,expected:"integer",received:"float",message:v.message}),_.dirty()}else if(v.kind==="min"){if(v.inclusive?$.data<v.value:$.data<=v.value)g=this._getOrReturnCtx($,g),C(g,{code:z.too_small,minimum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),_.dirty()}else if(v.kind==="max"){if(v.inclusive?$.data>v.value:$.data>=v.value)g=this._getOrReturnCtx($,g),C(g,{code:z.too_big,maximum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),_.dirty()}else if(v.kind==="multipleOf"){if(Qz($.data,v.value)!==0)g=this._getOrReturnCtx($,g),C(g,{code:z.not_multiple_of,multipleOf:v.value,message:v.message}),_.dirty()}else if(v.kind==="finite"){if(!Number.isFinite($.data))g=this._getOrReturnCtx($,g),C(g,{code:z.not_finite,message:v.message}),_.dirty()}else w$.assertNever(v);return{status:_.value,value:$.data}}gte($,w){return this.setLimit("min",$,!0,l.toString(w))}gt($,w){return this.setLimit("min",$,!1,l.toString(w))}lte($,w){return this.setLimit("max",$,!0,l.toString(w))}lt($,w){return this.setLimit("max",$,!1,l.toString(w))}setLimit($,w,g,_){return new kv({...this._def,checks:[...this._def.checks,{kind:$,value:w,inclusive:g,message:l.toString(_)}]})}_addCheck($){return new kv({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:l.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString($)})}multipleOf($,w){return this._addCheck({kind:"multipleOf",value:$,message:l.toString(w)})}finite($){return this._addCheck({kind:"finite",message:l.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString($)})}get minValue(){let $=null;for(let w of this._def.checks)if(w.kind==="min"){if($===null||w.value>$)$=w.value}return $}get maxValue(){let $=null;for(let w of this._def.checks)if(w.kind==="max"){if($===null||w.value<$)$=w.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&w$.isInteger($.value))}get isFinite(){let $=null,w=null;for(let g of this._def.checks)if(g.kind==="finite"||g.kind==="int"||g.kind==="multipleOf")return!0;else if(g.kind==="min"){if(w===null||g.value>w)w=g.value}else if(g.kind==="max"){if($===null||g.value<$)$=g.value}return Number.isFinite(w)&&Number.isFinite($)}}kv.create=($)=>{return new kv({checks:[],typeName:y.ZodNumber,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...r($)})};class nv extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch(v){return this._getInvalidInput($)}if(this._getType($)!==h.bigint)return this._getInvalidInput($);let g=void 0,_=new P$;for(let v of this._def.checks)if(v.kind==="min"){if(v.inclusive?$.data<v.value:$.data<=v.value)g=this._getOrReturnCtx($,g),C(g,{code:z.too_small,type:"bigint",minimum:v.value,inclusive:v.inclusive,message:v.message}),_.dirty()}else if(v.kind==="max"){if(v.inclusive?$.data>v.value:$.data>=v.value)g=this._getOrReturnCtx($,g),C(g,{code:z.too_big,type:"bigint",maximum:v.value,inclusive:v.inclusive,message:v.message}),_.dirty()}else if(v.kind==="multipleOf"){if($.data%v.value!==BigInt(0))g=this._getOrReturnCtx($,g),C(g,{code:z.not_multiple_of,multipleOf:v.value,message:v.message}),_.dirty()}else w$.assertNever(v);return{status:_.value,value:$.data}}_getInvalidInput($){let w=this._getOrReturnCtx($);return C(w,{code:z.invalid_type,expected:h.bigint,received:w.parsedType}),m}gte($,w){return this.setLimit("min",$,!0,l.toString(w))}gt($,w){return this.setLimit("min",$,!1,l.toString(w))}lte($,w){return this.setLimit("max",$,!0,l.toString(w))}lt($,w){return this.setLimit("max",$,!1,l.toString(w))}setLimit($,w,g,_){return new nv({...this._def,checks:[...this._def.checks,{kind:$,value:w,inclusive:g,message:l.toString(_)}]})}_addCheck($){return new nv({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString($)})}multipleOf($,w){return this._addCheck({kind:"multipleOf",value:$,message:l.toString(w)})}get minValue(){let $=null;for(let w of this._def.checks)if(w.kind==="min"){if($===null||w.value>$)$=w.value}return $}get maxValue(){let $=null;for(let w of this._def.checks)if(w.kind==="max"){if($===null||w.value<$)$=w.value}return $}}nv.create=($)=>{var w;return new nv({checks:[],typeName:y.ZodBigInt,coerce:(w=$===null||$===void 0?void 0:$.coerce)!==null&&w!==void 0?w:!1,...r($)})};class j6 extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==h.boolean){let g=this._getOrReturnCtx($);return C(g,{code:z.invalid_type,expected:h.boolean,received:g.parsedType}),m}return f$($.data)}}j6.create=($)=>{return new j6({typeName:y.ZodBoolean,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...r($)})};class v4 extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==h.date){let v=this._getOrReturnCtx($);return C(v,{code:z.invalid_type,expected:h.date,received:v.parsedType}),m}if(isNaN($.data.getTime())){let v=this._getOrReturnCtx($);return C(v,{code:z.invalid_date}),m}let g=new P$,_=void 0;for(let v of this._def.checks)if(v.kind==="min"){if($.data.getTime()<v.value)_=this._getOrReturnCtx($,_),C(_,{code:z.too_small,message:v.message,inclusive:!0,exact:!1,minimum:v.value,type:"date"}),g.dirty()}else if(v.kind==="max"){if($.data.getTime()>v.value)_=this._getOrReturnCtx($,_),C(_,{code:z.too_big,message:v.message,inclusive:!0,exact:!1,maximum:v.value,type:"date"}),g.dirty()}else w$.assertNever(v);return{status:g.value,value:new Date($.data.getTime())}}_addCheck($){return new v4({...this._def,checks:[...this._def.checks,$]})}min($,w){return this._addCheck({kind:"min",value:$.getTime(),message:l.toString(w)})}max($,w){return this._addCheck({kind:"max",value:$.getTime(),message:l.toString(w)})}get minDate(){let $=null;for(let w of this._def.checks)if(w.kind==="min"){if($===null||w.value>$)$=w.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let w of this._def.checks)if(w.kind==="max"){if($===null||w.value<$)$=w.value}return $!=null?new Date($):null}}v4.create=($)=>{return new v4({checks:[],coerce:($===null||$===void 0?void 0:$.coerce)||!1,typeName:y.ZodDate,...r($)})};class Z_ extends e{_parse($){if(this._getType($)!==h.symbol){let g=this._getOrReturnCtx($);return C(g,{code:z.invalid_type,expected:h.symbol,received:g.parsedType}),m}return f$($.data)}}Z_.create=($)=>{return new Z_({typeName:y.ZodSymbol,...r($)})};class K6 extends e{_parse($){if(this._getType($)!==h.undefined){let g=this._getOrReturnCtx($);return C(g,{code:z.invalid_type,expected:h.undefined,received:g.parsedType}),m}return f$($.data)}}K6.create=($)=>{return new K6({typeName:y.ZodUndefined,...r($)})};class O6 extends e{_parse($){if(this._getType($)!==h.null){let g=this._getOrReturnCtx($);return C(g,{code:z.invalid_type,expected:h.null,received:g.parsedType}),m}return f$($.data)}}O6.create=($)=>{return new O6({typeName:y.ZodNull,...r($)})};class g4 extends e{constructor(){super(...arguments);this._any=!0}_parse($){return f$($.data)}}g4.create=($)=>{return new g4({typeName:y.ZodAny,...r($)})};class Pv extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return f$($.data)}}Pv.create=($)=>{return new Pv({typeName:y.ZodUnknown,...r($)})};class Fw extends e{_parse($){let w=this._getOrReturnCtx($);return C(w,{code:z.invalid_type,expected:h.never,received:w.parsedType}),m}}Fw.create=($)=>{return new Fw({typeName:y.ZodNever,...r($)})};class x_ extends e{_parse($){if(this._getType($)!==h.undefined){let g=this._getOrReturnCtx($);return C(g,{code:z.invalid_type,expected:h.void,received:g.parsedType}),m}return f$($.data)}}x_.create=($)=>{return new x_({typeName:y.ZodVoid,...r($)})};class Uw extends e{_parse($){let{ctx:w,status:g}=this._processInputParams($),_=this._def;if(w.parsedType!==h.array)return C(w,{code:z.invalid_type,expected:h.array,received:w.parsedType}),m;if(_.exactLength!==null){let U=w.data.length>_.exactLength.value,G=w.data.length<_.exactLength.value;if(U||G)C(w,{code:U?z.too_big:z.too_small,minimum:G?_.exactLength.value:void 0,maximum:U?_.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:_.exactLength.message}),g.dirty()}if(_.minLength!==null){if(w.data.length<_.minLength.value)C(w,{code:z.too_small,minimum:_.minLength.value,type:"array",inclusive:!0,exact:!1,message:_.minLength.message}),g.dirty()}if(_.maxLength!==null){if(w.data.length>_.maxLength.value)C(w,{code:z.too_big,maximum:_.maxLength.value,type:"array",inclusive:!0,exact:!1,message:_.maxLength.message}),g.dirty()}if(w.common.async)return Promise.all([...w.data].map((U,G)=>{return _.type._parseAsync(new Gw(w,U,w.path,G))})).then((U)=>{return P$.mergeArray(g,U)});let v=[...w.data].map((U,G)=>{return _.type._parseSync(new Gw(w,U,w.path,G))});return P$.mergeArray(g,v)}get element(){return this._def.type}min($,w){return new Uw({...this._def,minLength:{value:$,message:l.toString(w)}})}max($,w){return new Uw({...this._def,maxLength:{value:$,message:l.toString(w)}})}length($,w){return new Uw({...this._def,exactLength:{value:$,message:l.toString(w)}})}nonempty($){return this.min(1,$)}}Uw.create=($,w)=>{return new Uw({type:$,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...r(w)})};function I6($){if($ instanceof W$){let w={};for(let g in $.shape){let _=$.shape[g];w[g]=bw.create(I6(_))}return new W$({...$._def,shape:()=>w})}else if($ instanceof Uw)return new Uw({...$._def,type:I6($.element)});else if($ instanceof bw)return bw.create(I6($.unwrap()));else if($ instanceof Cw)return Cw.create(I6($.unwrap()));else if($ instanceof jw)return jw.create($.items.map((w)=>I6(w)));else return $}class W$ extends e{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),w=w$.objectKeys($);return this._cached={shape:$,keys:w}}_parse($){if(this._getType($)!==h.object){let J=this._getOrReturnCtx($);return C(J,{code:z.invalid_type,expected:h.object,received:J.parsedType}),m}let{status:g,ctx:_}=this._processInputParams($),{shape:v,keys:U}=this._getCached(),G=[];if(!(this._def.catchall instanceof Fw&&this._def.unknownKeys==="strip")){for(let J in _.data)if(!U.includes(J))G.push(J)}let D=[];for(let J of U){let X=v[J],Q=_.data[J];D.push({key:{status:"valid",value:J},value:X._parse(new Gw(_,Q,_.path,J)),alwaysSet:J in _.data})}if(this._def.catchall instanceof Fw){let J=this._def.unknownKeys;if(J==="passthrough")for(let X of G)D.push({key:{status:"valid",value:X},value:{status:"valid",value:_.data[X]}});else if(J==="strict"){if(G.length>0)C(_,{code:z.unrecognized_keys,keys:G}),g.dirty()}else if(J==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let J=this._def.catchall;for(let X of G){let Q=_.data[X];D.push({key:{status:"valid",value:X},value:J._parse(new Gw(_,Q,_.path,X)),alwaysSet:X in _.data})}}if(_.common.async)return Promise.resolve().then(async()=>{let J=[];for(let X of D){let Q=await X.key,Y=await X.value;J.push({key:Q,value:Y,alwaysSet:X.alwaysSet})}return J}).then((J)=>{return P$.mergeObjectSync(g,J)});else return P$.mergeObjectSync(g,D)}get shape(){return this._def.shape()}strict($){return l.errToObj,new W$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(w,g)=>{var _,v,U,G;let D=(U=(v=(_=this._def).errorMap)===null||v===void 0?void 0:v.call(_,w,g).message)!==null&&U!==void 0?U:g.defaultError;if(w.code==="unrecognized_keys")return{message:(G=l.errToObj($).message)!==null&&G!==void 0?G:D};return{message:D}}}:{}})}strip(){return new W$({...this._def,unknownKeys:"strip"})}passthrough(){return new W$({...this._def,unknownKeys:"passthrough"})}extend($){return new W$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new W$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:y.ZodObject})}setKey($,w){return this.augment({[$]:w})}catchall($){return new W$({...this._def,catchall:$})}pick($){let w={};return w$.objectKeys($).forEach((g)=>{if($[g]&&this.shape[g])w[g]=this.shape[g]}),new W$({...this._def,shape:()=>w})}omit($){let w={};return w$.objectKeys(this.shape).forEach((g)=>{if(!$[g])w[g]=this.shape[g]}),new W$({...this._def,shape:()=>w})}deepPartial(){return I6(this)}partial($){let w={};return w$.objectKeys(this.shape).forEach((g)=>{let _=this.shape[g];if($&&!$[g])w[g]=_;else w[g]=_.optional()}),new W$({...this._def,shape:()=>w})}required($){let w={};return w$.objectKeys(this.shape).forEach((g)=>{if($&&!$[g])w[g]=this.shape[g];else{let v=this.shape[g];while(v instanceof bw)v=v._def.innerType;w[g]=v}}),new W$({...this._def,shape:()=>w})}keyof(){return rY(w$.objectKeys(this.shape))}}W$.create=($,w)=>{return new W$({shape:()=>$,unknownKeys:"strip",catchall:Fw.create(),typeName:y.ZodObject,...r(w)})};W$.strictCreate=($,w)=>{return new W$({shape:()=>$,unknownKeys:"strict",catchall:Fw.create(),typeName:y.ZodObject,...r(w)})};W$.lazycreate=($,w)=>{return new W$({shape:$,unknownKeys:"strip",catchall:Fw.create(),typeName:y.ZodObject,...r(w)})};class N6 extends e{_parse($){let{ctx:w}=this._processInputParams($),g=this._def.options;function _(v){for(let G of v)if(G.result.status==="valid")return G.result;for(let G of v)if(G.result.status==="dirty")return w.common.issues.push(...G.ctx.common.issues),G.result;let U=v.map((G)=>new Z$(G.ctx.common.issues));return C(w,{code:z.invalid_union,unionErrors:U}),m}if(w.common.async)return Promise.all(g.map(async(v)=>{let U={...w,common:{...w.common,issues:[]},parent:null};return{result:await v._parseAsync({data:w.data,path:w.path,parent:U}),ctx:U}})).then(_);else{let v=void 0,U=[];for(let D of g){let J={...w,common:{...w.common,issues:[]},parent:null},X=D._parseSync({data:w.data,path:w.path,parent:J});if(X.status==="valid")return X;else if(X.status==="dirty"&&!v)v={result:X,ctx:J};if(J.common.issues.length)U.push(J.common.issues)}if(v)return w.common.issues.push(...v.ctx.common.issues),v.result;let G=U.map((D)=>new Z$(D));return C(w,{code:z.invalid_union,unionErrors:G}),m}}get options(){return this._def.options}}N6.create=($,w)=>{return new N6({options:$,typeName:y.ZodUnion,...r(w)})};var Tw=($)=>{if($ instanceof k6)return Tw($.schema);else if($ instanceof o$)return Tw($.innerType());else if($ instanceof n6)return[$.value];else if($ instanceof Mv)return $.options;else if($ instanceof M6)return w$.objectValues($.enum);else if($ instanceof z6)return Tw($._def.innerType);else if($ instanceof K6)return[void 0];else if($ instanceof O6)return[null];else if($ instanceof bw)return[void 0,...Tw($.unwrap())];else if($ instanceof Cw)return[null,...Tw($.unwrap())];else if($ instanceof U0)return Tw($.unwrap());else if($ instanceof A6)return Tw($.unwrap());else if($ instanceof f6)return Tw($._def.innerType);else return[]};class _0 extends e{_parse($){let{ctx:w}=this._processInputParams($);if(w.parsedType!==h.object)return C(w,{code:z.invalid_type,expected:h.object,received:w.parsedType}),m;let g=this.discriminator,_=w.data[g],v=this.optionsMap.get(_);if(!v)return C(w,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[g]}),m;if(w.common.async)return v._parseAsync({data:w.data,path:w.path,parent:w});else return v._parseSync({data:w.data,path:w.path,parent:w})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,w,g){let _=new Map;for(let v of w){let U=Tw(v.shape[$]);if(!U.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let G of U){if(_.has(G))throw Error(`Discriminator property ${String($)} has duplicate value ${String(G)}`);_.set(G,v)}}return new _0({typeName:y.ZodDiscriminatedUnion,discriminator:$,options:w,optionsMap:_,...r(g)})}}function _X($,w){let g=Rw($),_=Rw(w);if($===w)return{valid:!0,data:$};else if(g===h.object&&_===h.object){let v=w$.objectKeys(w),U=w$.objectKeys($).filter((D)=>v.indexOf(D)!==-1),G={...$,...w};for(let D of U){let J=_X($[D],w[D]);if(!J.valid)return{valid:!1};G[D]=J.data}return{valid:!0,data:G}}else if(g===h.array&&_===h.array){if($.length!==w.length)return{valid:!1};let v=[];for(let U=0;U<$.length;U++){let G=$[U],D=w[U],J=_X(G,D);if(!J.valid)return{valid:!1};v.push(J.data)}return{valid:!0,data:v}}else if(g===h.date&&_===h.date&&+$===+w)return{valid:!0,data:$};else return{valid:!1}}class P6 extends e{_parse($){let{status:w,ctx:g}=this._processInputParams($),_=(v,U)=>{if(vX(v)||vX(U))return m;let G=_X(v.value,U.value);if(!G.valid)return C(g,{code:z.invalid_intersection_types}),m;if(gX(v)||gX(U))w.dirty();return{status:w.value,value:G.data}};if(g.common.async)return Promise.all([this._def.left._parseAsync({data:g.data,path:g.path,parent:g}),this._def.right._parseAsync({data:g.data,path:g.path,parent:g})]).then(([v,U])=>_(v,U));else return _(this._def.left._parseSync({data:g.data,path:g.path,parent:g}),this._def.right._parseSync({data:g.data,path:g.path,parent:g}))}}P6.create=($,w,g)=>{return new P6({left:$,right:w,typeName:y.ZodIntersection,...r(g)})};class jw extends e{_parse($){let{status:w,ctx:g}=this._processInputParams($);if(g.parsedType!==h.array)return C(g,{code:z.invalid_type,expected:h.array,received:g.parsedType}),m;if(g.data.length<this._def.items.length)return C(g,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;if(!this._def.rest&&g.data.length>this._def.items.length)C(g,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w.dirty();let v=[...g.data].map((U,G)=>{let D=this._def.items[G]||this._def.rest;if(!D)return null;return D._parse(new Gw(g,U,g.path,G))}).filter((U)=>!!U);if(g.common.async)return Promise.all(v).then((U)=>{return P$.mergeArray(w,U)});else return P$.mergeArray(w,v)}get items(){return this._def.items}rest($){return new jw({...this._def,rest:$})}}jw.create=($,w)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new jw({items:$,typeName:y.ZodTuple,rest:null,...r(w)})};class h_ extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:w,ctx:g}=this._processInputParams($);if(g.parsedType!==h.object)return C(g,{code:z.invalid_type,expected:h.object,received:g.parsedType}),m;let _=[],v=this._def.keyType,U=this._def.valueType;for(let G in g.data)_.push({key:v._parse(new Gw(g,G,g.path,G)),value:U._parse(new Gw(g,g.data[G],g.path,G)),alwaysSet:G in g.data});if(g.common.async)return P$.mergeObjectAsync(w,_);else return P$.mergeObjectSync(w,_)}get element(){return this._def.valueType}static create($,w,g){if(w instanceof e)return new h_({keyType:$,valueType:w,typeName:y.ZodRecord,...r(g)});return new h_({keyType:_w.create(),valueType:$,typeName:y.ZodRecord,...r(w)})}}class l_ extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:w,ctx:g}=this._processInputParams($);if(g.parsedType!==h.map)return C(g,{code:z.invalid_type,expected:h.map,received:g.parsedType}),m;let _=this._def.keyType,v=this._def.valueType,U=[...g.data.entries()].map(([G,D],J)=>{return{key:_._parse(new Gw(g,G,g.path,[J,"key"])),value:v._parse(new Gw(g,D,g.path,[J,"value"]))}});if(g.common.async){let G=new Map;return Promise.resolve().then(async()=>{for(let D of U){let J=await D.key,X=await D.value;if(J.status==="aborted"||X.status==="aborted")return m;if(J.status==="dirty"||X.status==="dirty")w.dirty();G.set(J.value,X.value)}return{status:w.value,value:G}})}else{let G=new Map;for(let D of U){let{key:J,value:X}=D;if(J.status==="aborted"||X.status==="aborted")return m;if(J.status==="dirty"||X.status==="dirty")w.dirty();G.set(J.value,X.value)}return{status:w.value,value:G}}}}l_.create=($,w,g)=>{return new l_({valueType:w,keyType:$,typeName:y.ZodMap,...r(g)})};class _4 extends e{_parse($){let{status:w,ctx:g}=this._processInputParams($);if(g.parsedType!==h.set)return C(g,{code:z.invalid_type,expected:h.set,received:g.parsedType}),m;let _=this._def;if(_.minSize!==null){if(g.data.size<_.minSize.value)C(g,{code:z.too_small,minimum:_.minSize.value,type:"set",inclusive:!0,exact:!1,message:_.minSize.message}),w.dirty()}if(_.maxSize!==null){if(g.data.size>_.maxSize.value)C(g,{code:z.too_big,maximum:_.maxSize.value,type:"set",inclusive:!0,exact:!1,message:_.maxSize.message}),w.dirty()}let v=this._def.valueType;function U(D){let J=new Set;for(let X of D){if(X.status==="aborted")return m;if(X.status==="dirty")w.dirty();J.add(X.value)}return{status:w.value,value:J}}let G=[...g.data.values()].map((D,J)=>v._parse(new Gw(g,D,g.path,J)));if(g.common.async)return Promise.all(G).then((D)=>U(D));else return U(G)}min($,w){return new _4({...this._def,minSize:{value:$,message:l.toString(w)}})}max($,w){return new _4({...this._def,maxSize:{value:$,message:l.toString(w)}})}size($,w){return this.min($,w).max($,w)}nonempty($){return this.min(1,$)}}_4.create=($,w)=>{return new _4({valueType:$,minSize:null,maxSize:null,typeName:y.ZodSet,...r(w)})};class V6 extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:w}=this._processInputParams($);if(w.parsedType!==h.function)return C(w,{code:z.invalid_type,expected:h.function,received:w.parsedType}),m;function g(G,D){return v0({data:G,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,w0(),F6].filter((J)=>!!J),issueData:{code:z.invalid_arguments,argumentsError:D}})}function _(G,D){return v0({data:G,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,w0(),F6].filter((J)=>!!J),issueData:{code:z.invalid_return_type,returnTypeError:D}})}let v={errorMap:w.common.contextualErrorMap},U=w.data;if(this._def.returns instanceof U4){let G=this;return f$(async function(...D){let J=new Z$([]),X=await G._def.args.parseAsync(D,v).catch((q)=>{throw J.addIssue(g(D,q)),J}),Q=await Reflect.apply(U,this,X);return await G._def.returns._def.type.parseAsync(Q,v).catch((q)=>{throw J.addIssue(_(Q,q)),J})})}else{let G=this;return f$(function(...D){let J=G._def.args.safeParse(D,v);if(!J.success)throw new Z$([g(D,J.error)]);let X=Reflect.apply(U,this,J.data),Q=G._def.returns.safeParse(X,v);if(!Q.success)throw new Z$([_(X,Q.error)]);return Q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new V6({...this._def,args:jw.create($).rest(Pv.create())})}returns($){return new V6({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,w,g){return new V6({args:$?$:jw.create([]).rest(Pv.create()),returns:w||Pv.create(),typeName:y.ZodFunction,...r(g)})}}class k6 extends e{get schema(){return this._def.getter()}_parse($){let{ctx:w}=this._processInputParams($);return this._def.getter()._parse({data:w.data,path:w.path,parent:w})}}k6.create=($,w)=>{return new k6({getter:$,typeName:y.ZodLazy,...r(w)})};class n6 extends e{_parse($){if($.data!==this._def.value){let w=this._getOrReturnCtx($);return C(w,{received:w.data,code:z.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:$.data}}get value(){return this._def.value}}n6.create=($,w)=>{return new n6({value:$,typeName:y.ZodLiteral,...r(w)})};function rY($,w){return new Mv({values:$,typeName:y.ZodEnum,...r(w)})}class Mv extends e{constructor(){super(...arguments);C_.set(this,void 0)}_parse($){if(typeof $.data!=="string"){let w=this._getOrReturnCtx($),g=this._def.values;return C(w,{expected:w$.joinValues(g),received:w.parsedType,code:z.invalid_type}),m}if(!g0(this,C_,"f"))mY(this,C_,new Set(this._def.values),"f");if(!g0(this,C_,"f").has($.data)){let w=this._getOrReturnCtx($),g=this._def.values;return C(w,{received:w.data,code:z.invalid_enum_value,options:g}),m}return f$($.data)}get options(){return this._def.values}get enum(){let $={};for(let w of this._def.values)$[w]=w;return $}get Values(){let $={};for(let w of this._def.values)$[w]=w;return $}get Enum(){let $={};for(let w of this._def.values)$[w]=w;return $}extract($,w=this._def){return Mv.create($,{...this._def,...w})}exclude($,w=this._def){return Mv.create(this.options.filter((g)=>!$.includes(g)),{...this._def,...w})}}C_=new WeakMap;Mv.create=rY;class M6 extends e{constructor(){super(...arguments);u_.set(this,void 0)}_parse($){let w=w$.getValidEnumValues(this._def.values),g=this._getOrReturnCtx($);if(g.parsedType!==h.string&&g.parsedType!==h.number){let _=w$.objectValues(w);return C(g,{expected:w$.joinValues(_),received:g.parsedType,code:z.invalid_type}),m}if(!g0(this,u_,"f"))mY(this,u_,new Set(w$.getValidEnumValues(this._def.values)),"f");if(!g0(this,u_,"f").has($.data)){let _=w$.objectValues(w);return C(g,{received:g.data,code:z.invalid_enum_value,options:_}),m}return f$($.data)}get enum(){return this._def.values}}u_=new WeakMap;M6.create=($,w)=>{return new M6({values:$,typeName:y.ZodNativeEnum,...r(w)})};class U4 extends e{unwrap(){return this._def.type}_parse($){let{ctx:w}=this._processInputParams($);if(w.parsedType!==h.promise&&w.common.async===!1)return C(w,{code:z.invalid_type,expected:h.promise,received:w.parsedType}),m;let g=w.parsedType===h.promise?w.data:Promise.resolve(w.data);return f$(g.then((_)=>{return this._def.type.parseAsync(_,{path:w.path,errorMap:w.common.contextualErrorMap})}))}}U4.create=($,w)=>{return new U4({type:$,typeName:y.ZodPromise,...r(w)})};class o$ extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:w,ctx:g}=this._processInputParams($),_=this._def.effect||null,v={addIssue:(U)=>{if(C(g,U),U.fatal)w.abort();else w.dirty()},get path(){return g.path}};if(v.addIssue=v.addIssue.bind(v),_.type==="preprocess"){let U=_.transform(g.data,v);if(g.common.async)return Promise.resolve(U).then(async(G)=>{if(w.value==="aborted")return m;let D=await this._def.schema._parseAsync({data:G,path:g.path,parent:g});if(D.status==="aborted")return m;if(D.status==="dirty")return L6(D.value);if(w.value==="dirty")return L6(D.value);return D});else{if(w.value==="aborted")return m;let G=this._def.schema._parseSync({data:U,path:g.path,parent:g});if(G.status==="aborted")return m;if(G.status==="dirty")return L6(G.value);if(w.value==="dirty")return L6(G.value);return G}}if(_.type==="refinement"){let U=(G)=>{let D=_.refinement(G,v);if(g.common.async)return Promise.resolve(D);if(D instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return G};if(g.common.async===!1){let G=this._def.schema._parseSync({data:g.data,path:g.path,parent:g});if(G.status==="aborted")return m;if(G.status==="dirty")w.dirty();return U(G.value),{status:w.value,value:G.value}}else return this._def.schema._parseAsync({data:g.data,path:g.path,parent:g}).then((G)=>{if(G.status==="aborted")return m;if(G.status==="dirty")w.dirty();return U(G.value).then(()=>{return{status:w.value,value:G.value}})})}if(_.type==="transform")if(g.common.async===!1){let U=this._def.schema._parseSync({data:g.data,path:g.path,parent:g});if(!w4(U))return U;let G=_.transform(U.value,v);if(G instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:w.value,value:G}}else return this._def.schema._parseAsync({data:g.data,path:g.path,parent:g}).then((U)=>{if(!w4(U))return U;return Promise.resolve(_.transform(U.value,v)).then((G)=>({status:w.value,value:G}))});w$.assertNever(_)}}o$.create=($,w,g)=>{return new o$({schema:$,typeName:y.ZodEffects,effect:w,...r(g)})};o$.createWithPreprocess=($,w,g)=>{return new o$({schema:w,effect:{type:"preprocess",transform:$},typeName:y.ZodEffects,...r(g)})};class bw extends e{_parse($){if(this._getType($)===h.undefined)return f$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}bw.create=($,w)=>{return new bw({innerType:$,typeName:y.ZodOptional,...r(w)})};class Cw extends e{_parse($){if(this._getType($)===h.null)return f$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Cw.create=($,w)=>{return new Cw({innerType:$,typeName:y.ZodNullable,...r(w)})};class z6 extends e{_parse($){let{ctx:w}=this._processInputParams($),g=w.data;if(w.parsedType===h.undefined)g=this._def.defaultValue();return this._def.innerType._parse({data:g,path:w.path,parent:w})}removeDefault(){return this._def.innerType}}z6.create=($,w)=>{return new z6({innerType:$,typeName:y.ZodDefault,defaultValue:typeof w.default==="function"?w.default:()=>w.default,...r(w)})};class f6 extends e{_parse($){let{ctx:w}=this._processInputParams($),g={...w,common:{...w.common,issues:[]}},_=this._def.innerType._parse({data:g.data,path:g.path,parent:{...g}});if(E_(_))return _.then((v)=>{return{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new Z$(g.common.issues)},input:g.data})}});else return{status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new Z$(g.common.issues)},input:g.data})}}removeCatch(){return this._def.innerType}}f6.create=($,w)=>{return new f6({innerType:$,typeName:y.ZodCatch,catchValue:typeof w.catch==="function"?w.catch:()=>w.catch,...r(w)})};class c_ extends e{_parse($){if(this._getType($)!==h.nan){let g=this._getOrReturnCtx($);return C(g,{code:z.invalid_type,expected:h.nan,received:g.parsedType}),m}return{status:"valid",value:$.data}}}c_.create=($)=>{return new c_({typeName:y.ZodNaN,...r($)})};var Yz=Symbol("zod_brand");class U0 extends e{_parse($){let{ctx:w}=this._processInputParams($),g=w.data;return this._def.type._parse({data:g,path:w.path,parent:w})}unwrap(){return this._def.type}}class y_ extends e{_parse($){let{status:w,ctx:g}=this._processInputParams($);if(g.common.async)return(async()=>{let v=await this._def.in._parseAsync({data:g.data,path:g.path,parent:g});if(v.status==="aborted")return m;if(v.status==="dirty")return w.dirty(),L6(v.value);else return this._def.out._parseAsync({data:v.value,path:g.path,parent:g})})();else{let _=this._def.in._parseSync({data:g.data,path:g.path,parent:g});if(_.status==="aborted")return m;if(_.status==="dirty")return w.dirty(),{status:"dirty",value:_.value};else return this._def.out._parseSync({data:_.value,path:g.path,parent:g})}}static create($,w){return new y_({in:$,out:w,typeName:y.ZodPipeline})}}class A6 extends e{_parse($){let w=this._def.innerType._parse($),g=(_)=>{if(w4(_))_.value=Object.freeze(_.value);return _};return E_(w)?w.then((_)=>g(_)):g(w)}unwrap(){return this._def.innerType}}A6.create=($,w)=>{return new A6({innerType:$,typeName:y.ZodReadonly,...r(w)})};function pY($,w={},g){if($)return g4.create().superRefine((_,v)=>{var U,G;if(!$(_)){let D=typeof w==="function"?w(_):typeof w==="string"?{message:w}:w,J=(G=(U=D.fatal)!==null&&U!==void 0?U:g)!==null&&G!==void 0?G:!0,X=typeof D==="string"?{message:D}:D;v.addIssue({code:"custom",...X,fatal:J})}});return g4.create()}var Wz={object:W$.lazycreate},y;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(y||(y={}));var Hz=($,w={message:`Input not instance of ${$.name}`})=>pY((g)=>g instanceof $,w),eY=_w.create,aY=kv.create,qz=c_.create,Bz=nv.create,sY=j6.create,Iz=v4.create,Lz=Z_.create,Vz=K6.create,Fz=O6.create,jz=g4.create,Kz=Pv.create,Oz=Fw.create,Nz=x_.create,Pz=Uw.create,kz=W$.create,nz=W$.strictCreate,Mz=N6.create,zz=_0.create,fz=P6.create,Az=jw.create,Sz=h_.create,iz=l_.create,Tz=_4.create,Rz=V6.create,Cz=k6.create,uz=n6.create,Ez=Mv.create,Zz=M6.create,xz=U4.create,cY=o$.create,hz=bw.create,lz=Cw.create,cz=o$.createWithPreprocess,yz=y_.create,mz=()=>eY().optional(),tz=()=>aY().optional(),dz=()=>sY().optional(),oz={string:($)=>_w.create({...$,coerce:!0}),number:($)=>kv.create({...$,coerce:!0}),boolean:($)=>j6.create({...$,coerce:!0}),bigint:($)=>nv.create({...$,coerce:!0}),date:($)=>v4.create({...$,coerce:!0})},rz=m,I=Object.freeze({__proto__:null,defaultErrorMap:F6,setErrorMap:cM,getErrorMap:w0,makeIssue:v0,EMPTY_PATH:yM,addIssueToContext:C,ParseStatus:P$,INVALID:m,DIRTY:L6,OK:f$,isAborted:vX,isDirty:gX,isValid:w4,isAsync:E_,get util(){return w$},get objectUtil(){return wX},ZodParsedType:h,getParsedType:Rw,ZodType:e,datetimeRegex:oY,ZodString:_w,ZodNumber:kv,ZodBigInt:nv,ZodBoolean:j6,ZodDate:v4,ZodSymbol:Z_,ZodUndefined:K6,ZodNull:O6,ZodAny:g4,ZodUnknown:Pv,ZodNever:Fw,ZodVoid:x_,ZodArray:Uw,ZodObject:W$,ZodUnion:N6,ZodDiscriminatedUnion:_0,ZodIntersection:P6,ZodTuple:jw,ZodRecord:h_,ZodMap:l_,ZodSet:_4,ZodFunction:V6,ZodLazy:k6,ZodLiteral:n6,ZodEnum:Mv,ZodNativeEnum:M6,ZodPromise:U4,ZodEffects:o$,ZodTransformer:o$,ZodOptional:bw,ZodNullable:Cw,ZodDefault:z6,ZodCatch:f6,ZodNaN:c_,BRAND:Yz,ZodBranded:U0,ZodPipeline:y_,ZodReadonly:A6,custom:pY,Schema:e,ZodSchema:e,late:Wz,get ZodFirstPartyTypeKind(){return y},coerce:oz,any:jz,array:Pz,bigint:Bz,boolean:sY,date:Iz,discriminatedUnion:zz,effect:cY,enum:Ez,function:Rz,instanceof:Hz,intersection:fz,lazy:Cz,literal:uz,map:iz,nan:qz,nativeEnum:Zz,never:Oz,null:Fz,nullable:lz,number:aY,object:kz,oboolean:dz,onumber:tz,optional:hz,ostring:mz,pipeline:yz,preprocess:cz,promise:xz,record:Sz,set:Tz,strictObject:nz,string:eY,symbol:Lz,transformer:cY,tuple:Az,undefined:Vz,union:Mz,unknown:Kz,void:Nz,NEVER:rz,ZodIssueCode:z,quotelessJson:lM,ZodError:Z$});var UX="2024-11-05",$W=[UX,"2024-10-07"],b0="2.0",wW=I.union([I.string(),I.number().int()]),vW=I.string(),Dw=I.object({_meta:I.optional(I.object({progressToken:I.optional(wW)}).passthrough())}).passthrough(),x$=I.object({method:I.string(),params:I.optional(Dw)}),m_=I.object({_meta:I.optional(I.object({}).passthrough())}).passthrough(),Kw=I.object({method:I.string(),params:I.optional(m_)}),Jw=I.object({_meta:I.optional(I.object({}).passthrough())}).passthrough(),G0=I.union([I.string(),I.number().int()]),pz=I.object({jsonrpc:I.literal(b0),id:G0}).merge(x$).strict(),ez=I.object({jsonrpc:I.literal(b0)}).merge(Kw).strict(),az=I.object({jsonrpc:I.literal(b0),id:G0,result:Jw}).strict(),b4;(function($){$[$.ConnectionClosed=-1]="ConnectionClosed",$[$.RequestTimeout=-2]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError"})(b4||(b4={}));var sz=I.object({jsonrpc:I.literal(b0),id:G0,error:I.object({code:I.number().int(),message:I.string(),data:I.optional(I.unknown())})}).strict(),gW=I.union([pz,ez,az,sz]),D0=Jw.strict(),J0=Kw.extend({method:I.literal("notifications/cancelled"),params:m_.extend({requestId:G0,reason:I.string().optional()})}),_W=I.object({name:I.string(),version:I.string()}).passthrough(),$f=I.object({experimental:I.optional(I.object({}).passthrough()),sampling:I.optional(I.object({}).passthrough()),roots:I.optional(I.object({listChanged:I.optional(I.boolean())}).passthrough())}).passthrough(),bX=x$.extend({method:I.literal("initialize"),params:Dw.extend({protocolVersion:I.string(),capabilities:$f,clientInfo:_W})}),wf=I.object({experimental:I.optional(I.object({}).passthrough()),logging:I.optional(I.object({}).passthrough()),prompts:I.optional(I.object({listChanged:I.optional(I.boolean())}).passthrough()),resources:I.optional(I.object({subscribe:I.optional(I.boolean()),listChanged:I.optional(I.boolean())}).passthrough()),tools:I.optional(I.object({listChanged:I.optional(I.boolean())}).passthrough())}).passthrough(),vf=Jw.extend({protocolVersion:I.string(),capabilities:wf,serverInfo:_W}),GX=Kw.extend({method:I.literal("notifications/initialized")}),X0=x$.extend({method:I.literal("ping")}),gf=I.object({progress:I.number(),total:I.optional(I.number())}).passthrough(),Q0=Kw.extend({method:I.literal("notifications/progress"),params:m_.merge(gf).extend({progressToken:wW})}),Y0=x$.extend({params:Dw.extend({cursor:I.optional(vW)}).optional()}),W0=Jw.extend({nextCursor:I.optional(vW)}),UW=I.object({uri:I.string(),mimeType:I.optional(I.string())}).passthrough(),bW=UW.extend({text:I.string()}),GW=UW.extend({blob:I.string().base64()}),_f=I.object({uri:I.string(),name:I.string(),description:I.optional(I.string()),mimeType:I.optional(I.string())}).passthrough(),Uf=I.object({uriTemplate:I.string(),name:I.string(),description:I.optional(I.string()),mimeType:I.optional(I.string())}).passthrough(),bf=Y0.extend({method:I.literal("resources/list")}),Gf=W0.extend({resources:I.array(_f)}),Df=Y0.extend({method:I.literal("resources/templates/list")}),Jf=W0.extend({resourceTemplates:I.array(Uf)}),Xf=x$.extend({method:I.literal("resources/read"),params:Dw.extend({uri:I.string()})}),Qf=Jw.extend({contents:I.array(I.union([bW,GW]))}),Yf=Kw.extend({method:I.literal("notifications/resources/list_changed")}),Wf=x$.extend({method:I.literal("resources/subscribe"),params:Dw.extend({uri:I.string()})}),Hf=x$.extend({method:I.literal("resources/unsubscribe"),params:Dw.extend({uri:I.string()})}),qf=Kw.extend({method:I.literal("notifications/resources/updated"),params:m_.extend({uri:I.string()})}),Bf=I.object({name:I.string(),description:I.optional(I.string()),required:I.optional(I.boolean())}).passthrough(),If=I.object({name:I.string(),description:I.optional(I.string()),arguments:I.optional(I.array(Bf))}).passthrough(),Lf=Y0.extend({method:I.literal("prompts/list")}),Vf=W0.extend({prompts:I.array(If)}),Ff=x$.extend({method:I.literal("prompts/get"),params:Dw.extend({name:I.string(),arguments:I.optional(I.record(I.string()))})}),H0=I.object({type:I.literal("text"),text:I.string()}).passthrough(),q0=I.object({type:I.literal("image"),data:I.string().base64(),mimeType:I.string()}).passthrough(),DW=I.object({type:I.literal("resource"),resource:I.union([bW,GW])}).passthrough(),jf=I.object({role:I.enum(["user","assistant"]),content:I.union([H0,q0,DW])}).passthrough(),Kf=Jw.extend({description:I.optional(I.string()),messages:I.array(jf)}),Of=Kw.extend({method:I.literal("notifications/prompts/list_changed")}),Nf=I.object({name:I.string(),description:I.optional(I.string()),inputSchema:I.object({type:I.literal("object"),properties:I.optional(I.object({}).passthrough())}).passthrough()}).passthrough(),DX=Y0.extend({method:I.literal("tools/list")}),Pf=W0.extend({tools:I.array(Nf)}),JW=Jw.extend({content:I.array(I.union([H0,q0,DW])),isError:I.boolean().default(!1).optional()}),sh=JW.or(Jw.extend({toolResult:I.unknown()})),JX=x$.extend({method:I.literal("tools/call"),params:Dw.extend({name:I.string(),arguments:I.optional(I.record(I.unknown()))})}),kf=Kw.extend({method:I.literal("notifications/tools/list_changed")}),XW=I.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),nf=x$.extend({method:I.literal("logging/setLevel"),params:Dw.extend({level:XW})}),Mf=Kw.extend({method:I.literal("notifications/message"),params:m_.extend({level:XW,logger:I.optional(I.string()),data:I.unknown()})}),zf=I.object({name:I.string().optional()}).passthrough(),ff=I.object({hints:I.optional(I.array(zf)),costPriority:I.optional(I.number().min(0).max(1)),speedPriority:I.optional(I.number().min(0).max(1)),intelligencePriority:I.optional(I.number().min(0).max(1))}).passthrough(),Af=I.object({role:I.enum(["user","assistant"]),content:I.union([H0,q0])}).passthrough(),Sf=x$.extend({method:I.literal("sampling/createMessage"),params:Dw.extend({messages:I.array(Af),systemPrompt:I.optional(I.string()),includeContext:I.optional(I.enum(["none","thisServer","allServers"])),temperature:I.optional(I.number()),maxTokens:I.number().int(),stopSequences:I.optional(I.array(I.string())),metadata:I.optional(I.object({}).passthrough()),modelPreferences:I.optional(ff)})}),XX=Jw.extend({model:I.string(),stopReason:I.optional(I.enum(["endTurn","stopSequence","maxTokens"]).or(I.string())),role:I.enum(["user","assistant"]),content:I.discriminatedUnion("type",[H0,q0])}),Tf=I.object({type:I.literal("ref/resource"),uri:I.string()}).passthrough(),Rf=I.object({type:I.literal("ref/prompt"),name:I.string()}).passthrough(),Cf=x$.extend({method:I.literal("completion/complete"),params:Dw.extend({ref:I.union([Rf,Tf]),argument:I.object({name:I.string(),value:I.string()}).passthrough()})}),uf=Jw.extend({completion:I.object({values:I.array(I.string()).max(100),total:I.optional(I.number().int()),hasMore:I.optional(I.boolean())}).passthrough()}),Ef=I.object({uri:I.string().startsWith("file://"),name:I.optional(I.string())}).passthrough(),Zf=x$.extend({method:I.literal("roots/list")}),QX=Jw.extend({roots:I.array(Ef)}),xf=Kw.extend({method:I.literal("notifications/roots/list_changed")}),$l=I.union([X0,bX,Cf,nf,Ff,Lf,bf,Df,Xf,Wf,Hf,JX,DX]),wl=I.union([J0,Q0,GX,xf]),vl=I.union([D0,XX,QX]),gl=I.union([X0,Sf,Zf]),_l=I.union([J0,Q0,Mf,qf,Yf,kf,Of]),Ul=I.union([D0,vf,uf,Kf,Vf,Gf,Jf,Qf,JW,Pf]);class t_ extends Error{constructor($,w,g){super(`MCP error ${$}: ${w}`);this.code=$,this.data=g}}var hf=60000;class YX{constructor($){this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this.setNotificationHandler(J0,(w)=>{let g=this._requestHandlerAbortControllers.get(w.params.requestId);g===null||g===void 0||g.abort(w.params.reason)}),this.setNotificationHandler(Q0,(w)=>{this._onprogress(w)}),this.setRequestHandler(X0,(w)=>({}))}async connect($){this._transport=$,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=(w)=>{this._onerror(w)},this._transport.onmessage=(w)=>{if(!("method"in w))this._onresponse(w);else if("id"in w)this._onrequest(w);else this._onnotification(w)},await this._transport.start()}_onclose(){var $;let w=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let g=new t_(b4.ConnectionClosed,"Connection closed");for(let _ of w.values())_(g)}_onerror($){var w;(w=this.onerror)===null||w===void 0||w.call(this,$)}_onnotification($){var w;let g=(w=this._notificationHandlers.get($.method))!==null&&w!==void 0?w:this.fallbackNotificationHandler;if(g===void 0)return;Promise.resolve().then(()=>g($)).catch((_)=>this._onerror(Error(`Uncaught error in notification handler: ${_}`)))}_onrequest($){var w,g;let _=(w=this._requestHandlers.get($.method))!==null&&w!==void 0?w:this.fallbackRequestHandler;if(_===void 0){(g=this._transport)===null||g===void 0||g.send({jsonrpc:"2.0",id:$.id,error:{code:b4.MethodNotFound,message:"Method not found"}}).catch((U)=>this._onerror(Error(`Failed to send an error response: ${U}`)));return}let v=new AbortController;this._requestHandlerAbortControllers.set($.id,v),Promise.resolve().then(()=>_($,{signal:v.signal})).then((U)=>{var G;if(v.signal.aborted)return;return(G=this._transport)===null||G===void 0?void 0:G.send({result:U,jsonrpc:"2.0",id:$.id})},(U)=>{var G,D;if(v.signal.aborted)return;return(G=this._transport)===null||G===void 0?void 0:G.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(U.code)?U.code:b4.InternalError,message:(D=U.message)!==null&&D!==void 0?D:"Internal error"}})}).catch((U)=>this._onerror(Error(`Failed to send response: ${U}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:w,...g}=$.params,_=this._progressHandlers.get(Number(w));if(_===void 0){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}_(g)}_onresponse($){let w=$.id,g=this._responseHandlers.get(Number(w));if(g===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(Number(w)),this._progressHandlers.delete(Number(w)),"result"in $)g($);else{let _=new t_($.error.code,$.error.message,$.error.data);g(_)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,w,g){return new Promise((_,v)=>{var U,G,D,J;if(!this._transport){v(Error("Not connected"));return}if(((U=this._options)===null||U===void 0?void 0:U.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(G=g===null||g===void 0?void 0:g.signal)===null||G===void 0||G.throwIfAborted();let X=this._requestMessageId++,Q={...$,jsonrpc:"2.0",id:X};if(g===null||g===void 0?void 0:g.onprogress)this._progressHandlers.set(X,g.onprogress),Q.params={...$.params,_meta:{progressToken:X}};let Y=void 0;this._responseHandlers.set(X,(F)=>{var H;if(Y!==void 0)clearTimeout(Y);if((H=g===null||g===void 0?void 0:g.signal)===null||H===void 0?void 0:H.aborted)return;if(F instanceof Error)return v(F);try{let V=w.parse(F.result);_(V)}catch(V){v(V)}});let q=(F)=>{var H;this._responseHandlers.delete(X),this._progressHandlers.delete(X),(H=this._transport)===null||H===void 0||H.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:X,reason:String(F)}}).catch((V)=>this._onerror(Error(`Failed to send cancellation: ${V}`))),v(F)};(D=g===null||g===void 0?void 0:g.signal)===null||D===void 0||D.addEventListener("abort",()=>{var F;if(Y!==void 0)clearTimeout(Y);q((F=g===null||g===void 0?void 0:g.signal)===null||F===void 0?void 0:F.reason)});let L=(J=g===null||g===void 0?void 0:g.timeout)!==null&&J!==void 0?J:hf;Y=setTimeout(()=>q(new t_(b4.RequestTimeout,"Request timed out",{timeout:L})),L),this._transport.send(Q).catch((F)=>{if(Y!==void 0)clearTimeout(Y);v(F)})})}async notification($){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let w={...$,jsonrpc:"2.0"};await this._transport.send(w)}setRequestHandler($,w){let g=$.shape.method.value;this.assertRequestHandlerCapability(g),this._requestHandlers.set(g,(_,v)=>Promise.resolve(w($.parse(_),v)))}removeRequestHandler($){this._requestHandlers.delete($)}setNotificationHandler($,w){this._notificationHandlers.set($.shape.method.value,(g)=>Promise.resolve(w($.parse(g))))}removeNotificationHandler($){this._notificationHandlers.delete($)}}class WX extends YX{constructor($,w){super(w);this._serverInfo=$,this._capabilities=w.capabilities,this.setRequestHandler(bX,(g)=>this._oninitialize(g)),this.setNotificationHandler(GX,()=>{var g;return(g=this.oninitialized)===null||g===void 0?void 0:g.call(this)})}assertCapabilityForMethod($){var w,g;switch($){case"sampling/createMessage":if(!((w=this._clientCapabilities)===null||w===void 0?void 0:w.sampling))throw Error(`Client does not support sampling (required for ${$})`);break;case"roots/list":if(!((g=this._clientCapabilities)===null||g===void 0?void 0:g.roots))throw Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Server does not support sampling (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let w=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:$W.includes(w)?w:UX,capabilities:this.getCapabilities(),serverInfo:this._serverInfo}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},D0)}async createMessage($,w){return this.request({method:"sampling/createMessage",params:$},XX,w)}async listRoots($,w){return this.request({method:"roots/list",params:$},QX,w)}async sendLoggingMessage($){return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}import YW from"node:process";class HX{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
|
|
179
|
+
`);if($===-1)return null;let w=this._buffer.toString("utf8",0,$);return this._buffer=this._buffer.subarray($+1),lf(w)}clear(){this._buffer=void 0}}function lf($){return gW.parse(JSON.parse($))}function QW($){return JSON.stringify($)+`
|
|
180
|
+
`}class qX{constructor($=YW.stdin,w=YW.stdout){this._stdin=$,this._stdout=w,this._readBuffer=new HX,this._started=!1,this._ondata=(g)=>{this._readBuffer.append(g),this.processReadBuffer()},this._onerror=(g)=>{var _;(_=this.onerror)===null||_===void 0||_.call(this,g)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var $,w;while(!0)try{let g=this._readBuffer.readMessage();if(g===null)break;($=this.onmessage)===null||$===void 0||$.call(this,g)}catch(g){(w=this.onerror)===null||w===void 0||w.call(this,g)}}async close(){var $;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._readBuffer.clear(),($=this.onclose)===null||$===void 0||$.call(this)}send($){return new Promise((w)=>{let g=QW($);if(this._stdout.write(g))w();else this._stdout.once("drain",w)})}}function i6($,w){var g={};for(var _ in $)if(Object.prototype.hasOwnProperty.call($,_)&&w.indexOf(_)<0)g[_]=$[_];if($!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var v=0,_=Object.getOwnPropertySymbols($);v<_.length;v++)if(w.indexOf(_[v])<0&&Object.prototype.propertyIsEnumerable.call($,_[v]))g[_[v]]=$[_[v]]}return g}var cf={ZodAny:"any",ZodArray:"array",ZodBigInt:"bigint",ZodBoolean:"boolean",ZodDefault:"default",ZodPrefault:"prefault",ZodTransform:"transform",ZodEnum:"enum",ZodIntersection:"intersection",ZodLazy:"lazy",ZodLiteral:"literal",ZodNever:"never",ZodNull:"null",ZodNullable:"nullable",ZodNumber:"number",ZodNonOptional:"nonoptional",ZodObject:"object",ZodOptional:"optional",ZodPipe:"pipe",ZodReadonly:"readonly",ZodRecord:"record",ZodString:"string",ZodTuple:"tuple",ZodType:"type",ZodUnion:"union",ZodDiscriminatedUnion:"union",ZodUnknown:"unknown",ZodVoid:"void",ZodDate:"date",ZodTemplateLiteral:"template_literal"};function Ew($,w){return(Array.isArray(w)?w:[w]).some((_)=>{var v;let U=((v=$===null||$===void 0?void 0:$.def)===null||v===void 0?void 0:v.type)===cf[_];if(_==="ZodDiscriminatedUnion")return U&&"discriminator"in $.def;return U})}function S6($){return $&&"def"in $}class HW{constructor(){this._map=new Map,this._idmap=new Map}add($,...w){let g=w[0];if(this._map.set($,g),g&&typeof g==="object"&&"id"in g){if(this._idmap.has(g.id))throw Error(`ID ${g.id} already exists in the registry`);this._idmap.set(g.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let w=this._map.get($);if(w&&typeof w==="object"&&"id"in w)this._idmap.delete(w.id);return this._map.delete($),this}get($){let w=$._zod.parent;if(w){let g={...this.get(w)??{}};return delete g.id,{...g,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function yf(){return new HW}function BX($){return $===void 0}function mf($,w){let g={};return Object.entries($).forEach(([_,v])=>{if(!w.some((U)=>U===_))g[_]=v}),g}function IX($,w){let g={};return Object.entries($).forEach(([_,v])=>{if(!w(v,_))g[_]=v}),g}var WW=yf();class Zw{static collectMetadata($,w){let g=this.getMetadataFromRegistry($),_=Object.assign(Object.assign({},g===null||g===void 0?void 0:g._internal),w===null||w===void 0?void 0:w._internal),v=Object.assign(Object.assign({},g===null||g===void 0?void 0:g.param),w===null||w===void 0?void 0:w.param),U=Object.assign(Object.assign(Object.assign(Object.assign({},Object.keys(_).length>0?{_internal:_}:{}),g),w),Object.keys(v).length>0?{param:v}:{});if(Ew($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&S6($._zod.def.innerType))return this.collectMetadata($._zod.def.innerType,U);if(Ew($,"ZodPipe")){let G=$._zod.def.in,D=$._zod.def.out;if(Ew(G,"ZodTransform")&&S6(D))return this.collectMetadata(D,U);if(S6(G))return this.collectMetadata(G,U)}return U}static getMetadata($){return this.collectMetadata($)}static getOpenApiMetadata($){let w=this.collectMetadata($);return i6(w!==null&&w!==void 0?w:{},["_internal"])}static getInternalMetadata($){var w;return(w=this.collectMetadata($))===null||w===void 0?void 0:w._internal}static getParamMetadata($){let w=this.collectMetadata($);return Object.assign(Object.assign({},w),{param:Object.assign(Object.assign({},(w===null||w===void 0?void 0:w.description)?{description:w.description}:{}),w===null||w===void 0?void 0:w.param)})}static buildSchemaMetadata($){return IX(mf($,["param","_internal"]),BX)}static buildParameterMetadata($){return IX($,BX)}static applySchemaMetadata($,w){return IX(Object.assign(Object.assign({},$),this.buildSchemaMetadata(w)),BX)}static getRefId($){var w;return(w=this.getInternalMetadata($))===null||w===void 0?void 0:w.refId}static unwrapChained($){return this.unwrapUntil($)}static getDefaultValue($){var w;let g=(w=this.unwrapUntil($,"ZodDefault"))!==null&&w!==void 0?w:this.unwrapUntil($,"ZodPrefault");return g===null||g===void 0?void 0:g._zod.def.defaultValue}static unwrapUntil($,w){if(w&&Ew($,w))return $;if(Ew($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&S6($._zod.def.innerType))return this.unwrapUntil($._zod.def.innerType,w);if(Ew($,"ZodPipe")){let g=$._zod.def.in,_=$._zod.def.out;if(Ew(g,"ZodTransform")&&S6(_))return this.unwrapUntil(_,w);if(S6(g))return this.unwrapUntil(g,w)}return w?void 0:$}static getMetadataFromInternalRegistry($){return WW.get($)}static getMetadataFromRegistry($){let w=this.getMetadataFromInternalRegistry($),g=$.meta();if(!w)return g;let{_internal:_}=w,v=i6(w,["_internal"]),U=g!==null&&g!==void 0?g:{},{id:G,title:D}=U,J=i6(U,["id","title"]);return Object.assign(Object.assign(Object.assign({_internal:Object.assign(Object.assign({},G?{refId:G}:{}),_)},v),D?{description:D}:{}),J)}static setMetadataInRegistry($,w){WW.add($,w)}}function uw($,w){let g=$[w];if(typeof g!=="function")return;$[w]=function(..._){let v=g.apply(this,_),U=Zw.getMetadataFromRegistry(this);if(U)Zw.setMetadataInRegistry(v,U);return v}}function tf($){if(typeof $.ZodType.prototype.openapi<"u")return;$.ZodType.prototype.openapi=function(...w){let{refId:g,metadata:_,options:v}=df(...w),U=_!==null&&_!==void 0?_:{},{param:G}=U,D=i6(U,["param"]),J=Zw.getMetadataFromRegistry(this),X=J!==null&&J!==void 0?J:{},{_internal:Q}=X,Y=i6(X,["_internal"]),q=Object.assign(Object.assign(Object.assign({},Q),v),g?{refId:g}:void 0),L=Object.assign(Object.assign(Object.assign({},Y),D),(Y===null||Y===void 0?void 0:Y.param)||G?{param:Object.assign(Object.assign({},Y===null||Y===void 0?void 0:Y.param),G)}:void 0),F=new this.constructor(this._def);function H(K){Zw.setMetadataInRegistry(K,Object.assign(Object.assign({},Object.keys(q).length>0?{_internal:q}:void 0),L))}if(H(F),Ew(F,"ZodLazy"))H(this);if(Ew(F,"ZodObject")){let K=Zw.getMetadataFromRegistry(F),f=F.extend;F.extend=function(...S){let u=f.apply(F,S),Z=K!==null&&K!==void 0?K:{},{_internal:i}=Z,c=i6(Z,["_internal"]);return Zw.setMetadataInRegistry(u,{_internal:{extendedFrom:(i===null||i===void 0?void 0:i.refId)?{refId:i.refId,schema:F}:i===null||i===void 0?void 0:i.extendedFrom}}),u.openapi(c)},uw(F,"catchall")}uw(F,"optional"),uw(F,"nullable"),uw(F,"default"),uw(F,"transform"),uw(F,"refine"),uw(F,"length"),uw(F,"min"),uw(F,"max");let V=F.meta;return F.meta=function(...K){let f=V.apply(this,K);if(K[0]){let S=Zw.getMetadataFromInternalRegistry(this);if(S)Zw.setMetadataInRegistry(f,Object.assign(Object.assign({},S),K[0]))}return f},F}}function df($,w,g){if(typeof $==="string")return{refId:$,metadata:w,options:g};return{refId:void 0,metadata:$,options:w}}var LX=tf;LX(b);var LW=T({}).passthrough().openapi({description:"Structured context for the error (varies by error code)"}),VX=T({code:O().openapi({description:"Machine-stable error code from the error catalog",example:"session_not_found"}),message:O().openapi({description:"Human-readable error description",example:"The requested session does not exist."}),retryable:J$().openapi({description:"Whether clients SHOULD retry this request",example:!1}),details:LW.optional(),fix_hint:O().optional().openapi({description:"Actionable guidance for humans to resolve the error",example:"Verify the session ID is correct."})}).openapi("ErrorObject"),B0=T({code:O().openapi({description:"Machine-stable warning code",example:"partial_data"}),message:O().openapi({description:"Human-readable warning description",example:"Some optional fields were unavailable."}),details:LW.optional()}).openapi("ErrorWarning"),Vl=T({error:VX,trace_id:O().optional().openapi({description:"Distributed tracing correlation ID",example:"trace_abc123"}),request_id:O().openapi({description:"Unique request identifier",example:"req_xyz789"}),warnings:v$(B0).optional().openapi({description:"Non-fatal warnings returned alongside the error"})}).openapi("ErrorResponse"),xw=O().min(1).max(64).regex(/^(?:[a-zA-Z0-9_-]+|[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)$/,'repo_id must be a configured repo id or an "owner/repo" identifier').openapi({description:'Repository identifier or canonical "owner/repo" handle',example:"acme/docs"}),Xw=O().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/,"git_sha must be 40 or 64 lowercase hex characters").openapi({description:"Full Git SHA (40 chars for SHA-1, 64 for SHA-256)",example:"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b"}),U$=O().min(1).max(512).refine(($)=>!$.startsWith("/"),"file_path must be relative (no leading /)").refine(($)=>!$.includes(".."),"file_path must not contain path traversal (..)").refine(($)=>!$.includes("\x00"),"file_path must not contain NUL bytes").openapi({description:"Relative file path with no leading slash, traversal, or NUL bytes",example:"docs/guide.md"}),of=T({source_type:Y$("git"),repo_id:xw,git_sha:Xw,file_path:U$}).openapi("GitContentRef"),rf=T({source_type:Y$("upload"),project_id:O().openapi({description:"Project identifier",example:"proj_docs"}),upload_batch_id:O().openapi({description:"Upload batch identifier",example:"upload_20260208"}),file_path:U$.openapi({description:"Path to file in upload batch",example:"spec.md"})}).openapi("UploadContentRef"),G4=fw("source_type",[of,rf]).openapi("ContentRef"),pf=T({type:Y$("session")}).openapi("SessionAnchor"),ef=T({type:Y$("review")}).openapi("ReviewAnchor"),I0=O().regex(/^[a-z2-7]{16}$/,"block_id must be 16 lowercase base32 characters").openapi({description:"16-character lowercase base32 block identifier (truncated SHA-256)",example:"abcdefgh234567ab"}),af=T({type:Y$("block"),block_id:I0}).openapi("BlockAnchor"),sf=T({type:Y$("range"),block_id:I0,start_offset:X$().int().min(0).openapi({description:"Start byte offset within the block"}),end_offset:X$().int().min(0).openapi({description:"End byte offset within the block"})}).openapi("RangeAnchor"),hw=fw("type",[pf,ef,af,sf]).openapi("Anchor"),Fl=O().optional().openapi({description:"Client-generated idempotency key for safe retries",example:"scope:install_abc:op_123"}),VW=T({limit:s$.number().int().min(1).max(100).default(50).optional(),cursor:O().optional()}),jl=T({next_cursor:O().nullable(),has_more:J$()}),qW=20,BW=64,IW=256,$A=/^[a-zA-Z][a-zA-Z0-9_-]*$/,lw=qw(O(),K$()).superRefine(($,w)=>{let g=Object.keys($);if(g.length>qW){w.addIssue({code:z$.custom,message:`Too many keys: ${g.length} exceeds maximum of ${qW}`});return}for(let _ of g){if(_.length<1||_.length>BW){w.addIssue({code:z$.custom,message:`Key "${_}" length ${_.length} is outside range 1-${BW}`,path:[_]});continue}if(!$A.test(_))w.addIssue({code:z$.custom,message:`Key "${_}" must start with a letter and contain only letters, digits, underscores, and hyphens`,path:[_]});let v=$[_];if(typeof v!=="string"){w.addIssue({code:z$.custom,message:`Value for key "${_}" must be a string, got ${typeof v}`,path:[_]});continue}if(v.length>IW)w.addIssue({code:z$.custom,message:`Value for key "${_}" length ${v.length} exceeds maximum of ${IW}`,path:[_]})}}).openapi("FlatJsonbMap"),Kl=lw.optional().default({});var KW=b.object({idempotency:b.enum(["always","keyed","none"]).optional(),retry_classification:b.enum(["safe","transient","manual"]).optional()}).openapi("AgentSurfaceRetrySemantics"),wA=b.object({next_cursor:b.string().nullable().optional(),has_more:b.boolean().optional(),total:b.number().int().nonnegative().optional(),limit:b.number().int().positive().optional(),offset:b.number().int().nonnegative().optional()}).openapi("AgentSurfacePagination"),vA=b.object({artifact_kind:b.string().optional(),non_authoritative:b.boolean().optional(),status:b.string().optional(),target_type:b.string().optional(),target_id:b.string().optional(),provenance:b.object({source_type:b.string().optional(),source_label:b.string().optional(),source_model:b.string().optional()}).optional()}).openapi("AdvisorySurfaceSummary"),gA=b.object({ok:b.literal(!0),request_id:b.string(),result:b.unknown(),warnings:b.array(B0).optional(),pagination:wA.optional(),advisory:vA.optional(),retry:KW.optional()}).openapi("AgentSurfaceSuccessEnvelope"),_A=b.object({ok:b.literal(!1),error:VX,request_id:b.string(),warnings:b.array(B0).optional(),retry:KW.optional()}).openapi("AgentSurfaceErrorEnvelope");function Ow($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function cw($,w){let g=$[w];return typeof g==="string"&&g.trim().length>0?g:void 0}function OW($,w){let g=$[w];return typeof g==="boolean"?g:void 0}function FX($,w){let g=$[w];if(typeof g!=="number"||!Number.isInteger(g)||g<0)return;return g}function NW($){if(!Array.isArray($))return[];return $.flatMap((w)=>{if(typeof w==="string"&&w.trim().length>0)return[{code:"warning",message:w}];let g=Ow(w);if(!g)return[];let _=cw(g,"message");if(!_)return[];let v=cw(g,"code")??"warning",U=Ow(g.details)??void 0;return[{code:v,message:_,...U?{details:U}:{}}]})}function FW($){let w=Ow($);if(!w)return;let g={},_=w.next_cursor;if(typeof _==="string"||_===null)g.next_cursor=_;if(g.next_cursor===void 0&&(typeof w.cursor==="string"||w.cursor===null))g.next_cursor=w.cursor;let v=OW(w,"has_more");if(v!==void 0)g.has_more=v;let U=FX(w,"total");if(U!==void 0)g.total=U;let G=FX(w,"limit");if(G!==void 0&&G>0)g.limit=G;let D=FX(w,"offset");if(D!==void 0)g.offset=D;return Object.keys(g).length>0?g:void 0}function jW($){let w=Ow($);if(!w)return;let g=Ow(w.advisory_artifact)??Ow(w.advisory)??w,_=cw(g,"artifact_kind"),v=OW(g,"non_authoritative"),U=cw(g,"status"),G=Ow(g.target),D=Ow(g.provenance);if(_===void 0&&v===void 0&&G===null&&D===null)return;let J={};if(_!==void 0)J.artifact_kind=_;if(v!==void 0)J.non_authoritative=v;if(U!==void 0)J.status=U;if(G){let X=cw(G,"target_type"),Q=cw(G,"target_id");if(X!==void 0)J.target_type=X;if(Q!==void 0)J.target_id=Q}if(D){let X={},Q=cw(D,"source_type"),Y=cw(D,"source_label"),q=cw(D,"source_model");if(Q!==void 0)X.source_type=Q;if(Y!==void 0)X.source_label=Y;if(q!==void 0)X.source_model=q;if(Object.keys(X).length>0)J.provenance=X}return J}function PW($){if($.operation==="read")return"always";return $.hasIdempotencyKey?"keyed":"none"}function UA($){if(typeof $.retryable==="boolean")return $.retryable;if(typeof $.errorCode==="string"&&U6($.errorCode))return!0;if($.statusCode===0||$.statusCode===429)return!0;return typeof $.statusCode==="number"&&$.statusCode>=500}function Qw($){let w=PW($);return{idempotency:w,retry_classification:w==="none"?"manual":"safe"}}function kW($){let w=PW($);if(!UA($))return{idempotency:w,retry_classification:"manual"};return{idempotency:w,retry_classification:w==="none"?"transient":"safe"}}function nW($,w,g){let _=NW(Ow($)?.warnings),v={ok:!0,request_id:w,result:$,..._.length>0?{warnings:_}:{},...FW($)?{pagination:FW($)}:{},...jW($)?{advisory:jW($)}:{},...g?.retry?{retry:g.retry}:{}};return gA.parse(v),v}function MW($){let w=Ow($.error.details)??void 0,g=NW($.warnings),_={ok:!1,request_id:$.requestId,error:{code:$.error.code,message:$.error.message,retryable:$.error.retryable,request_id:$.requestId,...w?{details:w}:{},...$.error.fix_hint?{fix_hint:$.error.fix_hint}:{}},...g.length>0?{warnings:g}:{},...$.retry?{retry:$.retry}:{}};return _A.parse(_),_}var L0=b.enum(["content","rules"]).openapi("ReviewRole"),V0=b.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi("ReviewState"),zW=b.enum(["draft","published","deprecated"]).openapi("ReviewPublicationStatus"),bA=b.enum(["git","upload"]).openapi("ReviewSourceType"),jX=b.enum(["reviewer","approver","observer","owner"]).openapi("ReviewParticipantRole"),fW=b.enum(["read","comment","approve","admin"]).openapi("ReviewParticipantScope"),AW=b.enum(["pending","invited","active","failed","bounced"]).openapi("ReviewParticipantInviteStatus"),SW=b.enum(["pending","delivered","failed","bounced"]).openapi("ReviewParticipantDeliveryState"),GA=b.enum(["not_started","in_progress","complete"]).openapi("ReviewParticipantReviewStatus"),DA=b.object({email:b.string().email(),name:b.string().max(256).optional(),role:jX,scopes:b.array(fW).min(1)}).openapi("ReviewParticipantInput"),JA=b.object({participant_id:b.string(),email:b.string().email(),roles:b.array(jX),display_name:b.string().nullable(),joined_at:b.string().datetime().nullable(),last_seen_at:b.string().datetime().nullable(),invite_status:AW,review_status:GA,review_completed_at:b.string().datetime().nullable(),magic_link_opened_at:b.string().datetime().nullable(),delivery_state:SW.nullable()}).openapi("ReviewParticipantSummary"),XA=b.object({participant_id:b.string(),email:b.string().email(),roles:b.array(jX),review_link_id:b.string(),scope:fW,expires_at:b.string().datetime().nullable(),revoked_at:b.string().datetime().nullable(),invite_status:AW,delivery_state:SW.nullable()}).openapi("ReviewInvitationSummary"),Ml=b.object({repo_id:xw.optional(),git_sha:Xw.optional(),file_path:U$,document_type:b.enum(["markdown","pdf","image_set"]).default("markdown"),title:b.string().max(512).optional(),source_context:b.record(b.string(),b.unknown()).optional(),extra:b.record(b.string(),b.unknown()).optional(),role:L0.default("content"),applicability:lw.optional(),properties:lw.optional(),identity_restriction:b.enum(["open","participants_only","domain"]).default("open"),allowed_email_domains:b.array(b.string().min(1).max(253)).max(50).optional(),participants:b.array(DA).max(100).optional(),idempotency_key:b.string().max(256).optional(),supersedes_review_id:b.string().optional(),carry_forward_threads:b.boolean().optional(),carry_forward_filter:b.enum(["all","blocking","needs_changes"]).optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),content_body:b.string().max(1048576).optional(),focus_areas:b.array(b.string().max(100)).max(10).optional(),framing:b.string().max(1000).optional(),operator_name:b.string().max(200).optional()}).superRefine(($,w)=>{if($.role!=="rules"&&$.applicability!==void 0&&Object.keys($.applicability).length>0)w.addIssue({code:b.ZodIssueCode.custom,message:"applicability is only valid when role is 'rules'. Content reviews must not specify applicability.",path:["applicability"]});if($.identity_restriction==="domain"&&(!Array.isArray($.allowed_email_domains)||$.allowed_email_domains.length===0))w.addIssue({code:b.ZodIssueCode.custom,message:'allowed_email_domains is required and must be non-empty when identity_restriction is "domain"',path:["allowed_email_domains"]})}).openapi("CreateReviewRequest"),QA=b.object({review_id:b.string(),role:L0,state:V0,publication_status:zW.nullable().optional(),title:b.string().nullable(),file_path:b.string(),block_count:b.number().int().nonnegative(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("ReviewSummary"),zl=b.object({review_id:b.string(),role:L0,state:V0,publication_status:zW.nullable().optional(),source_type:bA,document_type:b.enum(["markdown","pdf","image_set"]),repo_id:b.string().nullable(),git_sha:b.string().nullable(),file_path:b.string(),title:b.string().nullable(),source_context:b.record(b.string(),b.unknown()).nullable(),extra:b.record(b.string(),b.unknown()).nullable(),identity_restriction:b.enum(["open","participants_only","domain"]),allowed_email_domains:b.array(b.string()).nullable(),applicability:b.record(b.string(),b.unknown()),properties:b.record(b.string(),b.unknown()),block_count:b.number().int().nonnegative(),root_review_id:b.string(),supersedes_review_id:b.string().nullable(),superseded_by_review_id:b.string().nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),participants:b.array(JA),invitations:b.array(XA),summary:b.object({total_threads:b.number().int().nonnegative(),open_threads:b.number().int().nonnegative(),blocking_threads:b.number().int().nonnegative(),resolved_threads:b.number().int().nonnegative(),total_findings:b.number().int().nonnegative().optional(),open_findings:b.number().int().nonnegative().optional(),blocking_findings:b.number().int().nonnegative().optional(),resolved_findings:b.number().int().nonnegative().optional()}),request_id:b.string()}).openapi("ReviewDetailResponse"),fl=b.object({role:L0.optional(),state:V0.optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(25)}).openapi("ListReviewsQuery"),Al=b.object({reviews:b.array(QA),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListReviewsResponse"),Sl=b.object({state:V0}).openapi("PatchReviewRequest"),il=b.object({git_sha:b.string().optional(),file_path:b.string().optional(),title:b.string().max(512).optional(),applicability:lw.optional(),properties:lw.optional(),idempotency_key:b.string().max(256).optional(),changes_summary:b.string().max(5000).optional(),carry_forward_threads:b.boolean().optional(),carry_forward_filter:b.enum(["all","blocking","needs_changes"]).optional()}).openapi("ReviseReviewRequest");var iW=b.enum(["suggestion","needs_changes","blocking"]).openapi({description:"Thread severity level"}),TW=b.enum(["inline","append","hero"]).openapi("CommentAttachmentPlacement"),RW=b.enum(["before","after"]).openapi("CommentAttachmentAnchorPosition"),YA=b.object({mime_type:b.string().min(1),width:b.number().int().nullable(),height:b.number().int().nullable(),blurhash:b.string().nullable()}).openapi("CommentAttachmentAsset"),KX=b.object({asset_id:b.string().min(1),sort_order:b.number().int().nonnegative(),placement:TW,alt_text:b.string().max(500).nullable().optional(),caption:b.string().max(2000).nullable().optional(),anchor_block_id:b.string().nullable().optional(),anchor_position:RW.nullable().optional(),spatial_x:b.number().min(0).max(100).nullable().optional(),spatial_y:b.number().min(0).max(100).nullable().optional()}).openapi("CommentAttachmentRequest"),F0=b.object({asset_id:b.string().min(1),sort_order:b.number().int().nonnegative(),placement:TW,alt_text:b.string().nullable(),caption:b.string().nullable(),anchor_block_id:b.string().nullable(),anchor_position:RW.nullable(),spatial_x:b.number().nullable(),spatial_y:b.number().nullable(),asset:YA}).openapi("CommentAttachmentResponse"),CW=b.object({id:b.string().openapi({description:"Unique comment identifier",example:"cmt_xyz789"}),thread_id:b.string(),author_email:b.string().email(),author_name:b.string().nullable(),body_md:b.string().openapi({description:"Comment body in Markdown"}),body_html:b.string().openapi({description:"Rendered HTML of the comment body"}),created_at:b.string().datetime(),updated_at:b.string().datetime().nullable(),version:b.number().int().min(1).openapi({description:"Edit version (starts at 1)"})}).openapi("Comment"),Cl=b.object({anchor:hw.openapi({description:"Where this thread is anchored in the document"}),body_md:b.string().min(1).max(65536).openapi({description:"Initial comment body in Markdown (UTF-8, max 64KB)"}),severity:iW.optional().default("suggestion")}).openapi("CreateThreadRequest"),uW=b.object({id:b.string().openapi({description:"Unique thread identifier",example:"thr_abc123"}),session_id:b.string(),anchor:hw,status:b.enum(["open","resolved"]).openapi({description:"Thread status"}),severity:iW,created_at:b.string().datetime(),updated_at:b.string().datetime(),comment_count:b.number().int().min(1),comments:b.array(CW).optional().openapi({description:"Comments in this thread (included on creation)"})}).openapi("Thread"),ul=uW.openapi("CreateThreadResponse"),El=b.object({body_md:b.string().min(1).max(65536).openapi({description:"Comment body in Markdown (UTF-8, max 64KB)"})}).openapi("CreateCommentRequest"),Zl=CW.openapi("CreateCommentResponse"),xl=b.object({status:b.enum(["open","resolved"])}).openapi("UpdateThreadStatusRequest"),hl=uW.openapi("UpdateThreadStatusResponse"),ll=b.object({session_id:b.string(),thread_id:b.string()}),cl=b.object({session_id:b.string(),thread_id:b.string(),comment_id:b.string()});var d_=b.enum(["open","resolved","withdrawn","wont_fix"]).openapi("FindingStatus"),T6=b.enum(["suggestion","needs_changes","blocking"]).openapi("FindingSeverity"),WA=["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],OX=b.enum(WA).openapi("FindingDecisionState"),HA=b.object({source_rule_release_id:b.string(),compiled_hash:b.string().nullable().optional(),source_rule_revision_id:b.string().nullable().optional(),source_clause_id:b.string().nullable().optional(),source_clause_lineage_id:b.string().nullable().optional(),matched_selectors:b.record(b.string(),b.string()).nullable().optional()}).openapi("RuleBasis"),dl=b.object({anchor:hw,body_md:b.string().min(1).max(65536),severity:T6.optional(),attachments:b.array(KX).max(50).optional(),idempotency_key:b.string().max(256).optional(),source_review_id:b.string().optional(),source_finding_id:b.string().optional(),rule_basis:HA.optional()}).openapi("CreateFindingRequest"),ol=b.object({finding_id:b.string(),comment_id:b.string(),attachments:b.array(F0),request_id:b.string()}).openapi("CreateFindingResponse"),rl=b.object({status:d_.optional(),severity:T6.optional(),block_id:b.string().optional(),q:b.string().max(200).optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(50)}).openapi("ListFindingsQuery"),qA=b.object({finding_id:b.string(),status:d_,severity:T6.nullable(),anchor:hw,comment_count:b.number().int().nonnegative(),body_preview:b.string().nullable().optional(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("FindingSummary"),pl=b.object({findings:b.array(qA),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListFindingsResponse"),BA=b.object({comment_id:b.string(),body_md:b.string(),author_name:b.string().nullable(),author_email:b.string().nullable(),attachments:b.array(F0),created_at:b.string().datetime()}).openapi("FindingComment"),IA=b.object({block_id:b.string(),block_key:b.string().nullable(),block_type:b.string(),properties:b.record(b.string(),b.unknown())}).openapi("FindingBlockContext"),LA=b.object({outcome:OX,decided_at:b.string().datetime(),decided_by:b.string().nullable()}).openapi("FindingDecision"),el=b.object({finding_id:b.string(),review_id:b.string(),status:d_,severity:T6.nullable(),anchor:hw,block_context:IA.nullable(),comments:b.array(BA),decision:LA.nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("FindingDetailResponse"),al=b.object({status:d_.optional(),severity:T6.optional(),expected_version:b.number().int().positive().optional()}).openapi("PatchFindingRequest"),sl=b.object({finding_id:b.string(),review_id:b.string(),status:d_,severity:T6.nullable(),version:b.number().int().positive(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("PatchFindingResponse"),$c=b.object({body_md:b.string().min(1).max(65536),attachments:b.array(KX).max(50).optional(),idempotency_key:b.string().max(256).optional()}).openapi("CreateFindingCommentRequest"),wc=b.object({comment_id:b.string(),attachments:b.array(F0),request_id:b.string()}).openapi("CreateFindingCommentResponse"),vc=b.object({state:OX,rationale_md:b.string().min(1).max(65536).optional(),expected_version:b.number().int().positive().optional()}).openapi("CreateFindingDecisionRequest"),gc=b.object({decision_id:b.string(),finding_id:b.string(),state:OX,request_id:b.string()}).openapi("CreateFindingDecisionResponse"),_c=b.object({evidence_type:b.string().min(1),evidence_json:b.record(b.string(),b.unknown()),dedupe_key:b.string().max(256).optional()}).openapi("CreateFindingEvidenceRequest"),Uc=b.object({evidence_id:b.string(),finding_id:b.string(),type:b.string(),request_id:b.string()}).openapi("CreateFindingEvidenceResponse");var VA=["pattern","canon_disagreement","rule_gap","drafting_recommendation"],NX=b.enum(VA).openapi("GovernanceSignalKind"),FA=["new","triaged","accepted_for_drafting","dismissed","converted","snoozed"],o_=b.enum(FA).openapi("GovernanceSignalState");var EW=b.object({target_type:b.string().trim().min(1).max(64),target_id:b.string().trim().min(1).max(256),target_context:b.object({review_id:b.string().trim().min(1).max(256).optional(),block_id:b.string().trim().min(1).max(256).optional()}).strict().optional()}).strict().openapi("GovernanceSignalTarget"),ZW=b.object({source_type:b.enum(["human","agent"]),source_label:b.string().trim().min(1).max(256),source_model:b.string().trim().min(1).max(256).optional(),source_harness:b.string().trim().min(1).max(256).optional(),submitted_by:b.string().trim().min(1).max(256),submitted_at:b.string().datetime()}).strict().openapi("GovernanceSignalProvenance"),xW=b.object({export_sha256:b.string().regex(/^[0-9a-f]{64}$/).optional(),rulepack_sha256:b.string().regex(/^[0-9a-f]{64}$/).optional(),source_content_sha256:b.string().regex(/^[0-9a-f]{64}$/).optional(),basis_review_ids:b.array(b.string().trim().min(1).max(256)).optional(),basis_finding_ids:b.array(b.string().trim().min(1).max(256)).optional(),source_rule_refs:b.array(b.string().trim().min(1).max(256)).optional(),rationale:b.string().trim().min(1).max(8000),custom:b.record(b.string(),b.string()).optional()}).strict().openapi("GovernanceSignalBasis"),hW=b.object({body_md:b.string().min(1).max(65536),structured_data:b.record(b.string(),b.unknown()).optional(),evidence_refs:b.array(b.string().trim().min(1).max(512)).optional(),confidence:b.number().min(0).max(1).optional(),severity_hint:b.string().trim().min(1).max(32).optional()}).strict().openapi("GovernanceSignalPayload"),j0=b.object({severity:b.string().trim().min(1).max(64).nullable(),affected_rule_document_ids:b.array(b.string().trim().min(1).max(256)),grouping_id:b.string().trim().min(1).max(256).nullable()}).strict().openapi("GovernanceSignalTriageMetadata"),jA=b.string().trim().min(1).max(256).openapi("GovernanceSignalId"),Dc=b.object({signal_id:jA,kind:NX,state:o_,workspace_id:b.string().trim().min(1).max(256),target:EW,review_id:b.string().trim().min(1).max(256).nullable(),provenance:ZW,basis:xW.nullable(),payload:hW,triage_metadata:j0.nullable(),dismissal_reason:b.string().trim().min(1).max(8000).nullable(),snooze_reason:b.string().trim().min(1).max(8000).nullable(),re_triage_date:b.string().datetime().nullable(),converted_working_draft_ids:b.array(b.string().trim().min(1).max(256)).nullable(),version:b.number().int().positive(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("GovernanceSignal"),Jc=b.object({kind:NX,workspace_id:b.string().trim().min(1).max(256),target:EW,provenance:ZW,basis:xW.optional(),payload:hW,review_id:b.string().trim().min(1).max(256).optional(),idempotency_key:b.string().trim().min(1).max(256).optional()}).strict().openapi("CreateGovernanceSignalRequest"),Xc=b.object({workspace_id:b.string().trim().min(1).max(256).optional(),review_id:b.string().trim().min(1).max(256).optional(),kind:NX.optional(),state:o_.optional(),submitted_by:b.string().trim().min(1).max(256).optional(),limit:b.coerce.number().int().min(1).max(200).default(50),offset:b.coerce.number().int().min(0).default(0)}).strict().openapi("GovernanceSignalListQuery"),Qc=b.object({target_state:o_,expected_version:b.number().int().positive().optional(),reason:b.string().trim().min(1).max(8000).optional(),triage_metadata:j0.optional(),re_triage_date:b.string().datetime().optional(),converted_working_draft_ids:b.array(b.string().trim().min(1).max(256)).optional(),idempotency_key:b.string().trim().min(1).max(256).optional()}).strict().openapi("TransitionGovernanceSignalRequest");var PX=b.enum(["rule","exception","definition","example","rationale","procedure","heading","metadata"]).openapi("ClauseKind"),kX=b.enum(["introduced","carried_forward","changed","retired","replaced"]).openapi("DerivationOutcome"),Hc=b.object({source_rule_revision_id:b.string(),clause_id:b.string(),clause_lineage_id:b.string(),carried_forward_from_clause_id:b.string().nullable(),block_id:b.string(),block_key:b.string().nullable(),block_index:b.number().int().nonnegative(),kind:PX,strength:b.enum(["must","should","may","must_not"]).nullable(),category:b.string().nullable(),canonical_plaintext:b.string(),selectors:b.record(b.string(),b.string()).default({}),parser_version:b.string(),extractor_version:b.string(),selector_schema_version:b.string(),source_map:b.object({start_offset:b.number().int().nonnegative(),end_offset:b.number().int().nonnegative(),source_line:b.number().int().positive().nullable()}).nullable().default(null),derivation_receipt_hash:b.string()}).openapi("DerivedRuleClause"),qc=b.object({clause_id:b.string(),outcome:kX,source_clause_id:b.string().nullable(),source_revision_id:b.string().nullable(),derivation_method:b.enum(["explicit","algorithmic"]),derived_at:b.string().datetime(),derived_by:b.string()}).openapi("DerivationReceipt");var KA={clause_count:8,selector_count:3,precedence_clause_count:4,exception_change_count:1,required_approvals:1},lW=b.object({clause_count:b.number().int().min(1).default(8),selector_count:b.number().int().min(1).default(3),precedence_clause_count:b.number().int().min(1).default(4),exception_change_count:b.number().int().min(1).default(1),required_approvals:b.number().int().min(1).default(1)}).openapi("ReleaseVerificationThresholds"),OA=b.enum(["active","superseded","rolled_back"]).openapi("RuleReleaseStatus"),r_=b.object({rule_release_id:b.string(),release_version:b.number().int().positive(),workspace_id:b.string(),included_rule_revision_ids:b.array(b.string()),compiled_hash:b.string(),status:OA,effective_at:b.string().datetime(),activated_at:b.string().datetime(),activated_by:b.string(),supersedes_release_id:b.string().nullable(),rollback_of_release_id:b.string().nullable(),change_note:b.string().nullable().default(null),source_candidate_id:b.string(),created_at:b.string().datetime()}).openapi("RuleRelease"),Lc=b.enum(["unapproved_candidate","stale_candidate","workspace_frozen","no_prior_release","concurrent_activation","verification_required"]);var Vc=b.object({release_candidate_id:b.string(),idempotency_key:b.string().max(256).optional()}).strict().openapi("ActivateReleaseRequest"),Fc=b.object({target_release_id:b.string().optional(),reason:b.string().min(1).max(1024),idempotency_key:b.string().max(256).optional()}).strict().openapi("RollbackReleaseRequest"),jc=b.object({rule_release_id:b.string(),release_version:b.number().int().positive(),status:b.literal("active"),supersedes_release_id:b.string().nullable(),effective_at:b.string().datetime(),request_id:b.string()}).openapi("ActivateReleaseResponse"),Kc=b.object({rule_release_id:b.string(),release_version:b.number().int().positive(),status:b.literal("active"),rollback_of_release_id:b.string(),change_note:b.string().nullable().default(null),effective_at:b.string().datetime(),request_id:b.string()}).openapi("RollbackReleaseResponse"),cW=b.object({workspace_id:b.string(),active_rule_release_id:b.string().nullable(),activation_frozen:b.boolean(),last_freeze_change_reason:b.string().nullable().default(null),last_freeze_change_actor_id:b.string().nullable().default(null),last_freeze_change_at:b.string().datetime().nullable().default(null),require_publisher_activator_separation:b.boolean().default(!1),updated_at:b.string().datetime().nullable(),verification_thresholds:lW.default(KA)}).openapi("ReleaseControlState"),Oc=b.object({verification_thresholds:lW.optional(),require_publisher_activator_separation:b.boolean().optional()}).refine(($)=>$.verification_thresholds!==void 0||$.require_publisher_activator_separation!==void 0,{message:"At least one release control field must be provided for update",path:[]}).strict().openapi("UpdateReleaseControlRequest"),Nc=b.object({limit:b.coerce.number().int().min(1).max(100).default(25)}).strict().openapi("ListRuleReleasesQuery"),Pc=b.object({items:b.array(r_),control:cW,request_id:b.string()}).openapi("ListRuleReleasesResponse"),yW=b.object({reason:b.string().min(1).max(1024).optional(),idempotency_key:b.string().max(256).optional()}).strict(),kc=yW.openapi("FreezeReleaseRequest"),nc=yW.openapi("UnfreezeReleaseRequest"),nX=b.object({control:cW,request_id:b.string()}),Mc=nX.openapi("FreezeReleaseResponse"),zc=nX.openapi("UnfreezeReleaseResponse"),fc=nX.openapi("UpdateReleaseControlResponse");var MX=["open","claimed","in_progress","blocked","done","canceled","expired"];var R6=b.enum(MX).openapi("WorkItemState"),K0=["review_task","verification_task","triage_task","approval_task","manual_task"],zX=b.enum(K0).openapi("WorkItemKind"),O0=["assigned","reviewer_pool","watchers","external_invite"],p_=b.enum(O0).openapi("WorkItemAudienceMode"),N0=["review_requested","verification_needed","challenge_received","draft_feedback","signal_triage","activation_approval","manual_assignment"],fX=b.enum(N0).openapi("WorkItemReasonCode"),AX=["my_work","team_queue","activity","external_entrypoint"],mW=b.enum(AX).openapi("WorkItemQueueSurface");var SX=["claim","release","start","block","unblock","complete","cancel","expire"],NA=b.enum(SX).openapi("WorkItemTransitionAction"),iX=["completed","approved","rejected","needs_changes"],PA=b.enum(iX).openapi("WorkItemCompletionOutcome"),P0=b.string().regex(/^wi_[0-9A-HJKMNP-TV-Z]{26}$/).openapi("WorkItemId"),tW=b.object({target_type:b.string().min(1).max(64),target_id:b.string().min(1).max(128)}).strict().openapi("WorkItemTarget");var dW=b.object({title:b.string().min(1).max(256),kind:zX,reason_code:fX,audience_mode:p_,blocking:b.boolean().default(!0),priority:b.number().int().min(0).max(9).default(5),target:tW,assignee_id:b.string().min(1).max(128).optional(),steward_group:b.string().min(1).max(128).optional(),due_at:b.string().datetime().optional(),metadata:b.record(b.string(),b.unknown()).optional(),idempotency_key:b.string().max(256).optional()}).strict().superRefine(($,w)=>{if($.audience_mode==="assigned"&&!$.assignee_id)w.addIssue({code:b.ZodIssueCode.custom,message:'assignee_id is required when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode!=="assigned"&&$.assignee_id)w.addIssue({code:b.ZodIssueCode.custom,message:'assignee_id is only valid when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode==="watchers"&&$.blocking)w.addIssue({code:b.ZodIssueCode.custom,message:"watchers work items must be non-blocking",path:["blocking"]})}).openapi("CreateWorkItemRequest"),oW=b.object({work_item_id:P0,workspace_id:b.string().min(1).max(128),title:b.string().min(1).max(256),description:b.string().max(4000).optional(),kind:zX,reason_code:fX,state:R6,audience_mode:p_,blocking:b.boolean(),target:tW,priority:b.number().int().min(0).max(9),assignee_id:b.string().nullable(),claimant_id:b.string().nullable(),claimed_at:b.string().datetime().nullable(),due_at:b.string().datetime().nullable(),expires_at:b.string().datetime().nullable(),steward_group:b.string().nullable(),metadata:b.record(b.string(),b.unknown()),version:b.number().int().positive(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).strict(),ic=oW.superRefine(($,w)=>{if($.audience_mode==="assigned"&&!$.assignee_id)w.addIssue({code:b.ZodIssueCode.custom,message:'assignee_id is required when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode!=="assigned"&&$.assignee_id)w.addIssue({code:b.ZodIssueCode.custom,message:'assignee_id is only valid when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode==="watchers"&&$.blocking)w.addIssue({code:b.ZodIssueCode.custom,message:"watchers work items must be non-blocking",path:["blocking"]});if($.state==="open"&&$.claimant_id)w.addIssue({code:b.ZodIssueCode.custom,message:"open work items must not have a claimant_id",path:["claimant_id"]});if($.state==="open"&&$.claimed_at)w.addIssue({code:b.ZodIssueCode.custom,message:"open work items must not have a claimed_at timestamp",path:["claimed_at"]});if(["claimed","in_progress","blocked"].includes($.state)&&!$.claimant_id)w.addIssue({code:b.ZodIssueCode.custom,message:`${$.state} work items require a claimant_id`,path:["claimant_id"]});if($.claimant_id&&!$.claimed_at)w.addIssue({code:b.ZodIssueCode.custom,message:"claimed_at is required when claimant_id is present",path:["claimed_at"]});if(!$.claimant_id&&$.claimed_at)w.addIssue({code:b.ZodIssueCode.custom,message:"claimant_id is required when claimed_at is present",path:["claimant_id"]})}).openapi("WorkItem"),kA=oW.pick({work_item_id:!0,title:!0,kind:!0,reason_code:!0,state:!0,audience_mode:!0,blocking:!0,target:!0,priority:!0,assignee_id:!0,claimant_id:!0,due_at:!0,version:!0,created_at:!0,updated_at:!0}).extend({queue_surface:mW,why_in_queue:b.string().min(1).max(256)}).openapi("WorkItemSummary"),rW=b.object({state:R6.optional(),kind:zX.optional(),reason_code:fX.optional(),audience_mode:p_.optional(),queue_surface:mW.optional(),assignee_id:b.string().max(128).optional(),claimant_id:b.string().max(128).optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(25)}).openapi("ListWorkItemsQuery"),Tc=b.object({items:b.array(kA),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListWorkItemsResponse"),pW=b.object({action:NA,expected_version:b.number().int().positive().optional(),idempotency_key:b.string().max(256).optional(),blocking_reason:b.string().min(1).max(256).optional(),cancellation_reason:b.string().min(1).max(256).optional(),completion_outcome:PA.optional(),comment:b.string().max(4000).optional()}).strict().superRefine(($,w)=>{if($.action==="block"&&!$.blocking_reason)w.addIssue({code:b.ZodIssueCode.custom,message:"blocking_reason is required when action is block",path:["blocking_reason"]});if($.action==="cancel"&&!$.cancellation_reason)w.addIssue({code:b.ZodIssueCode.custom,message:"cancellation_reason is required when action is cancel",path:["cancellation_reason"]});if($.action==="complete"&&!$.completion_outcome)w.addIssue({code:b.ZodIssueCode.custom,message:"completion_outcome is required when action is complete",path:["completion_outcome"]})}).openapi("TransitionWorkItemRequest"),Rc=b.object({work_item_id:b.string(),from_state:R6,to_state:R6,claimant_id:b.string().nullable(),version:b.number().int().positive(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("TransitionWorkItemResponse");var sW=b.enum(["must","should","may","must_not"]).openapi("RuleStrength"),nA=b.enum(["error","warning","info"]).openapi("RuleCheckFindingSeverity"),MA=b.enum(["document"]).openapi("RuleCheckAnchorMode"),zA=b.object({rule_text:b.string(),strength:sW,category:b.string().nullable(),source_review_id:b.string(),block_id:b.string(),block_index:b.number().int().nonnegative(),specificity:b.number().int().nonnegative(),applicability:b.record(b.string(),b.string())}).openapi("MatchedRuleResponse"),$7=b.object({latest_rule_session_updated_at:b.string().datetime().nullable(),contributing_session_count:b.number().int().nonnegative(),total_rule_count:b.number().int().nonnegative()}).openapi("RuleBundleFreshness"),cc=b.object({format:b.enum(["json","text","prompt"]).default("json"),limit:b.coerce.number().int().min(1).max(200).default(50),offset:b.coerce.number().int().nonnegative().default(0),collection_id:b.string().optional()}).openapi("ListRulesQuery"),yc=b.object({rules:b.array(zA),total:b.number().int().nonnegative(),limit:b.number().int().positive(),offset:b.number().int().nonnegative(),freshness:$7,compiled_hash:b.string(),request_id:b.string()}).openapi("ListRulesResponse"),mc=b.object({content:b.string().min(1).max(1048576),properties:lw.optional().default({}),collection_id:b.string().optional(),idempotency_key:b.string().max(256).optional()}).strict().openapi("RuleCheckRequest"),fA=b.object({block_index:b.number().int().nonnegative(),severity:nA,message:b.string(),rule_ref:p1.optional()}).openapi("RuleCheckFinding"),AA=b.object({total:b.number().int().nonnegative(),blocking:b.number().int().nonnegative(),warnings:b.number().int().nonnegative(),suggestions:b.number().int().nonnegative()}).openapi("RuleCheckSummary"),tc=b.object({findings:b.array(fA),summary:AA,anchor_mode:MA.optional(),rules_evaluated:b.number().int().nonnegative(),freshness:$7,compiled_hash:b.string(),request_id:b.string()}).openapi("RuleCheckResponse"),SA=b.object({source:b.enum(["manual","findings","external"]),source_review_id:b.string().optional(),source_label:b.string().max(256).optional()}).openapi("RuleImportProvenance"),dc=b.object({content:b.string().min(1).max(524288),title:b.string().max(512).optional(),applicability:lw.optional(),provenance:SA.optional(),preview:b.boolean().default(!1),idempotency_key:b.string().max(256).optional()}).strict().openapi("RuleImportRequest"),w7=b.object({source:b.enum(["manual","findings","external"]),source_review_id:b.string().optional(),source_label:b.string().max(256).optional(),content_bytes:b.number().int().positive(),review_title:b.string().nullable()}).openapi("RuleImportMetadata"),v7=b.object({block_index:b.number().int().nonnegative(),strength:sW,category:b.string().nullable(),plaintext:b.string()}).openapi("ParsedRuleBlock"),iA=b.object({preview:b.literal(!0),parsed_rules:b.array(v7),total_rules:b.number().int().nonnegative(),warnings:b.array(b.string()),import_metadata:w7,request_id:b.string()}).openapi("RuleImportPreviewResponse"),TA=b.object({preview:b.literal(!1),review_id:b.string(),state:b.literal("draft"),parsed_rules:b.array(v7),total_rules:b.number().int().nonnegative(),warnings:b.array(b.string()),import_metadata:w7,request_id:b.string()}).openapi("RuleImportCreateResponse"),oc=b.discriminatedUnion("preview",[iA,TA]),g7=b.enum(["finding_seeded","curated_feedback","advisory_seeded","direct_authored","imported"]).openapi("RuleInspectionOriginType"),RA=b.object({finding_id:b.string(),review_id:b.string(),review_title:b.string().nullable(),block_id:b.string().nullable(),body_excerpt:b.string().nullable(),severity:b.string().nullable(),created_at:b.string().datetime()}).openapi("RuleInspectionSourceFinding"),CA=b.object({review_id:b.string(),title:b.string().nullable(),file_path:b.string().nullable(),finding_count:b.number().int().nonnegative(),created_at:b.string().datetime()}).openapi("RuleInspectionSourceReview"),uA=b.object({artifact_id:b.string(),artifact_kind:b.string(),source_label:b.string().nullable(),source_model:b.string().nullable(),confidence:b.number().nullable(),body_excerpt:b.string().nullable(),adopted_at:b.string().datetime(),adopted_by:b.string().nullable()}).openapi("RuleInspectionSourceAdvisory"),eW=b.object({review_id:b.string(),title:b.string().nullable(),state:b.string(),published_at:b.string().datetime().nullable(),superseded_at:b.string().datetime().nullable()}).openapi("RuleInspectionLineageLink"),EA=b.object({root_review_id:b.string(),is_root:b.boolean(),predecessor:eW.nullable(),successor:eW.nullable(),revision_depth:b.number().int().positive()}).openapi("RuleInspectionLineage"),ZA=b.object({adopted_review_count:b.number().int().nonnegative(),total_findings:b.number().int().nonnegative(),governance_signal_count:b.number().int().nonnegative(),challenges_received:b.number().int().nonnegative(),action_receipt_count:b.number().int().nonnegative()}).openapi("RuleInspectionDownstream"),xA=b.object({total_signals:b.number().int().nonnegative(),open_signals:b.number().int().nonnegative(),dismissed_signals:b.number().int().nonnegative(),converted_signals:b.number().int().nonnegative(),last_signaled_at:b.string().datetime().nullable()}).openapi("RuleInspectionChallengeSummary"),hA=b.object({work_item_id:b.string(),state:R6,audience_mode:p_,assignee_id:b.string().nullable(),claimant_id:b.string().nullable(),steward_group:b.string().nullable(),updated_at:b.string().datetime()}).openapi("RuleInspectionOpenChallengeWorkItem"),lA=b.object({signal_id:b.string(),state:o_,submitted_by:b.string(),basis_rationale:b.string().nullable(),affected_rule_document_ids:b.array(b.string()),triage_metadata:j0.nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),work_item:hA.nullable()}).openapi("RuleInspectionOpenChallenge"),rc=b.object({review_id:b.string(),title:b.string().nullable(),state:b.string(),file_path:b.string().nullable(),block_count:b.number().int().nonnegative(),active_block_count:b.number().int().nonnegative(),origin_type:g7,source_findings:b.array(RA),source_reviews:b.array(CA),source_advisories:b.array(uA),seeded_by:b.string().nullable(),seeded_at:b.string().datetime().nullable(),evidence_summary:b.string().nullable(),first_live_release:r_.nullable(),current_release:r_.nullable(),release_membership:b.array(r_),lineage:EA,downstream:ZA,challenge_summary:xA,open_challenges:b.array(lA),request_id:b.string()}).openapi("RuleReviewInspectionResponse"),cA=b.object({introduced_clause_count:b.number().int().nonnegative(),carried_forward_clause_count:b.number().int().nonnegative(),changed_clause_count:b.number().int().nonnegative(),retired_clause_count:b.number().int().nonnegative(),replaced_clause_count:b.number().int().nonnegative(),selector_changed_clause_count:b.number().int().nonnegative()}).openapi("RuleReviewDiffSummary"),yA=b.object({outcome:kX,clause_lineage_id:b.string(),kind:PX,block_key:b.string().nullable(),current_clause_id:b.string().nullable(),previous_clause_id:b.string().nullable(),current_plaintext:b.string().nullable(),previous_plaintext:b.string().nullable(),selectors_changed:b.boolean()}).openapi("RuleReviewDiffClause"),pc=b.object({review_id:b.string(),predecessor_review_id:b.string().nullable(),summary:cA,clauses:b.array(yA),request_id:b.string()}).openapi("RuleReviewDiffResponse"),_7=b.enum(["7d","14d","30d","all"]).openapi("RuleEvidenceWindow"),aW=b.object({finding_seeded:b.number().int().nonnegative(),curated_feedback:b.number().int().nonnegative(),advisory_seeded:b.number().int().nonnegative(),direct_authored:b.number().int().nonnegative(),imported:b.number().int().nonnegative()}).openapi("RuleProvenanceOriginBreakdown"),mA=b.object({rule_session_id:b.string(),rule_session_name:b.string().nullable(),origin_type:g7,published_at:b.string().datetime().nullable()}).openapi("RuleProvenanceLatestFeedbackRule"),U7=b.object({tenant_id:b.string(),by_origin:aW,active_by_origin:aW,feedback_originated_count:b.number().int().nonnegative(),feedback_originated_active_count:b.number().int().nonnegative(),feedback_origin_rate:b.number().min(0).max(1),latest_feedback_rule:mA.nullable(),computed_at:b.string().datetime()}).openapi("RuleProvenanceAggregate"),ec=b.object({provenance:U7,request_id:b.string()}).openapi("RuleProvenanceAggregateResponse"),tA=b.object({tenant_id:b.string(),window:_7,window_start:b.string().datetime(),window_end:b.string().datetime(),total_content_reviews:b.number().int().nonnegative(),adopted_reviews:b.number().int().nonnegative(),adoption_rate:b.number().min(0).max(1),active_rule_sessions:b.number().int().nonnegative(),active_rule_blocks:b.number().int().nonnegative(),adopted_rule_blocks:b.number().int().nonnegative(),prior_window_adoption_rate:b.number().min(0).max(1).nullable(),adoption_rate_delta:b.number().nullable(),computed_at:b.string().datetime()}).openapi("RuleEvidenceAdoptionRollup"),ac=b.object({tenant_id:b.string(),window:_7,window_start:b.string().datetime(),window_end:b.string().datetime(),adoption:tA,total_active_rules:b.number().int().nonnegative(),zero_use_rules:b.number().int().nonnegative(),high_trigger_rules:b.number().int().nonnegative(),low_trigger_rules:b.number().int().nonnegative(),rules_published_in_window:b.number().int().nonnegative(),rules_superseded_in_window:b.number().int().nonnegative(),rules_deprecated_in_window:b.number().int().nonnegative(),total_findings_in_window:b.number().int().nonnegative(),resolved_findings_in_window:b.number().int().nonnegative(),unresolved_findings_in_window:b.number().int().nonnegative(),false_positive_findings_in_window:b.number().int().nonnegative(),provenance:U7,computed_at:b.string().datetime(),request_id:b.string()}).openapi("RuleEvidenceRollupResponse");var TX=b.enum(["draft","in_review","revising","ready_to_publish","withdrawn"]).openapi("WorkingDraftState");var wy=b.object({target_state:TX,idempotency_key:b.string().max(256).optional()}).strict().openapi("WorkingDraftTransitionRequest"),vy=b.object({draft_id:b.string(),previous_state:TX,state:TX,version:b.number().int().positive(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("WorkingDraftTransitionResponse"),gy=b.enum(["created","active","closed","superseded","archived"]).openapi("RuleReviewState");var _y=b.enum(["unpublished","published","superseded","deprecated"]).openapi("RuleRevisionState");var Gy=b.object({require_approval_before_publish:b.boolean().default(!1),require_publisher_activator_separation:b.boolean().default(!1),scoped_publish_enabled:b.boolean().default(!1),emergency_freeze:b.boolean().default(!1)}).openapi("GovernanceControls");var Dy=b.object({identity:b.string(),workspace_id:b.string().default("*"),selector_domain:b.string().default("*")}).openapi("PublishPermissionEntry"),Jy=b.object({allowed:b.boolean(),denial_reason:b.enum(["approval_required","publisher_activator_same_identity","publish_scope_denied","emergency_freeze_active"]).nullable(),denial_message:b.string().nullable()}).openapi("GovernanceAuthCheckResult");var k0=b.enum(["manifest","structured","text","diff","chunk"]).openapi("RuleRetrievalMode"),RX=b.enum(["workspace","collection","review","file"]).openapi("RuleRetrievalScope"),Yy=b.object({mode:k0,release_id:b.string().optional(),scope:RX.default("workspace"),collection_id:b.string().optional(),review_id:b.string().optional(),file_path:b.string().optional(),properties:b.record(b.string(),b.string()).optional(),token_budget:b.number().int().positive().optional()}).openapi("RuleRetrievalQuery"),dA=b.object({rule_document_id:b.string(),title:b.string().nullable(),revision_id:b.string(),clause_count:b.number().int().nonnegative(),strength_breakdown:b.object({must:b.number().int().nonnegative(),should:b.number().int().nonnegative(),may:b.number().int().nonnegative(),must_not:b.number().int().nonnegative()}),applicability:b.record(b.string(),b.string()),published_at:b.string().datetime().nullable()}),n0=b.object({mode:b.literal("manifest"),release_id:b.string(),documents:b.array(dA),total_documents:b.number().int().nonnegative(),total_clauses:b.number().int().nonnegative(),compiled_hash:b.string(),request_id:b.string()}).openapi("RuleManifestResponse"),oA=b.object({clause_id:b.string(),clause_lineage_id:b.string(),document_id:b.string(),block_id:b.string(),block_index:b.number().int().nonnegative(),kind:b.string(),strength:b.enum(["must","should","may","must_not"]).nullable(),category:b.string().nullable(),plaintext:b.string(),selectors:b.record(b.string(),b.string())}),M0=b.object({mode:b.literal("structured"),release_id:b.string(),clauses:b.array(oA),total_clauses:b.number().int().nonnegative(),compiled_hash:b.string(),request_id:b.string()}).openapi("RuleStructuredResponse"),z0=b.object({mode:b.literal("text"),release_id:b.string(),text:b.string(),total_clauses:b.number().int().nonnegative(),compiled_hash:b.string(),request_id:b.string()}).openapi("RuleTextResponse"),rA=b.object({clause_lineage_id:b.string(),outcome:b.enum(["introduced","carried_forward","changed","retired","replaced"]),before:b.string().nullable(),after:b.string().nullable(),strength_before:b.enum(["must","should","may","must_not"]).nullable(),strength_after:b.enum(["must","should","may","must_not"]).nullable()}),f0=b.object({mode:b.literal("diff"),from_release_id:b.string(),to_release_id:b.string(),changes:b.array(rA),total_changes:b.number().int().nonnegative(),request_id:b.string()}).openapi("RuleDiffResponse"),A0=b.object({mode:b.literal("chunk"),release_id:b.string(),chunks:b.array(b.object({chunk_index:b.number().int().nonnegative(),text:b.string(),clause_count:b.number().int().nonnegative(),token_estimate:b.number().int().nonnegative()})),total_chunks:b.number().int().nonnegative(),total_clauses:b.number().int().nonnegative(),compiled_hash:b.string(),request_id:b.string()}).openapi("RuleChunkResponse"),Wy=b.discriminatedUnion("mode",[n0,M0,z0,f0,A0]),Hy=b.object({error:b.object({code:b.literal("invalid_retrieval_mode"),message:b.string(),retryable:b.boolean(),details:b.object({valid_modes:b.array(k0)})}),request_id:b.string()}).openapi("RuleRetrievalInvalidModeError");var pA=["must","should","may","must_not","exception_must","exception_should","definition","example","rationale","procedure"],eA=b.enum(pA).openapi("ClauseMarker");var aA=b.object({title:b.string().min(1).max(512),owner:b.string().min(1).max(256),selectors:b.record(b.string(),b.string()).optional(),review_cadence:b.string().max(64).optional(),version:b.string().max(64).optional(),status:b.enum(["draft","active","deprecated"]).optional(),steward_group:b.string().max(256).optional(),applicability:b.record(b.string(),b.string()).optional()}).openapi("RuleDocumentFrontmatter"),Iy=b.object({selectors:b.record(b.string(),b.string()),scope:b.enum(["section","clause"]).default("section")}).openapi("TsSelectorsDirective"),sA=b.object({marker:eA,kind:b.string(),strength:b.enum(["must","should","may","must_not"]).nullable(),plaintext:b.string(),block_index:b.number().int().nonnegative(),effective_selectors:b.record(b.string(),b.string()),owner:b.string().nullable().optional(),evidence_ref:b.string().nullable().optional()}).openapi("ParsedClause"),Ly=b.object({frontmatter:aA,clauses:b.array(sA),total_clauses:b.number().int().nonnegative(),warnings:b.array(b.string()),parser_version:b.string()}).openapi("RuleDocumentParseResult"),Vy=b.object({error:b.object({code:b.enum(["missing_frontmatter","invalid_frontmatter","missing_required_field","unknown_clause_marker","invalid_selector_namespace"]),message:b.string(),line:b.number().int().positive().nullable(),field:b.string().nullable()})}).openapi("RuleDocumentParseError");var e_=b.string().min(1).max(36).openapi("ReviewSetId"),C6=b.enum(["git","upload"]).openapi("ReviewSetSourceType"),S0=b.enum(["review_set","release_bundle","packet"]).openapi("ReviewSetKind"),b7=b.enum(["active","closed","archived","deleted"]).openapi("ReviewSetState"),$S=b.enum(["topo","lex","lex_fallback"]).openapi("ReviewSetOrderingMethod"),wS=b.enum(["reviewer","approver"]).openapi("ReviewSetParticipantRole"),vS=b.object({email:b.string().email(),roles:b.array(wS).min(1)}).openapi("ReviewSetParticipant"),gS=b.union([b.string(),b.object({review_id:b.string().optional(),session_id:b.string().optional(),required:b.boolean().optional()}).refine(($)=>typeof $.review_id==="string"||typeof $.session_id==="string",{message:"review_id is required for review entries",path:["review_id"]})]).openapi("ReviewSetSessionEntry"),_S=b.object({repo_id:xw,git_sha:Xw,file_path:U$,required:b.boolean().optional()}).openapi("ReviewSetGitFileEntry"),US=b.object({project_id:b.string(),upload_batch_id:b.string(),file_path:U$,required:b.boolean().optional()}).openapi("ReviewSetUploadFileEntry"),bS=b.union([_S,US]).openapi("ReviewSetFileEntry"),GS=b.object({allow_mixed_shas:b.boolean().optional(),require_all_files_reviewed:b.boolean().optional()}).openapi("ReviewSetConfig"),Ky=b.object({title:b.string().optional(),kind:S0.optional(),source_type:C6,reviews:b.array(gS).max(200).optional(),files:b.array(bS).max(200).optional(),participants:b.array(vS).max(100).optional(),recipe_json:b.record(b.string(),b.unknown()).optional(),config:GS.optional()}).openapi("CreateReviewSetRequest"),DS=b.object({review_id:b.string(),file_path:U$,position:b.number().int().nonnegative(),required:b.boolean()}).openapi("ReviewSetItem"),JS=b.object({email:b.string().email(),roles:b.array(b.string()),review_url:b.string().url(),delivery:b.object({channel:b.literal("email"),state:b.literal("pending")})}).openapi("ReviewSetInvitation"),XS=b.object({review_id:b.string(),invitations:b.array(JS)}).openapi("ReviewSetPerFileLinks"),Oy=b.object({id:e_,title:b.string(),kind:S0,state:b.literal("active"),source_type:C6,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),ordering_method:$S,items:b.array(DS),links:b.object({set_link:b.string().url()}),per_file_links:b.array(XS),event_id:b.string(),created_at:b.string().datetime(),request_id:b.string().nullable()}).openapi("CreateReviewSetResponse"),G7=b.object({id:e_,title:b.string().nullable(),kind:S0,state:b7,source_type:C6,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),item_count:b.number().int().nonnegative(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("ReviewSetSummary"),Ny=b.object({source_type:C6.optional(),repo_id:xw.optional(),git_sha:Xw.optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),kind:S0.optional(),state:b7.optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListReviewSetsQuery"),Py=b.object({items:b.array(G7),next_cursor:b.string().nullable(),request_id:b.string()}).openapi("ListReviewSetsResponse"),ky=b.object({title:b.string().min(1).max(4096).optional(),state:b.enum(["active","closed","archived"]).optional()}).refine(($)=>$.title!==void 0||$.state!==void 0,"At least one field must be provided").openapi("UpdateReviewSetRequest"),ny=G7.extend({request_id:b.string()}).openapi("UpdateReviewSetResponse"),i0=b.enum(["pass","fail","warn"]).openapi("ReviewSetStatusVerdict"),T0=b.object({code:b.string(),message:b.string(),pointers:b.array(b.string())}).openapi("ReviewSetReasonCode"),CX=b.object({review_id:b.string(),file_path:U$,required:b.boolean(),verdict:i0,reason_codes:b.array(T0)}).openapi("ReviewSetStatusItem"),uX=b.object({action:b.string(),review_id:b.string(),finding_id:b.string().optional(),approver_email:b.string().email().optional(),reason_code:b.string(),message:b.string()}).openapi("ReviewSetActionRequired"),My=b.object({review_set_id:e_,verdict:i0,reason_codes:b.array(T0),items:b.array(CX),policy_snapshot_id:b.string().nullable(),actions_required:b.array(uX).optional(),request_id:b.string()}).openapi("GetReviewSetStatusResponse"),QS=b.enum(["blocked","needs_changes","suggestions","approved","not_started","in_progress"]).openapi("ReviewSetStatusIndicator"),YS=b.object({requested:b.boolean(),decided:b.boolean(),decision:b.enum(["approved","rejected","conditional","pending"])}).openapi("ReviewSetApprovalState"),EX=b.object({review_id:b.string(),role:b.enum(["content","rules"]),file_path:U$,position:b.number().int().nonnegative(),required:b.boolean(),status_summary:b.object({review_state:b.string(),thread_counts:b.object({total:b.number().int().nonnegative(),open:b.number().int().nonnegative(),resolved:b.number().int().nonnegative()}),severity_counts:b.object({blocking:b.number().int().nonnegative(),needs_changes:b.number().int().nonnegative(),suggestion:b.number().int().nonnegative()}),has_system_findings:b.boolean(),approval_state:YS.nullable(),status_indicator:QS})}).openapi("ReviewSetOverviewItem"),D7=b.object({total_items:b.number().int().nonnegative(),reviewed_items:b.number().int().nonnegative(),approved_items:b.number().int().nonnegative(),completion_pct:b.number().int().min(0).max(100)}).openapi("ReviewSetProgress"),zy=b.object({id:e_,title:b.string().nullable(),kind:b.string(),state:b.string(),source_type:C6,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),snapshot_id:b.string().nullable(),ordering_method:b.string().nullable(),recipe_json:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),items:b.array(EX),progress:D7,next_unresolved:b.object({review_id:b.string(),file_path:U$,block_id:b.string().nullable()}).nullable(),links:b.object({set_link:b.string().url().nullable()}),request_id:b.string()}).openapi("GetReviewSetResponse"),WS=b.object({id:e_,title:b.string().nullable(),kind:b.string(),state:b.string(),source_type:C6,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),snapshot_id:b.string().nullable(),ordering_method:b.string().nullable(),recipe_json:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("ReviewSetExportMetadata"),HS=b.object({review_id:b.string(),file_path:U$,position:b.number().int().nonnegative(),required:b.boolean(),review_export:b.record(b.string(),b.unknown())}).openapi("ReviewSetExportItem"),qS=b.object({canonicalization:b.literal("jcs"),export_sha256:b.string().regex(/^[0-9a-f]{64}$/).nullable()}).openapi("ReviewSetExportIntegrity"),fy=b.object({schema:b.literal("v2"),view_requested:b.string().nullable(),view_resolved:b.literal("review_set.v1"),set:WS,items:b.array(HS),progress:D7,integrity:qS}).openapi("GetReviewSetExportResponse");var BS=["draft","ready","approved","activated","stale","rejected"];var ZX=b.enum(BS).openapi("ReleaseCandidateState"),IS=["mark_ready","approve","reject","mark_stale","return_to_draft","activate","abandon"],xX=["mark_ready","reject","return_to_draft","activate","abandon"],LS=b.enum(IS).openapi("ReleaseCandidateTransitionAction"),Ty=b.enum(xX).openapi("PublicReleaseCandidateTransitionAction");var VS=["release_diff","selector_coverage","precedence_check","casebank_replay"],FS=b.enum(VS).openapi("SimulationType"),jS=b.object({type:FS,result:b.unknown(),computed_at:b.string().datetime(),basis_hash:b.string().min(1)}).openapi("SimulationReceipt"),J7=b.object({approver_id:b.string().min(1),approved_at:b.string().datetime(),verification_notes:b.string(),approval_scope:b.string().min(1)}).openapi("ApprovalReceipt"),KS=["clause_count","selector_count","precedence_clause_count","exception_change_count"],OS=b.enum(KS).openapi("ReleaseCandidateVerificationMetric"),NS=b.object({clause_count:b.number().int().min(0),selector_count:b.number().int().min(0),precedence_clause_count:b.number().int().min(0),exception_change_count:b.number().int().min(0),high_impact:b.boolean(),triggered_thresholds:b.array(OS),evaluated_at:b.string().datetime()}).openapi("ReleaseCandidateVerificationSummary"),PS=b.enum(["not_required","pending","approved"]).openapi("ReleaseCandidateVerificationStatus"),kS=b.object({required_approvals:b.number().int().min(0).default(0),approval_receipts:b.array(J7),status:PS,summary:NS}).openapi("ReleaseCandidateVerification"),nS=["revision_superseded","new_revision_published","based_on_release_no_longer_active"],MS=b.enum(nS).openapi("StalenessReason"),Ry=b.object({is_stale:b.boolean(),reason:MS.nullable(),detail:b.string().nullable(),checked_at:b.string().datetime()}).openapi("StalenessCheckResult");var Cy=b.object({workspace_id:b.string().min(1).max(128),included_rule_revision_ids:b.array(b.string().min(1).max(128)).min(1),based_on_active_release_id:b.string().min(1).max(128).optional(),rollback_of_release_id:b.string().min(1).max(128).optional(),title:b.string().min(1).max(256).optional(),idempotency_key:b.string().max(256).optional()}).strict().openapi("CreateReleaseCandidateRequest"),X7=b.object({release_candidate_id:b.string(),workspace_id:b.string(),state:ZX,title:b.string().nullable(),included_rule_revision_ids:b.array(b.string()),manifest_hash:b.string().nullable(),based_on_active_release_id:b.string().nullable(),rollback_of_release_id:b.string().nullable(),required_approvals:b.number().int().min(0).default(1),approval_receipts:b.array(J7),simulation_receipts:b.array(jS),rejected_by:b.string().nullable(),rejection_reason:b.string().nullable(),stale_reason:b.string().nullable(),rule_release_id:b.string().nullable(),verification:kS.nullable().default(null),compiled_at:b.string().datetime().nullable(),compiled_by:b.string().nullable(),version:b.number().int().positive(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("ReleaseCandidateSummary"),uy=b.object({limit:b.coerce.number().int().min(1).max(25).default(6)}).strict().openapi("ListReleaseCandidatesQuery"),Ey=b.object({items:b.array(X7),request_id:b.string()}).openapi("ListReleaseCandidatesResponse"),zS=b.object({total_items:b.number().int().nonnegative(),reviewed_items:b.number().int().nonnegative(),approved_items:b.number().int().nonnegative(),completion_pct:b.number().int().min(0).max(100)}).openapi("ReleaseCandidateProgress"),fS=b.object({review_id:b.string(),file_path:b.string(),block_id:b.string().nullable()}).openapi("ReleaseCandidateNextUnresolved"),AS=b.object({set_link:b.string().url().nullable()}).openapi("ReleaseCandidateLinks"),SS=X7.extend({source_type:b.enum(["git","upload"]),repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),items:b.array(EX),progress:zS,next_unresolved:fS.nullable(),links:AS}).openapi("ReleaseCandidateDetail"),Zy=SS.extend({request_id:b.string()}).openapi("GetReleaseCandidateResponse"),xy=b.object({release_candidate_id:b.string(),verdict:i0,reason_codes:b.array(T0),items:b.array(CX),policy_snapshot_id:b.string().nullable(),actions_required:b.array(uX).optional(),request_id:b.string()}).openapi("GetReleaseCandidateStatusResponse"),hy=b.object({action:LS,expected_version:b.number().int().positive().optional(),idempotency_key:b.string().max(256).optional(),rejection_reason:b.string().min(1).max(1024).optional(),stale_reason:b.string().min(1).max(1024).optional()}).strict().superRefine(($,w)=>{if($.action==="reject"&&!$.rejection_reason)w.addIssue({code:b.ZodIssueCode.custom,message:"rejection_reason is required when action is reject",path:["rejection_reason"]});if($.action==="abandon"&&!$.rejection_reason)w.addIssue({code:b.ZodIssueCode.custom,message:"rejection_reason is required when action is abandon",path:["rejection_reason"]});if($.action==="mark_stale"&&!$.stale_reason)w.addIssue({code:b.ZodIssueCode.custom,message:"stale_reason is required when action is mark_stale",path:["stale_reason"]})}).openapi("TransitionReleaseCandidateRequest"),ly=b.object({release_candidate_id:b.string(),from_state:ZX,to_state:ZX,rule_release_id:b.string().nullable(),release_version:b.number().int().positive().nullable().optional(),version:b.number().int().positive(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("TransitionReleaseCandidateResponse");var hX=b.record(b.string(),b.unknown()).openapi("ProjectConfig"),iS=b.enum(["active","deleting","deleted"]).openapi("ProjectState"),my=b.object({name:b.string().min(1).max(256),config:hX.optional()}).openapi("CreateProjectRequest"),ty=b.object({name:b.string().min(1).max(256).optional(),config:hX.optional()}).openapi("UpdateProjectRequest"),dy=b.object({cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListProjectsQuery"),TS=b.object({id:b.string(),status:b.string(),file_count:b.number().int().nonnegative(),total_size_bytes:b.number().int().nonnegative(),created_at:b.string().datetime()}).openapi("ProjectLatestBatch"),RS=b.object({id:b.string(),name:b.string(),state:iS,tenant_id:b.string(),config_hash:b.string().nullable(),config:hX.nullable(),created_by_user_id:b.string().nullable(),created_at:b.string().datetime(),latest_batch:TS.nullable().optional(),request_id:b.string()}).openapi("ProjectResponse"),oy=b.object({items:b.array(RS.omit({request_id:!0})),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListProjectsResponse"),ry=b.object({project_id:b.string(),state:b.literal("deleting"),deletion_job_id:b.string(),request_id:b.string()}).openapi("DeleteProjectResponse"),py=b.object({from_path:U$,to_path:U$}).refine(($)=>$.from_path!==$.to_path,{message:"from_path and to_path must differ",path:["to_path"]}).openapi("CreateProjectMoveRequest"),ey=b.object({id:b.string(),project_id:b.string(),from_path:U$,to_path:U$,declared_at:b.string().datetime(),request_id:b.string()}).openapi("ProjectMoveResponse");var lX=b.enum(["git","upload"]).openapi("SessionTemplateSourceType"),CS=b.object({participant_id:b.string().min(1).max(256),scope:b.enum(["read","comment","approve"])}).openapi("SessionTemplateParticipantConfig"),uS=b.object({slack_channel:b.string().max(256).optional(),email_participants:b.boolean().optional()}).openapi("SessionTemplateNotificationConfig"),Q7=b.object({participants:b.array(CS).max(100).optional(),checks_enabled:b.boolean().optional(),policy_enabled:b.boolean().optional(),steering_enabled:b.boolean().optional(),extra_json:b.record(b.string(),b.unknown()).optional(),notification_config:uS.optional()}).openapi("SessionTemplateConfig"),$m=b.object({name:b.string().min(1).max(256),description:b.string().max(4000).optional(),source_type:lX,repo_id:b.string().max(256).optional(),project_id:b.string().max(256).optional(),config:Q7}).openapi("CreateSessionTemplateRequest"),wm=b.object({source_type:lX.optional(),repo_id:b.string().optional(),project_id:b.string().optional(),include_archived:b.boolean().optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListSessionTemplatesQuery"),ES=b.object({id:b.string(),tenant_id:b.string(),name:b.string(),description:b.string().nullable(),source_type:lX,repo_id:b.string().nullable(),project_id:b.string().nullable(),config:Q7,created_by_user_id:b.string().nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),archived_at:b.string().datetime().nullable(),request_id:b.string()}).openapi("SessionTemplateResponse"),vm=b.object({items:b.array(ES.omit({request_id:!0})),next_cursor:b.string().nullable(),request_id:b.string()}).openapi("ListSessionTemplatesResponse");var ZS=b.object({id:b.string(),tenant_id:b.string(),name:b.string(),description:b.string().nullable(),color:b.string().nullable(),created_by:b.string(),created_at:b.string().datetime().nullable(),updated_at:b.string().datetime().nullable(),archived_at:b.string().datetime().nullable(),request_id:b.string()}).openapi("CollectionResponse"),Um=b.object({name:b.string().min(1),description:b.string().nullable().optional(),color:b.string().nullable().optional()}).openapi("CreateCollectionRequest"),bm=b.object({name:b.string().min(1).optional(),description:b.string().nullable().optional(),color:b.string().nullable().optional(),archived:b.boolean().optional()}).openapi("UpdateCollectionRequest"),Gm=b.object({cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).optional(),include_archived:b.boolean().optional()}).openapi("ListCollectionsQuery"),xS=b.object({collection_id:b.string(),session_id:b.string(),added_at:b.string().datetime().nullable(),added_by:b.string(),request_id:b.string()}).openapi("CollectionSessionResponse"),Dm=b.object({session_id:b.string()}).openapi("AddCollectionSessionRequest"),hS=b.object({id:b.string(),collection_id:b.string(),url:b.string().url(),title:b.string(),link_type:b.string(),created_by:b.string(),created_at:b.string().datetime().nullable(),request_id:b.string()}).openapi("CollectionSourceLinkResponse"),Jm=b.object({url:b.string().url(),title:b.string(),link_type:b.string()}).openapi("CreateCollectionSourceLinkRequest"),Xm=b.object({items:b.array(ZS.omit({request_id:!0})),cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListCollectionsResponse"),Qm=b.object({id:b.string(),tenant_id:b.string(),name:b.string(),description:b.string().nullable(),color:b.string().nullable(),created_by:b.string(),created_at:b.string().datetime().nullable(),updated_at:b.string().datetime().nullable(),archived_at:b.string().datetime().nullable(),source_links:b.array(hS.omit({request_id:!0})),sessions:b.array(xS.omit({request_id:!0})),request_id:b.string()}).openapi("CollectionDetailResponse"),Ym=b.object({request_id:b.string()}).openapi("CollectionMutationAck");var Y7=b.enum(["git","upload"]).openapi("CorpusSourceType"),lS=b.enum(["building","ready","failed"]).openapi("CorpusSnapshotStatus"),cS=b.enum(["frontmatter","marker","sidecar","auto"]).openapi("CorpusDocIdentityMode"),W7=b.object({in_scope_globs:b.array(b.string().min(1)).min(1).optional(),exclude_globs:b.array(b.string().min(1)).optional(),max_files:b.number().int().positive().optional(),max_total_bytes:b.number().int().positive().optional(),max_snapshot_build_seconds:b.number().int().positive().optional(),doc_identity_mode:cS.optional(),include_external_links:b.boolean().optional()}).openapi("CorpusConfig"),qm=b.object({git_sha:Xw,corpus_config:W7.optional()}).openapi("RequestGitSnapshot"),Bm=b.object({upload_batch_id:b.string(),corpus_config:W7.optional()}).openapi("RequestUploadSnapshot"),Im=b.object({snapshot_id:b.string(),status:lS,source_type:Y7,repo_id:xw.optional(),git_sha:Xw.optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),indexer_version:b.string(),config_hash:b.string(),snapshot_sha256:b.string().nullable().optional(),error_json:b.unknown().optional(),created_at:b.string().datetime(),request_id:b.string()}).openapi("CorpusSnapshotStatusResponse"),yS=b.object({source_path:U$,source_doc_key:b.string().nullable(),source_block_id:b.string().nullable(),link_kind:b.string(),context:b.null()}).openapi("CorpusBacklinkItem"),Lm=b.object({snapshot_id:b.string(),file_path:U$,anchor:b.string().nullable(),backlinks:b.array(yS),request_id:b.string()}).openapi("CorpusBacklinksResponse"),H7=b.object({file_path:U$,doc_key:b.string().nullable(),doc_type:b.string().nullable(),title:b.string().nullable()}).openapi("CorpusRepoMapItem"),Vm=b.object({snapshot_id:b.string(),git_sha:Xw,files:b.array(H7),request_id:b.string()}).openapi("CorpusGitRepoMapResponse"),Fm=b.object({snapshot_id:b.string(),upload_batch_id:b.string(),files:b.array(H7),request_id:b.string()}).openapi("CorpusUploadRepoMapResponse"),mS=b.object({file_path:U$,doc_key:b.string().nullable(),distance:b.number().int().positive(),link_kind:b.string(),via_path:U$}).openapi("CorpusImpactRadiusItem"),jm=b.object({snapshot_id:b.string(),session_id:b.string(),file_path:U$,impacted_files:b.array(mS),request_id:b.string()}).openapi("CorpusImpactResponse"),Km=b.object({target_file:U$,anchor:b.string().nullable(),block_id:b.string(),plaintext:b.string(),html:b.string(),request_id:b.string()}).openapi("CorpusLinkPreviewResponse"),tS=b.object({file_path:U$,doc_key:b.string().nullable(),violation_type:b.enum(["unknown_doc_type","missing_required_field","invalid_field_type","unknown_tag","unknown_category","invalid_locale"]),field:b.string(),expected:b.string(),actual:b.string(),message:b.string()}).openapi("CorpusTaxonomyViolation"),dS=b.object({file_path:U$,doc_key:b.string().min(1).optional(),doc_type:b.string().min(1).optional(),title:b.string().optional(),source_content_sha256:b.string().regex(/^[0-9a-f]{64}$/),frontmatter:b.object({raw:b.record(b.string(),b.unknown()).nullable(),normalized:b.record(b.string(),b.unknown()).nullable()}).optional(),taxonomy_violations:b.array(tS).optional()}).openapi("CorpusSnapshotArtifactDoc"),oS=b.object({source_file_path:U$,target_file_path:U$.optional(),target_url:b.string().url().optional(),edge_type:b.enum(["link","image","include","xref"]),resolved:b.boolean()}).refine(($)=>$.target_file_path!==void 0!==($.target_url!==void 0),{message:"exactly one of target_file_path or target_url must be present"}).openapi("CorpusSnapshotArtifactEdge"),Om=b.object({schema_version:b.literal("corpus_snapshot.v1"),snapshot_id:b.string(),source_type:Y7,repo_id:xw.optional(),git_sha:Xw.optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),scope:b.object({include_globs:b.array(b.string().min(1)).min(1),exclude_globs:b.array(b.string().min(1)).optional()}),status:b.literal("ready"),docs:b.array(dS),edges:b.array(oS),indexer_version:b.string(),config_hash:b.string(),created_at:b.string().datetime(),completed_at:b.string().datetime()}).openapi("CorpusSnapshotArtifact");var km=b.object({content_ref:G4.openapi({description:"Reference to the content to review"}),participants:b.array(b.object({email:b.string().email(),name:b.string().optional(),role:b.enum(["reviewer","operator","observer"]).default("reviewer")})).optional().openapi({description:"Optional list of participants to invite"}),options:b.object({block_id_scheme:b.literal("v1").default("v1").optional(),render_profile:b.string().optional()}).optional(),operator_name:b.string().max(200).optional().openapi({description:"Name of the operator initiating the review"}),focus_areas:b.array(b.string().max(100)).max(10).optional().openapi({description:"Areas the reviewer should focus on"}),framing:b.string().max(1000).optional().openapi({description:"Context framing text shown to reviewers"}),carry_forward_threads:b.boolean().optional().openapi({description:"Whether to carry forward threads from the superseded session"}),carry_forward_filter:b.enum(["all","blocking","needs_changes"]).optional().openapi({description:"Filter for which threads to carry forward"})}).openapi("CreateSessionRequest"),rS=b.object({thread_id:b.string().openapi({description:"Thread ID to resolve"}),disposition:b.enum(["fixed","wont_fix","duplicate","by_design"]).openapi({description:"Resolution disposition"}),evidence:b.string().max(2000).optional().openapi({description:"Optional evidence or explanation"})}).openapi("ThreadResolution"),nm=b.object({git_sha:b.string().optional().openapi({description:"Git commit SHA for the new revision"}),file_path:b.string().optional().openapi({description:"File path (defaults to predecessor's)"}),title:b.string().max(512).optional().openapi({description:"Title for the new session"}),changes_summary:b.string().max(5000).optional().openapi({description:"Summary of changes for round-transition emails"}),resolutions:b.array(rS).optional().openapi({description:"Resolution manifest for predecessor threads"}),auto_read_only_on_supersede:b.boolean().default(!0).optional().openapi({description:"Whether to mark predecessor as read-only (default: true)"})}).openapi("SupersedeSessionRequest"),pS=b.object({block_id:b.string(),block_id_scheme:b.literal("v1"),block_index:b.number().int().min(0),block_type:b.string(),block_key:b.string().nullable(),block_key_source:b.enum(["marker","sidecar","auto"]).nullable(),start_line:b.number().int().min(1),end_line:b.number().int().min(1),start_offset:b.number().int().min(0),end_offset:b.number().int().min(0)}).openapi("BlockSummary"),q7=b.object({id:b.string().openapi({description:"Unique session identifier",example:"ses_abc123"}),created_at:b.string().datetime().openapi({description:"ISO 8601 timestamp of session creation"}),state:b.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi({description:"Current session lifecycle state"}),content_ref:G4,source_content_sha256:b.string().regex(/^[a-f0-9]{64}$/).openapi({description:"SHA-256 hash of canonical source content"}),block_count:b.number().int().min(0).openapi({description:"Number of blocks in the session"}),thread_count:b.number().int().min(0).openapi({description:"Total number of threads in the session"}),open_thread_count:b.number().int().min(0).openapi({description:"Number of open (unresolved) threads"})}).openapi("Session"),Mm=q7.extend({blocks:b.array(pS).optional().openapi({description:"Block summaries (included on creation)"})}).openapi("CreateSessionResponse"),zm=b.object({session_id:b.string().openapi({description:"Session identifier",example:"ses_abc123"})}),fm=q7.openapi("GetSessionResponse"),Am=VW.openapi("GetSessionBlocksQueryParams"),eS=b.object({block_id:b.string(),block_key:b.string().nullable(),block_key_source:b.enum(["marker","sidecar","auto"]).nullable(),block_index:b.number().int().min(0),block_type:b.string(),start_line:b.number().int().min(1),end_line:b.number().int().min(1),start_offset:b.number().int().min(0),end_offset:b.number().int().min(0)}).openapi("SessionBlockListItem"),Sm=b.object({session_id:b.string(),block_id_scheme:b.literal("v1"),block_key_scheme:b.literal("v1"),total_blocks:b.number().int().min(0),blocks:b.array(eS),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("GetSessionBlocksResponse"),aS=b.object({block_id:b.string(),block_key:b.string().nullable().optional(),block_key_source:b.string().nullable().optional(),block_index:b.number().int(),block_type:b.string(),properties:b.record(b.string(),b.unknown()).nullable().optional(),html:b.string().openapi({description:"Rendered HTML for this block"}),start_line:b.number().int(),end_line:b.number().int(),start_offset:b.number().int().optional(),end_offset:b.number().int().optional()}).openapi("RenderBlock"),im=b.object({session_id:b.string(),source_content_sha256:b.string(),blocks:b.array(aS),render_profile:b.string().nullable(),etag:b.string().openapi({description:"ETag for cache validation"})}).openapi("GetSessionRenderResponse"),sS=b.object({block_id:b.string(),thread_count:b.number().int().min(0),open_thread_count:b.number().int().min(0),has_unread:b.boolean().optional(),severity_max:b.enum(["suggestion","needs_changes","blocking"]).nullable()}).openapi("BlockAnnotation"),Tm=b.object({session_id:b.string(),blocks:b.array(sS),updated_at:b.string().datetime()}).openapi("GetSessionAnnotationsResponse");var um=b.object({token:b.string().openapi({description:"URL token from magic link",example:"tok_abc123xyz..."})}).openapi("ExchangeTokenRequest"),Em=b.object({access_token:b.string().openapi({description:"Short-lived access token for API requests"}),token_type:b.literal("Bearer"),expires_in:b.number().int().openapi({description:"Token lifetime in seconds",example:3600}),refresh_grant:b.boolean().optional().openapi({description:"Whether a refresh cookie was set"})}).openapi("ExchangeTokenResponse"),Zm=b.object({access_token:b.string(),token_type:b.literal("Bearer"),expires_in:b.number().int()}).openapi("RefreshTokenResponse"),xm=b.object({email:b.string().email().openapi({description:"Email address to send OTP to"})}).openapi("SendOtpRequest"),hm=b.object({code:b.string().length(6).regex(/^\d{6}$/).openapi({description:"6-digit OTP code",example:"123456"})}).openapi("VerifyOtpRequest"),lm=b.object({access_token:b.string().openapi({description:"Access token with elevated verification tier"}),token_type:b.literal("Bearer"),expires_in:b.number().int(),verification_tier:b.enum(["step_up"]).openapi({description:"Verification tier achieved"})}).openapi("VerifyOtpResponse");var $i=["full","redacted","pseudonymous","block_window.v1","unresolved.v1","response_matrix.v1","delta_review.v1","corpus_context.v1"],wi=["repair_kit.v1"],vi={block_window:"block_window.v1",unresolved:"unresolved.v1",response_matrix:"response_matrix.v1",repair_kit:"repair_kit.v1",delta_review:"delta_review.v1",corpus_context:"corpus_context.v1"};function gi($){if($i.includes($))return $;if(wi.includes($))return $;let w=vi[$];if(w)return w;throw Error(`Unknown export view: ${$}`)}var _i=b.enum(["full","redacted","pseudonymous","block_window","block_window.v1","unresolved","unresolved.v1","response_matrix","response_matrix.v1","repair_kit","repair_kit.v1","delta_review","delta_review.v1","corpus_context","corpus_context.v1"]),Ui=b.enum(["json","llm_prompt","llm_prompt.v1"]),tm=b.object({schema:b.literal("v2").default("v2"),view:_i.default("full"),format:Ui.default("json"),allow_partial:b.boolean().default(!1),anchors:b.string().optional(),window_before:b.coerce.number().int().min(0).default(2),window_after:b.coerce.number().int().min(0).default(2),severity:b.string().optional(),tags:b.string().optional(),assignee:b.string().optional(),signed:b.boolean().optional(),include_derived_keys:b.boolean().optional()}).superRefine(($,w)=>{if(gi($.view)==="block_window.v1"){if(!$.anchors||$.anchors.trim().length===0)w.addIssue({code:b.ZodIssueCode.custom,path:["anchors"],message:"anchors is required when view=block_window.v1"})}}),bi=b.object({block_id:b.string(),block_id_scheme:b.literal("v1"),block_index:b.number().int().min(0),block_type:b.string(),block_key:b.string().nullable(),block_key_source:b.enum(["marker","sidecar","auto"]).nullable(),start_line:b.number().int().min(1),end_line:b.number().int().min(1),start_offset:b.number().int().min(0),end_offset:b.number().int().min(0),plaintext_sha256:b.string().regex(/^[a-f0-9]{64}$/).nullable()}).openapi("ExportBlock"),Gi=b.object({id:b.string(),author_email:b.string().email().nullable().optional(),author_name:b.string().nullable(),author_source:b.string().nullable().optional(),body_md:b.string(),created_at:b.string().datetime(),updated_at:b.string().datetime().nullable(),version:b.number().int().min(1)}).openapi("ExportComment"),Di=b.object({id:b.string(),anchor:hw,block_id:b.string().nullable().optional(),status:b.enum(["open","resolved"]),severity:b.enum(["suggestion","needs_changes","blocking"]),created_at:b.string().datetime(),updated_at:b.string().datetime().nullable().optional(),finding_id:b.string().nullable().optional(),rule_id:b.string().nullable().optional(),rule_fingerprint:b.string().nullable().optional(),check_run_id:b.string().nullable().optional(),rule_ref:p1.optional(),comments:b.array(Gi)}).openapi("ExportThread"),Ji=b.object({open_threads:b.number().int().nonnegative(),resolved_threads:b.number().int().nonnegative(),blocking_threads:b.number().int().nonnegative()}).openapi("ExportIssuePerAnchorStatus"),Xi=b.object({anchor_id:b.string(),block_id:b.string().nullable(),anchor_type:b.enum(["session","block","range"]),linked_thread_ids:b.array(b.string()),per_anchor_status:Ji}).openapi("ExportIssueAnchor"),Qi=b.object({issue_id:b.string(),title:b.string(),status:b.string(),severity:b.string().nullable(),tags:b.array(b.string()),anchor_count:b.number().int().nonnegative(),thread_count:b.number().int().nonnegative(),anchors_in_this_session:b.array(Xi)}).openapi("ExportIssue"),Yi=b.object({disposition_id:b.string(),thread_id:b.string(),state:b.string(),rationale_md:b.string().nullable(),reason_code:b.string().nullable(),waiver_expires_at:b.string().datetime().nullable(),decided_by_participant_id:b.string().nullable(),decided_by_user_id:b.string().nullable(),decided_by_verification_level:b.string().nullable(),decided_by_display:b.string(),decided_at:b.string().datetime(),provenance_json:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().datetime()}).openapi("ExportDisposition"),Wi=b.object({evidence_id:b.string(),thread_id:b.string(),evidence_type:b.string(),evidence_json:b.record(b.string(),b.unknown()),verification_status:b.string(),verification_tier:b.number().int().nullable(),verified_at:b.string().datetime().nullable(),verifier_version:b.string().nullable(),dedupe_key:b.string().nullable(),created_by_participant_id:b.string().nullable(),created_by_user_id:b.string().nullable(),created_by_verification_level:b.string().nullable(),created_by_display:b.string(),created_at:b.string().datetime()}).openapi("ExportEvidence"),Hi=b.string().regex(/^[a-z][a-z0-9_.-]*$/),qi=b.string().regex(/^[a-z][a-z0-9_.-]*\.v[0-9]+$/),Bi=b.object({schema_version:qi,authoritative:b.boolean()}).passthrough().openapi("ExtensionEnvelope");var Ii=b.object({canonicalization:b.string(),export_sha256:b.string().regex(/^[a-f0-9]{64}$/).nullable(),export_full_sha256:b.string().regex(/^[a-f0-9]{64}$/).nullable().optional()}).passthrough().openapi("ExportIntegrity"),Li=b.object({section:b.enum(["threads","comments","approvals","proposed_changes","extensions"]),reason:b.enum(["db_timeout","permission_denied","section_disabled","internal_error"]),count_missing:b.number().int().min(0).optional()}).openapi("ExportIncompleteSection"),dm=b.object({schema_version:b.literal("export.v1"),exported_at:b.string().datetime(),view_requested:b.string().nullable().optional(),view_resolved:b.string().optional(),integrity:Ii,partial:b.boolean().optional(),incomplete_sections:b.array(Li).optional(),session:b.object({id:b.string(),created_at:b.string().datetime(),status:b.enum(["active","closed","archived"]),content_ref:G4,source_content_sha256:b.string().regex(/^[a-f0-9]{64}$/),root_session_id:b.string().nullable().optional(),supersedes_session_id:b.string().nullable().optional()}),blocks:b.array(bi),threads:b.array(Di),issues:b.array(Qi).default([]).openapi({description:"Issue summaries with per-anchor status for anchors in this session"}),dispositions:b.array(Yi).default([]).openapi({description:"Thread disposition log entries exported for audit/compliance workflows"}),evidence:b.array(Wi).default([]).openapi({description:"Thread evidence records exported for audit/compliance workflows"}),approvals:b.object({}).passthrough().optional().openapi({description:"Approval state summary (M0.5+)"}),extensions:b.record(Hi,Bi).optional().openapi({description:"Optional extension envelopes keyed by namespace (extensions.{namespace})"}),metadata:b.object({export_view:b.string().optional(),integrity_hash:b.string().optional()}).optional()}).openapi("ExportResponse");var Vi=b.object({code:b.string(),details:b.record(b.string(),b.unknown()).optional(),thread_ids:b.array(b.string()).optional(),approval_ids:b.array(b.string()).optional()}).openapi("PolicyReason"),Fi=b.object({supersedes_session_id:b.string(),blocks_added:b.number().int().min(0),blocks_removed:b.number().int().min(0),blocks_changed:b.number().int().min(0),blocks_unchanged:b.number().int().min(0),orphaned_threads_count:b.number().int().min(0)}).openapi("BriefingDeltaSummary"),ji=b.object({verdict:b.enum(["pass","fail","warn"]),reasons:b.array(Vi)}).openapi("BriefingPolicyStatus"),Ki=b.object({thread_id:b.string(),block_id:b.string().nullable(),severity:b.string(),snippet:b.string().max(120),source:b.enum(["human","system","automation"]),has_disposition:b.boolean()}).openapi("BriefingBlockerItem"),Oi=b.object({items:b.array(Ki),total:b.number().int().min(0)}).openapi("BriefingBlockers"),Ni=b.object({decision:b.enum(["approved","rejected","conditional"]),decided_by:b.string(),decided_at:b.string().datetime(),pending_conditions:b.number().int().min(0)}).openapi("BriefingApprovalDecision"),Pi=b.object({requested:b.boolean(),decisions:b.array(Ni),pending_count:b.number().int().min(0)}).openapi("BriefingApprovalsSummary"),ki=b.object({last_run_id:b.string(),status:b.enum(["completed","running","failed"]),total_findings:b.number().int().min(0),gating_findings:b.number().int().min(0),informational_findings:b.number().int().min(0)}).openapi("BriefingChecksSummary"),ni=b.object({total:b.number().int().min(0),unresolved:b.number().int().min(0),blocking:b.number().int().min(0),system_findings:b.number().int().min(0),human:b.number().int().min(0)}).openapi("BriefingThreadsSummary"),pm=b.object({schema_version:b.literal("briefing.v1"),session_id:b.string(),content_ref:G4,title:b.string().nullable(),created_at:b.string().datetime(),delta:Fi.optional(),policy_status:ji,blockers:Oi,approvals:Pi,checks:ki.optional(),threads:ni,computed_at:b.string().datetime(),annotations_version:b.number().int().min(1)}).openapi("BriefingBundle");var Mi=b.enum(["review","repo","tenant"]).openapi("SearchScope"),B7=b.enum(["fts","semantic"]).openapi({description:"`fts` is the canonical public search mode. `semantic` remains compatibility-only, non-authoritative retrieval and must not be treated as required launch behavior."}).openapi("SearchMode"),zi=b.enum(["review","block","finding","comment"]).openapi("SearchKind"),R0=b.enum(["open","resolved","draft"]).openapi("SearchStatus"),I7=b.enum(["suggestion","needs_changes","blocking"]).openapi("SearchSeverity"),sm=b.object({q:b.string().trim().min(1),scope:Mi.default("tenant").optional(),mode:B7.default("fts").optional().openapi({description:"Canonical public search uses `fts`. `semantic` is compatibility-only and may be disabled per tenant."}),review_id:b.string().trim().min(1).optional(),repo_id:b.string().trim().min(1).max(256).optional(),project_id:b.string().trim().min(1).max(256).optional(),model:b.string().trim().min(1).max(128).optional().openapi({description:"Compatibility-only semantic-search model hint. Canonical FTS callers should omit this field."}),min_score:b.coerce.number().min(0).max(1).optional().openapi({description:"Compatibility-only semantic-search threshold. Canonical FTS callers should omit this field."}),kind:b.string().trim().min(1).optional().openapi({description:"Single kind or comma-separated kinds"}),status:R0.optional(),severity:I7.optional(),assignee:b.string().trim().min(1).optional(),tags:b.string().trim().min(1).optional().openapi({description:"Comma-separated tag list"}),from:b.string().datetime().optional(),to:b.string().datetime().optional(),filters:b.string().trim().min(1).optional().openapi({description:"JSON-encoded or key=value,key=value filter expression"}),cursor:b.string().min(1).optional(),limit:b.coerce.number().int().min(1).max(100).optional()}).strict().openapi("SearchQueryParams"),fi=b.discriminatedUnion("type",[b.object({type:b.literal("review")}).strict(),b.object({type:b.literal("block"),block_id:I0}).strict()]).openapi("SearchAnchor"),Ai=b.object({schema_version:b.literal("anchor_ref.v1"),source_type:b.enum(["git","upload"]),repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),file_path:b.string().min(1),doc_key:b.string().nullable(),anchor:fi}).strict().openapi("SearchTarget"),Si=b.object({kind:zi,score:b.number(),entity_id:b.string().min(1),review_id:b.string().min(1),target:Ai,snippet:b.string(),finding:b.object({finding_id:b.string().min(1),status:R0,severity:I7.nullable(),assignee:b.string().nullable(),updated_at:b.string().datetime().nullable()}).strict().nullable().optional(),highlight_ranges:b.array(b.object({start:b.number().int().nonnegative(),end:b.number().int().positive()}).strict()),non_authoritative:b.literal(!0).optional(),provenance:b.object({model_id:b.string().min(1),model_version:b.string().min(1),similarity_score:b.number().min(0).max(1)}).strict().openapi({description:"Compatibility-only semantic-search provenance for non-authoritative results."}).optional()}).strict().openapi("SearchResult"),$t=b.object({results:b.array(Si),total_count:b.number().int().nonnegative(),cursor:b.string().nullable(),has_more:b.boolean(),metadata:b.object({search_mode:B7,model_id:b.string().min(1).optional(),model_version:b.string().min(1).optional()}).strict().openapi({description:"Canonical metadata reports `fts`. Semantic metadata fields are compatibility-only."}).optional(),request_id:b.string()}).strict().openapi("SearchResponse");var ii=["properties","applicability"],L7=["ts_"],Ti="^[a-z][a-z0-9_]{0,63}$",Ri=b.object({key:b.string(),targets:b.array(b.enum(ii)).min(1),value_format:b.enum(["slug","string"]),description:b.string(),examples:b.array(b.string()).min(1)}).openapi("PropertyVocabularyEntry"),gt=b.object({naming:b.object({case:b.literal("snake_case"),key_pattern:b.string(),max_key_length:b.number().int().positive()}).openapi("PropertyVocabularyNaming"),reserved:b.object({canonical_keys:b.array(b.string()),internal_prefixes:b.array(b.string())}).openapi("PropertyVocabularyReserved"),tenant_extensions:b.object({allowed:b.boolean(),forbidden_prefixes:b.array(b.string()),discoverable:b.boolean(),notes:b.string()}).openapi("PropertyVocabularyTenantExtensions"),canonical_keys:b.array(Ri)}).openapi("PropertyVocabulary"),_t={naming:{case:"snake_case",key_pattern:Ti,max_key_length:64},reserved:{canonical_keys:["client","content_type","source_kind","audience","market","surface"],internal_prefixes:[...L7]},tenant_extensions:{allowed:!0,forbidden_prefixes:[...L7],discoverable:!1,notes:"Tenant-defined keys are allowed but remain out-of-band until custom property-schema discovery lands."},canonical_keys:[{key:"client",targets:["properties","applicability"],value_format:"slug",description:"Brand, customer, product line, or account identifier used to scope rules and reviews.",examples:["acme","globex","internal_docs"]},{key:"content_type",targets:["properties","applicability"],value_format:"slug",description:"The kind of material under review, expressed as a stable slug rather than free-form prose.",examples:["landing_page","blog_post","ad_copy"]},{key:"source_kind",targets:["properties","applicability"],value_format:"slug",description:"The intake/source family for the reviewable artifact or the rule targeting it.",examples:["git","upload","paste"]},{key:"audience",targets:["properties","applicability"],value_format:"slug",description:"Intended reader or stakeholder audience segment for the reviewed content.",examples:["external","internal","partner"]},{key:"market",targets:["properties","applicability"],value_format:"slug",description:"Geographic, regulatory, or commercial market segment affected by the content or rule.",examples:["us","de","healthcare"]},{key:"surface",targets:["properties","applicability"],value_format:"slug",description:"Delivery surface or channel used for migration from legacy workstream language.",examples:["website","email","reddit"]}]};var cX=/^[A-Za-z0-9+/]*={0,2}$/,C0="local";function a_($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function Ci($,w,g){let _=a_($);if(!_)return w;let v=_.ok===!0&&"result"in _,U=v?a_(_.result):_,G=U!==null?{...U}:{result:v?_.result:$};G.ok=!0,G.request_id=w.request_id;let D=v&&Array.isArray(_.warnings)?_.warnings:w.warnings;if(D!==void 0)G.warnings=D;let J=(v?a_(_.pagination):null)??w.pagination;if(J!==void 0)G.pagination=J;let X=(v?a_(_.advisory):null)??w.advisory;if(X!==void 0)G.advisory=X;let Q=g?.retry??(v?a_(_.retry):null);if(Q!==null&&Q!==void 0)G.retry=Q;else if(w.retry!==void 0)G.retry=w.retry;return G}function P($,w,g){let _=nW($,w,g),v=Ci($,_,g);return{content:[{type:"text",text:JSON.stringify(v,null,2)}]}}function B($,w){let g=$.status===0||$.status>=500||$.status===429,_=MW({requestId:$.requestId,error:{code:$.code,message:$.message,retryable:g,details:$.details,fix_hint:$.fixHint},retry:w?.operation?kW({operation:w.operation,hasIdempotencyKey:w.hasIdempotencyKey,retryable:g,statusCode:$.status,errorCode:$.code}):{retry_classification:g?"transient":"manual"}});return{content:[{type:"text",text:JSON.stringify(_,null,2)}],isError:!0}}function H$($,w,g,_){return new W($,w,g,_?.requestId??C0,_?.details,_?.fixHint)}function j7($,w){if($ instanceof W)return $;let g=w?.message??($ instanceof Error?$.message:String($));return H$(w?.status??500,w?.code??"internal_error",g,w)}function k$($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("Expected object payload from upstream API");let w=$,g=w.data;if(g&&typeof g==="object"&&!Array.isArray(g))return g;return w}var K7=1e7;function V7($){if(typeof $==="string"){let v=$.trim();return v.length>0?v:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let w=$,g=w.base64??w.content_base64??w.content??w.data??w.bytes;if(typeof g!=="string")return null;let _=g.trim();return _.length>0?_:null}function F7($){if(typeof $==="string"){let _=$.trim();return _.length>0?_:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let w=$,g=w.path??w.file_path??w.filename??w.file_name??w.name;if(typeof g==="string"&&g.trim().length>0)return g.trim();return null}function O7($){if($===void 0||$===null)return{assets:{}};let w={};if(Array.isArray($)){for(let[_,v]of $.entries()){let U=F7(v),G=V7(v);if(!U||!G)return{error:new W(422,"invalid_argument",`inline_assets[${_}] requires both a path and base64 payload`,"local")};w[U]=G}return{assets:w}}if(typeof $!=="object")return{error:new W(422,"invalid_argument","inline_assets must be an object map or array","local")};let g=Object.entries($);for(let[_,v]of g){let U=v&&typeof v==="object"&&!Array.isArray(v)?F7(v):_,G=V7(v);if(!U||!G)return{error:new W(422,"invalid_argument",`inline_assets entry '${_}' requires base64 content`,"local")};w[U]=G}return{assets:w}}function N7($){if(!$||$.length===0)return"Asset path is empty";if($.includes("\x00"))return"Asset path contains NUL byte";let w=$.replace(/\\/g,"/");if(w.startsWith("/"))return"Asset path must be relative (no leading /)";if(w.includes(".."))return"Asset path must not contain '..'";return null}function yX($){let w=$.replace(/\s+/g,"");if(w.length===0)return new Uint8Array;if(w.length%4!==0||!cX.test(w))return null;let g=Buffer.from(w,"base64"),_=w.replace(/=+$/,""),v=g.toString("base64").replace(/=+$/,"");if(_!==v)return null;return Uint8Array.from(g)}var ui=await Promise.resolve().then(() => $8(m0(),1)),P7=ui.version,Ei={Server:WX,StdioServerTransport:qX,CallToolRequestSchema:JX,ListToolsRequestSchema:DX};function u0($){return{content:$.content.map((w)=>({type:w.type,text:w.text})),...$.isError===void 0?{}:{isError:$.isError}}}async function k7($,w=Ei){let g=new w.Server({name:"typescape",version:P7},{capabilities:{tools:{}}});g.setRequestHandler(w.ListToolsRequestSchema,async()=>{return{tools:$.getTools().map((U)=>({name:U.name,description:U.description,inputSchema:U.inputSchema}))}}),g.setRequestHandler(w.CallToolRequestSchema,async(v)=>{let{name:U,arguments:G}=v.params,D=$.getHandler(U);if(!D)return u0(B(H$(404,"not_found",`Unknown tool: ${U}`,{details:{tool:U},fixHint:"Use tools/list to inspect the registered Typescape tools."})));try{if(G===void 0)return u0(B(H$(400,"invalid_request",`Missing arguments payload for tool: ${U}`,{details:{tool:U},fixHint:"Provide an arguments object for the tool call, even if it is empty."})));let J=await D(G);return u0(J)}catch(J){return u0(B(j7(J)))}});let _=new w.StdioServerTransport;await g.connect(_),process.stderr.write(`Typescape MCP server v${P7} started
|
|
181
|
+
`)}var Zi=300000;function n7($){let w=null;return{async getCapabilities(){let g=Date.now();if(w&&g-w.fetchedAt<Zi)return w.features;try{let _=await $.get("/me/capabilities");if(!_.body.features||typeof _.body.features!=="object")throw Error("Capabilities response missing features object");return w={features:_.body.features,fetchedAt:g},w.features}catch(_){if(_ instanceof W)throw _;throw _}},featureDisabledResult(g){return B(H$(403,"feature_disabled",`Feature '${g}' is not enabled on this server`,{details:{feature:g}}))}}}var xi=R0.options.filter(($)=>$!=="draft"),M7={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier (short slug, e.g. 'typescape'; not a GitHub path like 'org/repo')"},git_sha:{type:"string",description:"Concrete 40-hex Git commit SHA (agent must resolve; no symbolic refs)"},file_path:{type:"string",description:"Path to the source document (required)"},filename:{type:"string",description:'PDF filename when document_type is "pdf" (optional; defaults to the file_path basename)'},project_id:{type:"string",description:"Upload project ID for upload-backed reviews (requires upload_batch_id)"},upload_batch_id:{type:"string",description:"Upload batch ID for upload-backed reviews (requires project_id)"},title:{type:"string",description:"Review title (optional)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},name:{type:"string"},role:{type:"string",enum:["reviewer","approver","observer","owner"]},scopes:{type:"array",minItems:1,items:{type:"string",enum:["read","comment","approve","admin"]}}},required:["email","role"]},description:"Participants to invite (optional). Scopes are optional and default by role."},reviewer_emails:{type:"array",items:{type:"string"},description:"Legacy alias for participants. Each email is invited as a reviewer."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},identity_restriction:{type:"string",enum:["open","participants_only","domain"],description:'Identity verification mode for OTP step-up. "open" (default) accepts any email. "participants_only": only invited participant emails. "domain": only emails from allowed_email_domains.'},allowed_email_domains:{type:"array",items:{type:"string"},description:'Allowed email domains when identity_restriction is "domain" (e.g., ["acme.com", "example.org"])'},operator_name:{type:"string",maxLength:200,description:"Name of the operator initiating the review (optional)"},focus_areas:{type:"array",items:{type:"string",maxLength:100},maxItems:10,description:"Areas the reviewer should focus on (optional)"},framing:{type:"string",maxLength:1000,description:"Context framing text shown to reviewers (optional)"},carry_forward_findings:{type:"boolean",description:"Whether to carry forward findings from the superseded review (optional)"},carry_forward_filter:{type:"string",enum:["all","blocking","needs_changes"],description:"Filter for which findings to carry forward (optional)"},content_body:{type:"string",maxLength:1048576,description:"Inline Markdown content (alternative to repo_id+git_sha). Creates an upload-backed review automatically."},inline_assets:{oneOf:[{type:"object",additionalProperties:{oneOf:[{type:"string"},{type:"object",properties:{base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}]}},{type:"array",items:{type:"object",properties:{path:{type:"string"},file_path:{type:"string"},filename:{type:"string"},file_name:{type:"string"},name:{type:"string"},base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}}],description:'Companion assets as either a map of relative path => base64 content, or a list of asset objects. Map example: { "images/fig.png": "iVBORw0KGgo..." }. Array example: [{ "path": "images/fig.png", "base64": "iVBORw0KGgo..." }]. Total decoded size must be <= 10MB.'},document_type:{type:"string",enum:["markdown","image_set","pdf"],description:'Document type (default: "markdown"). Use "image_set" for image-only reviews or "pdf" for PDF reviews.'},asset_resolution_mode:{type:"string",enum:["strict","warn"],description:'Asset resolution mode (default: "strict"). Use "warn" to create upload-backed reviews even if some referenced assets are missing.'},filenames:{type:"array",items:{type:"string"},minItems:1,maxItems:100,description:'Ordered list of image filenames (required when document_type is "image_set"). Each filename must be a relative path. Supported formats: PNG, JPEG, WebP, GIF, SVG.'},purpose:{type:"string",enum:["review","rules"],description:'Review purpose (default: "review"). Use "rules" to create a rule review that feeds the rules governance pipeline.'},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map). Used when purpose=rules or for rule-aware content reviews."}},required:["file_path"]},z7={type:"object",properties:{review_id:{type:"string",description:"ID of the review to revise (the predecessor, e.g., rev_01HXYZ...)"},git_sha:{type:"string",description:"Concrete 40-hex Git commit SHA for the new revision (agent must resolve; no symbolic refs)"},content_body:{type:"string",description:"Inline Markdown content for upload-backed revised reviews (alternative to git_sha/upload_batch_id)"},project_id:{type:"string",description:"Upload project ID for upload-backed revised reviews (required with upload_batch_id)"},upload_batch_id:{type:"string",description:"Upload batch ID for upload-backed revised reviews (alternative to git_sha/content_body)"},file_path:{type:"string",description:"Path to the source document (optional; defaults to predecessor's file_path)"},document_type:{type:"string",enum:["markdown","image_set","pdf"],description:"Document type for revision (optional; defaults to predecessor document_type)"},filename:{type:"string",description:"PDF filename for document_type=pdf revisions (optional; defaults to file_path)"},filenames:{type:"array",items:{type:"string"},minItems:1,description:"Ordered image filenames for document_type=image_set revisions"},title:{type:"string",description:"Title for the new review (optional; defaults to predecessor's title)"},changes_summary:{type:"string",maxLength:5000,description:"Summary of changes for round-transition emails and the superseded banner (optional)"},resolutions:{type:"array",items:{type:"object",properties:{finding_id:{type:"string",description:"Finding ID from the predecessor review"},disposition:{type:"string",enum:["fixed","wont_fix","duplicate","by_design"],description:"How the finding was resolved"},evidence:{type:"string",maxLength:2000,description:"Optional evidence or explanation for the resolution"}},required:["finding_id","disposition"]},description:"Resolution manifest for findings from the predecessor review (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id"]},f7={type:"object",properties:{review_id:{type:"string",description:"Review ID to export (e.g., rev_01HXYZ...)"},schema:{type:"string",default:"v2",description:"Export schema version (default: v2). Explicit retired or unknown schema values fail with machine-readable API errors."},view:{type:"string",description:"Export view variant (optional). Values: redacted, response_matrix.v1, delta_review.v1"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},include_rule_context:{type:"boolean",description:"Include rule context metadata in the export (rule_context block with compiled_hash, policy_snapshot_id, and source rule refs). Default: false."}},required:["review_id"]},A7={type:"object",properties:{review_id:{type:"string",description:"Review ID to fetch the handoff bundle for"},include_rules:{type:"boolean",description:"Whether to include rule context (default: true)"},include_lineage:{type:"boolean",description:"Whether to include lineage summaries (default: true)"},include_advisory:{type:"boolean",description:"Whether to include advisory artifacts (default: true)"},include_blocks:{type:"boolean",description:"Whether to include block slices (default: true)"},max_rules:{type:"number",description:"Maximum number of structured rules to inline"}},required:["review_id"]},S7={type:"object",properties:{repo_id:{type:"string",description:"Filter reviews by repository identifier (short slug, e.g. 'typescape'; optional)"},state:{type:"string",description:"Filter by review state: active, closed, archived (optional)"},file_paths:{type:"string",description:"Comma-separated list of file paths to filter by (optional)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of reviews to return (optional, default: 20)"},root_review_id:{type:"string",description:"Filter by supersede chain root review ID (optional, e.g., rev_...)"},supersedes_review_id:{type:"string",description:"Filter by immediate predecessor review ID (optional, e.g., rev_...)"},has_successor:{type:"boolean",description:"If true, return only reviews that have been superseded; if false, only chain heads (optional)"},q:{type:"string",description:"Search query for title/file path (alias: search, optional)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:[]},i7={type:"object",properties:{review_id:{type:"string",description:"Review ID to retrieve (e.g., rev_01HXYZ...)"}},required:["review_id"]},T7={type:"object",properties:{review_id:{type:"string",description:"Review ID to render (e.g., rev_01HXYZ...)"},include_plaintext:{type:"boolean",description:"Include plaintext representation alongside HTML (optional, default: false)"}},required:["review_id"]},R7={type:"object",properties:{review_id:{type:"string",description:"Review ID to list findings for (e.g., rev_01HXYZ...)"},block_id:{type:"string",description:"Filter findings by block_id anchor (optional)"},status:{type:"string",description:"Filter findings by status: open, resolved, all (optional, default: all)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of findings to return (optional, default: 50)"},q:{type:"string",description:"Search query across finding id, block id, and comment text (optional; alias: search)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:["review_id"]},mX={type:"object",properties:{review_id:{type:"string",description:"Review ID (e.g., rev_01HXYZ...)"}},required:["review_id"]},C7={type:"object",properties:{query:{type:"string",description:"Search query text for reviews (title/file path)."},limit:{type:"number",description:"Maximum reviews to return (optional, default: 20)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["query"]},u7={type:"object",properties:{review_id:{type:"string",description:"Review ID to search within."},query:{type:"string",description:"Search query text for findings/comments."},block_id:{type:"string",description:"Optional block filter."},status:{type:"string",enum:xi,description:"Optional status filter: open | resolved."},limit:{type:"number",description:"Maximum findings to return (optional, default: 50)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","query"]};var E7=["typescape_create_review","typescape_revise_review","typescape_export_review","typescape_get_handoff","typescape_list_reviews","typescape_get_review","typescape_get_render","typescape_list_findings","typescape_search_reviews","typescape_search_findings","typescape_close_review","typescape_reopen_review"],hi="markdown",li="open",ci="strict";function yi($){if($==="approver")return["read","comment","approve"];if($==="observer")return["read"];if($==="owner")return["read","comment","approve","admin"];return["read","comment"]}function mi($){return $.map((w)=>{let g=w.scopes&&w.scopes.length>0?[...new Set(w.scopes)]:yi(w.role);return{email:w.email,...w.name?{name:w.name}:{},role:w.role,scopes:g}})}function ti($,w){let g=[];if(Array.isArray($))g.push(...$);if(Array.isArray(w))for(let U of w){if(typeof U!=="string")continue;let G=U.trim();if(G.length===0)continue;g.push({email:G,role:"reviewer"})}let _=new Set,v=[];for(let U of g){if(!U||typeof U.email!=="string")continue;let G=U.email.trim();if(G.length===0)continue;let D=G.toLowerCase();if(_.has(D))continue;_.add(D),v.push({...U,email:G})}return v}function di($){if(!Array.isArray($))return[];let w=new Set,g=[];for(let _ of $){if(typeof _!=="string")continue;let v=_.trim().toLowerCase();if(v.length===0)continue;if(w.has(v))continue;w.add(v),g.push(v)}return g}function oi($){if(!$||typeof $!=="object"||Array.isArray($))return null;let w=$.id;return typeof w==="string"&&w.length>0?w:null}function ri($){if(!$||typeof $!=="object"||Array.isArray($))return null;let w=$;if(typeof w.id==="string"&&w.id.length>0)return w.id;let g=w.project;if(g&&typeof g==="object"&&!Array.isArray(g)&&typeof g.id==="string")return g.id;return null}function pi($){if(!$||typeof $!=="object"||Array.isArray($))return null;let w=$;if(typeof w.upload_batch_id==="string"&&w.upload_batch_id.length>0)return w.upload_batch_id;let g=w.upload;if(g&&typeof g==="object"&&!Array.isArray(g)&&typeof g.upload_batch_id==="string")return g.upload_batch_id;return null}function ei($){let w=O7($.inline_assets);if("error"in w)return w.error;let g=w.assets;if(!$.file_path)return new W(400,"missing_param","Missing required parameter: file_path","local");let _=typeof $.repo_id==="string"&&$.repo_id.length>0,v=typeof $.git_sha==="string"&&$.git_sha.length>0,U=typeof $.project_id==="string"&&$.project_id.length>0,G=typeof $.upload_batch_id==="string"&&$.upload_batch_id.length>0,D=_&&v,J=U&&G,X=!!$.content_body,Q=Object.keys(g).length>0;if(_&&!v||!_&&v)return new W(422,"invalid_argument","Both repo_id and git_sha are required for git-backed reviews","local");if(U&&!G||!U&&G)return new W(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed reviews","local");if($.document_type!==void 0&&$.document_type!=="markdown"&&$.document_type!=="image_set"&&$.document_type!=="pdf")return new W(422,"invalid_argument",`Unsupported document_type: ${$.document_type}. Supported values: "markdown", "image_set", "pdf".`,"local");if($.asset_resolution_mode!==void 0&&$.asset_resolution_mode!=="strict"&&$.asset_resolution_mode!=="warn")return new W(422,"invalid_argument",`Unsupported asset_resolution_mode: ${$.asset_resolution_mode}. Supported values: "strict", "warn".`,"local");let Y=$.document_type??hi,q=$.identity_restriction??li,L=$.asset_resolution_mode??ci,F=Y==="image_set",H=Y==="pdf";if(F){if(!Q&&!J)return new W(400,"image_set_empty","image_set reviews require inline_assets or upload-batch input (project_id + upload_batch_id)","local");if(J&&(!$.filenames||$.filenames.length===0))return new W(400,"missing_param",'document_type "image_set" with upload-batch mode requires filenames.',"local");let i=new Set([".png",".jpg",".jpeg",".webp",".gif",".svg"]);if(Q){for(let c of Object.keys(g)){let x=c.slice(c.lastIndexOf(".")).toLowerCase();if(!i.has(x))return new W(422,"unsupported_media_type",`Unsupported image format for image_set: ${c}. Supported extensions: ${[...i].join(", ")}`,"local")}if(Object.keys(g).length>100)return new W(422,"image_set_limit_exceeded",`Image set has ${Object.keys(g).length} images, exceeding the maximum of 100`,"local")}}if(H){if(D)return new W(422,"invalid_argument",'document_type "pdf" is only supported with upload-backed sources (inline_assets or project_id+upload_batch_id).',"local");if(X)return new W(422,"invalid_argument",'document_type "pdf" does not support content_body; provide inline_assets with one .pdf file.',"local");if(!Q&&!J)return new W(400,"missing_param",'document_type "pdf" requires either inline_assets with one .pdf file, or upload-batch input (project_id + upload_batch_id).',"local");if(Q&&J)return new W(422,"invalid_argument",'document_type "pdf" cannot mix inline_assets and upload-batch inputs.',"local");if(Q&&Object.keys(g).length!==1)return new W(422,"invalid_argument",'document_type "pdf" requires exactly one inline asset.',"local");if(Q){let[i]=Object.keys(g);if(!i)return new W(400,"missing_param",'document_type "pdf" requires inline_assets with exactly one .pdf file.',"local");if(i.slice(i.lastIndexOf(".")).toLowerCase()!==".pdf")return new W(422,"unsupported_media_type",`Unsupported PDF format: ${i}. Supported extension: .pdf`,"local");if($.file_path!==i)return new W(422,"invalid_argument",`For document_type "pdf", file_path must match inline_assets key: ${i}`,"local")}}let V=[D,X,J].filter(Boolean).length;if(!F&&!H&&V===0)return new W(400,"missing_param","Provide one source mode: (repo_id + git_sha), (content_body), or (project_id + upload_batch_id)","local");if(V>1)return new W(422,"ambiguous_review_input","Cannot mix source modes: choose exactly one of git-backed, inline content_body, or upload-backed.","local");if(!F&&$.filenames&&$.filenames.length>0)return new W(422,"invalid_argument","filenames is only valid when document_type is image_set.","local");if(!H&&$.filename&&$.filename.trim().length>0)return new W(422,"invalid_argument",'filename is only valid when document_type is "pdf".',"local");if(q==="domain"&&(!$.allowed_email_domains||$.allowed_email_domains.length===0))return new W(422,"invalid_argument",'allowed_email_domains is required when identity_restriction is "domain"',"local");if(Object.keys(g).length>0){if(!X&&!F&&!H)return new W(422,"invalid_argument","inline_assets requires content_body (inline mode)","local");let i=0;for(let[c,x]of Object.entries(g)){let G$=N7(c);if(G$)return new W(422,"invalid_argument",`${G$}: ${c}`,"local");let r$=yX(x);if(r$===null)return new W(422,"invalid_argument",`Invalid base64 content for asset: ${c}`,"local");i+=r$.byteLength}if(i>K7)return new W(413,"inline_payload_too_large",`Total decoded inline assets (${i} bytes) exceed 10MB limit. Use the Typescape CLI with upload batch for larger payloads.`,"local")}let K={file_path:$.file_path,document_type:Y,identity_restriction:q,asset_resolution_mode:L};if(D)K.repo_id=$.repo_id,K.git_sha=$.git_sha;if(J)K.project_id=$.project_id,K.upload_batch_id=$.upload_batch_id;if(X)K.content_body=$.content_body;if(Object.keys(g).length>0)K.inline_assets=g;let f=ti($.participants,$.reviewer_emails);if(f.length>0)K.participants=mi(f);if($.title!==void 0)K.title=$.title;if($.allowed_email_domains!==void 0&&$.allowed_email_domains.length>0)K.allowed_email_domains=$.allowed_email_domains;if($.operator_name!==void 0)K.operator_name=$.operator_name;if($.focus_areas!==void 0&&$.focus_areas.length>0)K.focus_areas=$.focus_areas;if($.framing!==void 0)K.framing=$.framing;if($.carry_forward_findings!==void 0)K.carry_forward_findings=$.carry_forward_findings;if($.carry_forward_filter!==void 0)K.carry_forward_filter=$.carry_forward_filter;if(H)K.filename=$.filename?.trim()||$.file_path.split("/").filter(Boolean).at(-1)||$.file_path;if(F)K.filenames=$.filenames&&$.filenames.length>0?$.filenames:Object.keys(g).sort();if($.purpose!==void 0)K.purpose=$.purpose;if($.properties!==void 0)K.properties=$.properties;let S={};if($.idempotency_key)S["Idempotency-Key"]=$.idempotency_key;if($.expected_version)S["If-Match"]=$.expected_version;let u=di($.reviewer_emails),Z=H&&Q?(()=>{let i=Object.entries(g)[0];if(!i)return null;let[c,x]=i;return c&&x?{assetPath:c,base64Content:x}:null})():null;return{body:K,headers:S,reviewerEmails:u,pdfInlineFallback:Z}}async function ai($,w,g){let _=Array.isArray(g.invitations)?g.invitations:[];if(w.length===0||_.length>0)return _;let v=oi(g.review);if(!v)throw new W(500,"invalid_upstream_response","Review create response missing review.id; cannot invite reviewer_emails","local");let U=await $.post(`/reviews/${encodeURIComponent(v)}/participants`,{body:{participants:w.map((D)=>({email:D,role:"reviewer"}))}}),G=Array.isArray(U.body.invitations)?U.body.invitations:[];if(G.length>0)return G;throw new W(502,"invalid_upstream_response","Reviewer invitation follow-up returned no invitations",U.requestId)}async function Z7($,w,g){return $.post("/reviews",{body:w,headers:g})}async function si($,w){if(!w.pdfInlineFallback)throw new W(500,"invalid_local_state","PDF fallback requires exactly one inline asset","local");let g=yX(w.pdfInlineFallback.base64Content);if(g===null)throw new W(422,"invalid_argument",`Invalid base64 content for asset: ${w.pdfInlineFallback.assetPath}`,"local");let _=await $.post("/projects",{body:{name:`MCP Upload ${w.pdfInlineFallback.assetPath}`}}),v=ri(_.body);if(!v)throw new W(502,"invalid_upstream_response","Project create response missing project id",_.requestId);let U=new FormData;U.append(w.pdfInlineFallback.assetPath,new Blob([g],{type:"application/pdf"}),w.pdfInlineFallback.assetPath);let G=await $.postFormData(`/projects/${encodeURIComponent(v)}/upload`,U),D=pi(G.body);if(!D)throw new W(502,"invalid_upstream_response","Upload response missing upload_batch_id",G.requestId);let J={...w.body,project_id:v,upload_batch_id:D};return delete J.inline_assets,Z7($,J,w.headers)}async function $T($,w){let g=async(_)=>{let v=await ai($,w.reviewerEmails,_.body);return P({review:_.body.review,invitations:v},_.requestId)};try{let _=await Z7($,w.body,w.headers);return await g(_)}catch(_){if(_ instanceof W&&w.pdfInlineFallback&&_.code==="feature_disabled"&&_.details?.feature==="inline_assets_enabled")try{let v=await si($,w);return await g(v)}catch(v){if(v instanceof W)return B(v);throw v}if(_ instanceof W)return B(_);throw _}}function wT($){if(!$.review_id)return new W(400,"missing_param","Missing required parameter: review_id","local");let w=typeof $.git_sha==="string"&&$.git_sha.length>0,g=typeof $.content_body==="string"&&$.content_body.length>0,_=typeof $.upload_batch_id==="string"&&$.upload_batch_id.length>0,v=typeof $.project_id==="string"&&$.project_id.length>0;if(v&&!_||!v&&_)return new W(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed revision","local");let U=[w,g,_].filter(Boolean).length;if(U===0)return new W(400,"missing_param","One of git_sha, content_body, or upload_batch_id is required","local");if(U>1)return new W(422,"invalid_argument","git_sha, content_body, and upload_batch_id are mutually exclusive","local");let G=w?$.git_sha:void 0;if(G&&!/^[a-f0-9]{40}$/i.test(G))return new W(400,"invalid_param",`Invalid git_sha format: must be a 40-character hex string, got "${$.git_sha}"`,"local");let D={};if(G)D.git_sha=G.toLowerCase();if(g)D.content_body=$.content_body;if(_)D.project_id=$.project_id,D.upload_batch_id=$.upload_batch_id;if($.file_path!==void 0)D.file_path=$.file_path;if($.document_type!==void 0)D.document_type=$.document_type;if($.filename!==void 0)D.filename=$.filename;else if($.document_type==="pdf"&&$.file_path!==void 0)D.filename=$.file_path;if($.filenames!==void 0&&$.filenames.length>0)D.filenames=$.filenames;if($.title!==void 0)D.title=$.title;if($.changes_summary!==void 0)D.changes_summary=$.changes_summary;if($.resolutions!==void 0&&$.resolutions.length>0)D.resolutions=$.resolutions;let J={};if($.idempotency_key)J["Idempotency-Key"]=$.idempotency_key;return{reviewId:$.review_id,body:D,headers:J}}async function vT($,w){try{let g=await $.post(`/reviews/${encodeURIComponent(w.reviewId)}/revise`,{body:w.body,headers:w.headers});return P(g.body,g.requestId)}catch(g){if(g instanceof W)return B(g);throw g}}function x7($,w){let g=new Map;function _(F){let H=F.indexOf("#");if(H===-1)throw new W(500,"invalid_review_url","Review link URL is missing fragment token","local");return F.slice(H+1)}async function v(F){let H=g.get(F);if(H&&H.expiresAtMs>Date.now())return H.token;let V=await w.get(`/reviews/${F}/participants`,{query:{role:"reviewer"}}),K=V.body.items?.[0]?.participant_id;if(!K)K=(await w.get(`/reviews/${F}/participants`,{query:{limit:"1"}})).body.items?.[0]?.participant_id;if(!K)throw new W(422,"no_participants","No participants available to mint a render token",V.requestId);let f=await w.post(`/reviews/${F}/links`,{body:{participant_id:K,scope:"read",single_use:!0,url_token_ttl_minutes:60}}),S=f.body.url;if(!S||typeof S!=="string")throw new W(500,"invalid_link_response","Failed to mint review link for render",f.requestId);let u=await w.post("/auth/exchange",{body:{url_token:_(S)}}),Z=u.body.session_access_token,i=u.body.expires_in_seconds;if(!Z||typeof Z!=="string")throw new W(500,"token_exchange_failed","Failed to exchange review link for review access token",u.requestId);let c=typeof i==="number"&&Number.isFinite(i)?Math.max(0,Math.trunc(i)-30)*1000:300000;return g.set(F,{token:Z,expiresAtMs:Date.now()+c}),Z}let U={name:"typescape_create_review",description:"Create a new Typescape review for Markdown, image-set, or PDF content. Supports three source modes: (1) git-backed with repo_id+git_sha, (2) inline with content_body and optional inline_assets (base64), or (3) upload-backed with project_id+upload_batch_id. Returns the review ID and any invitations sent.",inputSchema:M7};$.register(U,async(F)=>{let H=ei(F);if(H instanceof W)return B(H);return $T(w,H)});let G={name:"typescape_revise_review",description:"Compatibility-only helper for product-owned revise flows. Preferred pattern: external agent revises content, then create a new Typescape review pinned to a newer revision, superseding an existing review. The predecessor becomes read-only and unresolved findings are carried forward to the new review. Supports git revision (git_sha) and upload revision (content_body or upload_batch_id+project_id).",inputSchema:z7};$.register(G,async(F)=>{let H=wT(F);if(H instanceof W)return B(H);return vT(w,H)});let D={name:"typescape_export_review",description:"Export all feedback from a Typescape review as structured JSON. Returns the full export document including findings, comments, and anchors.",inputSchema:f7};$.register(D,async(F)=>{let H=F;if(!H.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));let K={schema:typeof H.schema==="string"&&H.schema.trim().length>0?H.schema.trim():"v2"};if(H.view)K.view=H.view;if(H.include_rule_context)K.include_rule_context="true";let f={};if(H.expected_version)f["If-Match"]=H.expected_version;try{let S=await w.get(`/reviews/${H.review_id}/export`,{query:K,headers:f});return P(S.body,S.requestId)}catch(S){if(S instanceof W)return B(S);throw S}});let J={name:"typescape_get_handoff",description:"Fetch the canonical agent handoff bundle for a Typescape review. Returns review state, findings, lineage, rules, artifacts, and next actions in one read-only package.",inputSchema:A7};$.register(J,async(F)=>{let H=F;if(!H.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));let V={};if(typeof H.include_rules==="boolean")V.include_rules=H.include_rules?"true":"false";if(typeof H.include_lineage==="boolean")V.include_lineage=H.include_lineage?"true":"false";if(typeof H.include_advisory==="boolean")V.include_advisory=H.include_advisory?"true":"false";if(typeof H.include_blocks==="boolean")V.include_blocks=H.include_blocks?"true":"false";if(typeof H.max_rules==="number")V.max_rules=String(H.max_rules);try{let K=await w.get(`/reviews/${encodeURIComponent(H.review_id)}/handoff`,{query:V});return P(K.body,K.requestId)}catch(K){if(K instanceof W)return B(K);throw K}});let X={name:"typescape_list_reviews",description:"List Typescape reviews with optional filters. Returns paginated review summaries. Use cursor from previous response for pagination.",inputSchema:S7};$.register(X,async(F)=>{let H=F,V={};if(H.repo_id)V.repo_id=H.repo_id;if(H.state)V.state=H.state;if(H.file_paths)V.file_paths=H.file_paths;if(H.cursor)V.cursor=H.cursor;if(H.limit!==void 0)V.limit=String(H.limit);if(H.root_review_id)V.root_review_id=H.root_review_id;if(H.supersedes_review_id)V.supersedes_review_id=H.supersedes_review_id;if(H.has_successor!==void 0)V.has_successor=H.has_successor?"true":"false";let K=H.q??H.search;if(K)V.q=K;try{let f=await w.get("/reviews",{query:V});return P(f.body,f.requestId)}catch(f){if(f instanceof W)return B(f);throw f}});let Q={name:"typescape_get_review",description:"Get details of a specific Typescape review. Returns full review metadata including participants, stats, and provenance.",inputSchema:i7};$.register(Q,async(F)=>{let H=F;if(!H.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{let V=await w.get(`/reviews/${encodeURIComponent(H.review_id)}`);return P(V.body,V.requestId)}catch(V){if(V instanceof W)return B(V);throw V}});let Y={name:"typescape_get_render",description:"Get the rendered content of a review. Returns immutable block-level HTML structure with block_ids for anchoring.",inputSchema:T7};$.register(Y,async(F)=>{let H=F;if(!H.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));let V={};if(H.include_plaintext)V.include_plaintext="true";try{let K=await v(H.review_id),f=await w.get(`/reviews/${H.review_id}/render`,{query:V,headers:{Authorization:`Bearer ${K}`}});return P(f.body,f.requestId)}catch(K){if(K instanceof W)return B(K);throw K}});let q={name:"typescape_list_findings",description:"List findings (review comments) for a review in the same plain-language form the reviewer or agent wrote them. Optionally filter by block_id anchor or finding status. Returns paginated finding list with comments.",inputSchema:R7},L=async(F)=>{if(!F.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));let H={};if(F.block_id)H.block_id=F.block_id;if(F.status)H.status=F.status;if(F.cursor)H.cursor=F.cursor;if(F.limit!==void 0)H.limit=String(F.limit);let V=F.q??F.search;if(V)H.q=V;try{let K=await w.get(`/reviews/${encodeURIComponent(F.review_id)}/findings`,{query:H});return P(K.body,K.requestId)}catch(K){if(K instanceof W)return B(K);throw K}};$.register(q,async(F)=>{return L(F)}),$.register({name:"typescape_search_reviews",description:"Search reviews by title/file path using server-side query matching.",inputSchema:C7},async(F)=>{let H=F,V=typeof H.query==="string"?H.query.trim():"";if(!V)return B(new W(400,"missing_param","Missing required parameter: query","local"));let K={q:V};if(H.limit!==void 0)K.limit=String(H.limit);if(H.cursor)K.cursor=H.cursor;try{let f=await w.get("/reviews",{query:K});return P(f.body,f.requestId)}catch(f){if(f instanceof W)return B(f);throw f}}),$.register({name:"typescape_search_findings",description:"Search findings/comments within a review using server-side query matching.",inputSchema:u7},async(F)=>{let H=F,V=typeof H.query==="string"?H.query.trim():"";if(!H.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!V)return B(new W(400,"missing_param","Missing required parameter: query","local"));return L({review_id:H.review_id,q:V,block_id:H.block_id,status:H.status,limit:H.limit,cursor:H.cursor})}),$.register({name:"typescape_close_review",description:"Close an active review, making it read-only for reviewers.",inputSchema:mX},async(F)=>{let H=F;if(!H.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{let V=await w.post(`/reviews/${encodeURIComponent(H.review_id)}/close`,{body:{}});return P(V.body,V.requestId)}catch(V){if(V instanceof W)return B(V);throw V}}),$.register({name:"typescape_reopen_review",description:"Reopen a closed review and return it to active state.",inputSchema:mX},async(F)=>{let H=F;if(!H.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{let V=await w.post(`/reviews/${encodeURIComponent(H.review_id)}/reopen`,{body:{}});return P(V.body,V.requestId)}catch(V){if(V instanceof W)return B(V);throw V}})}var h7={type:"object",properties:{review_id:{type:"string",description:"Review ID to export response matrix for (e.g., sess_01HXYZ...)"}},required:["review_id"]},l7={type:"object",properties:{review_id:{type:"string",description:"Review ID to attach the finding to (e.g., sess_01HXYZ...)"},body_md:{type:"string",description:"Plain-language finding body in Markdown. Say what is wrong, unclear, or missing."},body:{type:"string",description:"Compatibility alias for body_md."},block_id:{type:"string",description:"Block ID to anchor the finding to when feedback targets a specific passage (optional; omit for review-level)."},anchor:{type:"object",properties:{type:{type:"string",enum:["session","block","range"],description:"Anchor type (default: session if no block_id, block if block_id provided)"},start_offset:{type:"number",description:"Start offset for range anchor"},end_offset:{type:"number",description:"End offset for range anchor"}},description:"Optional anchor details. Omit for review-level feedback or provide block/range details when you have them."},severity:{type:"string",enum:["suggestion","needs_changes","blocking"],description:"Optional severity hint. Omit unless the finding clearly blocks approval or needs explicit escalation. Note: 'blocking' from automation is coerced to 'needs_changes' per Ch 11 L6250."},tags:{type:"array",items:{type:"string"},description:"Optional machine tags for downstream automation. Most agent loops should omit this."},suggestion:{type:"object",properties:{type:{type:"string",enum:["replace","insert","delete"]}},description:"Optional structured edit payload when you want to carry an explicit replacement."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","body_md"]},c7={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to post comment to"},body_md:{type:"string",description:"Plain-language comment body in Markdown."},body:{type:"string",description:"Compatibility alias for body_md"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","finding_id","body_md"]},y7={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to resolve"},decision:{type:"object",properties:{state:{type:"string",enum:["accepted","rejected","deferred","duplicate","needs_more_info"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["state"],description:"Decision to record with resolution (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},m7={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to reopen"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},t7={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to record decision for"},state:{type:"string",enum:["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["review_id","finding_id","state"]},d7={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to attach evidence to"},evidence_type:{type:"string",enum:["commit","proposed_change","pr","attestation","external_ticket","note"],description:"Evidence type (required). Determines which additional fields are relevant."},commit_sha:{type:"string",description:"Git commit SHA (for evidence_type=commit)"},repo_url:{type:"string",description:"Repository URL (for evidence_type=commit)"},message:{type:"string",description:"Commit message (for evidence_type=commit)"},proposed_change_id:{type:"string",description:"Proposed change ID (for evidence_type=proposed_change)"},patch_sha256:{type:"string",description:"Patch SHA256 (for evidence_type=proposed_change)"},pr_url:{type:"string",description:"PR URL (for evidence_type=pr)"},pr_number:{type:"number",description:"PR number (for evidence_type=pr)"},attestation_id:{type:"string",description:"Attestation ID (for evidence_type=attestation)"},attestor:{type:"string",description:"Attestor identity (optional, for attestation type)"},ticket_url:{type:"string",description:"Ticket URL (for evidence_type=external_ticket)"},ticket_id:{type:"string",description:"Ticket ID (for evidence_type=external_ticket)"},system:{type:"string",description:"Ticket system (for evidence_type=external_ticket)"},note_md:{type:"string",description:"Note text (for evidence_type=note)"},body_md:{type:"string",description:"Markdown evidence body (alias for note_md/text; useful for attestation/external_ticket notes)"},dedupe_key:{type:"string",description:"Optional idempotency/deduplication key for evidence attach"}},required:["review_id","finding_id","evidence_type"]},o7={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to fetch latest decision for."}},required:["review_id","finding_id"]},r7={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to list evidence for."},limit:{type:"number",description:"Maximum evidence entries to return (optional)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","finding_id"]};var e7=["typescape_export_response_matrix","typescape_create_finding","typescape_post_comment","typescape_resolve_finding","typescape_reopen_finding","typescape_record_decision","typescape_attach_evidence","typescape_get_decision","typescape_list_evidence"],tX=Qw({operation:"read"});function u6($){return Qw({operation:"write",hasIdempotencyKey:$})}var gT="X-Typescape-If-Match";function p7($,w,g){if(!$)return;if(/^[1-9]\d*$/.test($)){w.expected_version=Number.parseInt($,10);return}g[gT]=$}function a7($,w){$.register({name:"typescape_export_response_matrix",description:"Export the response matrix for a review. Returns per-finding decision and evidence summary.",inputSchema:h7},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{let v=await w.get(`/reviews/${_.review_id}/export`,{query:{view:"response_matrix.v1"}});return P(v.body,v.requestId,{retry:tX})}catch(v){if(v instanceof W)return B(v,{operation:"read"});throw v}}),$.register({name:"typescape_create_finding",description:"Create a new finding (comment) on a review after the agent has read the content and formed its own judgment. Use plain-language body text that a reviewer or operator can read directly. Optionally anchor to a specific block_id. Agent-created findings are tagged source='automation'. Severity 'blocking' is coerced to 'needs_changes' for automation sources.",inputSchema:l7},async(g)=>{let _=g,v=_.body_md??_.body;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!v)return B(new W(400,"missing_param","Missing required parameter: body_md","local"));let U={body_md:v,source:"automation"},G=typeof _.block_id==="string"?_.block_id.trim():void 0;if(G)U.block_id=G;if(_.anchor!==void 0)U.anchor=_.anchor;else if(G)U.anchor={type:"block"};if(_.severity!==void 0)U.severity=_.severity;if(_.tags!==void 0)U.tags=_.tags;if(_.suggestion!==void 0)U.suggestion=_.suggestion;let D={};if(_.idempotency_key)D["Idempotency-Key"]=_.idempotency_key;try{let J=await w.post(`/reviews/${encodeURIComponent(_.review_id)}/findings`,{body:U,headers:D});return P(J.body,J.requestId,{retry:u6(Boolean(_.idempotency_key))})}catch(J){if(J instanceof W)return B(J,{operation:"write",hasIdempotencyKey:Boolean(_.idempotency_key)});throw J}}),$.register({name:"typescape_post_comment",description:"Post a comment (reply) to an existing finding. Returns the created comment with its ID.",inputSchema:c7},async(g)=>{let _=g,v=_.body_md??_.body;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!_.finding_id)return B(new W(400,"missing_param","Missing required parameter: finding_id","local"));if(!v)return B(new W(400,"missing_param","Missing required parameter: body_md","local"));let U={body_md:v,source:"automation"},G={};if(_.idempotency_key)G["Idempotency-Key"]=_.idempotency_key;try{let D=await w.post(`/reviews/${encodeURIComponent(_.review_id)}/findings/${encodeURIComponent(_.finding_id)}/comments`,{body:U,headers:G});return P(D.body,D.requestId,{retry:u6(Boolean(_.idempotency_key))})}catch(D){if(D instanceof W)return B(D,{operation:"write",hasIdempotencyKey:Boolean(_.idempotency_key)});throw D}}),$.register({name:"typescape_resolve_finding",description:"Resolve (close) a finding. Optionally include a decision. Use expected_version or if_match for optimistic concurrency.",inputSchema:y7},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!_.finding_id)return B(new W(400,"missing_param","Missing required parameter: finding_id","local"));let v=_.decision===void 0?{status:"resolved"}:{disposition:_.decision},U={};p7(_.expected_version??_.if_match,v,U);try{let G=_.decision===void 0?await w.patch(`/reviews/${encodeURIComponent(_.review_id)}/findings/${encodeURIComponent(_.finding_id)}`,{body:v,headers:U}):await w.post(`/reviews/${_.review_id}/threads/${_.finding_id}/resolve`,{body:v,headers:U});return P(G.body,G.requestId,{retry:u6(!1)})}catch(G){if(G instanceof W)return B(G,{operation:"write"});throw G}}),$.register({name:"typescape_reopen_finding",description:"Reopen a previously resolved finding. Use expected_version or if_match for optimistic concurrency.",inputSchema:m7},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!_.finding_id)return B(new W(400,"missing_param","Missing required parameter: finding_id","local"));let v={},U={};p7(_.expected_version??_.if_match,v,U);try{v.status="open";let G=await w.patch(`/reviews/${encodeURIComponent(_.review_id)}/findings/${encodeURIComponent(_.finding_id)}`,{body:v,headers:U});return P(G.body,G.requestId,{retry:u6(!1)})}catch(G){if(G instanceof W)return B(G,{operation:"write"});throw G}}),$.register({name:"typescape_record_decision",description:"Record a decision (decision) on a finding. Decisions track how feedback was addressed. Note: recording a resolving decision may automatically resolve the finding.",inputSchema:t7},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!_.finding_id)return B(new W(400,"missing_param","Missing required parameter: finding_id","local"));if(!_.state)return B(new W(400,"missing_param","Missing required parameter: state","local"));let v={state:_.state};if(_.rationale_md!==void 0)v.rationale_md=_.rationale_md;try{let U=await w.post(`/reviews/${encodeURIComponent(_.review_id)}/findings/${encodeURIComponent(_.finding_id)}/decision`,{body:v});return P(U.body,U.requestId,{retry:u6(!1)})}catch(U){if(U instanceof W)return B(U,{operation:"write"});throw U}}),$.register({name:"typescape_attach_evidence",description:"Attach evidence to a finding. Evidence proves that feedback was addressed (e.g., commit SHA, proposed change, PR URL, or attestation).",inputSchema:d7},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!_.finding_id)return B(new W(400,"missing_param","Missing required parameter: finding_id","local"));let v,U;if(_.evidence_type){v=_.evidence_type.trim(),U={};let D=["commit_sha","repo_url","message","proposed_change_id","patch_sha256","pr_url","pr_number","attestation_id","attestor","ticket_url","ticket_id","system","note_md","body_md"];for(let J of D)if(_[J]!==void 0)U[J]=_[J];if(_.body_md!==void 0)U.body=_.body_md,U.text=_.body_md;else if(_.note_md!==void 0)U.body=_.note_md,U.text=_.note_md}else if(_.evidence)v=typeof _.evidence.type==="string"?_.evidence.type.trim():"",U={..._.evidence},delete U.type;else return B(new W(400,"missing_param","Missing required parameter: evidence_type","local"));if(!v)return B(new W(422,"invalid_argument","evidence_type is required","local"));let G={evidence_type:v,evidence_json:U};if(_.dedupe_key)G.dedupe_key=_.dedupe_key;try{let D=await w.post(`/reviews/${encodeURIComponent(_.review_id)}/findings/${encodeURIComponent(_.finding_id)}/evidence`,{body:G});return P(D.body,D.requestId,{retry:u6(!1)})}catch(D){if(D instanceof W)return B(D,{operation:"write"});throw D}}),$.register({name:"typescape_get_decision",description:"Get the latest decision for a specific finding.",inputSchema:o7},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!_.finding_id)return B(new W(400,"missing_param","Missing required parameter: finding_id","local"));try{let v=await w.get(`/reviews/${encodeURIComponent(_.review_id)}/findings/${encodeURIComponent(_.finding_id)}/decision`);return P(v.body,v.requestId,{retry:tX})}catch(v){if(v instanceof W)return B(v,{operation:"read"});throw v}}),$.register({name:"typescape_list_evidence",description:"List evidence entries attached to a finding.",inputSchema:r7},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!_.finding_id)return B(new W(400,"missing_param","Missing required parameter: finding_id","local"));let v={};if(_.limit!==void 0)v.limit=String(_.limit);if(_.cursor)v.cursor=_.cursor;try{let U=await w.get(`/reviews/${encodeURIComponent(_.review_id)}/findings/${encodeURIComponent(_.finding_id)}/evidence`,{query:v});return P(U.body,U.requestId,{retry:tX})}catch(U){if(U instanceof W)return B(U,{operation:"read"});throw U}})}var E0=["file","doc","pr","custom"],s7=new Set(E0),$H={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review set"},title:{type:"string",description:"Review set title (optional)"},kind:{type:"string",enum:["review_set","release_bundle","packet"],description:"Kind of review set (optional, default: review_set)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},role:{type:"string",enum:["reviewer","approver"]},roles:{type:"array",items:{type:"string",enum:["reviewer","approver"]},minItems:1}},required:["email"]},description:"Participants to invite (optional). Supports role (single) or roles (array)."},reviews:{type:"array",items:{oneOf:[{type:"string"},{type:"object",properties:{review_id:{type:"string"},session_id:{type:"string"},required:{type:"boolean"}},anyOf:[{required:["review_id"]},{required:["session_id"]}],additionalProperties:!1}]},minItems:1,description:"Review IDs (or review entry objects) to include in this review set."},files:{type:"array",items:{type:"object",properties:{repo_id:{type:"string"},git_sha:{type:"string"},project_id:{type:"string"},upload_batch_id:{type:"string"},file_path:{type:"string"},required:{type:"boolean"}},required:["file_path"],additionalProperties:!1},minItems:1,description:"File entries for git or upload source types (must include file_path plus source identifiers)."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["source_type"]},wH={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to export"},schema:{type:"string",description:"Export schema version (optional, default: v2). Canonical first-party review-set export uses schema=v2."},view:{type:"string",description:"Export view variant (optional). Values: full, redacted, response_matrix.v1, etc."}},required:["review_set_id"]},vH={type:"object",properties:{limit:{type:"number",description:"Maximum number of review sets to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},gH={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to retrieve"}},required:["review_set_id"]},_H={type:"object",properties:{title:{type:"string",description:"Work item title"},kind:{type:"string",enum:K0,description:"Canonical work item kind"},reason_code:{type:"string",enum:N0,description:"Canonical reason code describing why the item exists"},audience_mode:{type:"string",enum:O0,description:"Queue routing mode for this work item"},blocking:{type:"boolean",description:"Whether the item is blocking"},priority:{type:"number",description:"Priority from 0-9"},target:{type:"object",properties:{target_type:{type:"string",description:"Canonical target type"},target_id:{type:"string",description:"Canonical target identifier"}},required:["target_type","target_id"],additionalProperties:!1},assignee_id:{type:"string",description:"Assignee user ID when audience_mode=assigned"},steward_group:{type:"string",description:"Optional steward group label"},due_at:{type:"string",description:"Optional ISO-8601 due timestamp"},metadata:{type:"object",description:"Optional metadata object",additionalProperties:!0},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries"}},required:["title","kind","reason_code","audience_mode","target"],additionalProperties:!1},UH={type:"object",properties:{state:{type:"string",enum:MX,description:"Filter by work item state"},kind:{type:"string",enum:K0,description:"Filter by work item kind"},reason_code:{type:"string",enum:N0,description:"Filter by canonical reason code"},audience_mode:{type:"string",enum:O0,description:"Filter by audience mode"},queue_surface:{type:"string",enum:AX,description:"Filter by derived queue surface"},assignee_id:{type:"string",description:"Filter by assignee"},claimant_id:{type:"string",description:"Filter by claimant"},cursor:{type:"string",description:"Pagination cursor from a previous response"},limit:{type:"number",description:"Maximum number of work items to return (default: 25, max: 100)"}},additionalProperties:!1},bH={type:"object",properties:{work_item_id:{type:"string",description:"Work item ID to retrieve"}},required:["work_item_id"],additionalProperties:!1},GH={type:"object",properties:{work_item_id:{type:"string",description:"Work item ID to transition"},action:{type:"string",enum:SX,description:"Canonical transition action"},expected_version:{type:"number",description:"Optimistic concurrency version guard"},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries"},blocking_reason:{type:"string",description:"Required when action=block"},cancellation_reason:{type:"string",description:"Required when action=cancel"},completion_outcome:{type:"string",enum:iX,description:"Required when action=complete"},comment:{type:"string",description:"Optional operator comment"}},required:["work_item_id","action"],additionalProperties:!1},DH={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review ref"},repo_id:{type:"string",description:"Repository identifier (required for git source_type; short slug, e.g. 'typescape')"},project_id:{type:"string",description:"Project identifier (required for upload source_type; omit for git)"},kind:{type:"string",enum:E0,description:"Review ref kind"},key:{type:"string",description:"Review ref key (e.g., file path, doc slug, PR number, custom name)"},head_session_id:{type:"string",description:"Session ID to use as the initial head (required, e.g., sess_01HXYZ...)"}},required:["source_type","kind","key","head_session_id"]},JH={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to resolve"}},required:["review_ref_id"]},XH={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to advance"},head_session_id:{type:"string",description:"New head review ID to advance to"},expected_head_session_id:{type:"string",description:"Expected current head for optimistic concurrency (optional)"}},required:["review_ref_id","head_session_id"]},QH={type:"object",properties:{review_id:{type:"string",description:"Review ID to request approval for"},approver_emails:{type:"array",items:{type:"string"},description:"Email addresses of approvers"},message:{type:"string",description:"Message to include with the approval request (optional)"},notify:{type:"object",properties:{email:{type:"boolean"},slack:{type:"boolean"}},description:"Notification channels (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","approver_emails"]},YH={type:"object",properties:{review_id:{type:"string",description:"Review ID to get status for"},simulate:{type:"boolean",description:"Run policy evaluation without side effects (optional)"},wait:{type:"number",description:"Long-poll timeout in seconds (optional)"}},required:["review_id"]},WH={type:"object",properties:{review_id:{type:"string",description:"Review ID to run deterministic product-owned checks against"}},required:["review_id"]},HH={type:"object",properties:{},additionalProperties:!1},qH={type:"object",properties:{},additionalProperties:!1},BH={type:"object",properties:{},additionalProperties:!1};var IH=["typescape_create_review_set","typescape_export_review_set","typescape_list_review_sets","typescape_get_review_set","typescape_create_work_item","typescape_list_work_items","typescape_get_work_item","typescape_transition_work_item","typescape_create_review_ref","typescape_resolve_review_ref","typescape_advance_review_ref","typescape_request_approval","typescape_get_status","typescape_run_checks","typescape_account_usage","typescape_account_plan","typescape_get_capabilities"];function _T($){return $.replace(/\bSession\b/g,"Review").replace(/\bsession\b/g,"review").replace(/\bThread\b/g,"Finding").replace(/\bthread\b/g,"finding")}function dX($){if(Array.isArray($))return $.map((_)=>dX(_));if($===null||typeof $!=="object")return $;let w=new Map([["session_id","review_id"],["thread_id","finding_id"],["thread_ids","finding_ids"]]),g=Object.entries($).map(([_,v])=>{let U=w.get(_)??_,G=typeof v==="string"&&(_==="description"||_==="message")?_T(v):dX(v);return[U,G]});return Object.fromEntries(g)}function s_($,w){let g=$[0];if(!g)return w;return`${g.path.length>0?`${g.path.map((v)=>String(v)).join(".")}: `:""}${g.message}`}function LH($,w,g){$.register({name:"typescape_create_review_set",description:"Create a new review set (multi-file review pack). Requires features.review_sets to be enabled.",inputSchema:$H},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(Q){if(Q instanceof W)return B(Q);throw Q}if(!v.source_type)return B(new W(400,"missing_param","Missing required parameter: source_type","local"));if(v.source_type!=="git"&&v.source_type!=="upload")return B(new W(422,"invalid_argument","source_type must be one of: git, upload","local"));let U=Array.isArray(v.reviews)&&v.reviews.length>0?v.reviews:Array.isArray(v.sessions)&&v.sessions.length>0?v.sessions:void 0,G=Array.isArray(U)&&U.length>0,D=Array.isArray(v.files)&&v.files.length>0;if(!G&&!D)return B(new W(400,"missing_param","At least one of reviews[] or files[] is required","local"));let J={source_type:v.source_type};if(v.title!==void 0)J.title=v.title;if(v.kind!==void 0)J.kind=v.kind;if(G)J.reviews=U;if(D)J.files=v.files;if(v.participants!==void 0)J.participants=v.participants.map((Q)=>{if(Array.isArray(Q.roles)&&Q.roles.length>0)return{email:Q.email,roles:Q.roles};if(Q.role)return{email:Q.email,roles:[Q.role]};return Q});let X={};if(v.idempotency_key)X["Idempotency-Key"]=v.idempotency_key;try{let Q=await w.post("/review-sets",{body:J,headers:X});return P(Q.body,Q.requestId)}catch(Q){if(Q instanceof W)return B(Q);throw Q}}),$.register({name:"typescape_export_review_set",description:"Export feedback from a review set. Requires features.review_sets to be enabled.",inputSchema:wH},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(D){if(D instanceof W)return B(D);throw D}if(!v.review_set_id)return B(new W(400,"missing_param","Missing required parameter: review_set_id","local"));let G={schema:typeof v.schema==="string"&&v.schema.trim().length>0?v.schema.trim():"v2"};if(v.view)G.view=v.view;try{let D=await w.get(`/review-sets/${encodeURIComponent(v.review_set_id)}/export`,{query:G});return P(D.body,D.requestId)}catch(D){if(D instanceof W)return B(D);throw D}}),$.register({name:"typescape_list_review_sets",description:"List review sets with optional cursor pagination. Requires features.review_sets to be enabled. Returns an array of review sets with pagination metadata.",inputSchema:vH},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(G){if(G instanceof W)return B(G);throw G}let U={};if(v.limit!==void 0)U.limit=String(v.limit);if(v.cursor!==void 0)U.cursor=v.cursor;try{let G=await w.get("/review-sets",{query:U});return P(G.body,G.requestId)}catch(G){if(G instanceof W)return B(G);throw G}}),$.register({name:"typescape_get_review_set",description:"Get a review set by ID. Returns the review set details including status, review memberships, and configuration. Requires features.review_sets to be enabled.",inputSchema:gH},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(U){if(U instanceof W)return B(U);throw U}if(!v.review_set_id)return B(new W(400,"missing_param","Missing required parameter: review_set_id","local"));try{let U=await w.get(`/review-sets/${encodeURIComponent(v.review_set_id)}`);return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_create_work_item",description:"Create a canonical shared-queue work item for review, verification, triage, approval, or manual operator tasks.",inputSchema:_H},async(_)=>{let v=_;if(!v.title)return B(H$(400,"missing_param","Missing required parameter: title"));if(!v.kind)return B(H$(400,"missing_param","Missing required parameter: kind"));if(!v.reason_code)return B(H$(400,"missing_param","Missing required parameter: reason_code"));if(!v.audience_mode)return B(H$(400,"missing_param","Missing required parameter: audience_mode"));if(!v.target?.target_type)return B(H$(400,"missing_param","Missing required parameter: target.target_type"));if(!v.target?.target_id)return B(H$(400,"missing_param","Missing required parameter: target.target_id"));let U=dW.safeParse(_);if(!U.success)return B(H$(422,"invalid_argument",s_(U.error.issues,"Invalid work-item create payload")));try{let G=await w.post("/work-items",{body:U.data});return P(G.body,G.requestId)}catch(G){if(G instanceof W)return B(G);throw G}}),$.register({name:"typescape_list_work_items",description:"List canonical shared-queue work items with optional queue, state, and ownership filters.",inputSchema:UH},async(_)=>{let v=_,U=rW.safeParse(v);if(!U.success)return B(H$(422,"invalid_argument",s_(U.error.issues,"Invalid work-item query")));let G={limit:String(U.data.limit)};if(U.data.state)G.state=U.data.state;if(U.data.kind)G.kind=U.data.kind;if(U.data.reason_code)G.reason_code=U.data.reason_code;if(U.data.audience_mode)G.audience_mode=U.data.audience_mode;if(U.data.queue_surface)G.queue_surface=U.data.queue_surface;if(U.data.assignee_id)G.assignee_id=U.data.assignee_id;if(U.data.claimant_id)G.claimant_id=U.data.claimant_id;if(U.data.cursor)G.cursor=U.data.cursor;try{let D=await w.get("/work-items",{query:G});return P(D.body,D.requestId)}catch(D){if(D instanceof W)return B(D);throw D}}),$.register({name:"typescape_get_work_item",description:"Get canonical detail for a shared-queue work item by ID.",inputSchema:bH},async(_)=>{let v=_;if(!v.work_item_id)return B(H$(400,"missing_param","Missing required parameter: work_item_id"));let U=P0.safeParse(v.work_item_id);if(!U.success)return B(H$(422,"invalid_argument",s_(U.error.issues,"Invalid work item ID")));try{let G=await w.get(`/work-items/${encodeURIComponent(U.data)}`);return P(G.body,G.requestId)}catch(G){if(G instanceof W)return B(G);throw G}}),$.register({name:"typescape_transition_work_item",description:"Move a shared-queue work item through the canonical lifecycle using claim/start/block/complete and related actions.",inputSchema:GH},async(_)=>{let v=_;if(!v.work_item_id)return B(H$(400,"missing_param","Missing required parameter: work_item_id"));if(!v.action)return B(H$(400,"missing_param","Missing required parameter: action"));let U=P0.safeParse(v.work_item_id);if(!U.success)return B(H$(422,"invalid_argument",s_(U.error.issues,"Invalid work item ID")));let G=pW.safeParse({action:v.action,...v.expected_version!==void 0?{expected_version:v.expected_version}:{},...v.idempotency_key?{idempotency_key:v.idempotency_key}:{},...v.blocking_reason?{blocking_reason:v.blocking_reason}:{},...v.cancellation_reason?{cancellation_reason:v.cancellation_reason}:{},...v.completion_outcome?{completion_outcome:v.completion_outcome}:{},...v.comment?{comment:v.comment}:{}});if(!G.success)return B(H$(422,"invalid_argument",s_(G.error.issues,"Invalid work-item transition payload")));try{let D=await w.post(`/work-items/${encodeURIComponent(U.data)}/transitions`,{body:G.data});return P(D.body,D.requestId)}catch(D){if(D instanceof W)return B(D);throw D}}),$.register({name:"typescape_create_review_ref",description:"Create a stable review reference that tracks HEAD review for doc/file/PR/custom keys. Always available (core primitive).",inputSchema:DH},async(_)=>{let v=_;if(!v.source_type)return B(new W(400,"missing_param","Missing required parameter: source_type","local"));if(!v.kind)return B(new W(400,"missing_param","Missing required parameter: kind","local"));if(!v.key)return B(new W(400,"missing_param","Missing required parameter: key","local"));if(!v.head_session_id)return B(new W(400,"missing_param","Missing required parameter: head_session_id","local"));let U=v.kind.trim().toLowerCase();if(!s7.has(U))return B(new W(400,"invalid_param",`Invalid parameter: kind must be one of ${E0.join(", ")}`,"local"));let G={source_type:v.source_type,kind:U,key:v.key,head_session_id:v.head_session_id};if(v.repo_id!==void 0)G.repo_id=v.repo_id;if(v.project_id!==void 0)G.project_id=v.project_id;try{let D=await w.post("/review-refs",{body:G});return P(D.body,D.requestId)}catch(D){if(D instanceof W)return B(D);throw D}}),$.register({name:"typescape_resolve_review_ref",description:"Resolve a review ref to its current head review. Returns the head review ID and pinned content details.",inputSchema:JH},async(_)=>{let v=_;if(!v.review_ref_id)return B(new W(400,"missing_param","Missing required parameter: review_ref_id","local"));try{let U=await w.get(`/review-refs/${encodeURIComponent(v.review_ref_id)}/resolve`);return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_advance_review_ref",description:"Advance a review ref to a new head review. Use expected_head_session_id for optimistic concurrency.",inputSchema:XH},async(_)=>{let v=_;if(!v.review_ref_id)return B(new W(400,"missing_param","Missing required parameter: review_ref_id","local"));if(!v.head_session_id)return B(new W(400,"missing_param","Missing required parameter: head_session_id","local"));let U={head_session_id:v.head_session_id};if(v.expected_head_session_id!==void 0)U.expected_head_session_id=v.expected_head_session_id;try{let G=await w.post(`/review-refs/${encodeURIComponent(v.review_ref_id)}/advance`,{body:U});return P(G.body,G.requestId)}catch(G){if(G instanceof W)return B(G);throw G}}),$.register({name:"typescape_request_approval",description:"Request approval for a review from specified approvers. Sends notifications via configured channels.",inputSchema:QH},async(_)=>{let v=_;if(!v.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!v.approver_emails||v.approver_emails.length===0)return B(new W(400,"missing_param","Missing required parameter: approver_emails","local"));let U={approver_emails:v.approver_emails};if(v.message!==void 0)U.message=v.message;if(v.notify!==void 0)U.notify=v.notify;let G={};if(v.idempotency_key)G["Idempotency-Key"]=v.idempotency_key;try{let D=await w.post(`/reviews/${encodeURIComponent(v.review_id)}/request-approval`,{body:U,headers:G});return P(D.body,D.requestId)}catch(D){if(D instanceof W)return B(D);throw D}}),$.register({name:"typescape_get_status",description:"Get the policy verdict for a review. Returns pass/fail/needs_review with reasons. Requires features.policy to be enabled.",inputSchema:YH},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).policy)return g.featureDisabledResult("policy")}catch(G){if(G instanceof W)return B(G);throw G}if(!v.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));let U={};if(v.simulate)U.simulate="true";if(v.wait!==void 0)U.wait=String(v.wait);try{let G=await w.get(`/reviews/${encodeURIComponent(v.review_id)}/status`,{query:U});return P(dX(G.body),G.requestId)}catch(G){if(G instanceof W)return B(G);throw G}}),$.register({name:"typescape_run_checks",description:"Trigger deterministic product checks (DocLint and related server-owned checks) for a review. This is separate from agent judgment against the rule bundle. Returns the check run ID. Requires features.checks to be enabled.",inputSchema:WH},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).checks)return g.featureDisabledResult("checks")}catch(U){if(U instanceof W)return B(U);throw U}if(!v.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{let U=await w.post(`/reviews/${encodeURIComponent(v.review_id)}/run-checks`,{body:{}});return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_account_usage",description:"Get account usage and quota information (reviews used/limit, remaining, and billing period).",inputSchema:HH},async()=>{try{let _=await w.get("/account/usage");return P(_.body,_.requestId)}catch(_){if(_ instanceof W)return B(_);throw _}}),$.register({name:"typescape_account_plan",description:"Get account plan details (plan name/id, status, and limits metadata).",inputSchema:qH},async()=>{try{let _=await w.get("/account/plan");return P(_.body,_.requestId)}catch(_){if(_ instanceof W)return B(_);throw _}}),$.register({name:"typescape_get_capabilities",description:"Get authenticated capabilities and effective feature flags. Returns the same payload shape as GET /v1/me/capabilities.",inputSchema:BH},async()=>{try{let _=await w.get("/me/capabilities");return P(_.body,_.requestId)}catch(_){if(_ instanceof W)return B(_);throw _}})}var VH=["typescape_request_snapshot","typescape_get_snapshot","typescape_list_backlinks","typescape_get_impact"],UT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier to build a corpus snapshot for"}},required:["repo_id"]},bT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"}},required:["repo_id","git_sha"]},GT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"},path:{type:"string",description:"Target file path to query backlinks for"},anchor:{type:"string",description:"Optional anchor within the file to narrow backlinks"}},required:["repo_id","git_sha","path"]},DT={type:"object",properties:{review_id:{type:"string",description:"Review identifier to compute impact radius for"}},required:["review_id"]};function FH($,w,g){$.register({name:"typescape_request_snapshot",description:"Request a corpus snapshot build for a repository. Returns the snapshot ID and build status. The snapshot builds "+"asynchronously — use typescape_get_snapshot to poll for completion. "+"Requires features.corpus_snapshots to be enabled.",inputSchema:UT},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(U){if(U instanceof W)return B(U);throw U}if(!v.repo_id)return B(new W(400,"missing_param","Missing required parameter: repo_id","local"));try{let U=await w.post(`/repos/${encodeURIComponent(v.repo_id)}/snapshots`,{body:{}});return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_get_snapshot",description:"Get corpus snapshot metadata for a Git repo at a specific commit. Returns snapshot status, config hash, and source type. Requires features.corpus_snapshots to be enabled.",inputSchema:bT},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(U){if(U instanceof W)return B(U);throw U}if(!v.repo_id)return B(new W(400,"missing_param","Missing required parameter: repo_id","local"));if(!v.git_sha)return B(new W(400,"missing_param","Missing required parameter: git_sha","local"));try{let U=await w.get(`/repos/${encodeURIComponent(v.repo_id)}/snapshots/${encodeURIComponent(v.git_sha)}`);return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_list_backlinks",description:"List inbound backlinks for a target file (and optional anchor) within a corpus snapshot. Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:GT},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(U){if(U instanceof W)return B(U);throw U}if(!v.repo_id)return B(new W(400,"missing_param","Missing required parameter: repo_id","local"));if(!v.git_sha)return B(new W(400,"missing_param","Missing required parameter: git_sha","local"));if(!v.path)return B(new W(400,"missing_param","Missing required parameter: path","local"));try{let U=new URLSearchParams({path:v.path});if(v.anchor)U.set("anchor",v.anchor);let G=await w.get(`/repos/${encodeURIComponent(v.repo_id)}/snapshots/${encodeURIComponent(v.git_sha)}/backlinks?${U}`);return P(G.body,G.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_get_impact",description:"Compute the impact radius for a review: which other files are affected by changes to the review's target file (via backlinks). Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:DT},async(_)=>{let v=_;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(U){if(U instanceof W)return B(U);throw U}if(!v.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{let U=await w.get(`/reviews/${encodeURIComponent(v.review_id)}/impact`);return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}})}var zH=["typescape_get_rules","typescape_rules_pack","typescape_check_content","typescape_import_rules","typescape_publish_rules","typescape_deprecate_rules","typescape_create_release_candidate","typescape_list_release_candidates","typescape_get_release_candidate","typescape_get_release_candidate_status","typescape_transition_release_candidate","typescape_rules_dashboard"],C$=Qw({operation:"read"}),oX=new Map;function Z0($){return Qw({operation:"write",hasIdempotencyKey:$})}function jH($){return $.status===0||$.status===429||$.status>=500}function KH($){return{repo_id:typeof $.repo_id==="string"&&$.repo_id.trim().length>0?$.repo_id.trim():null,review_id:typeof $.review_id==="string"&&$.review_id.trim().length>0?$.review_id.trim():null,file_path:typeof $.file_path==="string"&&$.file_path.trim().length>0?$.file_path.trim():null}}function x0($,w){let g=SY($.freshness.fetched_at);return{...w,cache_status:g.status,cache_age_seconds:g.age_seconds,cache_compiled_hash:$.compiled_hash,...g.warning?{warnings:[{code:"cached_rules",message:g.warning}],cache_warning:g.warning}:{}}}function fH($){if(!$||typeof $!=="object"||Array.isArray($))return;let w=$.request_id;return typeof w==="string"?w:void 0}function rX($){let w=$.compiledHash===void 0?null:$.compiledHash;return{rules:$.rules,compiled_hash:w,freshness:$.freshness,...$.requestId?{request_id:$.requestId}:{},...$.cacheMetadata??{}}}function AH($){if(!Array.isArray($))return[];return $.filter((w)=>typeof w==="object"&&w!==null&&!Array.isArray(w))}function JT($){if(!$||typeof $!=="object"||Array.isArray($))return{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:0};let w=$;return{latest_rule_session_updated_at:typeof w.latest_rule_session_updated_at==="string"?w.latest_rule_session_updated_at:null,contributing_session_count:typeof w.contributing_session_count==="number"&&Number.isFinite(w.contributing_session_count)?w.contributing_session_count:0,total_rule_count:typeof w.total_rule_count==="number"&&Number.isFinite(w.total_rule_count)?w.total_rule_count:0}}function SH($){if(!$||typeof $!=="object"||Array.isArray($))return{};let w={};for(let[g,_]of Object.entries($))if(typeof _==="string"&&_.length>0)w[g]=_;return w}function iH($,w,g){try{return k$($)}catch{throw new W(502,"invalid_upstream_response",g,w)}}function XT($,w){let g=(()=>{switch(w){case"manifest":return n0.safeParse($);case"structured":return M0.safeParse($);case"text":return z0.safeParse($);case"diff":return f0.safeParse($);case"chunk":return A0.safeParse($)}})();if(g.success)return"unknown response mismatch";let _=g.error.issues[0];if(_===void 0)return"invalid response payload";return`${_.path.length===0?"(root)":_.path.join(".")}: ${_.message}`}function QT($,w,g){let _=(()=>{switch(g){case"manifest":return n0.safeParse($);case"structured":return M0.safeParse($);case"text":return z0.safeParse($);case"diff":return f0.safeParse($);case"chunk":return A0.safeParse($)}})();if(!_.success)throw new W(502,"invalid_upstream_response",`Rules retrieval mode=${g} response was invalid (${XT($,g)}).`,w);return _.data}function YT($){if($.scope!==void 0)return $.scope;if($.review_id&&($.file_path||$.path))return"file";if($.review_id)return"review";if($.file_path||$.path)return"file";if($.collection_id)return"collection";return"workspace"}function WT($){let w=$.mode;if(w===void 0)throw Error("canonical retrieval mode is required");let g=typeof $.file_path==="string"&&$.file_path.trim().length>0?$.file_path.trim():typeof $.path==="string"&&$.path.trim().length>0?$.path.trim():null,_=SH($.properties);if(typeof $.repo_id==="string"&&$.repo_id.trim().length>0)_.repo_id=$.repo_id.trim();let v={mode:w,scope:YT($)};if($.release_id)v.release_id=$.release_id;if($.collection_id)v.collection_id=$.collection_id;if($.review_id)v.review_id=$.review_id;if(g)v.file_path=g;if($.token_budget!==void 0&&$.token_budget!==null)v.token_budget=String($.token_budget);if(Object.keys(_).length>0)v.properties=JSON.stringify(_);return v}function OH($){let w=new URLSearchParams({format:$.format}),g=Object.entries($.contentProperties).sort(([_],[v])=>_.localeCompare(v));for(let[_,v]of g)w.set(_,v);return`/rules?${w.toString()}`}async function HT($){let w=await $.api.get(`/reviews/${encodeURIComponent($.reviewId)}`),g=iH(w.body,w.requestId,"Review detail response was not an object"),_=SH(g.properties),v=typeof g.repo_id==="string"&&g.repo_id.length>0?g.repo_id:null,U=typeof g.file_path==="string"&&g.file_path.length>0?g.file_path:null,G=$.filePath??U;if(v)_.repo_id=v;if(G)_.file_path=G;return{reviewId:$.reviewId,repoId:v,filePath:G,contentProperties:_}}async function NH($){let w={format:"json"},g={format:"text"};if($.scope.repo_id)w.repo_id=$.scope.repo_id,g.repo_id=$.scope.repo_id;if($.scope.review_id)w.review_id=$.scope.review_id,g.review_id=$.scope.review_id;if($.scope.file_path)w.file_path=$.scope.file_path,g.file_path=$.scope.file_path;if($.policySnapshotId)w.policy_snapshot_id=$.policySnapshotId,g.policy_snapshot_id=$.policySnapshotId;let[_,v]=await Promise.all([$.api.getText("/rules",{query:g}),$.api.get("/rules",{query:w})]),U=v.body,G=Array.isArray(U.rules)?U.rules:[],D=typeof U.compiled_hash==="string"?U.compiled_hash:null,J=U.freshness&&typeof U.freshness==="object"&&!Array.isArray(U.freshness)?U.freshness:{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:G.length},X=o3({scope:$.scope,rules:[],plain_text_bundle:_.body,freshness:J,compiled_hash:D??void 0,fetched_at:new Date().toISOString(),renderings:{text:_.body,json_payload:U,structured_payload:G}});oX.set(e1($.scope),X);let Q=typeof U.request_id==="string"?U.request_id:void 0;return{text:_.body,normalizedBody:U,structuredPayload:rX({rules:G,compiledHash:D,freshness:J,requestId:Q})}}async function PH($){let w=await HT({api:$.api,reviewId:$.reviewId,filePath:$.filePath}),[g,_]=await Promise.all([$.api.getText(OH({format:"text",contentProperties:w.contentProperties})),$.api.get(OH({format:"json",contentProperties:w.contentProperties}))]),v=iH(_.body,_.requestId,"Rules response payload was not an object"),U=AH(v.rules),G=JT(v.freshness),D=fH(v),J=D===void 0?_.requestId:D,X=typeof v.compiled_hash==="string"?v.compiled_hash:null,Q={...v,prompt_fragment:g.body,request_id:J},Y=rX({rules:U,compiledHash:X,freshness:G,requestId:J}),q=o3({scope:{repo_id:w.repoId,review_id:w.reviewId,file_path:w.filePath},rules:[],plain_text_bundle:g.body,freshness:G,compiled_hash:X??void 0,fetched_at:new Date().toISOString(),renderings:{text:g.body,json_payload:Q,structured_payload:U}});return oX.set(e1({repo_id:w.repoId,review_id:w.reviewId,file_path:w.filePath}),q),{text:g.body,normalizedBody:Q,structuredPayload:Y}}function kH($,w){let g=oX.get(e1($));if(!g)return null;if(w==="text")return x0(g,{text:g.plain_text_bundle,format:"text",cached:!0});if(w==="structured"){let v=AH(g.renderings?.structured_payload);return x0(g,{...rX({rules:v,compiledHash:g.compiled_hash,freshness:g.freshness,requestId:fH(g.renderings?.json_payload)}),cached:!0})}if(w==="prompt_fragment"){let v=g.renderings?.json_payload;if(v&&typeof v==="object"&&!Array.isArray(v))return x0(g,{...v,non_authoritative:!0,compatibility_only:!0,cached:!0});return null}let _=g.renderings?.json_payload;if(!_||typeof _!=="object"||Array.isArray(_))return null;return x0(g,{..._,cached:!0})}var qT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},review_id:{type:"string",description:"Review identifier. Use for upload-backed reviews or when repo_id is not known."},collection_id:{type:"string",description:"Optional collection scope for canonical retrieval."},properties:{type:"object",additionalProperties:{type:"string"},description:"Optional flat property map for canonical rule matching and retrieval."},release_id:{type:"string",description:"Optional exact immutable release ID for canonical retrieval."},mode:{type:"string",enum:["manifest","structured","text","diff","chunk"],description:"Optional canonical retrieval mode. When present, the tool returns the release-aware retrieval contract directly."},scope:{type:"string",enum:["workspace","collection","review","file"],description:"Optional canonical retrieval scope override. Default is inferred from review_id, file_path, and collection_id."},policy_snapshot_id:{type:"string",description:"Optional policy snapshot ID used to compile rules context"},file_path:{type:"string",description:"Optional file path to scope rules"},path:{type:"string",description:"Alias for file_path. If both are provided, file_path takes precedence."},format:{type:"string",enum:["text","structured","prompt_fragment"],description:'Output format: "text" returns the canonical plain-text rule bundle, "structured" returns governed JSON rules (authoritative), and "prompt_fragment" returns a compatibility prompt-shaped text view. Default: text.'},token_budget:{type:"number",description:"Maximum token count for prompt_fragment format (100-10000, default 2000)",minimum:100,maximum:1e4}}},BT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier for rules-pack lookup."},review_id:{type:"string",description:"Review identifier for rules-pack lookup when repo is unknown."},file_path:{type:"string",description:"Optional file path scope for rule selection."},path:{type:"string",description:"Alias for file_path."},format:{type:"string",enum:["text","prompt","structured","json"],description:'Output format. "text" returns the canonical plain-text rule bundle, "prompt" is a compatibility alias, "structured" returns normalized rules, and "json" returns the raw pack payload.'},token_budget:{type:"number",description:"Optional token budget for prompt_fragment generation."}}},IT={type:"object",properties:{content:{type:"string",description:"Markdown content for an optional server-side non-authoritative rules pass that can seed governance follow-up against applicable rules (max 1MB)."},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map, e.g. { doc_type: 'procedure' }). Use the same context the agent will reason against."},collection_id:{type:"string",description:"Optional collection ID to scope rule matching."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},LT={type:"object",properties:{content:{type:"string",description:"Rule markdown content to import (max 512KB). Each list item is a rule block."},title:{type:"string",description:"Human-readable title for the imported rule review (optional)."},applicability:{type:"object",additionalProperties:{type:"string"},description:"Applicability selector for rule matching (flat key-value map, optional)."},provenance:{type:"object",properties:{source:{type:"string",enum:["manual","findings","external"],description:"Import source classification."},source_review_id:{type:"string",description:"Source review ID when imported from findings."},source_label:{type:"string",description:"Human-readable source label."}},description:"Provenance metadata for finding-seeded imports (optional)."},preview:{type:"boolean",description:"If true, returns a preview without creating a review (dry run). Default: false."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},VT={type:"object",properties:{include_degraded:{type:"boolean",default:!0,description:"Include derived degradation buckets based on canonical evidence rollups"}}},nH={type:"object",properties:{review_id:{type:"string",description:"Rule review ID to publish or deprecate. Must refer to a rules review."}}},FT={type:"object",properties:{workspace_id:{type:"string",description:"Workspace ID that owns the release candidate."},included_rule_revision_ids:{type:"array",items:{type:"string"},description:"Rule revision IDs to include. In the current substrate these are rules review IDs."},based_on_active_release_id:{type:"string",description:"Optional active release baseline ID."},rollback_of_release_id:{type:"string",description:"Optional release ID being rolled back."},title:{type:"string",description:"Optional human-readable release candidate title."},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries."}},required:["workspace_id","included_rule_revision_ids"]},jT={type:"object",properties:{limit:{type:"number",description:"Maximum rows to return (default 6, max 25)."}}},MH={type:"object",properties:{release_candidate_id:{type:"string",description:"Canonical release candidate ID."}},required:["release_candidate_id"]},KT={type:"object",properties:{release_candidate_id:{type:"string",description:"Canonical release candidate ID."},action:{type:"string",enum:[...xX],description:"Public release candidate lifecycle action."},expected_version:{type:"number",description:"Optional optimistic concurrency version."},rejection_reason:{type:"string",description:"Required when action is reject or abandon."},stale_reason:{type:"string",description:"Required when action is mark_stale."},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries."}},required:["release_candidate_id","action"]};function TH($,w,g){let _=async()=>{try{return(await g.getCapabilities()).rules?null:g.featureDisabledResult("rules")}catch(G){if(G instanceof W)return B(G);throw G}},v=async(G)=>{try{let D=await w.patch(`/reviews/${encodeURIComponent(G.reviewId)}`,{body:{state:G.targetState}});return P(D.body,D.requestId,{retry:Z0(!1)})}catch(D){if(D instanceof W)return B(D,{operation:"write",hasIdempotencyKey:!1});throw D}},U=(G)=>{if(typeof G==="string"&&G.trim().length>0)return G.trim();return B(new W(400,"missing_param","Missing required parameter: release_candidate_id","local"),{operation:"read"})};$.register({name:"typescape_get_rules",description:'Canonical agent read path for repository or review context. Fetch this before reasoning about a draft or reconciling reviewer feedback. When mode is provided, the tool returns the canonical release-aware retrieval contract directly. format="text" returns the canonical plain-text rule bundle. format="structured" returns the deterministic rulepack with compiled hash and freshness metadata. format="prompt_fragment" returns a compatibility prompt-shaped text view. Requires rules to be enabled.',inputSchema:qT},async(G)=>{let D=G,J=await _();if(J)return J;if(D.mode!==void 0){let H=k0.safeParse(D.mode);if(!H.success)return B(new W(400,"invalid_mode",`Invalid mode: ${String(D.mode)}`,"local"));let V=D.scope===void 0?null:RX.safeParse(D.scope);if(V&&!V.success)return B(new W(400,"invalid_scope",`Invalid scope: ${String(D.scope)}`,"local"));try{let K=await w.get("/rules",{query:WT({...D,mode:H.data,...V?{scope:V.data}:{}})}),f=QT(K.body,K.requestId,H.data);return P(f,K.requestId,{retry:C$})}catch(K){if(K instanceof W)return B(K,{operation:"read"});throw K}}let X=typeof D.repo_id==="string"&&D.repo_id.length>0,Q=typeof D.review_id==="string"&&D.review_id.length>0;if(!X&&!Q)return B(new W(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let Y=D.format==="structured"?"structured":D.format==="prompt_fragment"?"prompt_fragment":"text",q=typeof D.file_path==="string"&&D.file_path.trim().length>0?D.file_path.trim():typeof D.path==="string"&&D.path.trim().length>0?D.path.trim():null,L=(H)=>{let V=new URLSearchParams({format:H});if(q)V.set("file_path",q);if(D.policy_snapshot_id)V.set("policy_snapshot_id",D.policy_snapshot_id);if(D.token_budget!==void 0&&D.token_budget!==null)V.set("token_budget",String(D.token_budget));return V},F=KH({repo_id:X?D.repo_id:void 0,review_id:Q?D.review_id:void 0,file_path:q});try{let H=Q&&!X?await PH({api:w,reviewId:D.review_id,filePath:q}):await NH({api:w,scope:F,tokenBudget:D.token_budget,policySnapshotId:D.policy_snapshot_id});if(Y==="text")return P({text:H.text,format:"text"},H.normalizedBody.request_id??"missing_request_id",{retry:C$});let V={...H.normalizedBody};if(V.prompt_fragment&&Y==="prompt_fragment")V.non_authoritative=!0,V.compatibility_only=!0;if(Y==="structured")V.rules=H.structuredPayload.rules,V.compiled_hash=H.structuredPayload.compiled_hash,V.freshness=H.structuredPayload.freshness;return P(V,V.request_id??"missing_request_id",{retry:C$})}catch(H){if(H instanceof W){if(jH(H)){let V=kH(F,Y);if(V)return P(V,H.requestId,{retry:C$})}return B(H,{operation:"read"})}throw H}}),$.register({name:"typescape_rules_pack",description:"Compatibility-only alias for typescape_get_rules. Prefer typescape_get_rules in new harnesses and workflows.",inputSchema:BT},async(G)=>{let D=G,J=await _();if(J)return J;let X=typeof D.repo_id==="string"?D.repo_id.trim():"",Q=typeof D.review_id==="string"?D.review_id.trim():"";if(!X&&!Q)return B(new W(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let Y=D.format??"text",q=typeof D.file_path==="string"&&D.file_path.trim().length>0?D.file_path.trim():typeof D.path==="string"&&D.path.trim().length>0?D.path.trim():null,L=KH({repo_id:X,review_id:Q,file_path:q});try{let F=Q&&!X?await PH({api:w,reviewId:Q,filePath:q}):await NH({api:w,scope:L,tokenBudget:D.token_budget});if(Y==="text")return P({text:F.text,format:"text"},F.normalizedBody.request_id??"missing_request_id",{retry:C$});let H=F.normalizedBody;if(Y==="structured")return P(F.structuredPayload,H.request_id??"missing_request_id",{retry:C$});if(Y==="json")return P(H,H.request_id??"missing_request_id",{retry:C$});let V=typeof H.prompt==="string"?H.prompt:typeof H.prompt_fragment==="string"?H.prompt_fragment:null;if(!V)throw new W(502,"invalid_upstream_response","Rules pack response is missing prompt content",H.request_id??"missing_request_id");return P({prompt:V,prompt_fragment:V,compatibility_only:!0},H.request_id??"missing_request_id",{retry:C$})}catch(F){if(F instanceof W){let H=Y==="prompt"?"prompt_fragment":Y;if(jH(F)){let V=kH(L,H);if(V)return P(V,F.requestId,{retry:C$})}return B(F,{operation:"read"})}throw F}}),$.register({name:"typescape_check_content",description:"Optional server-side non-authoritative rules pass for markdown content. Treat the result as candidate governance/advisory input, not a complete review or substitute for agent reasoning. Canonical loop: typescape_get_rules -> read content -> typescape_create_finding. Requires rules to be enabled.",inputSchema:IT},async(G)=>{let D=G,J=await _();if(J)return J;if(!D.content||D.content.length===0)return B(new W(400,"missing_param","Missing required parameter: content","local"));let X={content:D.content};if(D.properties!==void 0)X.properties=D.properties;if(D.collection_id!==void 0)X.collection_id=D.collection_id;if(D.idempotency_key!==void 0)X.idempotency_key=D.idempotency_key;try{let Q=await w.post("/rules/check",{body:X});return P(Q.body,Q.requestId,{retry:C$})}catch(Q){if(Q instanceof W)return B(Q,{operation:"read"});throw Q}}),$.register({name:"typescape_import_rules",description:"Import rules from markdown content, creating a draft rule review. Each list item in the markdown becomes a rule block. Set preview=true for a dry run. Returns the review ID and parsed rules. Requires rules to be enabled.",inputSchema:LT},async(G)=>{let D=G,J=await _();if(J)return J;if(!D.content||D.content.length===0)return B(new W(400,"missing_param","Missing required parameter: content","local"));let X={content:D.content};if(D.title!==void 0)X.title=D.title;if(D.applicability!==void 0)X.applicability=D.applicability;if(D.provenance!==void 0)X.provenance=D.provenance;if(D.preview!==void 0)X.preview=D.preview;if(D.idempotency_key!==void 0)X.idempotency_key=D.idempotency_key;let Q={};if(D.idempotency_key)Q["Idempotency-Key"]=D.idempotency_key;try{let Y=await w.post("/rules/import",{body:X,headers:Q});return P(Y.body,Y.requestId,{retry:Z0(Boolean(D.idempotency_key))})}catch(Y){if(Y instanceof W)return B(Y,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw Y}}),$.register({name:"typescape_publish_rules",description:"Publish a draft rule review through the canonical review state transition. Returns the resulting review state and publication status. Requires rules to be enabled.",inputSchema:nH},async(G)=>{let D=G,J=await _();if(J)return J;if(!D.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"),{operation:"write"});return v({reviewId:D.review_id,targetState:"active"})}),$.register({name:"typescape_deprecate_rules",description:"Deprecate a published rule review through the canonical review state transition. Returns the resulting review state and publication status. Requires rules to be enabled.",inputSchema:nH},async(G)=>{let D=G,J=await _();if(J)return J;if(!D.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"),{operation:"write"});return v({reviewId:D.review_id,targetState:"archived"})}),$.register({name:"typescape_create_release_candidate",description:"Create a canonical release candidate from rule revisions. Use this instead of release_bundle-style review-set assembly in new workflows. Requires rules to be enabled.",inputSchema:FT},async(G)=>{let D=G,J=await _();if(J)return J;if(!D.workspace_id)return B(new W(400,"missing_param","Missing required parameter: workspace_id","local"),{operation:"write"});if(!Array.isArray(D.included_rule_revision_ids)||D.included_rule_revision_ids.length===0)return B(new W(400,"missing_param","Missing required parameter: included_rule_revision_ids","local"),{operation:"write"});let X={workspace_id:D.workspace_id,included_rule_revision_ids:D.included_rule_revision_ids,...D.based_on_active_release_id?{based_on_active_release_id:D.based_on_active_release_id}:{},...D.rollback_of_release_id?{rollback_of_release_id:D.rollback_of_release_id}:{},...D.title?{title:D.title}:{},...D.idempotency_key?{idempotency_key:D.idempotency_key}:{}},Q={};if(D.idempotency_key)Q["Idempotency-Key"]=D.idempotency_key;try{let Y=await w.post("/releases/candidates",{body:X,...D.idempotency_key?{headers:Q}:{}});return P(Y.body,Y.requestId,{retry:Z0(Boolean(D.idempotency_key))})}catch(Y){if(Y instanceof W)return B(Y,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw Y}}),$.register({name:"typescape_list_release_candidates",description:"List canonical release candidates for the authenticated workspace tenant. Requires rules to be enabled.",inputSchema:jT},async(G)=>{let D=G,J=await _();if(J)return J;let X={};if(typeof D.limit==="number"&&Number.isFinite(D.limit))X.limit=String(D.limit);try{let Q=await w.get("/releases/candidates",{query:X});return P(Q.body,Q.requestId,{retry:C$})}catch(Q){if(Q instanceof W)return B(Q,{operation:"read"});throw Q}}),$.register({name:"typescape_get_release_candidate",description:"Get canonical release candidate detail by ID. Requires rules to be enabled.",inputSchema:MH},async(G)=>{let D=G,J=await _();if(J)return J;let X=U(D.release_candidate_id);if(typeof X!=="string")return X;try{let Q=await w.get(`/releases/candidates/${encodeURIComponent(X)}`);return P(Q.body,Q.requestId,{retry:C$})}catch(Q){if(Q instanceof W)return B(Q,{operation:"read"});throw Q}}),$.register({name:"typescape_get_release_candidate_status",description:"Get canonical release candidate status and required actions by ID. Requires rules to be enabled.",inputSchema:MH},async(G)=>{let D=G,J=await _();if(J)return J;let X=U(D.release_candidate_id);if(typeof X!=="string")return X;try{let Q=await w.get(`/releases/candidates/${encodeURIComponent(X)}/status`);return P(Q.body,Q.requestId,{retry:C$})}catch(Q){if(Q instanceof W)return B(Q,{operation:"read"});throw Q}}),$.register({name:"typescape_transition_release_candidate",description:"Move a canonical release candidate through its lifecycle. Requires rules to be enabled.",inputSchema:KT},async(G)=>{let D=G,J=await _();if(J)return J;let X=U(D.release_candidate_id);if(typeof X!=="string")return X;if(!D.action)return B(new W(400,"missing_param","Missing required parameter: action","local"),{operation:"write"});let Q={action:D.action,...typeof D.expected_version==="number"?{expected_version:D.expected_version}:{},...D.rejection_reason?{rejection_reason:D.rejection_reason}:{},...D.stale_reason?{stale_reason:D.stale_reason}:{},...D.idempotency_key?{idempotency_key:D.idempotency_key}:{}},Y={};if(D.idempotency_key)Y["Idempotency-Key"]=D.idempotency_key;try{let q=await w.post(`/releases/candidates/${encodeURIComponent(X)}/transition`,{body:Q,...D.idempotency_key?{headers:Y}:{}});return P(q.body,q.requestId,{retry:Z0(Boolean(D.idempotency_key))})}catch(q){if(q instanceof W)return B(q,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw q}}),$.register({name:"typescape_rules_dashboard",description:"Get aggregate rules evidence, provenance, and degradation summary from canonical rules runtime surfaces. Requires features.rules.",inputSchema:VT},async(G)=>{let D=G;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(J){if(J instanceof W)return B(J);throw J}try{let J=D.include_degraded!==!1,[X,Q]=await Promise.all([w.get("/rules/evidence",{query:{window:"14d"}}),w.get("/rules/provenance/aggregate")]),Y=k$(X.body),q=(i)=>{let c=Y[i];if(typeof c==="number"&&Number.isInteger(c)&&c>=0)return c;throw new W(502,"invalid_upstream_response",`${i} must be a non-negative integer`,X.requestId)},L=(i,c,x)=>{let G$=i[c];if(G$&&typeof G$==="object"&&!Array.isArray(G$))return G$;throw new W(502,"invalid_upstream_response",`${c} must be an object`,x)},F=q("total_active_rules"),H=q("zero_use_rules"),V=q("high_trigger_rules"),K=q("low_trigger_rules"),f=L(Y,"adoption",X.requestId);if(!Q.body||typeof Q.body!=="object"||Array.isArray(Q.body))throw new W(502,"invalid_upstream_response","Canonical provenance response must be an object",Q.requestId);let S=Q.body,u=L(S,"provenance",Q.requestId),Z={active_rules:F,rule_health:{total_rules:F,zero_use_rules:H,high_trigger_rules:V,low_trigger_rules:K},adoption:f,provenance:u,request_ids:{evidence:X.requestId,provenance:Q.requestId}};if(J)Z.degraded_rules=[{category:"zero_use",count:H,description:"Active rules with no observed adoption in the selected evidence window"},{category:"high_trigger",count:V,description:"Active rules with elevated trigger volume in the selected evidence window"},{category:"low_trigger",count:K,description:"Active rules with low trigger volume in the selected evidence window"}];return P(Z,X.requestId,{retry:C$})}catch(J){if(J instanceof W)return B(J,{operation:"read"});throw J}})}var RH=["typescape_list_repos","typescape_connect_repo","typescape_repo_branches","typescape_upload_reviewer_asset"];function OT($){switch($){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"bin"}}var NT=5242880,PT=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function CH($,w){let g={name:"typescape_list_repos",description:"List connected repositories in the workspace. Returns paginated list of repos with their origin URLs and metadata.",inputSchema:{type:"object",properties:{include_archived:{type:"boolean",description:"Include archived repositories (default: false)"},limit:{type:"number",description:"Maximum repos to return (1-100, default: 50)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}}};$.register(g,async(G)=>{let D=G,J={};if(D.include_archived)J.include_archived="true";if(D.limit!==void 0)J.limit=String(D.limit);if(D.cursor)J.cursor=D.cursor;try{let X=await w.get("/repos",{query:J});return P(X.body,X.requestId)}catch(X){if(X instanceof W)return B(X);throw X}});let _={name:"typescape_connect_repo",description:"Connect a Git repository by its origin URL. If the URL is a GitHub repo and a GitHub App installation exists, it will be automatically linked for branch/file browsing.",inputSchema:{type:"object",properties:{origin_url:{type:"string",description:"Git remote URL (HTTPS or SSH), e.g. https://github.com/acme/docs"},display_name:{type:"string",description:"Human-readable display name (optional, auto-derived from URL)"}},required:["origin_url"]}};$.register(_,async(G)=>{let D=G;if(!D.origin_url)return B(new W(400,"missing_param","Missing required parameter: origin_url","local"));let J={origin_url:D.origin_url};if(D.display_name)J.display_name=D.display_name;try{let X=await w.post("/repos",{body:J});return P(X.body,X.requestId)}catch(X){if(X instanceof W)return B(X);throw X}});let v={name:"typescape_repo_branches",description:"List branches for a connected repository. Requires a GitHub App installation to be linked to the repo. Returns branch names and their head SHAs.",inputSchema:{type:"object",properties:{repo_id:{type:"string",description:"Repository ID (e.g. repo_abc123)"}},required:["repo_id"]}};$.register(v,async(G)=>{let D=G;if(!D.repo_id)return B(new W(400,"missing_param","Missing required parameter: repo_id","local"));try{let J=await w.get(`/repos/${encodeURIComponent(D.repo_id)}/branches`);return P(J.body,J.requestId)}catch(J){if(J instanceof W)return B(J);throw J}});let U={name:"typescape_upload_reviewer_asset",description:"Upload a reviewer asset (image) to a review. Accepts base64-encoded image data (PNG, JPEG, GIF, WebP). Maximum size: 5MB. For larger files, use the CLI or web UI.",inputSchema:{type:"object",properties:{review_id:{type:"string",description:"Review ID to upload the asset to"},base64_content:{type:"string",description:"Base64-encoded image data"},mime_type:{type:"string",enum:["image/png","image/jpeg","image/gif","image/webp"],description:"MIME type of the image"},alt_text:{type:"string",description:"Alt text for the image (optional)"},filename:{type:"string",description:"Original filename (optional)"}},required:["review_id","base64_content","mime_type"]}};$.register(U,async(G)=>{let D=G;if(!D.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));if(!D.base64_content)return B(new W(400,"missing_param","Missing required parameter: base64_content","local"));if(!D.mime_type)return B(new W(400,"missing_param","Missing required parameter: mime_type","local"));if(!PT.has(D.mime_type))return B(new W(415,"unsupported_media_type",`Unsupported MIME type "${D.mime_type}". Allowed: PNG, JPEG, GIF, WebP.`,"local"));if(!cX.test(D.base64_content))return B(new W(400,"invalid_base64","base64_content is not valid base64-encoded data","local"));let J;try{let Y=Buffer.from(D.base64_content,"base64");J=new Uint8Array(Y)}catch{return B(new W(400,"invalid_base64","Failed to decode base64_content","local"))}if(J.byteLength>NT){let Y=(J.byteLength/1048576).toFixed(1);return B(new W(413,"asset_too_large",`Image is ${Y}MB, exceeding the 5MB MCP limit. Use the CLI ("typescape asset upload") or web UI for larger files.`,"local"))}let X=new Blob([J],{type:D.mime_type}),Q=new FormData;if(Q.append("file",X,D.filename||`upload.${OT(D.mime_type)}`),Q.append("mime_type",D.mime_type),D.alt_text)Q.append("alt_text",D.alt_text);try{let Y=await w.postFormData(`/reviews/${encodeURIComponent(D.review_id)}/reviewer-assets`,Q);return P(Y.body,Y.requestId)}catch(Y){if(Y instanceof W)return B(Y);throw Y}})}var uH=["typescape_create_collection","typescape_add_review_to_collection"],kT={type:"object",properties:{name:{type:"string",description:"Collection name (1-100 characters, unique per tenant among non-archived collections)"},description:{type:"string",description:"Optional Markdown description (max 2000 characters)"},color:{type:"string",description:"Optional hex color (e.g., #12A594)"}},required:["name"]},nT={type:"object",properties:{collection_id:{type:"string",description:"Collection ID (e.g., col_01HXYZ...)"},review_id:{type:"string",description:"Review ID to add (opaque identifier)"}},required:["collection_id","review_id"]};function EH($,w,g){$.register({name:"typescape_create_collection",description:"Create a new collection to group related reviews. Requires collections_enabled feature flag. Returns the created collection with its ID.",inputSchema:kT},async(_)=>{let v=_;if(!v.name)return B(new W(400,"missing_param","Missing required parameter: name","local"));try{if(!(await g.getCapabilities()).collections_enabled)return g.featureDisabledResult("collections_enabled")}catch(G){if(G instanceof W)return B(G);throw G}let U={name:v.name};if(v.description!==void 0)U.description=v.description;if(v.color!==void 0)U.color=v.color;try{let G=await w.post("/collections",{body:U});return P(k$(G.body),G.requestId)}catch(G){if(G instanceof W)return B(G);throw G}}),$.register({name:"typescape_add_review_to_collection",description:"Add a review to an existing collection. Idempotent: re-adding an already-present review is a no-op. Requires collections_enabled feature flag.",inputSchema:nT},async(_)=>{let v=_;if(!v.collection_id)return B(new W(400,"missing_param","Missing required parameter: collection_id","local"));if(!v.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{if(!(await g.getCapabilities()).collections_enabled)return g.featureDisabledResult("collections_enabled")}catch(U){if(U instanceof W)return B(U);throw U}try{let U=await w.post(`/collections/${encodeURIComponent(v.collection_id)}/sessions`,{body:{session_id:v.review_id}});return P(k$(U.body),U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}})}var ZH={type:"object",properties:{artifact_kind:{type:"string",description:"Advisory artifact kind: recommendation, classification, contradiction, synthesis, proposal, or challenge"},kind:{type:"string",description:"Compatibility alias for artifact_kind"},target_type:{type:"string",enum:["review","finding","rule_review","rule_block","review_set"],description:"Type of entity this advisory targets"},target_id:{type:"string",description:"ID of the target entity (e.g., sess_01HXYZ... or finding ID)"},review_id:{type:"string",description:"Review scope for this advisory (optional; enables review-scoped queries)"},body_md:{type:"string",description:"Advisory body in Markdown (required, max 64KB)"},body:{type:"string",description:"Compatibility alias for body_md"},source_type:{type:"string",enum:["human","agent"],description:"Provenance source type (default: agent)"},source_label:{type:"string",description:"Label identifying the source (e.g., agent name or tool)"},submitted_by:{type:"string",description:"Identity of the submitter (agent ID or user ID)"},confidence:{type:"number",description:"Confidence score between 0 and 1 (optional)"},severity_hint:{type:"string",description:"Severity hint: suggestion, needs_changes, blocking (optional)"},structured_data:{type:"object",description:"Machine-readable structured data payload (optional)"},evidence_refs:{type:"array",items:{type:"string"},description:"References to supporting evidence (optional)"},basis:{type:"object",properties:{export_sha256:{type:"string",description:"SHA256 of export used as basis"},rulepack_sha256:{type:"string",description:"SHA256 of rulepack used"},source_content_sha256:{type:"string",description:"SHA256 of source content"},basis_review_ids:{type:"array",items:{type:"string"},description:"Review IDs used as basis"},basis_finding_ids:{type:"array",items:{type:"string"},description:"Finding IDs used as basis"}},description:"Deterministic inputs the advisory was derived from (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["artifact_kind","target_type","target_id","body_md","source_label","submitted_by"]},xH={type:"object",properties:{review_id:{type:"string",description:"Filter by review ID (optional)"},target_type:{type:"string",enum:["review","finding","rule_review","rule_block","review_set"],description:"Filter by target type (optional)"},target_id:{type:"string",description:"Filter by target ID (optional)"},artifact_kind:{type:"string",description:"Filter by artifact kind (optional)"},status:{type:"string",enum:["submitted","adopted","rejected","superseded"],description:"Filter by status (optional)"},submitted_by:{type:"string",description:"Filter by submitter identity (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},hH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to retrieve"}},required:["artifact_id"]},lH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to adopt"},rationale:{type:"string",description:"Rationale for adoption (optional)"},adoption_review_id:{type:"string",description:"Review ID associated with adoption (optional)"},adoption_proposed_change_id:{type:"string",description:"Proposed change ID associated with adoption (optional)"}},required:["artifact_id"]},cH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to reject"},rejection_reason:{type:"string",description:"Reason for rejection (required)"}},required:["artifact_id","rejection_reason"]},yH={type:"object",properties:{workspace_id:{type:"string",description:"Workspace identifier for the governance signal"},kind:{type:"string",description:"Canonical governance signal kind: pattern, canon_disagreement, rule_gap, or drafting_recommendation"},target_type:{type:"string",description:"Type of entity this governance signal targets"},target_id:{type:"string",description:"ID of the target entity"},review_id:{type:"string",description:"Related review scope when applicable"},block_id:{type:"string",description:"Optional target-context block anchor within the review"},body_md:{type:"string",description:"Governance signal body in Markdown"},body:{type:"string",description:"Compatibility alias for body_md"},source_type:{type:"string",enum:["human","agent"],description:"Provenance source type (default: agent)"},source_label:{type:"string",description:"Label identifying the source (agent, tool, or reviewer)"},submitted_by:{type:"string",description:"Identity of the submitter"},confidence:{type:"number",description:"Confidence score between 0 and 1 (optional)"},severity_hint:{type:"string",description:"Optional severity hint carried in the payload"},structured_data:{type:"object",description:"Machine-readable structured data payload (optional)"},evidence_refs:{type:"array",items:{type:"string"},description:"References to supporting evidence (optional)"},basis:{type:"object",properties:{export_sha256:{type:"string",description:"SHA256 of export used as basis"},rulepack_sha256:{type:"string",description:"SHA256 of rulepack used"},source_content_sha256:{type:"string",description:"SHA256 of source content"},basis_review_ids:{type:"array",items:{type:"string"},description:"Review IDs used as basis"},basis_finding_ids:{type:"array",items:{type:"string"},description:"Finding IDs used as basis"}},description:"Deterministic inputs the governance signal was derived from (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["workspace_id","kind","target_type","target_id","body_md","source_label","submitted_by"]},mH={type:"object",properties:{workspace_id:{type:"string",description:"Filter by workspace ID (optional)"},review_id:{type:"string",description:"Filter by review ID (optional)"},target_type:{type:"string",description:"Optional client-side target type filter"},target_id:{type:"string",description:"Optional client-side target ID filter"},kind:{type:"string",description:"Filter by governance signal kind (optional)"},state:{type:"string",description:"Filter by governance signal state (optional)"},submitted_by:{type:"string",description:"Filter by submitter identity (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},tH={type:"object",properties:{signal_id:{type:"string",description:"Governance signal ID to retrieve"}},required:["signal_id"]},dH={type:"object",properties:{signal_id:{type:"string",description:"Governance signal ID to transition"},target_state:{type:"string",description:"Target lifecycle state"},expected_version:{type:"number",description:"Optional optimistic concurrency version"},reason:{type:"string",description:"Transition rationale (optional)"},severity:{type:"string",description:"Optional triage severity metadata"},grouping_id:{type:"string",description:"Optional triage grouping identifier"},affected_rule_document_ids:{type:"array",items:{type:"string"},description:"Affected rule documents for triage metadata"},re_triage_date:{type:"string",description:"Snooze wake-up date when applicable"},converted_working_draft_ids:{type:"array",items:{type:"string"},description:"Working drafts created from the signal when converting"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["signal_id","target_state"]};var rH=["typescape_submit_governance_signal","typescape_list_governance_signals","typescape_get_governance_signal","typescape_transition_governance_signal","typescape_submit_advisory","typescape_list_advisories","typescape_get_advisory","typescape_adopt_advisory","typescape_reject_advisory"],h0=Qw({operation:"read"});function $U($){return Qw({operation:"write",hasIdempotencyKey:$})}function oH($){if(!$)return;return{...$,export_sha256:$.export_sha256??$.export_hash,rulepack_sha256:$.rulepack_sha256??$.rulepack_hash,source_content_sha256:$.source_content_sha256??$.source_hash}}function MT($,w){if(!Array.isArray($))return $;return $.filter((g)=>{if(typeof g!=="object"||g===null)return!1;let _=g,v=typeof _.target==="object"&&_.target!==null?_.target:null;if(w.target_type&&v?.target_type!==w.target_type)return!1;if(w.target_id&&v?.target_id!==w.target_id)return!1;return!0})}function pH($,w){$.register({name:"typescape_submit_governance_signal",description:"Submit a canonical governance signal for operator triage. Use this for pattern, rule-gap, canon-disagreement, and drafting-recommendation intake.",inputSchema:yH},async(g)=>{let _=g,v=_.body_md??_.body,U=oH(_.basis);if(!_.workspace_id)return B(new W(400,"missing_param","Missing required parameter: workspace_id","local"));if(!_.kind)return B(new W(400,"missing_param","Missing required parameter: kind","local"));if(!_.target_type)return B(new W(400,"missing_param","Missing required parameter: target_type","local"));if(!_.target_id)return B(new W(400,"missing_param","Missing required parameter: target_id","local"));if(!v)return B(new W(400,"missing_param","Missing required parameter: body_md","local"));if(!_.source_label)return B(new W(400,"missing_param","Missing required parameter: source_label","local"));if(!_.submitted_by)return B(new W(400,"missing_param","Missing required parameter: submitted_by","local"));let G={kind:_.kind,workspace_id:_.workspace_id,target:{target_type:_.target_type,target_id:_.target_id,...(_.review_id||_.block_id)&&{target_context:{..._.review_id?{review_id:_.review_id}:{},..._.block_id?{block_id:_.block_id}:{}}}},provenance:{source_type:_.source_type??"agent",source_label:_.source_label,submitted_by:_.submitted_by,submitted_at:new Date().toISOString()},payload:{body_md:v,..._.confidence!==void 0?{confidence:_.confidence}:{},..._.severity_hint!==void 0?{severity_hint:_.severity_hint}:{},..._.structured_data!==void 0?{structured_data:_.structured_data}:{},..._.evidence_refs!==void 0?{evidence_refs:_.evidence_refs}:{}}};if(_.review_id)G.review_id=_.review_id;if(U)G.basis=U;if(_.idempotency_key)G.idempotency_key=_.idempotency_key;let D={};if(_.idempotency_key)D["Idempotency-Key"]=_.idempotency_key;try{let J=await w.post("/governance-signals",{body:G,headers:D});return P(J.body,J.requestId,{retry:$U(Boolean(_.idempotency_key))})}catch(J){if(J instanceof W)return B(J,{operation:"write",hasIdempotencyKey:Boolean(_.idempotency_key)});throw J}}),$.register({name:"typescape_list_governance_signals",description:"List canonical governance signals with optional workspace, review, kind, state, or submitter filters.",inputSchema:mH},async(g)=>{let _=g,v={};if(_.workspace_id)v.workspace_id=_.workspace_id;if(_.review_id)v.review_id=_.review_id;if(_.kind)v.kind=_.kind;if(_.state)v.state=_.state;if(_.submitted_by)v.submitted_by=_.submitted_by;if(_.limit!==void 0)v.limit=String(_.limit);if(_.offset!==void 0)v.offset=String(_.offset);try{let U=await w.get("/governance-signals",{query:v}),G=MT(U.body.items,_);return P({...U.body,items:G,total:Array.isArray(G)?G.length:U.body.total},U.requestId,{retry:h0})}catch(U){if(U instanceof W)return B(U,{operation:"read"});throw U}}),$.register({name:"typescape_get_governance_signal",description:"Get a single governance signal by ID. Returns full signal detail with provenance, payload, and triage state.",inputSchema:tH},async(g)=>{let _=g;if(!_.signal_id)return B(new W(400,"missing_param","Missing required parameter: signal_id","local"));try{let v=await w.get(`/governance-signals/${encodeURIComponent(_.signal_id)}`);return P(v.body,v.requestId,{retry:h0})}catch(v){if(v instanceof W)return B(v,{operation:"read"});throw v}}),$.register({name:"typescape_transition_governance_signal",description:"Transition a governance signal through the canonical triage lifecycle.",inputSchema:dH},async(g)=>{let _=g;if(!_.signal_id)return B(new W(400,"missing_param","Missing required parameter: signal_id","local"));if(!_.target_state)return B(new W(400,"missing_param","Missing required parameter: target_state","local"));let v={target_state:_.target_state,..._.expected_version!==void 0?{expected_version:_.expected_version}:{},..._.reason?{reason:_.reason}:{},..._.re_triage_date?{re_triage_date:_.re_triage_date}:{},..._.converted_working_draft_ids!==void 0?{converted_working_draft_ids:_.converted_working_draft_ids}:{},..._.idempotency_key?{idempotency_key:_.idempotency_key}:{}};if(_.severity!==void 0||_.grouping_id!==void 0||_.affected_rule_document_ids!==void 0)v.triage_metadata={..._.severity!==void 0?{severity:_.severity}:{},..._.grouping_id!==void 0?{grouping_id:_.grouping_id}:{},..._.affected_rule_document_ids!==void 0?{affected_rule_document_ids:_.affected_rule_document_ids}:{}};let U={};if(_.idempotency_key)U["Idempotency-Key"]=_.idempotency_key;try{let G=await w.post(`/governance-signals/${encodeURIComponent(_.signal_id)}/transition`,{body:v,headers:U});return P(G.body,G.requestId,{retry:$U(Boolean(_.idempotency_key))})}catch(G){if(G instanceof W)return B(G,{operation:"write",hasIdempotencyKey:Boolean(_.idempotency_key)});throw G}}),$.register({name:"typescape_submit_advisory",description:"Compatibility-only alias for older advisory submission flows. Prefer typescape_submit_governance_signal for new RGV2 automation.",inputSchema:ZH},async(g)=>{let _=g,v=_.artifact_kind??_.kind,U=_.body_md??_.body,G=oH(_.basis);if(!v)return B(new W(400,"missing_param","Missing required parameter: artifact_kind","local"));if(!_.target_type)return B(new W(400,"missing_param","Missing required parameter: target_type","local"));if(!_.target_id)return B(new W(400,"missing_param","Missing required parameter: target_id","local"));if(!U)return B(new W(400,"missing_param","Missing required parameter: body_md","local"));if(!_.source_label)return B(new W(400,"missing_param","Missing required parameter: source_label","local"));if(!_.submitted_by)return B(new W(400,"missing_param","Missing required parameter: submitted_by","local"));let D={artifact_kind:v,target:{target_type:_.target_type,target_id:_.target_id},provenance:{source_type:_.source_type??"agent",source_label:_.source_label,submitted_by:_.submitted_by,submitted_at:new Date().toISOString()},payload:{body_md:U,..._.confidence!==void 0&&{confidence:_.confidence},..._.severity_hint!==void 0&&{severity_hint:_.severity_hint},..._.structured_data!==void 0&&{structured_data:_.structured_data},..._.evidence_refs!==void 0&&{evidence_refs:_.evidence_refs}}};if(_.review_id)D.review_id=_.review_id;if(G)D.basis=G;if(_.idempotency_key)D.idempotency_key=_.idempotency_key;let J={};if(_.idempotency_key)J["Idempotency-Key"]=_.idempotency_key;try{let X=await w.post("/advisory-artifacts",{body:D,headers:J});return P(X.body,X.requestId,{retry:$U(Boolean(_.idempotency_key))})}catch(X){if(X instanceof W)return B(X,{operation:"write",hasIdempotencyKey:Boolean(_.idempotency_key)});throw X}}),$.register({name:"typescape_list_advisories",description:"Compatibility-only alias for older advisory listing flows.",inputSchema:xH},async(g)=>{let _=g,v={};if(_.review_id)v.review_id=_.review_id;if(_.target_type)v.target_type=_.target_type;if(_.target_id)v.target_id=_.target_id;if(_.artifact_kind)v.artifact_kind=_.artifact_kind;if(_.status)v.status=_.status;if(_.submitted_by)v.submitted_by=_.submitted_by;if(_.limit!==void 0)v.limit=String(_.limit);if(_.offset!==void 0)v.offset=String(_.offset);try{let U=await w.get("/advisory-artifacts",{query:v});return P(U.body,U.requestId,{retry:h0})}catch(U){if(U instanceof W)return B(U,{operation:"read"});throw U}}),$.register({name:"typescape_get_advisory",description:"Compatibility-only alias for older advisory detail lookups.",inputSchema:hH},async(g)=>{let _=g;if(!_.artifact_id)return B(new W(400,"missing_param","Missing required parameter: artifact_id","local"));try{let v=await w.get(`/advisory-artifacts/${encodeURIComponent(_.artifact_id)}`);return P(v.body,v.requestId,{retry:h0})}catch(v){if(v instanceof W)return B(v,{operation:"read"});throw v}}),$.register({name:"typescape_adopt_advisory",description:"Compatibility-only alias for legacy advisory adoption.",inputSchema:lH},async(g)=>{let _=g;if(!_.artifact_id)return B(new W(400,"missing_param","Missing required parameter: artifact_id","local"));let v={};if(_.rationale)v.rationale=_.rationale;if(_.adoption_review_id)v.adoption_review_id=_.adoption_review_id;if(_.adoption_proposed_change_id)v.adoption_proposed_change_id=_.adoption_proposed_change_id;try{let U=await w.post(`/advisory-artifacts/${encodeURIComponent(_.artifact_id)}/adopt`,{body:v});return P(U.body,U.requestId,{retry:$U(!1)})}catch(U){if(U instanceof W)return B(U,{operation:"write"});throw U}}),$.register({name:"typescape_reject_advisory",description:"Compatibility-only alias for legacy advisory rejection.",inputSchema:cH},async(g)=>{let _=g;if(!_.artifact_id)return B(new W(400,"missing_param","Missing required parameter: artifact_id","local"));if(!_.rejection_reason)return B(new W(400,"missing_param","Missing required parameter: rejection_reason","local"));let v={rejection_reason:_.rejection_reason};try{let U=await w.post(`/advisory-artifacts/${encodeURIComponent(_.artifact_id)}/reject`,{body:v});return P(U.body,U.requestId,{retry:$U(!1)})}catch(U){if(U instanceof W)return B(U,{operation:"write"});throw U}})}var eH={type:"object",properties:{artifact_id:{type:"string",description:"Filter by advisory artifact ID (optional)"},action_type:{type:"string",enum:["advisory_submit","advisory_adopt","advisory_reject","advisory_supersede","revision_recommend"],description:"Filter by action type (optional)"},actor_id:{type:"string",description:"Filter by actor ID (optional)"},actor_type:{type:"string",enum:["agent","human","system"],description:"Filter by actor type (optional)"},review_id:{type:"string",description:"Filter by review scope (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},aH={type:"object",properties:{receipt_id:{type:"string",description:"Action receipt ID to retrieve"}},required:["receipt_id"]},sH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to list receipts for"}},required:["artifact_id"]};var $q=["typescape_list_action_receipts","typescape_get_action_receipt","typescape_list_artifact_receipts"],pX=Qw({operation:"read"});function wq($,w){$.register({name:"typescape_list_action_receipts",description:"List action receipts with optional filters. Filter by artifact, action type, actor, or review scope. Receipts capture basis attestation and tool metadata for advisory operations.",inputSchema:eH},async(g)=>{let _=g,v={};if(_.artifact_id)v.artifact_id=_.artifact_id;if(_.action_type)v.action_type=_.action_type;if(_.actor_id)v.actor_id=_.actor_id;if(_.actor_type)v.actor_type=_.actor_type;if(_.review_id)v.review_id=_.review_id;if(_.limit!==void 0)v.limit=String(_.limit);if(_.offset!==void 0)v.offset=String(_.offset);try{let U=await w.get("/action-receipts",{query:v});return P(U.body,U.requestId,{retry:pX})}catch(U){if(U instanceof W)return B(U,{operation:"read"});throw U}}),$.register({name:"typescape_get_action_receipt",description:"Get a single action receipt by ID. Returns full receipt with basis snapshot, tool metadata, and result summary.",inputSchema:aH},async(g)=>{let _=g;if(!_.receipt_id)return B(new W(400,"missing_param","Missing required parameter: receipt_id","local"));try{let v=await w.get(`/action-receipts/${encodeURIComponent(_.receipt_id)}`);return P(v.body,v.requestId,{retry:pX})}catch(v){if(v instanceof W)return B(v,{operation:"read"});throw v}}),$.register({name:"typescape_list_artifact_receipts",description:"List all action receipts for a specific advisory artifact. Shows the full execution journal for an artifact's lifecycle.",inputSchema:sH},async(g)=>{let _=g;if(!_.artifact_id)return B(new W(400,"missing_param","Missing required parameter: artifact_id","local"));try{let v=await w.get(`/advisory-artifacts/${encodeURIComponent(_.artifact_id)}/receipts`);return P(v.body,v.requestId,{retry:pX})}catch(v){if(v instanceof W)return B(v,{operation:"read"});throw v}})}var vq=["typescape_create_project","typescape_list_projects","typescape_get_project","typescape_update_project"],zT={type:"object",properties:{name:{type:"string",description:"Project name (required, 1-200 characters)"},description:{type:"string",description:"Optional project description (Markdown, max 2000 characters)"}},required:["name"]},fT={type:"object",properties:{limit:{type:"number",description:"Maximum number of projects to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},AT={type:"object",properties:{project_id:{type:"string",description:"Project ID (e.g., prj_01HXYZ...)"}},required:["project_id"]},ST={type:"object",properties:{project_id:{type:"string",description:"Project ID to update"},name:{type:"string",description:"New project name (1-200 characters)"},description:{type:"string",description:"New project description (Markdown, max 2000 characters)"}},required:["project_id"]};function gq($,w){$.register({name:"typescape_create_project",description:"Create a new project for organizing document-upload-based reviews. Returns the created project with its ID.",inputSchema:zT},async(g)=>{let _=g;if(!_.name)return B(new W(400,"missing_param","Missing required parameter: name","local"));let v={name:_.name};if(_.description!==void 0)v.description=_.description;try{let U=await w.post("/projects",{body:v});return P(k$(U.body),U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_list_projects",description:"List projects with optional cursor pagination. Returns an array of projects with pagination metadata.",inputSchema:fT},async(g)=>{let _=g,v={};if(_.limit!==void 0)v.limit=String(_.limit);if(_.cursor!==void 0)v.cursor=_.cursor;try{let U=await w.get("/projects",{query:v});return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_get_project",description:"Get a project by ID. Returns the project details including configuration.",inputSchema:AT},async(g)=>{let _=g;if(!_.project_id)return B(new W(400,"missing_param","Missing required parameter: project_id","local"));try{let v=await w.get(`/projects/${encodeURIComponent(_.project_id)}`);return P(k$(v.body),v.requestId)}catch(v){if(v instanceof W)return B(v);throw v}}),$.register({name:"typescape_update_project",description:"Update a project's name or description. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:ST},async(g)=>{let _=g;if(!_.project_id)return B(new W(400,"missing_param","Missing required parameter: project_id","local"));let v={};if(_.name!==void 0)v.name=_.name;if(_.description!==void 0)v.description=_.description;try{let U=await w.request("PATCH",`/projects/${encodeURIComponent(_.project_id)}`,{body:v});return P(k$(U.body),U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}})}var _q=["typescape_create_template","typescape_list_templates","typescape_get_template"],iT={type:"object",properties:{name:{type:"string",description:"Template name (required, 1-200 characters)"},description:{type:"string",description:"Optional template description"},source_type:{type:"string",enum:["git","upload"],description:"Source type for reviews created from this template (default: git)"},repo_id:{type:"string",description:"Repository ID (required when source_type is git)"},project_id:{type:"string",description:"Project ID (required when source_type is upload)"},config:{type:"object",description:"Optional configuration object for the template (e.g., default participants, rules, settings)"}},required:["name"]},TT={type:"object",properties:{limit:{type:"number",description:"Maximum number of templates to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},RT={type:"object",properties:{template_id:{type:"string",description:"Template ID (e.g., tpl_01HXYZ...)"}},required:["template_id"]};function Uq($,w){$.register({name:"typescape_create_template",description:"Create a review template for repeatable review creation. Templates capture default settings so operators don't re-specify parameters each time. Returns the created template with its ID.",inputSchema:iT},async(g)=>{let _=g;if(!_.name)return B(new W(400,"missing_param","Missing required parameter: name","local"));let v={name:_.name};if(_.description!==void 0)v.description=_.description;if(_.source_type!==void 0)v.source_type=_.source_type;if(_.repo_id!==void 0)v.repo_id=_.repo_id;if(_.project_id!==void 0)v.project_id=_.project_id;if(_.config!==void 0)v.config=_.config;try{let U=await w.post("/session-templates",{body:v});return P(k$(U.body),U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_list_templates",description:"List review templates with optional cursor pagination. Returns an array of templates with pagination metadata.",inputSchema:TT},async(g)=>{let _=g,v={};if(_.limit!==void 0)v.limit=String(_.limit);if(_.cursor!==void 0)v.cursor=_.cursor;try{let U=await w.get("/session-templates",{query:v});return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_get_template",description:"Get a review template by ID. Returns the template details including configuration.",inputSchema:RT},async(g)=>{let _=g;if(!_.template_id)return B(new W(400,"missing_param","Missing required parameter: template_id","local"));try{let v=await w.get(`/session-templates/${encodeURIComponent(_.template_id)}`);return P(k$(v.body),v.requestId)}catch(v){if(v instanceof W)return B(v);throw v}})}var bq=["typescape_list_issues","typescape_get_issue","typescape_update_issue"],CT={type:"object",properties:{session_id:{type:"string",description:"Review/session ID to list issues for (required)"},status:{type:"string",enum:["open","closed","all"],description:"Filter by issue status (default: all)"},severity:{type:"string",enum:["critical","high","medium","low","info"],description:"Filter by severity level"},limit:{type:"number",description:"Maximum number of issues to return (default: 20, max: 100)"},offset:{type:"number",description:"Offset for pagination (default: 0)"}},required:["session_id"]},uT={type:"object",properties:{issue_id:{type:"string",description:"Issue ID (e.g., iss_01HXYZ...)"}},required:["issue_id"]},ET={type:"object",properties:{issue_id:{type:"string",description:"Issue ID to update"},status:{type:"string",enum:["open","closed"],description:"New status for the issue"},assignee:{type:"string",description:"User ID or email to assign the issue to (null to unassign)"},priority:{type:"string",enum:["critical","high","medium","low"],description:"New priority level"}},required:["issue_id"]};function Gq($,w){$.register({name:"typescape_list_issues",description:"List issues for a review. Supports filtering by status and severity, with offset-based pagination. Returns issues ordered by creation time descending.",inputSchema:CT},async(g)=>{let _=g;if(!_.session_id)return B(new W(400,"missing_param","Missing required parameter: session_id","local"));let v={};if(_.status!==void 0)v.status=_.status;if(_.severity!==void 0)v.severity=_.severity;if(_.limit!==void 0)v.limit=String(_.limit);if(_.offset!==void 0)v.offset=String(_.offset);try{let U=await w.get("/issues",{query:{...v,session_id:_.session_id}});return P(U.body,U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}}),$.register({name:"typescape_get_issue",description:"Get an issue by ID. Returns the full issue details including anchors, associated threads, and current status.",inputSchema:uT},async(g)=>{let _=g;if(!_.issue_id)return B(new W(400,"missing_param","Missing required parameter: issue_id","local"));try{let v=await w.get(`/issues/${encodeURIComponent(_.issue_id)}`);return P(k$(v.body),v.requestId)}catch(v){if(v instanceof W)return B(v);throw v}}),$.register({name:"typescape_update_issue",description:"Update an issue's status, assignee, or priority. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:ET},async(g)=>{let _=g;if(!_.issue_id)return B(new W(400,"missing_param","Missing required parameter: issue_id","local"));let v={};if(_.status!==void 0)v.status=_.status;if(_.assignee!==void 0)v.assignee=_.assignee;if(_.priority!==void 0)v.priority=_.priority;try{let U=await w.request("PATCH",`/issues/${encodeURIComponent(_.issue_id)}`,{body:v});return P(k$(U.body),U.requestId)}catch(U){if(U instanceof W)return B(U);throw U}})}var Dq=["typescape_list_webhooks","typescape_create_webhook","typescape_delete_webhook"],ZT={type:"object",properties:{status:{type:"string",description:"Filter by webhook status. One of: active, paused, disabled."},limit:{type:"integer",description:"Maximum number of results to return (default 25)."}},required:[]},xT={type:"object",properties:{url:{type:"string",description:"The HTTPS URL to deliver webhook events to."},events:{type:"array",items:{type:"string"},description:'Array of event types to subscribe to (e.g., ["review.created", "thread.resolved"]).'},description:{type:"string",description:"Optional human-readable description of the webhook."}},required:["url","events"]},hT={type:"object",properties:{webhook_id:{type:"string",description:"The webhook subscription ID to delete."}},required:["webhook_id"]};function Jq($,w){$.register({name:"typescape_list_webhooks",description:"List webhook subscriptions for the current tenant. Use this to audit which external systems receive event notifications and verify delivery targets before creating new subscriptions. Returns subscription details including URL, events, and status.",inputSchema:ZT},async(g)=>{let _=g;try{let v=new URLSearchParams;if(_.status)v.set("status",_.status);if(_.limit)v.set("limit",String(_.limit));let U=v.toString(),G=U?`/webhooks?${U}`:"/webhooks",D=await w.get(G);return P(D.body,D.requestId)}catch(v){if(v instanceof W)return B(v);throw v}}),$.register({name:"typescape_create_webhook",description:"Create a new webhook subscription to receive event notifications at an HTTPS endpoint. Common events include review.created, thread.resolved, and check_run.completed. Use this to integrate Typescape with external CI/CD pipelines or notification systems.",inputSchema:xT},async(g)=>{let _=g;if(!_.url)return B(new W(400,"missing_param","Missing required parameter: url","local"));if(!_.events||_.events.length===0)return B(new W(400,"missing_param","Missing required parameter: events (must be a non-empty array)","local"));try{let v=await w.post("/webhooks",{body:{url:_.url,events:_.events,description:_.description}});return P(v.body,v.requestId)}catch(v){if(v instanceof W)return B(v);throw v}}),$.register({name:"typescape_delete_webhook",description:"Delete a webhook subscription by ID, permanently stopping all deliveries to the target URL. Use typescape_list_webhooks first to find the subscription ID. This action cannot be undone.",inputSchema:hT},async(g)=>{let _=g;if(!_.webhook_id)return B(new W(400,"missing_param","Missing required parameter: webhook_id","local"));try{let v=await w.request("DELETE",`/webhooks/${encodeURIComponent(_.webhook_id)}`,{});return P({deleted:!0,webhook_id:_.webhook_id},v.requestId)}catch(v){if(v instanceof W)return B(v);throw v}})}var Xq=["typescape_list_events"],lT={type:"object",properties:{review_id:{type:"string",description:"Review (session) ID to list events for."},cursor:{type:"string",description:"Pagination cursor from a previous response. Events after this cursor are returned."},limit:{type:"integer",description:"Maximum number of events to return (default 50)."}},required:["review_id"]};function Qq($,w){$.register({name:"typescape_list_events",description:"List timeline events for a review. Use this to monitor review activity without re-fetching full review data. Returns an ordered list of events (comments, thread changes, status changes, check completions) with cursor-based pagination. Pass the cursor from the previous response for efficient incremental polling.",inputSchema:lT},async(g)=>{let _=g;if(!_.review_id)return B(new W(400,"missing_param","Missing required parameter: review_id","local"));try{let v=new URLSearchParams;if(_.cursor)v.set("cursor",_.cursor);if(_.limit)v.set("limit",String(_.limit));let U=v.toString(),G=`/reviews/${encodeURIComponent(_.review_id)}/events${U?`?${U}`:""}`,D=await w.get(G);return P(D.body,D.requestId)}catch(v){if(v instanceof W)return B(v);throw v}})}var Yq=`---
|
|
44
182
|
name: agent-review-loop
|
|
45
183
|
version: "1.0.0"
|
|
46
184
|
summary: "Run the end-to-end agent review loop while keeping user, reviewer, and operator decisions explicit."
|
|
@@ -240,7 +378,7 @@ existing rule is wrong or a new rule is needed.
|
|
|
240
378
|
- \`revise-from-feedback\`
|
|
241
379
|
- \`challenge-rule\`
|
|
242
380
|
- \`propose-rule\`
|
|
243
|
-
`;var
|
|
381
|
+
`;var Wq=`---
|
|
244
382
|
name: challenge-rule
|
|
245
383
|
version: "1.0.0"
|
|
246
384
|
summary: "Challenge an active rule with supporting evidence when a finding appears incorrect or overly broad."
|
|
@@ -453,7 +591,7 @@ If the operator rejects the challenge, the advisory status changes to
|
|
|
453
591
|
- \`fetch-rules-and-check\` — Understand the rules before challenging
|
|
454
592
|
- \`propose-rule\` — Propose a replacement rule if challenging successfully
|
|
455
593
|
- \`revise-from-feedback\` — Revise content if the challenge is rejected
|
|
456
|
-
`;var
|
|
594
|
+
`;var Hq=`---
|
|
457
595
|
name: create-review
|
|
458
596
|
version: "1.0.0"
|
|
459
597
|
summary: "Create a content review from a Git repository file and share it with reviewers."
|
|
@@ -641,7 +779,7 @@ using an \`idempotency_key\`, so retries are safe.
|
|
|
641
779
|
- \`fetch-rules-and-check\` — Fetch applicable rules and check content
|
|
642
780
|
- \`challenge-rule\` — Challenge a rule that produced a questionable finding
|
|
643
781
|
- \`propose-rule\` — Propose a new rule from repeated findings
|
|
644
|
-
`;var
|
|
782
|
+
`;var qq=`---
|
|
645
783
|
name: fetch-rules-and-check
|
|
646
784
|
version: "1.1.0"
|
|
647
785
|
summary: "Fetch the applicable rule bundle, use checks as a signal, and then perform the real agent evaluation block by block."
|
|
@@ -844,7 +982,7 @@ the whole review.
|
|
|
844
982
|
- \`agent-review-loop\`
|
|
845
983
|
- \`reviewer-feedback-loop\`
|
|
846
984
|
- \`revise-from-feedback\`
|
|
847
|
-
`;var
|
|
985
|
+
`;var Bq=`---
|
|
848
986
|
name: operator-advisory-triage
|
|
849
987
|
version: "1.0.0"
|
|
850
988
|
summary: "Evaluate agent-submitted advisories and decide adopt vs reject with explicit basis checking."
|
|
@@ -978,10 +1116,10 @@ That keeps the authoritative path auditable.
|
|
|
978
1116
|
- \`agent-review-loop\`
|
|
979
1117
|
- \`reviewer-feedback-loop\`
|
|
980
1118
|
- \`revise-from-feedback\`
|
|
981
|
-
`;var
|
|
1119
|
+
`;var Iq=`---
|
|
982
1120
|
name: propose-rule
|
|
983
1121
|
version: "1.0.0"
|
|
984
|
-
summary: "
|
|
1122
|
+
summary: "Create a draft rule review from repeated findings or reviewer feedback."
|
|
985
1123
|
workflows:
|
|
986
1124
|
- rule-governance
|
|
987
1125
|
- rule-creation
|
|
@@ -995,25 +1133,27 @@ license: "Apache-2.0"
|
|
|
995
1133
|
tags:
|
|
996
1134
|
- rules
|
|
997
1135
|
- governance
|
|
998
|
-
-
|
|
1136
|
+
- rule-review
|
|
999
1137
|
min_tools_required:
|
|
1000
|
-
-
|
|
1138
|
+
- typescape_import_rules
|
|
1139
|
+
- typescape_get_review
|
|
1001
1140
|
- typescape_list_findings
|
|
1002
1141
|
- typescape_submit_advisory
|
|
1003
1142
|
---
|
|
1004
1143
|
|
|
1005
|
-
# Playbook: Propose Rule
|
|
1144
|
+
# Playbook: Propose Rule via Draft Rule Review
|
|
1006
1145
|
|
|
1007
1146
|
## Overview
|
|
1008
1147
|
|
|
1009
|
-
|
|
1148
|
+
Create a draft rule review — or an update to an existing rule review — when
|
|
1010
1149
|
recurring patterns in review findings suggest a standard should be codified.
|
|
1011
|
-
Use this playbook when you notice the same feedback appearing across
|
|
1012
|
-
|
|
1013
|
-
|
|
1150
|
+
Use this playbook when you notice the same feedback appearing across multiple
|
|
1151
|
+
content reviews and want to elevate it from ad-hoc comments to an enforceable
|
|
1152
|
+
rule.
|
|
1014
1153
|
|
|
1015
|
-
|
|
1016
|
-
|
|
1154
|
+
The product no longer uses standalone proposal/GCI surfaces for this workflow.
|
|
1155
|
+
A "proposal" is now a draft rule review created through \`typescape_import_rules\`
|
|
1156
|
+
and later published, revised, or deprecated by an operator.
|
|
1017
1157
|
|
|
1018
1158
|
## Prerequisites
|
|
1019
1159
|
|
|
@@ -1052,7 +1192,7 @@ Record at least 2-3 finding IDs that demonstrate the pattern.
|
|
|
1052
1192
|
Before proposing a new rule, verify the pattern is not already covered by
|
|
1053
1193
|
an active rule.
|
|
1054
1194
|
|
|
1055
|
-
**Tool**: \`
|
|
1195
|
+
**Tool**: \`typescape_get_rules\`
|
|
1056
1196
|
|
|
1057
1197
|
**Input**:
|
|
1058
1198
|
|
|
@@ -1064,7 +1204,7 @@ an active rule.
|
|
|
1064
1204
|
|
|
1065
1205
|
Search the returned rules for any that address the same concern. If an
|
|
1066
1206
|
existing rule partially covers the pattern but is too narrow or too broad,
|
|
1067
|
-
consider a challenge (\`challenge-rule\` playbook) or a superseding
|
|
1207
|
+
consider a challenge (\`challenge-rule\` playbook) or a superseding rule review
|
|
1068
1208
|
instead.
|
|
1069
1209
|
|
|
1070
1210
|
### 3. Draft the rule
|
|
@@ -1117,35 +1257,38 @@ Consider:
|
|
|
1117
1257
|
Narrow applicability reduces false positives. Start narrow and broaden if
|
|
1118
1258
|
the rule proves valuable.
|
|
1119
1259
|
|
|
1120
|
-
### 5.
|
|
1260
|
+
### 5. Create the draft rule review
|
|
1121
1261
|
|
|
1122
|
-
**Tool**: \`
|
|
1262
|
+
**Tool**: \`typescape_import_rules\`
|
|
1123
1263
|
|
|
1124
1264
|
**Input**:
|
|
1125
1265
|
|
|
1126
1266
|
\`\`\`json
|
|
1127
1267
|
{
|
|
1128
|
-
"
|
|
1129
|
-
"
|
|
1268
|
+
"content": "**should** | terminology\\nUse \\"select\\" instead of \\"click\\" when describing user interactions with UI elements, to remain input-method neutral.",
|
|
1269
|
+
"title": "<concise rule review title>",
|
|
1130
1270
|
"applicability": {
|
|
1131
1271
|
"content_type": "documentation"
|
|
1132
1272
|
},
|
|
1133
|
-
"
|
|
1273
|
+
"provenance": {
|
|
1274
|
+
"source_type": "findings",
|
|
1275
|
+
"source_label": "recurring-review-pattern"
|
|
1276
|
+
}
|
|
1134
1277
|
}
|
|
1135
1278
|
\`\`\`
|
|
1136
1279
|
|
|
1137
|
-
**Expected output**: A rule
|
|
1280
|
+
**Expected output**: A draft rule review payload with:
|
|
1138
1281
|
|
|
1139
|
-
- \`
|
|
1140
|
-
- \`
|
|
1141
|
-
-
|
|
1282
|
+
- \`review_id\`
|
|
1283
|
+
- \`state\` — typically \`draft\`
|
|
1284
|
+
- parsed rule metadata for the imported blocks
|
|
1142
1285
|
|
|
1143
1286
|
**On error**:
|
|
1144
1287
|
|
|
1145
1288
|
- \`422\` (invalid rule format): Verify the strength marker is bold
|
|
1146
1289
|
(\`**must**\`, not \`must\`) and the category separator is \`|\`.
|
|
1147
|
-
- \`
|
|
1148
|
-
|
|
1290
|
+
- Use \`preview: true\` first if you want to validate parsing before creating the
|
|
1291
|
+
draft review.
|
|
1149
1292
|
|
|
1150
1293
|
### 6. Submit supporting advisory (optional)
|
|
1151
1294
|
|
|
@@ -1158,7 +1301,7 @@ For complex proposals, submit an advisory artifact with detailed rationale.
|
|
|
1158
1301
|
\`\`\`json
|
|
1159
1302
|
{
|
|
1160
1303
|
"target_type": "rule_review",
|
|
1161
|
-
"target_id": "<
|
|
1304
|
+
"target_id": "<review_id from step 5>",
|
|
1162
1305
|
"artifact_kind": "proposal",
|
|
1163
1306
|
"body_md": "## Rule Proposal Rationale\\n\\n### Pattern Observed\\n<description of recurring feedback>\\n\\n### Evidence\\n- Finding <finding_id_1> on review <review_id_1>: <summary>\\n- Finding <finding_id_2> on review <review_id_2>: <summary>\\n\\n### Expected Impact\\n<how many reviews this rule would affect, what category of content>\\n\\n### Alternatives Considered\\n<other approaches and why this rule is preferred>",
|
|
1164
1307
|
"basis": {
|
|
@@ -1171,34 +1314,36 @@ For complex proposals, submit an advisory artifact with detailed rationale.
|
|
|
1171
1314
|
|
|
1172
1315
|
### 7. Monitor proposal status
|
|
1173
1316
|
|
|
1174
|
-
Track the
|
|
1317
|
+
Track the draft rule review through the governance workflow.
|
|
1175
1318
|
|
|
1176
|
-
**Tool**: \`
|
|
1319
|
+
**Tool**: \`typescape_get_review\`
|
|
1177
1320
|
|
|
1178
1321
|
**Input**:
|
|
1179
1322
|
|
|
1180
1323
|
\`\`\`json
|
|
1181
|
-
{
|
|
1324
|
+
{
|
|
1325
|
+
"review_id": "<review_id from step 5>"
|
|
1326
|
+
}
|
|
1182
1327
|
\`\`\`
|
|
1183
1328
|
|
|
1184
|
-
The
|
|
1329
|
+
The rule review will move through states such as:
|
|
1185
1330
|
|
|
1186
|
-
- \`
|
|
1187
|
-
- \`
|
|
1188
|
-
- \`
|
|
1331
|
+
- \`draft\` — awaiting operator review
|
|
1332
|
+
- \`active\` — operator published the rule review
|
|
1333
|
+
- \`superseded\` or \`closed\` — no longer the current active ruleset
|
|
1189
1334
|
|
|
1190
1335
|
## Completion Criteria
|
|
1191
1336
|
|
|
1192
|
-
-
|
|
1337
|
+
- Draft rule review created with valid strength marker and category.
|
|
1193
1338
|
- At least 2 source findings cited as evidence for the pattern.
|
|
1194
1339
|
- Applicability properties set to the appropriate scope.
|
|
1195
|
-
-
|
|
1340
|
+
- Rule review state is \`draft\` or \`active\`.
|
|
1196
1341
|
|
|
1197
1342
|
## Troubleshooting
|
|
1198
1343
|
|
|
1199
|
-
###
|
|
1344
|
+
### Draft rule review not published
|
|
1200
1345
|
|
|
1201
|
-
Review the
|
|
1346
|
+
Review the operator feedback. Common causes:
|
|
1202
1347
|
|
|
1203
1348
|
- **Too broad**: The rule applicability matches too many content types.
|
|
1204
1349
|
Narrow the scope and resubmit.
|
|
@@ -1208,18 +1353,18 @@ Review the rejection reason. Common causes:
|
|
|
1208
1353
|
evaluation. Add concrete criteria.
|
|
1209
1354
|
- **Insufficient evidence**: Add more source findings or examples.
|
|
1210
1355
|
|
|
1211
|
-
### Rule
|
|
1356
|
+
### Rule review creates findings on unrelated content
|
|
1212
1357
|
|
|
1213
|
-
The applicability is too broad.
|
|
1214
|
-
properties. If
|
|
1215
|
-
|
|
1358
|
+
The applicability is too broad. Revise the rule review with narrower
|
|
1359
|
+
properties. If it is already active, use the \`challenge-rule\` playbook
|
|
1360
|
+
against the newly published rule review.
|
|
1216
1361
|
|
|
1217
1362
|
### Conflict with existing rule
|
|
1218
1363
|
|
|
1219
1364
|
If your proposed rule conflicts with an active rule, the operator may
|
|
1220
1365
|
require you to also submit a challenge against the conflicting rule. Use
|
|
1221
|
-
the \`challenge-rule\` playbook for the existing rule, referencing the
|
|
1222
|
-
|
|
1366
|
+
the \`challenge-rule\` playbook for the existing rule, referencing the draft
|
|
1367
|
+
rule review as evidence.
|
|
1223
1368
|
|
|
1224
1369
|
## Related Playbooks
|
|
1225
1370
|
|
|
@@ -1227,7 +1372,7 @@ proposal as evidence.
|
|
|
1227
1372
|
- \`fetch-rules-and-check\` — Check current rules before proposing new ones
|
|
1228
1373
|
- \`create-review\` — Create reviews that generate the findings evidence
|
|
1229
1374
|
- \`revise-from-feedback\` — Revise content using existing rules
|
|
1230
|
-
`;var
|
|
1375
|
+
`;var Lq=`---
|
|
1231
1376
|
name: revise-from-feedback
|
|
1232
1377
|
version: "1.0.0"
|
|
1233
1378
|
summary: "Consume a handoff bundle and produce a revision plan addressing review findings."
|
|
@@ -1436,7 +1581,7 @@ If still conflicting, flag for human resolution.
|
|
|
1436
1581
|
- \`create-review\` — Create the initial review that produces findings
|
|
1437
1582
|
- \`fetch-rules-and-check\` — Fetch rules and run checks before revising
|
|
1438
1583
|
- \`propose-rule\` — Propose a new rule from patterns found during revision
|
|
1439
|
-
`;var
|
|
1584
|
+
`;var Vq=`---
|
|
1440
1585
|
name: reviewer-feedback-loop
|
|
1441
1586
|
version: "1.0.0"
|
|
1442
1587
|
summary: "Help a human reviewer turn live findings into a revision, escalation, or governance action without overwriting reviewer judgment."
|
|
@@ -1558,4 +1703,4 @@ bury that in one document revision. Escalate it:
|
|
|
1558
1703
|
- \`revise-from-feedback\`
|
|
1559
1704
|
- \`challenge-rule\`
|
|
1560
1705
|
- \`propose-rule\`
|
|
1561
|
-
`;var
|
|
1706
|
+
`;var eT=[{filename:"agent-review-loop.md",content:Yq},{filename:"challenge-rule.md",content:Wq},{filename:"create-review.md",content:Hq},{filename:"fetch-rules-and-check.md",content:qq},{filename:"operator-advisory-triage.md",content:Bq},{filename:"propose-rule.md",content:Iq},{filename:"revise-from-feedback.md",content:Lq},{filename:"reviewer-feedback-loop.md",content:Vq}];function l0($){let w=$.trim();if(w.startsWith('"')&&w.endsWith('"')||w.startsWith("'")&&w.endsWith("'"))return w.slice(1,-1);return w}function aT($){let w=$.trim();if(w.startsWith("[")&&w.endsWith("]"))return w.slice(1,-1).split(",").map((g)=>l0(g)).filter((g)=>g.length>0);return l0(w)}function sT($){let w=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec($);if(!w)return null;let g={},_=w[1].split(/\r?\n/);for(let v=0;v<_.length;){let G=_[v].trim();if(G.length===0||G.startsWith("#")){v+=1;continue}let D=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(G);if(!D){v+=1;continue}let J=D.at(1);if(typeof J!=="string"||J.length===0){v+=1;continue}let X=(D.at(2)??"").trim();if(X.length>0){g[J]=aT(X),v+=1;continue}v+=1;let Q=[],Y={};while(v<_.length){let q=_[v],L=q.trim(),F=/^\s*/.exec(q)?.[0].length??0;if(L.length===0){v+=1;continue}if(F<2)break;if(L.startsWith("- ")){Q.push(l0(L.slice(2))),v+=1;continue}let H=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(L);if(!H){v+=1;continue}let V=H.at(1);if(typeof V!=="string"||V.length===0){v+=1;continue}Y[V]=l0(H.at(2)??""),v+=1}if(Q.length>0)g[J]=Q;else if(Object.keys(Y).length>0)g[J]=Y;else g[J]=""}return g}function eX($){if(!Array.isArray($))return;return $.filter((w)=>typeof w==="string"&&w.length>0)}function $R($){if(typeof $!=="object"||$===null||Array.isArray($))return;let w=Object.entries($).filter((g)=>typeof g[1]==="string");if(w.length===0)return;return Object.fromEntries(w)}function wR($){let w=sT($.content);if(w===null)throw Error(`Bundled playbook ${$.filename} is missing required frontmatter`);let g=$.filename.replace(/\.md$/i,""),_=typeof w.name==="string"&&w.name.length>0?w.name:g,v=eX(w.workflows)??[];return{name:_,version:typeof w.version==="string"&&w.version.length>0?w.version:"0.0.0",summary:typeof w.summary==="string"?w.summary:"",workflows:v,trust_level:typeof w.trust_level==="string"&&w.trust_level.length>0?w.trust_level:"first_party",author:typeof w.author==="string"&&w.author.length>0?w.author:"Typescape",content:$.content,compatible_api_version:typeof w.compatible_api_version==="string"&&w.compatible_api_version.length>0?w.compatible_api_version:void 0,compatible_artifacts:$R(w.compatible_artifacts),tags:eX(w.tags),min_tools_required:eX(w.min_tools_required)}}var Fq=eT.map(wR).sort(($,w)=>$.name.localeCompare(w.name));function jq($={}){return Fq.filter((w)=>{if($.workflow&&!w.workflows.includes($.workflow))return!1;if($.trustLevel&&w.trust_level.toLowerCase()!==$.trustLevel.toLowerCase())return!1;return!0}).map((w)=>({...w}))}function Kq($){let w=$.trim().toLowerCase();if(w.length===0)return null;let g=Fq.find((_)=>_.name.toLowerCase()===w);return g===void 0?null:{...g}}var Nq=["typescape_list_playbooks","typescape_get_playbook"],vR={type:"object",properties:{workflow:{type:"string",description:"Filter by workflow category (e.g., 'review-creation', 'rule-governance'). Returns only playbooks that cover this workflow."},trust_level:{type:"string",description:"Filter by trust level: first_party, tenant_local, or third_party."}},required:[]},gR={type:"object",properties:{name:{type:"string",description:"Playbook name (e.g., 'create-review', 'revise-from-feedback'). Use typescape_list_playbooks to discover available names."}},required:["name"]};function Oq($){return $.status===0||$.status===404||$.code==="not_found"}function Pq($,w){$.register({name:"typescape_list_playbooks",description:"List available playbook packages for agent workflows. Playbooks are instruction sets that guide agents through canonical Typescape operations like creating reviews, revising from feedback, checking rules, challenging rules, and proposing new rules. Use this to discover which playbooks are available before starting a workflow. Returns name, version, summary, workflows, and trust level for each.",inputSchema:vR},async(g)=>{let _=g;try{let v=new URLSearchParams;if(_.workflow)v.set("workflow",_.workflow);if(_.trust_level)v.set("trust_level",_.trust_level);let U=v.toString(),G=U?`/playbooks?${U}`:"/playbooks",D=await w.get(G);return P(D.body,D.requestId)}catch(v){if(v instanceof W&&Oq(v)){let U=jq({workflow:_.workflow,trustLevel:_.trust_level});return P({items:U,source:"bundled_local"},C0)}if(v instanceof W)return B(v);throw v}}),$.register({name:"typescape_get_playbook",description:"Get the full content of a playbook package by name. Returns the complete Markdown instruction set including frontmatter metadata, prerequisites, step-by-step workflow guidance with tool invocations, expected outputs, error handling, and completion criteria. Use typescape_list_playbooks first to discover available names.",inputSchema:gR},async(g)=>{let _=g;if(!_.name)return B(H$(400,"missing_param","Missing required parameter: name"));try{let v=`/playbooks/${encodeURIComponent(_.name)}`,U=await w.get(v);return P(U.body,U.requestId)}catch(v){if(v instanceof W&&Oq(v)){let U=Kq(_.name);if(U)return P(U,C0)}if(v instanceof W)return B(v);throw v}})}var Zo=[...E7,...e7,...IH,...VH,...zH,...RH,...uH,...rH,...$q,...vq,..._q,...bq,...Dq,...Xq,...Nq];function aX($,w){let g=n7(w);x7($,w),a7($,w),LH($,w,g),FH($,w,g),TH($,w,g),CH($,w),EH($,w,g),pH($,w),wq($,w),gq($,w),Uq($,w),Gq($,w),Jq($,w),Qq($,w),Pq($,w)}var kq={TYPESCAPE_API_KEY:"Operator API token for authenticating with the Typescape API",TYPESCAPE_BASE_URL:"Base URL of the Typescape API server (e.g., https://review.example.com)"};class c0 extends Error{missingEnvVars;constructor($){super("Missing required environment variables");this.missingEnvVars=$;this.name="McpConfigError"}}function wU($,w){let g=$[w];if(!g)return;let _=g.trim();return _.length>0?_:void 0}function _R($){let w=[];if(!wU($,"TYPESCAPE_API_KEY"))w.push(`TYPESCAPE_API_KEY: ${kq.TYPESCAPE_API_KEY}`);if(!wU($,"TYPESCAPE_BASE_URL"))w.push(`TYPESCAPE_BASE_URL: ${kq.TYPESCAPE_BASE_URL}`);return w}function nq($,w=$4){if(!$||$.trim().length===0)return{timeoutMs:w,warning:null};let g=$.trim();if(/^\d+$/.test(g)){let _=Number(g);if(_>=1000)return{timeoutMs:_,warning:null}}return{timeoutMs:w,warning:`Warning: Invalid TYPESCAPE_TIMEOUT_MS='${$}'. Using default ${w}ms.`}}function Mq($=process.env,w=$4){let g=wU($,"TYPESCAPE_API_KEY"),_=wU($,"TYPESCAPE_BASE_URL");if(!g||!_)throw new c0(_R($));let v=wU($,"TYPESCAPE_TIMEOUT_MS"),U=nq(v,w);return{apiKey:g,baseUrl:_,timeoutMs:U.timeoutMs,timeoutWarning:U.warning}}async function UR(){let $;try{$=Mq()}catch(_){if(_ instanceof c0){console.error("Error: Missing required environment variables:");for(let v of _.missingEnvVars)console.error(` - ${v}`);process.exit(1)}throw _}if($.timeoutWarning)console.warn($.timeoutWarning);let w=hY($.baseUrl,$.apiKey,$.timeoutMs),g=w8();aX(g,w),await k7(g)}if(J4.main==J4.module)UR().catch(($)=>{console.error("Fatal error:",$ instanceof Error?$.message:String($)),process.exit(1)});export{nq as resolveTimeoutMs};
|