@typescape-ai/mcp 1.9.23 → 1.9.26

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.
Files changed (2) hide show
  1. package/dist/mcp.js +1528 -10
  2. package/package.json +1 -1
package/dist/mcp.js CHANGED
@@ -1,9 +1,9 @@
1
- import{createRequire as g9}from"node:module";var oG=Object.create;var{getPrototypeOf:rG,defineProperty:kw,getOwnPropertyNames:dG}=Object;var pG=Object.prototype.hasOwnProperty;function eG($){return this[$]}var aG,sG,tD=($,n,g)=>{var U=$!=null&&typeof $==="object";if(U){var v=n?aG??=new WeakMap:sG??=new WeakMap,w=v.get($);if(w)return w}g=$!=null?oG(rG($)):{};let _=n||!$||!$.__esModule?kw(g,"default",{value:$,enumerable:!0}):g;for(let D of dG($))if(!pG.call(_,D))kw(_,D,{get:eG.bind($,D),enumerable:!0});if(U)v.set($,_);return _};var $9=($,n)=>()=>(n||$((n={exports:{}}).exports,n),n.exports);var v9=($)=>$;function n9($,n){this[$]=v9.bind(null,n)}var z$=($,n)=>{for(var g in n)kw($,g,{get:n[g],enumerable:!0,configurable:!0,set:n9.bind(n,g)})};var oD=g9(import.meta.url);var jw=$9((Aj,U9)=>{U9.exports={name:"@typescape-ai/mcp",version:"1.9.23",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 rD(){let $=new Map;return{register(n,g){$.set(n.name,{definition:n,handler:g})},getTools(){return Array.from($.values()).map((n)=>n.definition)},getHandler(n){return $.get(n)?.handler}}}var w9=await Promise.resolve().then(() => tD(jw(),1)),_9=`typescape-mcp/${w9.version}`;class Q extends Error{status;code;requestId;details;fixHint;constructor($,n,g,U,v,w){super(g);this.status=$;this.code=n;this.requestId=U;this.details=v;this.fixHint=w;this.name="ApiError"}}var Sg=30000;function Iw($,n,g,U){let v=`${$}${n}${g}`;if(U&&Object.keys(U).length>0){let w=new URLSearchParams(U);v+=`?${w.toString()}`}return v}function Hw($,n){return{Authorization:`Bearer ${$}`,Accept:"application/json","User-Agent":_9,...n}}function eD($){let n=$.headers.get("X-Request-Id");if(typeof n!=="string"||n.trim().length===0)return null;return n}function aD(){return"missing_request_id"}function sD($,n){if(typeof $.request_id==="string"&&$.request_id.trim().length>0)return $.request_id;let g=eD(n);if(g!==null)return g;return aD()}function dD($){let n=eD($);if(n!==null)return n;return aD()}async function pD($,n,g){let U;try{U=await fetch($,{...n,signal:AbortSignal.timeout(g)})}catch(D){if(D instanceof DOMException&&(D.name==="TimeoutError"||D.name==="AbortError")){let G=Math.round(g/1000);throw new Q(0,"request_timeout",`Request timed out after ${G}s. Check your network connection and server URL.`,"unknown")}let X=D instanceof Error?D.message:String(D);throw new Q(0,"network_error",`Network error: ${X}`,"unknown")}let v=U.headers.get("Content-Type");if(v===null)throw new Q(U.status,"invalid_response","Response missing Content-Type header","unknown");if(!v.includes("application/json"))throw new Q(U.status,"invalid_response",`Unexpected Content-Type: ${v}`,"unknown");let w;try{w=await U.json()}catch(D){throw new Q(U.status,"invalid_response",`Failed to parse JSON response: ${D instanceof Error?D.message:String(D)}`,"unknown")}let _=sD(w,U);if(typeof _!=="string"||_.trim().length===0)throw new Q(U.status,"invalid_response","Response missing request_id","unknown");if(!U.ok){let D=w,J=D.error?.code;if(typeof J!=="string"||J.trim().length===0)throw new Q(U.status,"invalid_response","Error response missing error.code",_);let X=D.error?.message;if(typeof X!=="string"||X.trim().length===0)throw new Q(U.status,"invalid_response","Error response missing error.message",_);throw new Q(U.status,J,X,_,D.error?.details,D.error?.fix_hint)}return{status:U.status,body:w,requestId:_}}async function b9($,n,g){let U;try{U=await fetch($,{...n,signal:AbortSignal.timeout(g)})}catch(_){if(_ instanceof DOMException&&(_.name==="TimeoutError"||_.name==="AbortError")){let X=Math.round(g/1000);throw new Q(0,"request_timeout",`Request timed out after ${X}s. Check your network connection and server URL.`,"unknown")}let J=_ instanceof Error?_.message:String(_);throw new Q(0,"network_error",`Network error: ${J}`,"unknown")}let v=U.headers.get("Content-Type");if(v===null)throw new Q(U.status,"invalid_response","Response missing Content-Type header","unknown");if(v.includes("application/json")){let _;try{_=await U.json()}catch(J){throw new Q(U.status,"invalid_response",`Failed to parse JSON response: ${J instanceof Error?J.message:String(J)}`,"unknown")}let D=sD(_,U);if(!U.ok){let J=_.error?.code,X=_.error?.message;if(typeof J!=="string"||J.trim().length===0||typeof X!=="string"||X.trim().length===0)throw new Q(U.status,"invalid_response","Error response missing error.code or error.message",D);throw new Q(U.status,J,X,D,_.error?.details,_.error?.fix_hint)}throw new Q(U.status,"invalid_response","Expected text response but received JSON payload",D)}let w;try{w=await U.text()}catch(_){throw new Q(U.status,"invalid_response",`Failed to read text response: ${_ instanceof Error?_.message:String(_)}`,dD(U))}return{status:U.status,body:w,requestId:dD(U)}}function $J($,n,g=Sg){let v=$.replace(/\/$/,"");async function w(_,D,J={}){let X=Iw(v,"/v1",D,J.query),G=Hw(n,J.headers);if(J.body!==void 0)G["Content-Type"]="application/json";return pD(X,{method:_,headers:G,body:J.body!==void 0?JSON.stringify(J.body):void 0},g)}return{async get(_,D){return w("GET",_,D)},async getText(_,D){let J=Iw(v,"/v1",_,D?.query),X=Hw(n,{Accept:"text/plain, application/json",...D?.headers});return b9(J,{method:"GET",headers:X},g)},async post(_,D){return w("POST",_,D)},async patch(_,D){return w("PATCH",_,D)},async postFormData(_,D,J){let X=Iw(v,"/v1",_,J?.query),G=Hw(n,J?.headers);return pD(X,{method:"POST",headers:G,body:D},g)},request:w}}var y;(function($){$.assertEqual=(v)=>v;function n(v){}$.assertIs=n;function g(v){throw Error()}$.assertNever=g,$.arrayToEnum=(v)=>{let w={};for(let _ of v)w[_]=_;return w},$.getValidEnumValues=(v)=>{let w=$.objectKeys(v).filter((D)=>typeof v[v[D]]!=="number"),_={};for(let D of w)_[D]=v[D];return $.objectValues(_)},$.objectValues=(v)=>{return $.objectKeys(v).map(function(w){return v[w]})},$.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},$.find=(v,w)=>{for(let _ of v)if(w(_))return _;return},$.isInteger=typeof Number.isInteger==="function"?(v)=>Number.isInteger(v):(v)=>typeof v==="number"&&isFinite(v)&&Math.floor(v)===v;function U(v,w=" | "){return v.map((_)=>typeof _==="string"?`'${_}'`:_).join(w)}$.joinValues=U,$.jsonStringifyReplacer=(v,w)=>{if(typeof w==="bigint")return w.toString();return w}})(y||(y={}));var Lw;(function($){$.mergeShapes=(n,g)=>{return{...n,...g}}})(Lw||(Lw={}));var R=y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$v=($)=>{switch(typeof $){case"undefined":return R.undefined;case"string":return R.string;case"number":return isNaN($)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":if(Array.isArray($))return R.array;if($===null)return R.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return R.promise;if(typeof Map<"u"&&$ instanceof Map)return R.map;if(typeof Set<"u"&&$ instanceof Set)return R.set;if(typeof Date<"u"&&$ instanceof Date)return R.date;return R.object;default:return R.unknown}},F=y.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"]),D9=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class H$ 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 n=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,n);else this.__proto__=n;this.name="ZodError",this.issues=$}format($){let n=$||function(v){return v.message},g={_errors:[]},U=(v)=>{for(let w of v.issues)if(w.code==="invalid_union")w.unionErrors.map(U);else if(w.code==="invalid_return_type")U(w.returnTypeError);else if(w.code==="invalid_arguments")U(w.argumentsError);else if(w.path.length===0)g._errors.push(n(w));else{let _=g,D=0;while(D<w.path.length){let J=w.path[D];if(D!==w.path.length-1)_[J]=_[J]||{_errors:[]};else _[J]=_[J]||{_errors:[]},_[J]._errors.push(n(w));_=_[J],D++}}};return U(this),g}static assert($){if(!($ instanceof H$))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,y.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(n)=>n.message){let n={},g=[];for(let U of this.issues)if(U.path.length>0)n[U.path[0]]=n[U.path[0]]||[],n[U.path[0]].push($(U));else g.push($(U));return{formErrors:g,fieldErrors:n}}get formErrors(){return this.flatten()}}H$.create=($)=>{return new H$($)};var qn=($,n)=>{let g;switch($.code){case F.invalid_type:if($.received===R.undefined)g="Required";else g=`Expected ${$.expected}, received ${$.received}`;break;case F.invalid_literal:g=`Invalid literal value, expected ${JSON.stringify($.expected,y.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:g=`Unrecognized key(s) in object: ${y.joinValues($.keys,", ")}`;break;case F.invalid_union:g="Invalid input";break;case F.invalid_union_discriminator:g=`Invalid discriminator value. Expected ${y.joinValues($.options)}`;break;case F.invalid_enum_value:g=`Invalid enum value. Expected ${y.joinValues($.options)}, received '${$.received}'`;break;case F.invalid_arguments:g="Invalid function arguments";break;case F.invalid_return_type:g="Invalid function return type";break;case F.invalid_date:g="Invalid date";break;case F.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 y.assertNever($.validation);else if($.validation!=="regex")g=`Invalid ${$.validation}`;else g="Invalid";break;case F.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 F.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 F.custom:g="Invalid input";break;case F.invalid_intersection_types:g="Intersection results could not be merged";break;case F.not_multiple_of:g=`Number must be a multiple of ${$.multipleOf}`;break;case F.not_finite:g="Number must be finite";break;default:g=n.defaultError,y.assertNever($)}return{message:g}},gJ=qn;function J9($){gJ=$}function zg(){return gJ}var Mg=($)=>{let{data:n,path:g,errorMaps:U,issueData:v}=$,w=[...g,...v.path||[]],_={...v,path:w};if(v.message!==void 0)return{...v,path:w,message:v.message};let D="",J=U.filter((X)=>!!X).slice().reverse();for(let X of J)D=X(_,{data:n,defaultError:D}).message;return{...v,path:w,message:D}},X9=[];function z($,n){let g=zg(),U=Mg({issueData:n,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,g,g===qn?void 0:qn].filter((v)=>!!v)});$.common.issues.push(U)}class D${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,n){let g=[];for(let U of n){if(U.status==="aborted")return f;if(U.status==="dirty")$.dirty();g.push(U.value)}return{status:$.value,value:g}}static async mergeObjectAsync($,n){let g=[];for(let U of n){let v=await U.key,w=await U.value;g.push({key:v,value:w})}return D$.mergeObjectSync($,g)}static mergeObjectSync($,n){let g={};for(let U of n){let{key:v,value:w}=U;if(v.status==="aborted")return f;if(w.status==="aborted")return f;if(v.status==="dirty")$.dirty();if(w.status==="dirty")$.dirty();if(v.value!=="__proto__"&&(typeof w.value<"u"||U.alwaysSet))g[v.value]=w.value}return{status:$.value,value:g}}}var f=Object.freeze({status:"aborted"}),Ln=($)=>({status:"dirty",value:$}),Q$=($)=>({status:"valid",value:$}),Kw=($)=>$.status==="aborted",qw=($)=>$.status==="dirty",ov=($)=>$.status==="valid",c6=($)=>typeof Promise<"u"&&$ instanceof Promise;function Rg($,n,g,U){if(g==="a"&&!U)throw TypeError("Private accessor was defined without a getter");if(typeof n==="function"?$!==n||!U:!n.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?U:g==="a"?U.call($):U?U.value:n.get($)}function UJ($,n,g,U,v){if(U==="m")throw TypeError("Private method is not writable");if(U==="a"&&!v)throw TypeError("Private accessor was defined without a setter");if(typeof n==="function"?$!==n||!v:!n.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return U==="a"?v.call($,g):v?v.value=g:n.set($,g),g}var A;(function($){$.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},$.toString=(n)=>typeof n==="string"?n:n===null||n===void 0?void 0:n.message})(A||(A={}));var l6,Z6;class x${constructor($,n,g,U){this._cachedPath=[],this.parent=$,this.data=n,this._path=g,this._key=U}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 vJ=($,n)=>{if(ov(n))return{success:!0,data:n.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 H$($.common.issues);return this._error=g,this._error}}}};function u($){if(!$)return{};let{errorMap:n,invalid_type_error:g,required_error:U,description:v}=$;if(n&&(g||U))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:v};return{errorMap:(_,D)=>{var J,X;let{message:G}=$;if(_.code==="invalid_enum_value")return{message:G!==null&&G!==void 0?G:D.defaultError};if(typeof D.data>"u")return{message:(J=G!==null&&G!==void 0?G:U)!==null&&J!==void 0?J:D.defaultError};if(_.code!=="invalid_type")return{message:D.defaultError};return{message:(X=G!==null&&G!==void 0?G:g)!==null&&X!==void 0?X:D.defaultError}},description:v}}class T{get description(){return this._def.description}_getType($){return $v($.data)}_getOrReturnCtx($,n){return n||{common:$.parent.common,data:$.data,parsedType:$v($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new D$,ctx:{common:$.parent.common,data:$.data,parsedType:$v($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let n=this._parse($);if(c6(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync($){let n=this._parse($);return Promise.resolve(n)}parse($,n){let g=this.safeParse($,n);if(g.success)return g.data;throw g.error}safeParse($,n){var g;let U={common:{issues:[],async:(g=n===null||n===void 0?void 0:n.async)!==null&&g!==void 0?g:!1,contextualErrorMap:n===null||n===void 0?void 0:n.errorMap},path:(n===null||n===void 0?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:$v($)},v=this._parseSync({data:$,path:U.path,parent:U});return vJ(U,v)}"~validate"($){var n,g;let U={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:$v($)};if(!this["~standard"].async)try{let v=this._parseSync({data:$,path:[],parent:U});return ov(v)?{value:v.value}:{issues:U.common.issues}}catch(v){if((g=(n=v===null||v===void 0?void 0:v.message)===null||n===void 0?void 0:n.toLowerCase())===null||g===void 0?void 0:g.includes("encountered"))this["~standard"].async=!0;U.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:U}).then((v)=>ov(v)?{value:v.value}:{issues:U.common.issues})}async parseAsync($,n){let g=await this.safeParseAsync($,n);if(g.success)return g.data;throw g.error}async safeParseAsync($,n){let g={common:{issues:[],contextualErrorMap:n===null||n===void 0?void 0:n.errorMap,async:!0},path:(n===null||n===void 0?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:$v($)},U=this._parse({data:$,path:g.path,parent:g}),v=await(c6(U)?U:Promise.resolve(U));return vJ(g,v)}refine($,n){let g=(U)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(U);else return n};return this._refinement((U,v)=>{let w=$(U),_=()=>v.addIssue({code:F.custom,...g(U)});if(typeof Promise<"u"&&w instanceof Promise)return w.then((D)=>{if(!D)return _(),!1;else return!0});if(!w)return _(),!1;else return!0})}refinement($,n){return this._refinement((g,U)=>{if(!$(g))return U.addIssue(typeof n==="function"?n(g,U):n),!1;else return!0})}_refinement($){return new q$({schema:this,typeName:x.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:(n)=>this["~validate"](n)}}optional(){return A$.create(this,this._def)}nullable(){return vv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R$.create(this)}promise(){return ev.create(this,this._def)}or($){return Nn.create([this,$],this._def)}and($){return Pn.create(this,$,this._def)}transform($){return new q$({...u(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:$}})}default($){let n=typeof $==="function"?$:()=>$;return new Rn({...u(this._def),innerType:this,defaultValue:n,typeName:x.ZodDefault})}brand(){return new xg({typeName:x.ZodBranded,type:this,...u(this._def)})}catch($){let n=typeof $==="function"?$:()=>$;return new An({...u(this._def),innerType:this,catchValue:n,typeName:x.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return r6.create(this,$)}readonly(){return xn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Q9=/^c[^\s-]{8,}$/i,G9=/^[0-9a-z]+$/,W9=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Y9=/^[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,k9=/^[a-z0-9_-]{21}$/i,j9=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I9=/^[-+]?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)?)??$/,H9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,V9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vw,L9=/^(?:(?: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])$/,K9=/^(?:(?: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])$/,q9=/^(([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]))$/,B9=/^(([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])$/,O9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,F9=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wJ="((\\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])))",N9=new RegExp(`^${wJ}$`);function _J($){let n="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if($.precision)n=`${n}\\.\\d{${$.precision}}`;else if($.precision==null)n=`${n}(\\.\\d+)?`;return n}function i9($){return new RegExp(`^${_J($)}$`)}function bJ($){let n=`${wJ}T${_J($)}`,g=[];if(g.push($.local?"Z?":"Z"),$.offset)g.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${g.join("|")})`,new RegExp(`^${n}$`)}function P9($,n){if((n==="v4"||!n)&&L9.test($))return!0;if((n==="v6"||!n)&&q9.test($))return!0;return!1}function S9($,n){if(!j9.test($))return!1;try{let[g]=$.split("."),U=g.replace(/-/g,"+").replace(/_/g,"/").padEnd(g.length+(4-g.length%4)%4,"="),v=JSON.parse(atob(U));if(typeof v!=="object"||v===null)return!1;if(!v.typ||!v.alg)return!1;if(n&&v.alg!==n)return!1;return!0}catch(g){return!1}}function z9($,n){if((n==="v4"||!n)&&K9.test($))return!0;if((n==="v6"||!n)&&B9.test($))return!0;return!1}class M$ extends T{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==R.string){let v=this._getOrReturnCtx($);return z(v,{code:F.invalid_type,expected:R.string,received:v.parsedType}),f}let g=new D$,U=void 0;for(let v of this._def.checks)if(v.kind==="min"){if($.data.length<v.value)U=this._getOrReturnCtx($,U),z(U,{code:F.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)U=this._getOrReturnCtx($,U),z(U,{code:F.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),g.dirty()}else if(v.kind==="length"){let w=$.data.length>v.value,_=$.data.length<v.value;if(w||_){if(U=this._getOrReturnCtx($,U),w)z(U,{code:F.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message});else if(_)z(U,{code:F.too_small,minimum:v.value,type:"string",inclusive:!0,exact:!0,message:v.message});g.dirty()}}else if(v.kind==="email"){if(!H9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"email",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="emoji"){if(!Vw)Vw=new RegExp(V9,"u");if(!Vw.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"emoji",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="uuid"){if(!Y9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"uuid",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="nanoid"){if(!k9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"nanoid",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="cuid"){if(!Q9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"cuid",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="cuid2"){if(!G9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"cuid2",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="ulid"){if(!W9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"ulid",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="url")try{new URL($.data)}catch(w){U=this._getOrReturnCtx($,U),z(U,{validation:"url",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="regex"){if(v.regex.lastIndex=0,!v.regex.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"regex",code:F.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))U=this._getOrReturnCtx($,U),z(U,{code:F.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))U=this._getOrReturnCtx($,U),z(U,{code:F.invalid_string,validation:{startsWith:v.value},message:v.message}),g.dirty()}else if(v.kind==="endsWith"){if(!$.data.endsWith(v.value))U=this._getOrReturnCtx($,U),z(U,{code:F.invalid_string,validation:{endsWith:v.value},message:v.message}),g.dirty()}else if(v.kind==="datetime"){if(!bJ(v).test($.data))U=this._getOrReturnCtx($,U),z(U,{code:F.invalid_string,validation:"datetime",message:v.message}),g.dirty()}else if(v.kind==="date"){if(!N9.test($.data))U=this._getOrReturnCtx($,U),z(U,{code:F.invalid_string,validation:"date",message:v.message}),g.dirty()}else if(v.kind==="time"){if(!i9(v).test($.data))U=this._getOrReturnCtx($,U),z(U,{code:F.invalid_string,validation:"time",message:v.message}),g.dirty()}else if(v.kind==="duration"){if(!I9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"duration",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="ip"){if(!P9($.data,v.version))U=this._getOrReturnCtx($,U),z(U,{validation:"ip",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="jwt"){if(!S9($.data,v.alg))U=this._getOrReturnCtx($,U),z(U,{validation:"jwt",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="cidr"){if(!z9($.data,v.version))U=this._getOrReturnCtx($,U),z(U,{validation:"cidr",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="base64"){if(!O9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"base64",code:F.invalid_string,message:v.message}),g.dirty()}else if(v.kind==="base64url"){if(!F9.test($.data))U=this._getOrReturnCtx($,U),z(U,{validation:"base64url",code:F.invalid_string,message:v.message}),g.dirty()}else y.assertNever(v);return{status:g.value,value:$.data}}_regex($,n,g){return this.refinement((U)=>$.test(U),{validation:n,code:F.invalid_string,...A.errToObj(g)})}_addCheck($){return new M$({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...A.errToObj($)})}url($){return this._addCheck({kind:"url",...A.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...A.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...A.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...A.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...A.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...A.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...A.errToObj($)})}base64($){return this._addCheck({kind:"base64",...A.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...A.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...A.errToObj($)})}ip($){return this._addCheck({kind:"ip",...A.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...A.errToObj($)})}datetime($){var n,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:(n=$===null||$===void 0?void 0:$.offset)!==null&&n!==void 0?n:!1,local:(g=$===null||$===void 0?void 0:$.local)!==null&&g!==void 0?g:!1,...A.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,...A.errToObj($===null||$===void 0?void 0:$.message)})}duration($){return this._addCheck({kind:"duration",...A.errToObj($)})}regex($,n){return this._addCheck({kind:"regex",regex:$,...A.errToObj(n)})}includes($,n){return this._addCheck({kind:"includes",value:$,position:n===null||n===void 0?void 0:n.position,...A.errToObj(n===null||n===void 0?void 0:n.message)})}startsWith($,n){return this._addCheck({kind:"startsWith",value:$,...A.errToObj(n)})}endsWith($,n){return this._addCheck({kind:"endsWith",value:$,...A.errToObj(n)})}min($,n){return this._addCheck({kind:"min",value:$,...A.errToObj(n)})}max($,n){return this._addCheck({kind:"max",value:$,...A.errToObj(n)})}length($,n){return this._addCheck({kind:"length",value:$,...A.errToObj(n)})}nonempty($){return this.min(1,A.errToObj($))}trim(){return new M$({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new M$({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new M$({...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 n of this._def.checks)if(n.kind==="min"){if($===null||n.value>$)$=n.value}return $}get maxLength(){let $=null;for(let n of this._def.checks)if(n.kind==="max"){if($===null||n.value<$)$=n.value}return $}}M$.create=($)=>{var n;return new M$({checks:[],typeName:x.ZodString,coerce:(n=$===null||$===void 0?void 0:$.coerce)!==null&&n!==void 0?n:!1,...u($)})};function M9($,n){let g=($.toString().split(".")[1]||"").length,U=(n.toString().split(".")[1]||"").length,v=g>U?g:U,w=parseInt($.toFixed(v).replace(".","")),_=parseInt(n.toFixed(v).replace(".",""));return w%_/Math.pow(10,v)}class jv extends T{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($)!==R.number){let v=this._getOrReturnCtx($);return z(v,{code:F.invalid_type,expected:R.number,received:v.parsedType}),f}let g=void 0,U=new D$;for(let v of this._def.checks)if(v.kind==="int"){if(!y.isInteger($.data))g=this._getOrReturnCtx($,g),z(g,{code:F.invalid_type,expected:"integer",received:"float",message:v.message}),U.dirty()}else if(v.kind==="min"){if(v.inclusive?$.data<v.value:$.data<=v.value)g=this._getOrReturnCtx($,g),z(g,{code:F.too_small,minimum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),U.dirty()}else if(v.kind==="max"){if(v.inclusive?$.data>v.value:$.data>=v.value)g=this._getOrReturnCtx($,g),z(g,{code:F.too_big,maximum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),U.dirty()}else if(v.kind==="multipleOf"){if(M9($.data,v.value)!==0)g=this._getOrReturnCtx($,g),z(g,{code:F.not_multiple_of,multipleOf:v.value,message:v.message}),U.dirty()}else if(v.kind==="finite"){if(!Number.isFinite($.data))g=this._getOrReturnCtx($,g),z(g,{code:F.not_finite,message:v.message}),U.dirty()}else y.assertNever(v);return{status:U.value,value:$.data}}gte($,n){return this.setLimit("min",$,!0,A.toString(n))}gt($,n){return this.setLimit("min",$,!1,A.toString(n))}lte($,n){return this.setLimit("max",$,!0,A.toString(n))}lt($,n){return this.setLimit("max",$,!1,A.toString(n))}setLimit($,n,g,U){return new jv({...this._def,checks:[...this._def.checks,{kind:$,value:n,inclusive:g,message:A.toString(U)}]})}_addCheck($){return new jv({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:A.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString($)})}multipleOf($,n){return this._addCheck({kind:"multipleOf",value:$,message:A.toString(n)})}finite($){return this._addCheck({kind:"finite",message:A.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString($)})}get minValue(){let $=null;for(let n of this._def.checks)if(n.kind==="min"){if($===null||n.value>$)$=n.value}return $}get maxValue(){let $=null;for(let n of this._def.checks)if(n.kind==="max"){if($===null||n.value<$)$=n.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&y.isInteger($.value))}get isFinite(){let $=null,n=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(n===null||g.value>n)n=g.value}else if(g.kind==="max"){if($===null||g.value<$)$=g.value}return Number.isFinite(n)&&Number.isFinite($)}}jv.create=($)=>{return new jv({checks:[],typeName:x.ZodNumber,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...u($)})};class Iv extends T{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($)!==R.bigint)return this._getInvalidInput($);let g=void 0,U=new D$;for(let v of this._def.checks)if(v.kind==="min"){if(v.inclusive?$.data<v.value:$.data<=v.value)g=this._getOrReturnCtx($,g),z(g,{code:F.too_small,type:"bigint",minimum:v.value,inclusive:v.inclusive,message:v.message}),U.dirty()}else if(v.kind==="max"){if(v.inclusive?$.data>v.value:$.data>=v.value)g=this._getOrReturnCtx($,g),z(g,{code:F.too_big,type:"bigint",maximum:v.value,inclusive:v.inclusive,message:v.message}),U.dirty()}else if(v.kind==="multipleOf"){if($.data%v.value!==BigInt(0))g=this._getOrReturnCtx($,g),z(g,{code:F.not_multiple_of,multipleOf:v.value,message:v.message}),U.dirty()}else y.assertNever(v);return{status:U.value,value:$.data}}_getInvalidInput($){let n=this._getOrReturnCtx($);return z(n,{code:F.invalid_type,expected:R.bigint,received:n.parsedType}),f}gte($,n){return this.setLimit("min",$,!0,A.toString(n))}gt($,n){return this.setLimit("min",$,!1,A.toString(n))}lte($,n){return this.setLimit("max",$,!0,A.toString(n))}lt($,n){return this.setLimit("max",$,!1,A.toString(n))}setLimit($,n,g,U){return new Iv({...this._def,checks:[...this._def.checks,{kind:$,value:n,inclusive:g,message:A.toString(U)}]})}_addCheck($){return new Iv({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString($)})}multipleOf($,n){return this._addCheck({kind:"multipleOf",value:$,message:A.toString(n)})}get minValue(){let $=null;for(let n of this._def.checks)if(n.kind==="min"){if($===null||n.value>$)$=n.value}return $}get maxValue(){let $=null;for(let n of this._def.checks)if(n.kind==="max"){if($===null||n.value<$)$=n.value}return $}}Iv.create=($)=>{var n;return new Iv({checks:[],typeName:x.ZodBigInt,coerce:(n=$===null||$===void 0?void 0:$.coerce)!==null&&n!==void 0?n:!1,...u($)})};class Bn extends T{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let g=this._getOrReturnCtx($);return z(g,{code:F.invalid_type,expected:R.boolean,received:g.parsedType}),f}return Q$($.data)}}Bn.create=($)=>{return new Bn({typeName:x.ZodBoolean,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...u($)})};class rv extends T{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let v=this._getOrReturnCtx($);return z(v,{code:F.invalid_type,expected:R.date,received:v.parsedType}),f}if(isNaN($.data.getTime())){let v=this._getOrReturnCtx($);return z(v,{code:F.invalid_date}),f}let g=new D$,U=void 0;for(let v of this._def.checks)if(v.kind==="min"){if($.data.getTime()<v.value)U=this._getOrReturnCtx($,U),z(U,{code:F.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)U=this._getOrReturnCtx($,U),z(U,{code:F.too_big,message:v.message,inclusive:!0,exact:!1,maximum:v.value,type:"date"}),g.dirty()}else y.assertNever(v);return{status:g.value,value:new Date($.data.getTime())}}_addCheck($){return new rv({...this._def,checks:[...this._def.checks,$]})}min($,n){return this._addCheck({kind:"min",value:$.getTime(),message:A.toString(n)})}max($,n){return this._addCheck({kind:"max",value:$.getTime(),message:A.toString(n)})}get minDate(){let $=null;for(let n of this._def.checks)if(n.kind==="min"){if($===null||n.value>$)$=n.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let n of this._def.checks)if(n.kind==="max"){if($===null||n.value<$)$=n.value}return $!=null?new Date($):null}}rv.create=($)=>{return new rv({checks:[],coerce:($===null||$===void 0?void 0:$.coerce)||!1,typeName:x.ZodDate,...u($)})};class h6 extends T{_parse($){if(this._getType($)!==R.symbol){let g=this._getOrReturnCtx($);return z(g,{code:F.invalid_type,expected:R.symbol,received:g.parsedType}),f}return Q$($.data)}}h6.create=($)=>{return new h6({typeName:x.ZodSymbol,...u($)})};class On extends T{_parse($){if(this._getType($)!==R.undefined){let g=this._getOrReturnCtx($);return z(g,{code:F.invalid_type,expected:R.undefined,received:g.parsedType}),f}return Q$($.data)}}On.create=($)=>{return new On({typeName:x.ZodUndefined,...u($)})};class Fn extends T{_parse($){if(this._getType($)!==R.null){let g=this._getOrReturnCtx($);return z(g,{code:F.invalid_type,expected:R.null,received:g.parsedType}),f}return Q$($.data)}}Fn.create=($)=>{return new Fn({typeName:x.ZodNull,...u($)})};class dv extends T{constructor(){super(...arguments);this._any=!0}_parse($){return Q$($.data)}}dv.create=($)=>{return new dv({typeName:x.ZodAny,...u($)})};class kv extends T{constructor(){super(...arguments);this._unknown=!0}_parse($){return Q$($.data)}}kv.create=($)=>{return new kv({typeName:x.ZodUnknown,...u($)})};class h$ extends T{_parse($){let n=this._getOrReturnCtx($);return z(n,{code:F.invalid_type,expected:R.never,received:n.parsedType}),f}}h$.create=($)=>{return new h$({typeName:x.ZodNever,...u($)})};class m6 extends T{_parse($){if(this._getType($)!==R.undefined){let g=this._getOrReturnCtx($);return z(g,{code:F.invalid_type,expected:R.void,received:g.parsedType}),f}return Q$($.data)}}m6.create=($)=>{return new m6({typeName:x.ZodVoid,...u($)})};class R$ extends T{_parse($){let{ctx:n,status:g}=this._processInputParams($),U=this._def;if(n.parsedType!==R.array)return z(n,{code:F.invalid_type,expected:R.array,received:n.parsedType}),f;if(U.exactLength!==null){let w=n.data.length>U.exactLength.value,_=n.data.length<U.exactLength.value;if(w||_)z(n,{code:w?F.too_big:F.too_small,minimum:_?U.exactLength.value:void 0,maximum:w?U.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:U.exactLength.message}),g.dirty()}if(U.minLength!==null){if(n.data.length<U.minLength.value)z(n,{code:F.too_small,minimum:U.minLength.value,type:"array",inclusive:!0,exact:!1,message:U.minLength.message}),g.dirty()}if(U.maxLength!==null){if(n.data.length>U.maxLength.value)z(n,{code:F.too_big,maximum:U.maxLength.value,type:"array",inclusive:!0,exact:!1,message:U.maxLength.message}),g.dirty()}if(n.common.async)return Promise.all([...n.data].map((w,_)=>{return U.type._parseAsync(new x$(n,w,n.path,_))})).then((w)=>{return D$.mergeArray(g,w)});let v=[...n.data].map((w,_)=>{return U.type._parseSync(new x$(n,w,n.path,_))});return D$.mergeArray(g,v)}get element(){return this._def.type}min($,n){return new R$({...this._def,minLength:{value:$,message:A.toString(n)}})}max($,n){return new R$({...this._def,maxLength:{value:$,message:A.toString(n)}})}length($,n){return new R$({...this._def,exactLength:{value:$,message:A.toString(n)}})}nonempty($){return this.min(1,$)}}R$.create=($,n)=>{return new R$({type:$,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...u(n)})};function Vn($){if($ instanceof $$){let n={};for(let g in $.shape){let U=$.shape[g];n[g]=A$.create(Vn(U))}return new $$({...$._def,shape:()=>n})}else if($ instanceof R$)return new R$({...$._def,type:Vn($.element)});else if($ instanceof A$)return A$.create(Vn($.unwrap()));else if($ instanceof vv)return vv.create(Vn($.unwrap()));else if($ instanceof m$)return m$.create($.items.map((n)=>Vn(n)));else return $}class $$ extends T{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(),n=y.objectKeys($);return this._cached={shape:$,keys:n}}_parse($){if(this._getType($)!==R.object){let J=this._getOrReturnCtx($);return z(J,{code:F.invalid_type,expected:R.object,received:J.parsedType}),f}let{status:g,ctx:U}=this._processInputParams($),{shape:v,keys:w}=this._getCached(),_=[];if(!(this._def.catchall instanceof h$&&this._def.unknownKeys==="strip")){for(let J in U.data)if(!w.includes(J))_.push(J)}let D=[];for(let J of w){let X=v[J],G=U.data[J];D.push({key:{status:"valid",value:J},value:X._parse(new x$(U,G,U.path,J)),alwaysSet:J in U.data})}if(this._def.catchall instanceof h$){let J=this._def.unknownKeys;if(J==="passthrough")for(let X of _)D.push({key:{status:"valid",value:X},value:{status:"valid",value:U.data[X]}});else if(J==="strict"){if(_.length>0)z(U,{code:F.unrecognized_keys,keys:_}),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 _){let G=U.data[X];D.push({key:{status:"valid",value:X},value:J._parse(new x$(U,G,U.path,X)),alwaysSet:X in U.data})}}if(U.common.async)return Promise.resolve().then(async()=>{let J=[];for(let X of D){let G=await X.key,j=await X.value;J.push({key:G,value:j,alwaysSet:X.alwaysSet})}return J}).then((J)=>{return D$.mergeObjectSync(g,J)});else return D$.mergeObjectSync(g,D)}get shape(){return this._def.shape()}strict($){return A.errToObj,new $$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(n,g)=>{var U,v,w,_;let D=(w=(v=(U=this._def).errorMap)===null||v===void 0?void 0:v.call(U,n,g).message)!==null&&w!==void 0?w:g.defaultError;if(n.code==="unrecognized_keys")return{message:(_=A.errToObj($).message)!==null&&_!==void 0?_:D};return{message:D}}}:{}})}strip(){return new $$({...this._def,unknownKeys:"strip"})}passthrough(){return new $$({...this._def,unknownKeys:"passthrough"})}extend($){return new $$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new $$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:x.ZodObject})}setKey($,n){return this.augment({[$]:n})}catchall($){return new $$({...this._def,catchall:$})}pick($){let n={};return y.objectKeys($).forEach((g)=>{if($[g]&&this.shape[g])n[g]=this.shape[g]}),new $$({...this._def,shape:()=>n})}omit($){let n={};return y.objectKeys(this.shape).forEach((g)=>{if(!$[g])n[g]=this.shape[g]}),new $$({...this._def,shape:()=>n})}deepPartial(){return Vn(this)}partial($){let n={};return y.objectKeys(this.shape).forEach((g)=>{let U=this.shape[g];if($&&!$[g])n[g]=U;else n[g]=U.optional()}),new $$({...this._def,shape:()=>n})}required($){let n={};return y.objectKeys(this.shape).forEach((g)=>{if($&&!$[g])n[g]=this.shape[g];else{let v=this.shape[g];while(v instanceof A$)v=v._def.innerType;n[g]=v}}),new $$({...this._def,shape:()=>n})}keyof(){return DJ(y.objectKeys(this.shape))}}$$.create=($,n)=>{return new $$({shape:()=>$,unknownKeys:"strip",catchall:h$.create(),typeName:x.ZodObject,...u(n)})};$$.strictCreate=($,n)=>{return new $$({shape:()=>$,unknownKeys:"strict",catchall:h$.create(),typeName:x.ZodObject,...u(n)})};$$.lazycreate=($,n)=>{return new $$({shape:$,unknownKeys:"strip",catchall:h$.create(),typeName:x.ZodObject,...u(n)})};class Nn extends T{_parse($){let{ctx:n}=this._processInputParams($),g=this._def.options;function U(v){for(let _ of v)if(_.result.status==="valid")return _.result;for(let _ of v)if(_.result.status==="dirty")return n.common.issues.push(..._.ctx.common.issues),_.result;let w=v.map((_)=>new H$(_.ctx.common.issues));return z(n,{code:F.invalid_union,unionErrors:w}),f}if(n.common.async)return Promise.all(g.map(async(v)=>{let w={...n,common:{...n.common,issues:[]},parent:null};return{result:await v._parseAsync({data:n.data,path:n.path,parent:w}),ctx:w}})).then(U);else{let v=void 0,w=[];for(let D of g){let J={...n,common:{...n.common,issues:[]},parent:null},X=D._parseSync({data:n.data,path:n.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)w.push(J.common.issues)}if(v)return n.common.issues.push(...v.ctx.common.issues),v.result;let _=w.map((D)=>new H$(D));return z(n,{code:F.invalid_union,unionErrors:_}),f}}get options(){return this._def.options}}Nn.create=($,n)=>{return new Nn({options:$,typeName:x.ZodUnion,...u(n)})};var s$=($)=>{if($ instanceof Sn)return s$($.schema);else if($ instanceof q$)return s$($.innerType());else if($ instanceof zn)return[$.value];else if($ instanceof Hv)return $.options;else if($ instanceof Mn)return y.objectValues($.enum);else if($ instanceof Rn)return s$($._def.innerType);else if($ instanceof On)return[void 0];else if($ instanceof Fn)return[null];else if($ instanceof A$)return[void 0,...s$($.unwrap())];else if($ instanceof vv)return[null,...s$($.unwrap())];else if($ instanceof xg)return s$($.unwrap());else if($ instanceof xn)return s$($.unwrap());else if($ instanceof An)return s$($._def.innerType);else return[]};class Ag extends T{_parse($){let{ctx:n}=this._processInputParams($);if(n.parsedType!==R.object)return z(n,{code:F.invalid_type,expected:R.object,received:n.parsedType}),f;let g=this.discriminator,U=n.data[g],v=this.optionsMap.get(U);if(!v)return z(n,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[g]}),f;if(n.common.async)return v._parseAsync({data:n.data,path:n.path,parent:n});else return v._parseSync({data:n.data,path:n.path,parent:n})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,n,g){let U=new Map;for(let v of n){let w=s$(v.shape[$]);if(!w.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let _ of w){if(U.has(_))throw Error(`Discriminator property ${String($)} has duplicate value ${String(_)}`);U.set(_,v)}}return new Ag({typeName:x.ZodDiscriminatedUnion,discriminator:$,options:n,optionsMap:U,...u(g)})}}function Bw($,n){let g=$v($),U=$v(n);if($===n)return{valid:!0,data:$};else if(g===R.object&&U===R.object){let v=y.objectKeys(n),w=y.objectKeys($).filter((D)=>v.indexOf(D)!==-1),_={...$,...n};for(let D of w){let J=Bw($[D],n[D]);if(!J.valid)return{valid:!1};_[D]=J.data}return{valid:!0,data:_}}else if(g===R.array&&U===R.array){if($.length!==n.length)return{valid:!1};let v=[];for(let w=0;w<$.length;w++){let _=$[w],D=n[w],J=Bw(_,D);if(!J.valid)return{valid:!1};v.push(J.data)}return{valid:!0,data:v}}else if(g===R.date&&U===R.date&&+$===+n)return{valid:!0,data:$};else return{valid:!1}}class Pn extends T{_parse($){let{status:n,ctx:g}=this._processInputParams($),U=(v,w)=>{if(Kw(v)||Kw(w))return f;let _=Bw(v.value,w.value);if(!_.valid)return z(g,{code:F.invalid_intersection_types}),f;if(qw(v)||qw(w))n.dirty();return{status:n.value,value:_.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,w])=>U(v,w));else return U(this._def.left._parseSync({data:g.data,path:g.path,parent:g}),this._def.right._parseSync({data:g.data,path:g.path,parent:g}))}}Pn.create=($,n,g)=>{return new Pn({left:$,right:n,typeName:x.ZodIntersection,...u(g)})};class m$ extends T{_parse($){let{status:n,ctx:g}=this._processInputParams($);if(g.parsedType!==R.array)return z(g,{code:F.invalid_type,expected:R.array,received:g.parsedType}),f;if(g.data.length<this._def.items.length)return z(g,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;if(!this._def.rest&&g.data.length>this._def.items.length)z(g,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let v=[...g.data].map((w,_)=>{let D=this._def.items[_]||this._def.rest;if(!D)return null;return D._parse(new x$(g,w,g.path,_))}).filter((w)=>!!w);if(g.common.async)return Promise.all(v).then((w)=>{return D$.mergeArray(n,w)});else return D$.mergeArray(n,v)}get items(){return this._def.items}rest($){return new m$({...this._def,rest:$})}}m$.create=($,n)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new m$({items:$,typeName:x.ZodTuple,rest:null,...u(n)})};class y6 extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:n,ctx:g}=this._processInputParams($);if(g.parsedType!==R.object)return z(g,{code:F.invalid_type,expected:R.object,received:g.parsedType}),f;let U=[],v=this._def.keyType,w=this._def.valueType;for(let _ in g.data)U.push({key:v._parse(new x$(g,_,g.path,_)),value:w._parse(new x$(g,g.data[_],g.path,_)),alwaysSet:_ in g.data});if(g.common.async)return D$.mergeObjectAsync(n,U);else return D$.mergeObjectSync(n,U)}get element(){return this._def.valueType}static create($,n,g){if(n instanceof T)return new y6({keyType:$,valueType:n,typeName:x.ZodRecord,...u(g)});return new y6({keyType:M$.create(),valueType:$,typeName:x.ZodRecord,...u(n)})}}class t6 extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:n,ctx:g}=this._processInputParams($);if(g.parsedType!==R.map)return z(g,{code:F.invalid_type,expected:R.map,received:g.parsedType}),f;let U=this._def.keyType,v=this._def.valueType,w=[...g.data.entries()].map(([_,D],J)=>{return{key:U._parse(new x$(g,_,g.path,[J,"key"])),value:v._parse(new x$(g,D,g.path,[J,"value"]))}});if(g.common.async){let _=new Map;return Promise.resolve().then(async()=>{for(let D of w){let J=await D.key,X=await D.value;if(J.status==="aborted"||X.status==="aborted")return f;if(J.status==="dirty"||X.status==="dirty")n.dirty();_.set(J.value,X.value)}return{status:n.value,value:_}})}else{let _=new Map;for(let D of w){let{key:J,value:X}=D;if(J.status==="aborted"||X.status==="aborted")return f;if(J.status==="dirty"||X.status==="dirty")n.dirty();_.set(J.value,X.value)}return{status:n.value,value:_}}}}t6.create=($,n,g)=>{return new t6({valueType:n,keyType:$,typeName:x.ZodMap,...u(g)})};class pv extends T{_parse($){let{status:n,ctx:g}=this._processInputParams($);if(g.parsedType!==R.set)return z(g,{code:F.invalid_type,expected:R.set,received:g.parsedType}),f;let U=this._def;if(U.minSize!==null){if(g.data.size<U.minSize.value)z(g,{code:F.too_small,minimum:U.minSize.value,type:"set",inclusive:!0,exact:!1,message:U.minSize.message}),n.dirty()}if(U.maxSize!==null){if(g.data.size>U.maxSize.value)z(g,{code:F.too_big,maximum:U.maxSize.value,type:"set",inclusive:!0,exact:!1,message:U.maxSize.message}),n.dirty()}let v=this._def.valueType;function w(D){let J=new Set;for(let X of D){if(X.status==="aborted")return f;if(X.status==="dirty")n.dirty();J.add(X.value)}return{status:n.value,value:J}}let _=[...g.data.values()].map((D,J)=>v._parse(new x$(g,D,g.path,J)));if(g.common.async)return Promise.all(_).then((D)=>w(D));else return w(_)}min($,n){return new pv({...this._def,minSize:{value:$,message:A.toString(n)}})}max($,n){return new pv({...this._def,maxSize:{value:$,message:A.toString(n)}})}size($,n){return this.min($,n).max($,n)}nonempty($){return this.min(1,$)}}pv.create=($,n)=>{return new pv({valueType:$,minSize:null,maxSize:null,typeName:x.ZodSet,...u(n)})};class Kn extends T{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:n}=this._processInputParams($);if(n.parsedType!==R.function)return z(n,{code:F.invalid_type,expected:R.function,received:n.parsedType}),f;function g(_,D){return Mg({data:_,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,zg(),qn].filter((J)=>!!J),issueData:{code:F.invalid_arguments,argumentsError:D}})}function U(_,D){return Mg({data:_,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,zg(),qn].filter((J)=>!!J),issueData:{code:F.invalid_return_type,returnTypeError:D}})}let v={errorMap:n.common.contextualErrorMap},w=n.data;if(this._def.returns instanceof ev){let _=this;return Q$(async function(...D){let J=new H$([]),X=await _._def.args.parseAsync(D,v).catch((L)=>{throw J.addIssue(g(D,L)),J}),G=await Reflect.apply(w,this,X);return await _._def.returns._def.type.parseAsync(G,v).catch((L)=>{throw J.addIssue(U(G,L)),J})})}else{let _=this;return Q$(function(...D){let J=_._def.args.safeParse(D,v);if(!J.success)throw new H$([g(D,J.error)]);let X=Reflect.apply(w,this,J.data),G=_._def.returns.safeParse(X,v);if(!G.success)throw new H$([U(X,G.error)]);return G.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new Kn({...this._def,args:m$.create($).rest(kv.create())})}returns($){return new Kn({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,n,g){return new Kn({args:$?$:m$.create([]).rest(kv.create()),returns:n||kv.create(),typeName:x.ZodFunction,...u(g)})}}class Sn extends T{get schema(){return this._def.getter()}_parse($){let{ctx:n}=this._processInputParams($);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Sn.create=($,n)=>{return new Sn({getter:$,typeName:x.ZodLazy,...u(n)})};class zn extends T{_parse($){if($.data!==this._def.value){let n=this._getOrReturnCtx($);return z(n,{received:n.data,code:F.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:$.data}}get value(){return this._def.value}}zn.create=($,n)=>{return new zn({value:$,typeName:x.ZodLiteral,...u(n)})};function DJ($,n){return new Hv({values:$,typeName:x.ZodEnum,...u(n)})}class Hv extends T{constructor(){super(...arguments);l6.set(this,void 0)}_parse($){if(typeof $.data!=="string"){let n=this._getOrReturnCtx($),g=this._def.values;return z(n,{expected:y.joinValues(g),received:n.parsedType,code:F.invalid_type}),f}if(!Rg(this,l6,"f"))UJ(this,l6,new Set(this._def.values),"f");if(!Rg(this,l6,"f").has($.data)){let n=this._getOrReturnCtx($),g=this._def.values;return z(n,{received:n.data,code:F.invalid_enum_value,options:g}),f}return Q$($.data)}get options(){return this._def.values}get enum(){let $={};for(let n of this._def.values)$[n]=n;return $}get Values(){let $={};for(let n of this._def.values)$[n]=n;return $}get Enum(){let $={};for(let n of this._def.values)$[n]=n;return $}extract($,n=this._def){return Hv.create($,{...this._def,...n})}exclude($,n=this._def){return Hv.create(this.options.filter((g)=>!$.includes(g)),{...this._def,...n})}}l6=new WeakMap;Hv.create=DJ;class Mn extends T{constructor(){super(...arguments);Z6.set(this,void 0)}_parse($){let n=y.getValidEnumValues(this._def.values),g=this._getOrReturnCtx($);if(g.parsedType!==R.string&&g.parsedType!==R.number){let U=y.objectValues(n);return z(g,{expected:y.joinValues(U),received:g.parsedType,code:F.invalid_type}),f}if(!Rg(this,Z6,"f"))UJ(this,Z6,new Set(y.getValidEnumValues(this._def.values)),"f");if(!Rg(this,Z6,"f").has($.data)){let U=y.objectValues(n);return z(g,{received:g.data,code:F.invalid_enum_value,options:U}),f}return Q$($.data)}get enum(){return this._def.values}}Z6=new WeakMap;Mn.create=($,n)=>{return new Mn({values:$,typeName:x.ZodNativeEnum,...u(n)})};class ev extends T{unwrap(){return this._def.type}_parse($){let{ctx:n}=this._processInputParams($);if(n.parsedType!==R.promise&&n.common.async===!1)return z(n,{code:F.invalid_type,expected:R.promise,received:n.parsedType}),f;let g=n.parsedType===R.promise?n.data:Promise.resolve(n.data);return Q$(g.then((U)=>{return this._def.type.parseAsync(U,{path:n.path,errorMap:n.common.contextualErrorMap})}))}}ev.create=($,n)=>{return new ev({type:$,typeName:x.ZodPromise,...u(n)})};class q$ extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:n,ctx:g}=this._processInputParams($),U=this._def.effect||null,v={addIssue:(w)=>{if(z(g,w),w.fatal)n.abort();else n.dirty()},get path(){return g.path}};if(v.addIssue=v.addIssue.bind(v),U.type==="preprocess"){let w=U.transform(g.data,v);if(g.common.async)return Promise.resolve(w).then(async(_)=>{if(n.value==="aborted")return f;let D=await this._def.schema._parseAsync({data:_,path:g.path,parent:g});if(D.status==="aborted")return f;if(D.status==="dirty")return Ln(D.value);if(n.value==="dirty")return Ln(D.value);return D});else{if(n.value==="aborted")return f;let _=this._def.schema._parseSync({data:w,path:g.path,parent:g});if(_.status==="aborted")return f;if(_.status==="dirty")return Ln(_.value);if(n.value==="dirty")return Ln(_.value);return _}}if(U.type==="refinement"){let w=(_)=>{let D=U.refinement(_,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 _};if(g.common.async===!1){let _=this._def.schema._parseSync({data:g.data,path:g.path,parent:g});if(_.status==="aborted")return f;if(_.status==="dirty")n.dirty();return w(_.value),{status:n.value,value:_.value}}else return this._def.schema._parseAsync({data:g.data,path:g.path,parent:g}).then((_)=>{if(_.status==="aborted")return f;if(_.status==="dirty")n.dirty();return w(_.value).then(()=>{return{status:n.value,value:_.value}})})}if(U.type==="transform")if(g.common.async===!1){let w=this._def.schema._parseSync({data:g.data,path:g.path,parent:g});if(!ov(w))return w;let _=U.transform(w.value,v);if(_ instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:_}}else return this._def.schema._parseAsync({data:g.data,path:g.path,parent:g}).then((w)=>{if(!ov(w))return w;return Promise.resolve(U.transform(w.value,v)).then((_)=>({status:n.value,value:_}))});y.assertNever(U)}}q$.create=($,n,g)=>{return new q$({schema:$,typeName:x.ZodEffects,effect:n,...u(g)})};q$.createWithPreprocess=($,n,g)=>{return new q$({schema:n,effect:{type:"preprocess",transform:$},typeName:x.ZodEffects,...u(g)})};class A$ extends T{_parse($){if(this._getType($)===R.undefined)return Q$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}A$.create=($,n)=>{return new A$({innerType:$,typeName:x.ZodOptional,...u(n)})};class vv extends T{_parse($){if(this._getType($)===R.null)return Q$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}vv.create=($,n)=>{return new vv({innerType:$,typeName:x.ZodNullable,...u(n)})};class Rn extends T{_parse($){let{ctx:n}=this._processInputParams($),g=n.data;if(n.parsedType===R.undefined)g=this._def.defaultValue();return this._def.innerType._parse({data:g,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Rn.create=($,n)=>{return new Rn({innerType:$,typeName:x.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...u(n)})};class An extends T{_parse($){let{ctx:n}=this._processInputParams($),g={...n,common:{...n.common,issues:[]}},U=this._def.innerType._parse({data:g.data,path:g.path,parent:{...g}});if(c6(U))return U.then((v)=>{return{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new H$(g.common.issues)},input:g.data})}});else return{status:"valid",value:U.status==="valid"?U.value:this._def.catchValue({get error(){return new H$(g.common.issues)},input:g.data})}}removeCatch(){return this._def.innerType}}An.create=($,n)=>{return new An({innerType:$,typeName:x.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...u(n)})};class o6 extends T{_parse($){if(this._getType($)!==R.nan){let g=this._getOrReturnCtx($);return z(g,{code:F.invalid_type,expected:R.nan,received:g.parsedType}),f}return{status:"valid",value:$.data}}}o6.create=($)=>{return new o6({typeName:x.ZodNaN,...u($)})};var R9=Symbol("zod_brand");class xg extends T{_parse($){let{ctx:n}=this._processInputParams($),g=n.data;return this._def.type._parse({data:g,path:n.path,parent:n})}unwrap(){return this._def.type}}class r6 extends T{_parse($){let{status:n,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 f;if(v.status==="dirty")return n.dirty(),Ln(v.value);else return this._def.out._parseAsync({data:v.value,path:g.path,parent:g})})();else{let U=this._def.in._parseSync({data:g.data,path:g.path,parent:g});if(U.status==="aborted")return f;if(U.status==="dirty")return n.dirty(),{status:"dirty",value:U.value};else return this._def.out._parseSync({data:U.value,path:g.path,parent:g})}}static create($,n){return new r6({in:$,out:n,typeName:x.ZodPipeline})}}class xn extends T{_parse($){let n=this._def.innerType._parse($),g=(U)=>{if(ov(U))U.value=Object.freeze(U.value);return U};return c6(n)?n.then((U)=>g(U)):g(n)}unwrap(){return this._def.innerType}}xn.create=($,n)=>{return new xn({innerType:$,typeName:x.ZodReadonly,...u(n)})};function JJ($,n={},g){if($)return dv.create().superRefine((U,v)=>{var w,_;if(!$(U)){let D=typeof n==="function"?n(U):typeof n==="string"?{message:n}:n,J=(_=(w=D.fatal)!==null&&w!==void 0?w:g)!==null&&_!==void 0?_:!0,X=typeof D==="string"?{message:D}:D;v.addIssue({code:"custom",...X,fatal:J})}});return dv.create()}var A9={object:$$.lazycreate},x;(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"})(x||(x={}));var x9=($,n={message:`Input not instance of ${$.name}`})=>JJ((g)=>g instanceof $,n),XJ=M$.create,QJ=jv.create,f9=o6.create,E9=Iv.create,GJ=Bn.create,C9=rv.create,u9=h6.create,T9=On.create,l9=Fn.create,Z9=dv.create,c9=kv.create,h9=h$.create,m9=m6.create,y9=R$.create,t9=$$.create,o9=$$.strictCreate,r9=Nn.create,d9=Ag.create,p9=Pn.create,e9=m$.create,a9=y6.create,s9=t6.create,$8=pv.create,v8=Kn.create,n8=Sn.create,g8=zn.create,U8=Hv.create,w8=Mn.create,_8=ev.create,nJ=q$.create,b8=A$.create,D8=vv.create,J8=q$.createWithPreprocess,X8=r6.create,Q8=()=>XJ().optional(),G8=()=>QJ().optional(),W8=()=>GJ().optional(),Y8={string:($)=>M$.create({...$,coerce:!0}),number:($)=>jv.create({...$,coerce:!0}),boolean:($)=>Bn.create({...$,coerce:!0}),bigint:($)=>Iv.create({...$,coerce:!0}),date:($)=>rv.create({...$,coerce:!0})},k8=f,W=Object.freeze({__proto__:null,defaultErrorMap:qn,setErrorMap:J9,getErrorMap:zg,makeIssue:Mg,EMPTY_PATH:X9,addIssueToContext:z,ParseStatus:D$,INVALID:f,DIRTY:Ln,OK:Q$,isAborted:Kw,isDirty:qw,isValid:ov,isAsync:c6,get util(){return y},get objectUtil(){return Lw},ZodParsedType:R,getParsedType:$v,ZodType:T,datetimeRegex:bJ,ZodString:M$,ZodNumber:jv,ZodBigInt:Iv,ZodBoolean:Bn,ZodDate:rv,ZodSymbol:h6,ZodUndefined:On,ZodNull:Fn,ZodAny:dv,ZodUnknown:kv,ZodNever:h$,ZodVoid:m6,ZodArray:R$,ZodObject:$$,ZodUnion:Nn,ZodDiscriminatedUnion:Ag,ZodIntersection:Pn,ZodTuple:m$,ZodRecord:y6,ZodMap:t6,ZodSet:pv,ZodFunction:Kn,ZodLazy:Sn,ZodLiteral:zn,ZodEnum:Hv,ZodNativeEnum:Mn,ZodPromise:ev,ZodEffects:q$,ZodTransformer:q$,ZodOptional:A$,ZodNullable:vv,ZodDefault:Rn,ZodCatch:An,ZodNaN:o6,BRAND:R9,ZodBranded:xg,ZodPipeline:r6,ZodReadonly:xn,custom:JJ,Schema:T,ZodSchema:T,late:A9,get ZodFirstPartyTypeKind(){return x},coerce:Y8,any:Z9,array:y9,bigint:E9,boolean:GJ,date:C9,discriminatedUnion:d9,effect:nJ,enum:U8,function:v8,instanceof:x9,intersection:p9,lazy:n8,literal:g8,map:s9,nan:f9,nativeEnum:w8,never:h9,null:l9,nullable:D8,number:QJ,object:t9,oboolean:W8,onumber:G8,optional:b8,ostring:Q8,pipeline:X8,preprocess:J8,promise:_8,record:a9,set:$8,strictObject:o9,string:XJ,symbol:u9,transformer:nJ,tuple:e9,undefined:T9,union:r9,unknown:c9,void:m9,NEVER:k8,ZodIssueCode:F,quotelessJson:D9,ZodError:H$});var Ow="2024-11-05",WJ=[Ow,"2024-10-07"],fg="2.0",YJ=W.union([W.string(),W.number().int()]),kJ=W.string(),f$=W.object({_meta:W.optional(W.object({progressToken:W.optional(YJ)}).passthrough())}).passthrough(),V$=W.object({method:W.string(),params:W.optional(f$)}),d6=W.object({_meta:W.optional(W.object({}).passthrough())}).passthrough(),y$=W.object({method:W.string(),params:W.optional(d6)}),E$=W.object({_meta:W.optional(W.object({}).passthrough())}).passthrough(),Eg=W.union([W.string(),W.number().int()]),j8=W.object({jsonrpc:W.literal(fg),id:Eg}).merge(V$).strict(),I8=W.object({jsonrpc:W.literal(fg)}).merge(y$).strict(),H8=W.object({jsonrpc:W.literal(fg),id:Eg,result:E$}).strict(),av;(function($){$[$.ConnectionClosed=-1]="ConnectionClosed",$[$.RequestTimeout=-2]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError"})(av||(av={}));var V8=W.object({jsonrpc:W.literal(fg),id:Eg,error:W.object({code:W.number().int(),message:W.string(),data:W.optional(W.unknown())})}).strict(),jJ=W.union([j8,I8,H8,V8]),Cg=E$.strict(),ug=y$.extend({method:W.literal("notifications/cancelled"),params:d6.extend({requestId:Eg,reason:W.string().optional()})}),IJ=W.object({name:W.string(),version:W.string()}).passthrough(),L8=W.object({experimental:W.optional(W.object({}).passthrough()),sampling:W.optional(W.object({}).passthrough()),roots:W.optional(W.object({listChanged:W.optional(W.boolean())}).passthrough())}).passthrough(),Fw=V$.extend({method:W.literal("initialize"),params:f$.extend({protocolVersion:W.string(),capabilities:L8,clientInfo:IJ})}),K8=W.object({experimental:W.optional(W.object({}).passthrough()),logging:W.optional(W.object({}).passthrough()),prompts:W.optional(W.object({listChanged:W.optional(W.boolean())}).passthrough()),resources:W.optional(W.object({subscribe:W.optional(W.boolean()),listChanged:W.optional(W.boolean())}).passthrough()),tools:W.optional(W.object({listChanged:W.optional(W.boolean())}).passthrough())}).passthrough(),q8=E$.extend({protocolVersion:W.string(),capabilities:K8,serverInfo:IJ}),Nw=y$.extend({method:W.literal("notifications/initialized")}),Tg=V$.extend({method:W.literal("ping")}),B8=W.object({progress:W.number(),total:W.optional(W.number())}).passthrough(),lg=y$.extend({method:W.literal("notifications/progress"),params:d6.merge(B8).extend({progressToken:YJ})}),Zg=V$.extend({params:f$.extend({cursor:W.optional(kJ)}).optional()}),cg=E$.extend({nextCursor:W.optional(kJ)}),HJ=W.object({uri:W.string(),mimeType:W.optional(W.string())}).passthrough(),VJ=HJ.extend({text:W.string()}),LJ=HJ.extend({blob:W.string().base64()}),O8=W.object({uri:W.string(),name:W.string(),description:W.optional(W.string()),mimeType:W.optional(W.string())}).passthrough(),F8=W.object({uriTemplate:W.string(),name:W.string(),description:W.optional(W.string()),mimeType:W.optional(W.string())}).passthrough(),N8=Zg.extend({method:W.literal("resources/list")}),i8=cg.extend({resources:W.array(O8)}),P8=Zg.extend({method:W.literal("resources/templates/list")}),S8=cg.extend({resourceTemplates:W.array(F8)}),z8=V$.extend({method:W.literal("resources/read"),params:f$.extend({uri:W.string()})}),M8=E$.extend({contents:W.array(W.union([VJ,LJ]))}),R8=y$.extend({method:W.literal("notifications/resources/list_changed")}),A8=V$.extend({method:W.literal("resources/subscribe"),params:f$.extend({uri:W.string()})}),x8=V$.extend({method:W.literal("resources/unsubscribe"),params:f$.extend({uri:W.string()})}),f8=y$.extend({method:W.literal("notifications/resources/updated"),params:d6.extend({uri:W.string()})}),E8=W.object({name:W.string(),description:W.optional(W.string()),required:W.optional(W.boolean())}).passthrough(),C8=W.object({name:W.string(),description:W.optional(W.string()),arguments:W.optional(W.array(E8))}).passthrough(),u8=Zg.extend({method:W.literal("prompts/list")}),T8=cg.extend({prompts:W.array(C8)}),l8=V$.extend({method:W.literal("prompts/get"),params:f$.extend({name:W.string(),arguments:W.optional(W.record(W.string()))})}),hg=W.object({type:W.literal("text"),text:W.string()}).passthrough(),mg=W.object({type:W.literal("image"),data:W.string().base64(),mimeType:W.string()}).passthrough(),KJ=W.object({type:W.literal("resource"),resource:W.union([VJ,LJ])}).passthrough(),Z8=W.object({role:W.enum(["user","assistant"]),content:W.union([hg,mg,KJ])}).passthrough(),c8=E$.extend({description:W.optional(W.string()),messages:W.array(Z8)}),h8=y$.extend({method:W.literal("notifications/prompts/list_changed")}),m8=W.object({name:W.string(),description:W.optional(W.string()),inputSchema:W.object({type:W.literal("object"),properties:W.optional(W.object({}).passthrough())}).passthrough()}).passthrough(),iw=Zg.extend({method:W.literal("tools/list")}),y8=cg.extend({tools:W.array(m8)}),qJ=E$.extend({content:W.array(W.union([hg,mg,KJ])),isError:W.boolean().default(!1).optional()}),Cj=qJ.or(E$.extend({toolResult:W.unknown()})),Pw=V$.extend({method:W.literal("tools/call"),params:f$.extend({name:W.string(),arguments:W.optional(W.record(W.unknown()))})}),t8=y$.extend({method:W.literal("notifications/tools/list_changed")}),BJ=W.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),o8=V$.extend({method:W.literal("logging/setLevel"),params:f$.extend({level:BJ})}),r8=y$.extend({method:W.literal("notifications/message"),params:d6.extend({level:BJ,logger:W.optional(W.string()),data:W.unknown()})}),d8=W.object({name:W.string().optional()}).passthrough(),p8=W.object({hints:W.optional(W.array(d8)),costPriority:W.optional(W.number().min(0).max(1)),speedPriority:W.optional(W.number().min(0).max(1)),intelligencePriority:W.optional(W.number().min(0).max(1))}).passthrough(),e8=W.object({role:W.enum(["user","assistant"]),content:W.union([hg,mg])}).passthrough(),a8=V$.extend({method:W.literal("sampling/createMessage"),params:f$.extend({messages:W.array(e8),systemPrompt:W.optional(W.string()),includeContext:W.optional(W.enum(["none","thisServer","allServers"])),temperature:W.optional(W.number()),maxTokens:W.number().int(),stopSequences:W.optional(W.array(W.string())),metadata:W.optional(W.object({}).passthrough()),modelPreferences:W.optional(p8)})}),Sw=E$.extend({model:W.string(),stopReason:W.optional(W.enum(["endTurn","stopSequence","maxTokens"]).or(W.string())),role:W.enum(["user","assistant"]),content:W.discriminatedUnion("type",[hg,mg])}),s8=W.object({type:W.literal("ref/resource"),uri:W.string()}).passthrough(),$W=W.object({type:W.literal("ref/prompt"),name:W.string()}).passthrough(),vW=V$.extend({method:W.literal("completion/complete"),params:f$.extend({ref:W.union([$W,s8]),argument:W.object({name:W.string(),value:W.string()}).passthrough()})}),nW=E$.extend({completion:W.object({values:W.array(W.string()).max(100),total:W.optional(W.number().int()),hasMore:W.optional(W.boolean())}).passthrough()}),gW=W.object({uri:W.string().startsWith("file://"),name:W.optional(W.string())}).passthrough(),UW=V$.extend({method:W.literal("roots/list")}),zw=E$.extend({roots:W.array(gW)}),wW=y$.extend({method:W.literal("notifications/roots/list_changed")}),uj=W.union([Tg,Fw,vW,o8,l8,u8,N8,P8,z8,A8,x8,Pw,iw]),Tj=W.union([ug,lg,Nw,wW]),lj=W.union([Cg,Sw,zw]),Zj=W.union([Tg,a8,UW]),cj=W.union([ug,lg,r8,f8,R8,t8,h8]),hj=W.union([Cg,q8,nW,c8,T8,i8,S8,M8,qJ,y8]);class p6 extends Error{constructor($,n,g){super(`MCP error ${$}: ${n}`);this.code=$,this.data=g}}var _W=60000;class Mw{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(ug,(n)=>{let g=this._requestHandlerAbortControllers.get(n.params.requestId);g===null||g===void 0||g.abort(n.params.reason)}),this.setNotificationHandler(lg,(n)=>{this._onprogress(n)}),this.setRequestHandler(Tg,(n)=>({}))}async connect($){this._transport=$,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=(n)=>{this._onerror(n)},this._transport.onmessage=(n)=>{if(!("method"in n))this._onresponse(n);else if("id"in n)this._onrequest(n);else this._onnotification(n)},await this._transport.start()}_onclose(){var $;let n=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let g=new p6(av.ConnectionClosed,"Connection closed");for(let U of n.values())U(g)}_onerror($){var n;(n=this.onerror)===null||n===void 0||n.call(this,$)}_onnotification($){var n;let g=(n=this._notificationHandlers.get($.method))!==null&&n!==void 0?n:this.fallbackNotificationHandler;if(g===void 0)return;Promise.resolve().then(()=>g($)).catch((U)=>this._onerror(Error(`Uncaught error in notification handler: ${U}`)))}_onrequest($){var n,g;let U=(n=this._requestHandlers.get($.method))!==null&&n!==void 0?n:this.fallbackRequestHandler;if(U===void 0){(g=this._transport)===null||g===void 0||g.send({jsonrpc:"2.0",id:$.id,error:{code:av.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($.id,v),Promise.resolve().then(()=>U($,{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:$.id})},(w)=>{var _,D;if(v.signal.aborted)return;return(_=this._transport)===null||_===void 0?void 0:_.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(w.code)?w.code:av.InternalError,message:(D=w.message)!==null&&D!==void 0?D:"Internal error"}})}).catch((w)=>this._onerror(Error(`Failed to send response: ${w}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:n,...g}=$.params,U=this._progressHandlers.get(Number(n));if(U===void 0){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}U(g)}_onresponse($){let n=$.id,g=this._responseHandlers.get(Number(n));if(g===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(Number(n)),this._progressHandlers.delete(Number(n)),"result"in $)g($);else{let U=new p6($.error.code,$.error.message,$.error.data);g(U)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,n,g){return new Promise((U,v)=>{var w,_,D,J;if(!this._transport){v(Error("Not connected"));return}if(((w=this._options)===null||w===void 0?void 0:w.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(_=g===null||g===void 0?void 0:g.signal)===null||_===void 0||_.throwIfAborted();let X=this._requestMessageId++,G={...$,jsonrpc:"2.0",id:X};if(g===null||g===void 0?void 0:g.onprogress)this._progressHandlers.set(X,g.onprogress),G.params={...$.params,_meta:{progressToken:X}};let j=void 0;this._responseHandlers.set(X,(I)=>{var H;if(j!==void 0)clearTimeout(j);if((H=g===null||g===void 0?void 0:g.signal)===null||H===void 0?void 0:H.aborted)return;if(I instanceof Error)return v(I);try{let S=n.parse(I.result);U(S)}catch(S){v(S)}});let L=(I)=>{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(I)}}).catch((S)=>this._onerror(Error(`Failed to send cancellation: ${S}`))),v(I)};(D=g===null||g===void 0?void 0:g.signal)===null||D===void 0||D.addEventListener("abort",()=>{var I;if(j!==void 0)clearTimeout(j);L((I=g===null||g===void 0?void 0:g.signal)===null||I===void 0?void 0:I.reason)});let K=(J=g===null||g===void 0?void 0:g.timeout)!==null&&J!==void 0?J:_W;j=setTimeout(()=>L(new p6(av.RequestTimeout,"Request timed out",{timeout:K})),K),this._transport.send(G).catch((I)=>{if(j!==void 0)clearTimeout(j);v(I)})})}async notification($){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let n={...$,jsonrpc:"2.0"};await this._transport.send(n)}setRequestHandler($,n){let g=$.shape.method.value;this.assertRequestHandlerCapability(g),this._requestHandlers.set(g,(U,v)=>Promise.resolve(n($.parse(U),v)))}removeRequestHandler($){this._requestHandlers.delete($)}setNotificationHandler($,n){this._notificationHandlers.set($.shape.method.value,(g)=>Promise.resolve(n($.parse(g))))}removeNotificationHandler($){this._notificationHandlers.delete($)}}class Rw extends Mw{constructor($,n){super(n);this._serverInfo=$,this._capabilities=n.capabilities,this.setRequestHandler(Fw,(g)=>this._oninitialize(g)),this.setNotificationHandler(Nw,()=>{var g;return(g=this.oninitialized)===null||g===void 0?void 0:g.call(this)})}assertCapabilityForMethod($){var n,g;switch($){case"sampling/createMessage":if(!((n=this._clientCapabilities)===null||n===void 0?void 0:n.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 n=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:WJ.includes(n)?n:Ow,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"},Cg)}async createMessage($,n){return this.request({method:"sampling/createMessage",params:$},Sw,n)}async listRoots($,n){return this.request({method:"roots/list",params:$},zw,n)}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 FJ from"node:process";class Aw{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
2
- `);if($===-1)return null;let n=this._buffer.toString("utf8",0,$);return this._buffer=this._buffer.subarray($+1),bW(n)}clear(){this._buffer=void 0}}function bW($){return jJ.parse(JSON.parse($))}function OJ($){return JSON.stringify($)+`
3
- `}class xw{constructor($=FJ.stdin,n=FJ.stdout){this._stdin=$,this._stdout=n,this._readBuffer=new Aw,this._started=!1,this._ondata=(g)=>{this._readBuffer.append(g),this.processReadBuffer()},this._onerror=(g)=>{var U;(U=this.onerror)===null||U===void 0||U.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 $,n;while(!0)try{let g=this._readBuffer.readMessage();if(g===null)break;($=this.onmessage)===null||$===void 0||$.call(this,g)}catch(g){(n=this.onerror)===null||n===void 0||n.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((n)=>{let g=OJ($);if(this._stdout.write(g))n();else this._stdout.once("drain",n)})}}function En($,n){var g={};for(var U in $)if(Object.prototype.hasOwnProperty.call($,U)&&n.indexOf(U)<0)g[U]=$[U];if($!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var v=0,U=Object.getOwnPropertySymbols($);v<U.length;v++)if(n.indexOf(U[v])<0&&Object.prototype.propertyIsEnumerable.call($,U[v]))g[U[v]]=$[U[v]]}return g}var DW={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){return(Array.isArray(n)?n:[n]).some((U)=>{var v;let w=((v=$===null||$===void 0?void 0:$.def)===null||v===void 0?void 0:v.type)===DW[U];if(U==="ZodDiscriminatedUnion")return w&&"discriminator"in $.def;return w})}function fn($){return $&&"def"in $}class iJ{constructor(){this._map=new Map,this._idmap=new Map}add($,...n){let g=n[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 n=this._map.get($);if(n&&typeof n==="object"&&"id"in n)this._idmap.delete(n.id);return this._map.delete($),this}get($){let n=$._zod.parent;if(n){let g={...this.get(n)??{}};return delete g.id,{...g,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function JW(){return new iJ}function fw($){return $===void 0}function XW($,n){let g={};return Object.entries($).forEach(([U,v])=>{if(!n.some((w)=>w===U))g[U]=v}),g}function Ew($,n){let g={};return Object.entries($).forEach(([U,v])=>{if(!n(v,U))g[U]=v}),g}var NJ=JW();class Uv{static collectMetadata($,n){let g=this.getMetadataFromRegistry($),U=Object.assign(Object.assign({},g===null||g===void 0?void 0:g._internal),n===null||n===void 0?void 0:n._internal),v=Object.assign(Object.assign({},g===null||g===void 0?void 0:g.param),n===null||n===void 0?void 0:n.param),w=Object.assign(Object.assign(Object.assign(Object.assign({},Object.keys(U).length>0?{_internal:U}:{}),g),n),Object.keys(v).length>0?{param:v}:{});if(gv($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&fn($._zod.def.innerType))return this.collectMetadata($._zod.def.innerType,w);if(gv($,"ZodPipe")){let _=$._zod.def.in,D=$._zod.def.out;if(gv(_,"ZodTransform")&&fn(D))return this.collectMetadata(D,w);if(fn(_))return this.collectMetadata(_,w)}return w}static getMetadata($){return this.collectMetadata($)}static getOpenApiMetadata($){let n=this.collectMetadata($);return En(n!==null&&n!==void 0?n:{},["_internal"])}static getInternalMetadata($){var n;return(n=this.collectMetadata($))===null||n===void 0?void 0:n._internal}static getParamMetadata($){let n=this.collectMetadata($);return Object.assign(Object.assign({},n),{param:Object.assign(Object.assign({},(n===null||n===void 0?void 0:n.description)?{description:n.description}:{}),n===null||n===void 0?void 0:n.param)})}static buildSchemaMetadata($){return Ew(XW($,["param","_internal"]),fw)}static buildParameterMetadata($){return Ew($,fw)}static applySchemaMetadata($,n){return Ew(Object.assign(Object.assign({},$),this.buildSchemaMetadata(n)),fw)}static getRefId($){var n;return(n=this.getInternalMetadata($))===null||n===void 0?void 0:n.refId}static unwrapChained($){return this.unwrapUntil($)}static getDefaultValue($){var n;let g=(n=this.unwrapUntil($,"ZodDefault"))!==null&&n!==void 0?n:this.unwrapUntil($,"ZodPrefault");return g===null||g===void 0?void 0:g._zod.def.defaultValue}static unwrapUntil($,n){if(n&&gv($,n))return $;if(gv($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&fn($._zod.def.innerType))return this.unwrapUntil($._zod.def.innerType,n);if(gv($,"ZodPipe")){let g=$._zod.def.in,U=$._zod.def.out;if(gv(g,"ZodTransform")&&fn(U))return this.unwrapUntil(U,n);if(fn(g))return this.unwrapUntil(g,n)}return n?void 0:$}static getMetadataFromInternalRegistry($){return NJ.get($)}static getMetadataFromRegistry($){let n=this.getMetadataFromInternalRegistry($),g=$.meta();if(!n)return g;let{_internal:U}=n,v=En(n,["_internal"]),w=g!==null&&g!==void 0?g:{},{id:_,title:D}=w,J=En(w,["id","title"]);return Object.assign(Object.assign(Object.assign({_internal:Object.assign(Object.assign({},_?{refId:_}:{}),U)},v),D?{description:D}:{}),J)}static setMetadataInRegistry($,n){NJ.add($,n)}}function nv($,n){let g=$[n];if(typeof g!=="function")return;$[n]=function(...U){let v=g.apply(this,U),w=Uv.getMetadataFromRegistry(this);if(w)Uv.setMetadataInRegistry(v,w);return v}}function QW($){if(typeof $.ZodType.prototype.openapi<"u")return;$.ZodType.prototype.openapi=function(...n){let{refId:g,metadata:U,options:v}=GW(...n),w=U!==null&&U!==void 0?U:{},{param:_}=w,D=En(w,["param"]),J=Uv.getMetadataFromRegistry(this),X=J!==null&&J!==void 0?J:{},{_internal:G}=X,j=En(X,["_internal"]),L=Object.assign(Object.assign(Object.assign({},G),v),g?{refId:g}:void 0),K=Object.assign(Object.assign(Object.assign({},j),D),(j===null||j===void 0?void 0:j.param)||_?{param:Object.assign(Object.assign({},j===null||j===void 0?void 0:j.param),_)}:void 0),I=new this.constructor(this._def);function H(i){Uv.setMetadataInRegistry(i,Object.assign(Object.assign({},Object.keys(L).length>0?{_internal:L}:void 0),K))}if(H(I),gv(I,"ZodLazy"))H(this);if(gv(I,"ZodObject")){let i=Uv.getMetadataFromRegistry(I),c=I.extend;I.extend=function(...m){let a=c.apply(I,m),s=i!==null&&i!==void 0?i:{},{_internal:t}=s,g$=En(s,["_internal"]);return Uv.setMetadataInRegistry(a,{_internal:{extendedFrom:(t===null||t===void 0?void 0:t.refId)?{refId:t.refId,schema:I}:t===null||t===void 0?void 0:t.extendedFrom}}),a.openapi(g$)},nv(I,"catchall")}nv(I,"optional"),nv(I,"nullable"),nv(I,"default"),nv(I,"transform"),nv(I,"refine"),nv(I,"length"),nv(I,"min"),nv(I,"max");let S=I.meta;return I.meta=function(...i){let c=S.apply(this,i);if(i[0]){let m=Uv.getMetadataFromInternalRegistry(this);if(m)Uv.setMetadataInRegistry(c,Object.assign(Object.assign({},m),i[0]))}return c},I}}function GW($,n,g){if(typeof $==="string")return{refId:$,metadata:n,options:g};return{refId:void 0,metadata:$,options:n}}var Cw=QW;var b={};z$(b,{z:()=>l,xor:()=>SU,xid:()=>s1,void:()=>OU,uuidv7:()=>y1,uuidv6:()=>m1,uuidv4:()=>h1,uuid:()=>c1,util:()=>O,url:()=>t1,uppercase:()=>Fv,unknown:()=>Y$,union:()=>N6,undefined:()=>qU,ulid:()=>a1,uint64:()=>LU,uint32:()=>IU,tuple:()=>e4,trim:()=>Mv,treeifyError:()=>_4,transform:()=>P6,toUpperCase:()=>Av,toLowerCase:()=>Rv,toJSONSchema:()=>v6,templateLiteral:()=>lU,symbol:()=>KU,superRefine:()=>Bg,success:()=>CU,stringbool:()=>rU,stringFormat:()=>XU,string:()=>h,strictObject:()=>iU,startsWith:()=>iv,slugify:()=>xv,size:()=>_v,setErrorMap:()=>VD,set:()=>AU,safeParseAsync:()=>i4,safeParse:()=>N4,safeEncodeAsync:()=>x4,safeEncode:()=>R4,safeDecodeAsync:()=>f4,safeDecode:()=>A4,registry:()=>on,regexes:()=>I$,regex:()=>Bv,refine:()=>qg,record:()=>p$,readonly:()=>jg,property:()=>an,promise:()=>ZU,prettifyError:()=>b4,preprocess:()=>pU,prefault:()=>Jg,positive:()=>rn,pipe:()=>Jn,partialRecord:()=>zU,parseAsync:()=>F4,parse:()=>O4,overwrite:()=>K$,optional:()=>bn,object:()=>n$,number:()=>hv,nullish:()=>EU,nullable:()=>Dn,null:()=>l4,normalize:()=>zv,nonpositive:()=>pn,nonoptional:()=>Xg,nonnegative:()=>en,never:()=>F6,negative:()=>dn,nativeEnum:()=>xU,nanoid:()=>d1,nan:()=>uU,multipleOf:()=>o$,minSize:()=>N$,minLength:()=>C$,mime:()=>Sv,meta:()=>tU,maxSize:()=>r$,maxLength:()=>bv,map:()=>RU,mac:()=>nU,lte:()=>G$,lt:()=>O$,lowercase:()=>Ov,looseRecord:()=>MU,looseObject:()=>PU,locales:()=>wn,literal:()=>l$,length:()=>Dv,lazy:()=>Vg,ksuid:()=>$U,keyof:()=>NU,jwt:()=>JU,json:()=>dU,iso:()=>uv,ipv6:()=>gU,ipv4:()=>vU,intersection:()=>d4,int64:()=>VU,int32:()=>jU,int:()=>_6,instanceof:()=>oU,includes:()=>Nv,httpUrl:()=>o1,hostname:()=>QU,hex:()=>GU,hash:()=>WU,guid:()=>Z1,gte:()=>b$,gt:()=>F$,globalRegistry:()=>U$,getErrorMap:()=>LD,function:()=>cU,fromJSONSchema:()=>eU,formatError:()=>nn,float64:()=>kU,float32:()=>YU,flattenError:()=>vn,file:()=>fU,exactOptional:()=>Ug,enum:()=>i6,endsWith:()=>Pv,encodeAsync:()=>z4,encode:()=>P4,emoji:()=>r1,email:()=>l1,e164:()=>DU,discriminatedUnion:()=>Yn,describe:()=>yU,decodeAsync:()=>M4,decode:()=>S4,date:()=>FU,custom:()=>mU,cuid2:()=>e1,cuid:()=>p1,core:()=>u$,config:()=>v$,coerce:()=>In,codec:()=>TU,clone:()=>_$,cidrv6:()=>wU,cidrv4:()=>UU,check:()=>hU,catch:()=>Wg,boolean:()=>d$,bigint:()=>HU,base64url:()=>bU,base64:()=>_U,array:()=>T$,any:()=>BU,_function:()=>cU,_default:()=>bg,_ZodString:()=>b6,ZodXor:()=>t4,ZodXID:()=>Y6,ZodVoid:()=>m4,ZodUnknown:()=>c4,ZodUnion:()=>Wn,ZodUndefined:()=>u4,ZodUUID:()=>i$,ZodURL:()=>Xn,ZodULID:()=>W6,ZodType:()=>C,ZodTuple:()=>p4,ZodTransform:()=>ng,ZodTemplateLiteral:()=>Ig,ZodSymbol:()=>C4,ZodSuccess:()=>Qg,ZodStringFormat:()=>o,ZodString:()=>lv,ZodSet:()=>s4,ZodRecord:()=>kn,ZodRealError:()=>J$,ZodReadonly:()=>kg,ZodPromise:()=>Lg,ZodPrefault:()=>Dg,ZodPipe:()=>M6,ZodOptional:()=>S6,ZodObject:()=>Gn,ZodNumberFormat:()=>Jv,ZodNumber:()=>cv,ZodNullable:()=>wg,ZodNull:()=>T4,ZodNonOptional:()=>z6,ZodNever:()=>h4,ZodNanoID:()=>X6,ZodNaN:()=>Yg,ZodMap:()=>a4,ZodMAC:()=>E4,ZodLiteral:()=>$g,ZodLazy:()=>Hg,ZodKSUID:()=>k6,ZodJWT:()=>B6,ZodIssueCode:()=>Xv,ZodIntersection:()=>r4,ZodISOTime:()=>U6,ZodISODuration:()=>w6,ZodISODateTime:()=>n6,ZodISODate:()=>g6,ZodIPv6:()=>I6,ZodIPv4:()=>j6,ZodGUID:()=>_n,ZodFunction:()=>Kg,ZodFirstPartyTypeKind:()=>Og,ZodFile:()=>vg,ZodExactOptional:()=>gg,ZodError:()=>HD,ZodEnum:()=>Tv,ZodEmoji:()=>J6,ZodEmail:()=>D6,ZodE164:()=>q6,ZodDiscriminatedUnion:()=>o4,ZodDefault:()=>_g,ZodDate:()=>Qn,ZodCustomStringFormat:()=>Zv,ZodCustom:()=>jn,ZodCodec:()=>R6,ZodCatch:()=>Gg,ZodCUID2:()=>G6,ZodCUID:()=>Q6,ZodCIDRv6:()=>V6,ZodCIDRv4:()=>H6,ZodBoolean:()=>mv,ZodBigIntFormat:()=>O6,ZodBigInt:()=>yv,ZodBase64URL:()=>K6,ZodBase64:()=>L6,ZodArray:()=>y4,ZodAny:()=>Z4,TimePrecision:()=>q4,NEVER:()=>a6,$output:()=>H4,$input:()=>V4,$brand:()=>s6});var KD={};z$(KD,{z:()=>A6,xor:()=>SU,xid:()=>s1,void:()=>OU,uuidv7:()=>y1,uuidv6:()=>m1,uuidv4:()=>h1,uuid:()=>c1,util:()=>O,url:()=>t1,uppercase:()=>Fv,unknown:()=>Y$,union:()=>N6,undefined:()=>qU,ulid:()=>a1,uint64:()=>LU,uint32:()=>IU,tuple:()=>e4,trim:()=>Mv,treeifyError:()=>_4,transform:()=>P6,toUpperCase:()=>Av,toLowerCase:()=>Rv,toJSONSchema:()=>v6,templateLiteral:()=>lU,symbol:()=>KU,superRefine:()=>Bg,success:()=>CU,stringbool:()=>rU,stringFormat:()=>XU,string:()=>h,strictObject:()=>iU,startsWith:()=>iv,slugify:()=>xv,size:()=>_v,setErrorMap:()=>VD,set:()=>AU,safeParseAsync:()=>i4,safeParse:()=>N4,safeEncodeAsync:()=>x4,safeEncode:()=>R4,safeDecodeAsync:()=>f4,safeDecode:()=>A4,registry:()=>on,regexes:()=>I$,regex:()=>Bv,refine:()=>qg,record:()=>p$,readonly:()=>jg,property:()=>an,promise:()=>ZU,prettifyError:()=>b4,preprocess:()=>pU,prefault:()=>Jg,positive:()=>rn,pipe:()=>Jn,partialRecord:()=>zU,parseAsync:()=>F4,parse:()=>O4,overwrite:()=>K$,optional:()=>bn,object:()=>n$,number:()=>hv,nullish:()=>EU,nullable:()=>Dn,null:()=>l4,normalize:()=>zv,nonpositive:()=>pn,nonoptional:()=>Xg,nonnegative:()=>en,never:()=>F6,negative:()=>dn,nativeEnum:()=>xU,nanoid:()=>d1,nan:()=>uU,multipleOf:()=>o$,minSize:()=>N$,minLength:()=>C$,mime:()=>Sv,meta:()=>tU,maxSize:()=>r$,maxLength:()=>bv,map:()=>RU,mac:()=>nU,lte:()=>G$,lt:()=>O$,lowercase:()=>Ov,looseRecord:()=>MU,looseObject:()=>PU,locales:()=>wn,literal:()=>l$,length:()=>Dv,lazy:()=>Vg,ksuid:()=>$U,keyof:()=>NU,jwt:()=>JU,json:()=>dU,iso:()=>uv,ipv6:()=>gU,ipv4:()=>vU,intersection:()=>d4,int64:()=>VU,int32:()=>jU,int:()=>_6,instanceof:()=>oU,includes:()=>Nv,httpUrl:()=>o1,hostname:()=>QU,hex:()=>GU,hash:()=>WU,guid:()=>Z1,gte:()=>b$,gt:()=>F$,globalRegistry:()=>U$,getErrorMap:()=>LD,function:()=>cU,fromJSONSchema:()=>eU,formatError:()=>nn,float64:()=>kU,float32:()=>YU,flattenError:()=>vn,file:()=>fU,exactOptional:()=>Ug,enum:()=>i6,endsWith:()=>Pv,encodeAsync:()=>z4,encode:()=>P4,emoji:()=>r1,email:()=>l1,e164:()=>DU,discriminatedUnion:()=>Yn,describe:()=>yU,default:()=>dY,decodeAsync:()=>M4,decode:()=>S4,date:()=>FU,custom:()=>mU,cuid2:()=>e1,cuid:()=>p1,core:()=>u$,config:()=>v$,coerce:()=>In,codec:()=>TU,clone:()=>_$,cidrv6:()=>wU,cidrv4:()=>UU,check:()=>hU,catch:()=>Wg,boolean:()=>d$,bigint:()=>HU,base64url:()=>bU,base64:()=>_U,array:()=>T$,any:()=>BU,_function:()=>cU,_default:()=>bg,_ZodString:()=>b6,ZodXor:()=>t4,ZodXID:()=>Y6,ZodVoid:()=>m4,ZodUnknown:()=>c4,ZodUnion:()=>Wn,ZodUndefined:()=>u4,ZodUUID:()=>i$,ZodURL:()=>Xn,ZodULID:()=>W6,ZodType:()=>C,ZodTuple:()=>p4,ZodTransform:()=>ng,ZodTemplateLiteral:()=>Ig,ZodSymbol:()=>C4,ZodSuccess:()=>Qg,ZodStringFormat:()=>o,ZodString:()=>lv,ZodSet:()=>s4,ZodRecord:()=>kn,ZodRealError:()=>J$,ZodReadonly:()=>kg,ZodPromise:()=>Lg,ZodPrefault:()=>Dg,ZodPipe:()=>M6,ZodOptional:()=>S6,ZodObject:()=>Gn,ZodNumberFormat:()=>Jv,ZodNumber:()=>cv,ZodNullable:()=>wg,ZodNull:()=>T4,ZodNonOptional:()=>z6,ZodNever:()=>h4,ZodNanoID:()=>X6,ZodNaN:()=>Yg,ZodMap:()=>a4,ZodMAC:()=>E4,ZodLiteral:()=>$g,ZodLazy:()=>Hg,ZodKSUID:()=>k6,ZodJWT:()=>B6,ZodIssueCode:()=>Xv,ZodIntersection:()=>r4,ZodISOTime:()=>U6,ZodISODuration:()=>w6,ZodISODateTime:()=>n6,ZodISODate:()=>g6,ZodIPv6:()=>I6,ZodIPv4:()=>j6,ZodGUID:()=>_n,ZodFunction:()=>Kg,ZodFirstPartyTypeKind:()=>Og,ZodFile:()=>vg,ZodExactOptional:()=>gg,ZodError:()=>HD,ZodEnum:()=>Tv,ZodEmoji:()=>J6,ZodEmail:()=>D6,ZodE164:()=>q6,ZodDiscriminatedUnion:()=>o4,ZodDefault:()=>_g,ZodDate:()=>Qn,ZodCustomStringFormat:()=>Zv,ZodCustom:()=>jn,ZodCodec:()=>R6,ZodCatch:()=>Gg,ZodCUID2:()=>G6,ZodCUID:()=>Q6,ZodCIDRv6:()=>V6,ZodCIDRv4:()=>H6,ZodBoolean:()=>mv,ZodBigIntFormat:()=>O6,ZodBigInt:()=>yv,ZodBase64URL:()=>K6,ZodBase64:()=>L6,ZodArray:()=>y4,ZodAny:()=>Z4,TimePrecision:()=>q4,NEVER:()=>a6,$output:()=>H4,$input:()=>V4,$brand:()=>s6});var A6={};z$(A6,{xor:()=>SU,xid:()=>s1,void:()=>OU,uuidv7:()=>y1,uuidv6:()=>m1,uuidv4:()=>h1,uuid:()=>c1,util:()=>O,url:()=>t1,uppercase:()=>Fv,unknown:()=>Y$,union:()=>N6,undefined:()=>qU,ulid:()=>a1,uint64:()=>LU,uint32:()=>IU,tuple:()=>e4,trim:()=>Mv,treeifyError:()=>_4,transform:()=>P6,toUpperCase:()=>Av,toLowerCase:()=>Rv,toJSONSchema:()=>v6,templateLiteral:()=>lU,symbol:()=>KU,superRefine:()=>Bg,success:()=>CU,stringbool:()=>rU,stringFormat:()=>XU,string:()=>h,strictObject:()=>iU,startsWith:()=>iv,slugify:()=>xv,size:()=>_v,setErrorMap:()=>VD,set:()=>AU,safeParseAsync:()=>i4,safeParse:()=>N4,safeEncodeAsync:()=>x4,safeEncode:()=>R4,safeDecodeAsync:()=>f4,safeDecode:()=>A4,registry:()=>on,regexes:()=>I$,regex:()=>Bv,refine:()=>qg,record:()=>p$,readonly:()=>jg,property:()=>an,promise:()=>ZU,prettifyError:()=>b4,preprocess:()=>pU,prefault:()=>Jg,positive:()=>rn,pipe:()=>Jn,partialRecord:()=>zU,parseAsync:()=>F4,parse:()=>O4,overwrite:()=>K$,optional:()=>bn,object:()=>n$,number:()=>hv,nullish:()=>EU,nullable:()=>Dn,null:()=>l4,normalize:()=>zv,nonpositive:()=>pn,nonoptional:()=>Xg,nonnegative:()=>en,never:()=>F6,negative:()=>dn,nativeEnum:()=>xU,nanoid:()=>d1,nan:()=>uU,multipleOf:()=>o$,minSize:()=>N$,minLength:()=>C$,mime:()=>Sv,meta:()=>tU,maxSize:()=>r$,maxLength:()=>bv,map:()=>RU,mac:()=>nU,lte:()=>G$,lt:()=>O$,lowercase:()=>Ov,looseRecord:()=>MU,looseObject:()=>PU,locales:()=>wn,literal:()=>l$,length:()=>Dv,lazy:()=>Vg,ksuid:()=>$U,keyof:()=>NU,jwt:()=>JU,json:()=>dU,iso:()=>uv,ipv6:()=>gU,ipv4:()=>vU,intersection:()=>d4,int64:()=>VU,int32:()=>jU,int:()=>_6,instanceof:()=>oU,includes:()=>Nv,httpUrl:()=>o1,hostname:()=>QU,hex:()=>GU,hash:()=>WU,guid:()=>Z1,gte:()=>b$,gt:()=>F$,globalRegistry:()=>U$,getErrorMap:()=>LD,function:()=>cU,fromJSONSchema:()=>eU,formatError:()=>nn,float64:()=>kU,float32:()=>YU,flattenError:()=>vn,file:()=>fU,exactOptional:()=>Ug,enum:()=>i6,endsWith:()=>Pv,encodeAsync:()=>z4,encode:()=>P4,emoji:()=>r1,email:()=>l1,e164:()=>DU,discriminatedUnion:()=>Yn,describe:()=>yU,decodeAsync:()=>M4,decode:()=>S4,date:()=>FU,custom:()=>mU,cuid2:()=>e1,cuid:()=>p1,core:()=>u$,config:()=>v$,coerce:()=>In,codec:()=>TU,clone:()=>_$,cidrv6:()=>wU,cidrv4:()=>UU,check:()=>hU,catch:()=>Wg,boolean:()=>d$,bigint:()=>HU,base64url:()=>bU,base64:()=>_U,array:()=>T$,any:()=>BU,_function:()=>cU,_default:()=>bg,_ZodString:()=>b6,ZodXor:()=>t4,ZodXID:()=>Y6,ZodVoid:()=>m4,ZodUnknown:()=>c4,ZodUnion:()=>Wn,ZodUndefined:()=>u4,ZodUUID:()=>i$,ZodURL:()=>Xn,ZodULID:()=>W6,ZodType:()=>C,ZodTuple:()=>p4,ZodTransform:()=>ng,ZodTemplateLiteral:()=>Ig,ZodSymbol:()=>C4,ZodSuccess:()=>Qg,ZodStringFormat:()=>o,ZodString:()=>lv,ZodSet:()=>s4,ZodRecord:()=>kn,ZodRealError:()=>J$,ZodReadonly:()=>kg,ZodPromise:()=>Lg,ZodPrefault:()=>Dg,ZodPipe:()=>M6,ZodOptional:()=>S6,ZodObject:()=>Gn,ZodNumberFormat:()=>Jv,ZodNumber:()=>cv,ZodNullable:()=>wg,ZodNull:()=>T4,ZodNonOptional:()=>z6,ZodNever:()=>h4,ZodNanoID:()=>X6,ZodNaN:()=>Yg,ZodMap:()=>a4,ZodMAC:()=>E4,ZodLiteral:()=>$g,ZodLazy:()=>Hg,ZodKSUID:()=>k6,ZodJWT:()=>B6,ZodIssueCode:()=>Xv,ZodIntersection:()=>r4,ZodISOTime:()=>U6,ZodISODuration:()=>w6,ZodISODateTime:()=>n6,ZodISODate:()=>g6,ZodIPv6:()=>I6,ZodIPv4:()=>j6,ZodGUID:()=>_n,ZodFunction:()=>Kg,ZodFirstPartyTypeKind:()=>Og,ZodFile:()=>vg,ZodExactOptional:()=>gg,ZodError:()=>HD,ZodEnum:()=>Tv,ZodEmoji:()=>J6,ZodEmail:()=>D6,ZodE164:()=>q6,ZodDiscriminatedUnion:()=>o4,ZodDefault:()=>_g,ZodDate:()=>Qn,ZodCustomStringFormat:()=>Zv,ZodCustom:()=>jn,ZodCodec:()=>R6,ZodCatch:()=>Gg,ZodCUID2:()=>G6,ZodCUID:()=>Q6,ZodCIDRv6:()=>V6,ZodCIDRv4:()=>H6,ZodBoolean:()=>mv,ZodBigIntFormat:()=>O6,ZodBigInt:()=>yv,ZodBase64URL:()=>K6,ZodBase64:()=>L6,ZodArray:()=>y4,ZodAny:()=>Z4,TimePrecision:()=>q4,NEVER:()=>a6,$output:()=>H4,$input:()=>V4,$brand:()=>s6});var u$={};z$(u$,{version:()=>Z_,util:()=>O,treeifyError:()=>_4,toJSONSchema:()=>v6,toDotPath:()=>AJ,safeParseAsync:()=>rw,safeParse:()=>ow,safeEncodeAsync:()=>yW,safeEncode:()=>hW,safeDecodeAsync:()=>tW,safeDecode:()=>mW,registry:()=>on,regexes:()=>I$,process:()=>r,prettifyError:()=>b4,parseAsync:()=>rg,parse:()=>og,meta:()=>ib,locales:()=>wn,isValidJWT:()=>aJ,isValidBase64URL:()=>eJ,isValidBase64:()=>J0,initializeContext:()=>fv,globalRegistry:()=>U$,globalConfig:()=>e6,formatError:()=>nn,flattenError:()=>vn,finalize:()=>Cv,extractDefs:()=>Ev,encodeAsync:()=>ZW,encode:()=>TW,describe:()=>Nb,decodeAsync:()=>cW,decode:()=>lW,createToJSONSchemaMethod:()=>Sb,createStandardJSONSchemaMethod:()=>$6,config:()=>v$,clone:()=>_$,_xor:()=>jY,_xid:()=>N1,_void:()=>Ib,_uuidv7:()=>L1,_uuidv6:()=>V1,_uuidv4:()=>H1,_uuid:()=>I1,_url:()=>K4,_uppercase:()=>Fv,_unknown:()=>kb,_union:()=>kY,_undefined:()=>Gb,_ulid:()=>F1,_uint64:()=>Xb,_uint32:()=>Ub,_tuple:()=>VY,_trim:()=>Mv,_transform:()=>NY,_toUpperCase:()=>Av,_toLowerCase:()=>Rv,_templateLiteral:()=>fY,_symbol:()=>Qb,_superRefine:()=>Fb,_success:()=>MY,_stringbool:()=>Pb,_stringFormat:()=>sn,_string:()=>y2,_startsWith:()=>iv,_slugify:()=>xv,_size:()=>_v,_set:()=>qY,_safeParseAsync:()=>mn,_safeParse:()=>hn,_safeEncodeAsync:()=>v1,_safeEncode:()=>sg,_safeDecodeAsync:()=>n1,_safeDecode:()=>$1,_regex:()=>Bv,_refine:()=>Ob,_record:()=>LY,_readonly:()=>xY,_property:()=>an,_promise:()=>CY,_positive:()=>rn,_pipe:()=>AY,_parseAsync:()=>cn,_parse:()=>Zn,_overwrite:()=>K$,_optional:()=>iY,_number:()=>a2,_nullable:()=>PY,_null:()=>Wb,_normalize:()=>zv,_nonpositive:()=>pn,_nonoptional:()=>zY,_nonnegative:()=>en,_never:()=>jb,_negative:()=>dn,_nativeEnum:()=>OY,_nanoid:()=>q1,_nan:()=>Lb,_multipleOf:()=>o$,_minSize:()=>N$,_minLength:()=>C$,_min:()=>b$,_mime:()=>Sv,_maxSize:()=>r$,_maxLength:()=>bv,_max:()=>G$,_map:()=>KY,_mac:()=>o2,_lte:()=>G$,_lt:()=>O$,_lowercase:()=>Ov,_literal:()=>FY,_length:()=>Dv,_lazy:()=>EY,_ksuid:()=>i1,_jwt:()=>f1,_isoTime:()=>p2,_isoDuration:()=>e2,_isoDateTime:()=>r2,_isoDate:()=>d2,_ipv6:()=>S1,_ipv4:()=>P1,_intersection:()=>HY,_int64:()=>Jb,_int32:()=>gb,_int:()=>$b,_includes:()=>Nv,_guid:()=>L4,_gte:()=>b$,_gt:()=>F$,_float64:()=>nb,_float32:()=>vb,_file:()=>qb,_enum:()=>BY,_endsWith:()=>Pv,_encodeAsync:()=>eg,_encode:()=>dg,_emoji:()=>K1,_email:()=>j1,_e164:()=>x1,_discriminatedUnion:()=>IY,_default:()=>SY,_decodeAsync:()=>ag,_decode:()=>pg,_date:()=>Hb,_custom:()=>Bb,_cuid2:()=>O1,_cuid:()=>B1,_coercedString:()=>t2,_coercedNumber:()=>s2,_coercedDate:()=>Vb,_coercedBoolean:()=>_b,_coercedBigint:()=>Db,_cidrv6:()=>M1,_cidrv4:()=>z1,_check:()=>bX,_catch:()=>RY,_boolean:()=>wb,_bigint:()=>bb,_base64url:()=>A1,_base64:()=>R1,_array:()=>Kb,_any:()=>Yb,TimePrecision:()=>q4,NEVER:()=>a6,JSONSchemaGenerator:()=>WD,JSONSchema:()=>DX,Doc:()=>_1,$output:()=>H4,$input:()=>V4,$constructor:()=>k,$brand:()=>s6,$ZodXor:()=>i0,$ZodXID:()=>a_,$ZodVoid:()=>B0,$ZodUnknown:()=>K0,$ZodUnion:()=>G4,$ZodUndefined:()=>H0,$ZodUUID:()=>m_,$ZodURL:()=>t_,$ZodULID:()=>e_,$ZodType:()=>E,$ZodTuple:()=>Y1,$ZodTransform:()=>E0,$ZodTemplateLiteral:()=>o0,$ZodSymbol:()=>I0,$ZodSuccess:()=>c0,$ZodStringFormat:()=>p,$ZodString:()=>Un,$ZodSet:()=>R0,$ZodRegistry:()=>m2,$ZodRecord:()=>z0,$ZodRealError:()=>j$,$ZodReadonly:()=>t0,$ZodPromise:()=>d0,$ZodPrefault:()=>l0,$ZodPipe:()=>y0,$ZodOptional:()=>k1,$ZodObjectJIT:()=>N0,$ZodObject:()=>vX,$ZodNumberFormat:()=>k0,$ZodNumber:()=>G1,$ZodNullable:()=>u0,$ZodNull:()=>V0,$ZodNonOptional:()=>Z0,$ZodNever:()=>q0,$ZodNanoID:()=>r_,$ZodNaN:()=>m0,$ZodMap:()=>M0,$ZodMAC:()=>_0,$ZodLiteral:()=>x0,$ZodLazy:()=>p0,$ZodKSUID:()=>s_,$ZodJWT:()=>W0,$ZodIntersection:()=>S0,$ZodISOTime:()=>n0,$ZodISODuration:()=>g0,$ZodISODateTime:()=>$0,$ZodISODate:()=>v0,$ZodIPv6:()=>w0,$ZodIPv4:()=>U0,$ZodGUID:()=>h_,$ZodFunction:()=>r0,$ZodFile:()=>f0,$ZodExactOptional:()=>C0,$ZodError:()=>w4,$ZodEnum:()=>A0,$ZodEncodeError:()=>sv,$ZodEmoji:()=>o_,$ZodEmail:()=>y_,$ZodE164:()=>G0,$ZodDiscriminatedUnion:()=>P0,$ZodDefault:()=>T0,$ZodDate:()=>O0,$ZodCustomStringFormat:()=>Y0,$ZodCustom:()=>e0,$ZodCodec:()=>W4,$ZodCheckUpperCase:()=>x_,$ZodCheckStringFormat:()=>yn,$ZodCheckStartsWith:()=>E_,$ZodCheckSizeEquals:()=>P_,$ZodCheckRegex:()=>R_,$ZodCheckProperty:()=>u_,$ZodCheckOverwrite:()=>l_,$ZodCheckNumberFormat:()=>O_,$ZodCheckMultipleOf:()=>B_,$ZodCheckMinSize:()=>i_,$ZodCheckMinLength:()=>z_,$ZodCheckMimeType:()=>T_,$ZodCheckMaxSize:()=>N_,$ZodCheckMaxLength:()=>S_,$ZodCheckLowerCase:()=>A_,$ZodCheckLessThan:()=>U1,$ZodCheckLengthEquals:()=>M_,$ZodCheckIncludes:()=>f_,$ZodCheckGreaterThan:()=>w1,$ZodCheckEndsWith:()=>C_,$ZodCheckBigIntFormat:()=>F_,$ZodCheck:()=>e,$ZodCatch:()=>h0,$ZodCUID2:()=>p_,$ZodCUID:()=>d_,$ZodCIDRv6:()=>D0,$ZodCIDRv4:()=>b0,$ZodBoolean:()=>Q4,$ZodBigIntFormat:()=>j0,$ZodBigInt:()=>W1,$ZodBase64URL:()=>Q0,$ZodBase64:()=>X0,$ZodAsyncError:()=>t$,$ZodArray:()=>F0,$ZodAny:()=>L0});var a6=Object.freeze({status:"aborted"});function k($,n,g){function U(D,J){if(!D._zod)Object.defineProperty(D,"_zod",{value:{def:J,constr:_,traits:new Set},enumerable:!1});if(D._zod.traits.has($))return;D._zod.traits.add($),n(D,J);let X=_.prototype,G=Object.keys(X);for(let j=0;j<G.length;j++){let L=G[j];if(!(L in D))D[L]=X[L].bind(D)}}let v=g?.Parent??Object;class w extends v{}Object.defineProperty(w,"name",{value:$});function _(D){var J;let X=g?.Parent?new w:this;U(X,D),(J=X._zod).deferred??(J.deferred=[]);for(let G of X._zod.deferred)G();return X}return Object.defineProperty(_,"init",{value:U}),Object.defineProperty(_,Symbol.hasInstance,{value:(D)=>{if(g?.Parent&&D instanceof g.Parent)return!0;return D?._zod?.traits?.has($)}}),Object.defineProperty(_,"name",{value:$}),_}var s6=Symbol("zod_brand");class t$ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class sv extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var e6={};function v$($){if($)Object.assign(e6,$);return e6}var O={};z$(O,{unwrapMessage:()=>$4,uint8ArrayToHex:()=>CW,uint8ArrayToBase64url:()=>fW,uint8ArrayToBase64:()=>zJ,stringifyPrimitive:()=>B,slugify:()=>lw,shallowClone:()=>cw,safeExtend:()=>SW,required:()=>RW,randomString:()=>qW,propertyKeyTypes:()=>n4,promiseAllObject:()=>KW,primitiveTypes:()=>hw,prefixIssues:()=>L$,pick:()=>NW,partial:()=>MW,parsedType:()=>N,optionalKeys:()=>mw,omit:()=>iW,objectClone:()=>HW,numKeys:()=>BW,nullish:()=>Vv,normalizeParams:()=>P,mergeDefs:()=>wv,merge:()=>zW,jsonStringifyReplacer:()=>un,joinValues:()=>V,issue:()=>ln,isPlainObject:()=>Kv,isObject:()=>$n,hexToUint8Array:()=>EW,getSizableOrigin:()=>g4,getParsedType:()=>OW,getLengthableOrigin:()=>U4,getEnumValues:()=>Cn,getElementAtPath:()=>LW,floatSafeRemainder:()=>Tw,finalizeIssue:()=>k$,extend:()=>PW,escapeRegex:()=>B$,esc:()=>yg,defineLazy:()=>Z,createTransparentProxy:()=>FW,cloneDef:()=>VW,clone:()=>_$,cleanRegex:()=>v4,cleanEnum:()=>AW,captureStackTrace:()=>tg,cached:()=>Tn,base64urlToUint8Array:()=>xW,base64ToUint8Array:()=>SJ,assignProp:()=>Lv,assertNotEqual:()=>YW,assertNever:()=>jW,assertIs:()=>kW,assertEqual:()=>WW,assert:()=>IW,allowsEval:()=>Zw,aborted:()=>qv,NUMBER_FORMAT_RANGES:()=>yw,Class:()=>MJ,BIGINT_FORMAT_RANGES:()=>tw});function WW($){return $}function YW($){return $}function kW($){}function jW($){throw Error("Unexpected value in exhaustive check")}function IW($){}function Cn($){let n=Object.values($).filter((U)=>typeof U==="number");return Object.entries($).filter(([U,v])=>n.indexOf(+U)===-1).map(([U,v])=>v)}function V($,n="|"){return $.map((g)=>B(g)).join(n)}function un($,n){if(typeof n==="bigint")return n.toString();return n}function Tn($){return{get value(){{let g=$();return Object.defineProperty(this,"value",{value:g}),g}throw Error("cached value already set")}}}function Vv($){return $===null||$===void 0}function v4($){let n=$.startsWith("^")?1:0,g=$.endsWith("$")?$.length-1:$.length;return $.slice(n,g)}function Tw($,n){let g=($.toString().split(".")[1]||"").length,U=n.toString(),v=(U.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(U)){let J=U.match(/\d?e-(\d?)/);if(J?.[1])v=Number.parseInt(J[1])}let w=g>v?g:v,_=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(n.toFixed(w).replace(".",""));return _%D/10**w}var PJ=Symbol("evaluating");function Z($,n,g){let U=void 0;Object.defineProperty($,n,{get(){if(U===PJ)return;if(U===void 0)U=PJ,U=g();return U},set(v){Object.defineProperty($,n,{value:v})},configurable:!0})}function HW($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function Lv($,n,g){Object.defineProperty($,n,{value:g,writable:!0,enumerable:!0,configurable:!0})}function wv(...$){let n={};for(let g of $){let U=Object.getOwnPropertyDescriptors(g);Object.assign(n,U)}return Object.defineProperties({},n)}function VW($){return wv($._zod.def)}function LW($,n){if(!n)return $;return n.reduce((g,U)=>g?.[U],$)}function KW($){let n=Object.keys($),g=n.map((U)=>$[U]);return Promise.all(g).then((U)=>{let v={};for(let w=0;w<n.length;w++)v[n[w]]=U[w];return v})}function qW($=10){let g="";for(let U=0;U<$;U++)g+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return g}function yg($){return JSON.stringify($)}function lw($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var tg="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function $n($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var Zw=Tn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function Kv($){if($n($)===!1)return!1;let n=$.constructor;if(n===void 0)return!0;if(typeof n!=="function")return!0;let g=n.prototype;if($n(g)===!1)return!1;if(Object.prototype.hasOwnProperty.call(g,"isPrototypeOf")===!1)return!1;return!0}function cw($){if(Kv($))return{...$};if(Array.isArray($))return[...$];return $}function BW($){let n=0;for(let g in $)if(Object.prototype.hasOwnProperty.call($,g))n++;return n}var OW=($)=>{let n=typeof $;switch(n){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: ${n}`)}},n4=new Set(["string","number","symbol"]),hw=new Set(["string","number","bigint","boolean","symbol","undefined"]);function B$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _$($,n,g){let U=new $._zod.constr(n??$._zod.def);if(!n||g?.parent)U._zod.parent=$;return U}function P($){let n=$;if(!n)return{};if(typeof n==="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");n.error=n.message}if(delete n.message,typeof n.error==="string")return{...n,error:()=>n.error};return n}function FW($){let n;return new Proxy({},{get(g,U,v){return n??(n=$()),Reflect.get(n,U,v)},set(g,U,v,w){return n??(n=$()),Reflect.set(n,U,v,w)},has(g,U){return n??(n=$()),Reflect.has(n,U)},deleteProperty(g,U){return n??(n=$()),Reflect.deleteProperty(n,U)},ownKeys(g){return n??(n=$()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(g,U){return n??(n=$()),Reflect.getOwnPropertyDescriptor(n,U)},defineProperty(g,U,v){return n??(n=$()),Reflect.defineProperty(n,U,v)}})}function B($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function mw($){return Object.keys($).filter((n)=>{return $[n]._zod.optin==="optional"&&$[n]._zod.optout==="optional"})}var yw={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]},tw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function NW($,n){let g=$._zod.def,U=g.checks;if(U&&U.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let w=wv($._zod.def,{get shape(){let _={};for(let D in n){if(!(D in g.shape))throw Error(`Unrecognized key: "${D}"`);if(!n[D])continue;_[D]=g.shape[D]}return Lv(this,"shape",_),_},checks:[]});return _$($,w)}function iW($,n){let g=$._zod.def,U=g.checks;if(U&&U.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let w=wv($._zod.def,{get shape(){let _={...$._zod.def.shape};for(let D in n){if(!(D in g.shape))throw Error(`Unrecognized key: "${D}"`);if(!n[D])continue;delete _[D]}return Lv(this,"shape",_),_},checks:[]});return _$($,w)}function PW($,n){if(!Kv(n))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=wv($._zod.def,{get shape(){let w={...$._zod.def.shape,...n};return Lv(this,"shape",w),w},checks:[]});return _$($,v)}function SW($,n){if(!Kv(n))throw Error("Invalid input to safeExtend: expected a plain object");let g=wv($._zod.def,{get shape(){let U={...$._zod.def.shape,...n};return Lv(this,"shape",U),U}});return _$($,g)}function zW($,n){let g=wv($._zod.def,{get shape(){let U={...$._zod.def.shape,...n._zod.def.shape};return Lv(this,"shape",U),U},get catchall(){return n._zod.def.catchall},checks:[]});return _$($,g)}function MW($,n,g){let v=n._zod.def.checks;if(v&&v.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let _=wv(n._zod.def,{get shape(){let D=n._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 Lv(this,"shape",J),J},checks:[]});return _$(n,_)}function RW($,n,g){let U=wv(n._zod.def,{get shape(){let v=n._zod.def.shape,w={...v};if(g)for(let _ in g){if(!(_ in w))throw Error(`Unrecognized key: "${_}"`);if(!g[_])continue;w[_]=new $({type:"nonoptional",innerType:v[_]})}else for(let _ in v)w[_]=new $({type:"nonoptional",innerType:v[_]});return Lv(this,"shape",w),w}});return _$(n,U)}function qv($,n=0){if($.aborted===!0)return!0;for(let g=n;g<$.issues.length;g++)if($.issues[g]?.continue!==!0)return!0;return!1}function L$($,n){return n.map((g)=>{var U;return(U=g).path??(U.path=[]),g.path.unshift($),g})}function $4($){return typeof $==="string"?$:$?.message}function k$($,n,g){let U={...$,path:$.path??[]};if(!$.message){let v=$4($.inst?._zod.def?.error?.($))??$4(n?.error?.($))??$4(g.customError?.($))??$4(g.localeError?.($))??"Invalid input";U.message=v}if(delete U.inst,delete U.continue,!n?.reportInput)delete U.input;return U}function g4($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function U4($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function N($){let n=typeof $;switch(n){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 n}function ln(...$){let[n,g,U]=$;if(typeof n==="string")return{message:n,code:"custom",input:g,inst:U};return{...n}}function AW($){return Object.entries($).filter(([n,g])=>{return Number.isNaN(Number.parseInt(n,10))}).map((n)=>n[1])}function SJ($){let n=atob($),g=new Uint8Array(n.length);for(let U=0;U<n.length;U++)g[U]=n.charCodeAt(U);return g}function zJ($){let n="";for(let g=0;g<$.length;g++)n+=String.fromCharCode($[g]);return btoa(n)}function xW($){let n=$.replace(/-/g,"+").replace(/_/g,"/"),g="=".repeat((4-n.length%4)%4);return SJ(n+g)}function fW($){return zJ($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function EW($){let n=$.replace(/^0x/,"");if(n.length%2!==0)throw Error("Invalid hex string length");let g=new Uint8Array(n.length/2);for(let U=0;U<n.length;U+=2)g[U/2]=Number.parseInt(n.slice(U,U+2),16);return g}function CW($){return Array.from($).map((n)=>n.toString(16).padStart(2,"0")).join("")}class MJ{constructor(...$){}}var RJ=($,n)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:n,enumerable:!1}),$.message=JSON.stringify(n,un,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},w4=k("$ZodError",RJ),j$=k("$ZodError",RJ,{Parent:Error});function vn($,n=(g)=>g.message){let g={},U=[];for(let v of $.issues)if(v.path.length>0)g[v.path[0]]=g[v.path[0]]||[],g[v.path[0]].push(n(v));else U.push(n(v));return{formErrors:U,fieldErrors:g}}function nn($,n=(g)=>g.message){let g={_errors:[]},U=(v)=>{for(let w of v.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map((_)=>U({issues:_}));else if(w.code==="invalid_key")U({issues:w.issues});else if(w.code==="invalid_element")U({issues:w.issues});else if(w.path.length===0)g._errors.push(n(w));else{let _=g,D=0;while(D<w.path.length){let J=w.path[D];if(D!==w.path.length-1)_[J]=_[J]||{_errors:[]};else _[J]=_[J]||{_errors:[]},_[J]._errors.push(n(w));_=_[J],D++}}};return U($),g}function _4($,n=(g)=>g.message){let g={errors:[]},U=(v,w=[])=>{var _,D;for(let J of v.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((X)=>U({issues:X},J.path));else if(J.code==="invalid_key")U({issues:J.issues},J.path);else if(J.code==="invalid_element")U({issues:J.issues},J.path);else{let X=[...w,...J.path];if(X.length===0){g.errors.push(n(J));continue}let G=g,j=0;while(j<X.length){let L=X[j],K=j===X.length-1;if(typeof L==="string")G.properties??(G.properties={}),(_=G.properties)[L]??(_[L]={errors:[]}),G=G.properties[L];else G.items??(G.items=[]),(D=G.items)[L]??(D[L]={errors:[]}),G=G.items[L];if(K)G.errors.push(n(J));j++}}};return U($),g}function AJ($){let n=[],g=$.map((U)=>typeof U==="object"?U.key:U);for(let U of g)if(typeof U==="number")n.push(`[${U}]`);else if(typeof U==="symbol")n.push(`[${JSON.stringify(String(U))}]`);else if(/[^\w$]/.test(U))n.push(`[${JSON.stringify(U)}]`);else{if(n.length)n.push(".");n.push(U)}return n.join("")}function b4($){let n=[],g=[...$.issues].sort((U,v)=>(U.path??[]).length-(v.path??[]).length);for(let U of g)if(n.push(`✖ ${U.message}`),U.path?.length)n.push(` → at ${AJ(U.path)}`);return n.join(`
4
- `)}var Zn=($)=>(n,g,U,v)=>{let w=U?Object.assign(U,{async:!1}):{async:!1},_=n._zod.run({value:g,issues:[]},w);if(_ instanceof Promise)throw new t$;if(_.issues.length){let D=new(v?.Err??$)(_.issues.map((J)=>k$(J,w,v$())));throw tg(D,v?.callee),D}return _.value},og=Zn(j$),cn=($)=>async(n,g,U,v)=>{let w=U?Object.assign(U,{async:!0}):{async:!0},_=n._zod.run({value:g,issues:[]},w);if(_ instanceof Promise)_=await _;if(_.issues.length){let D=new(v?.Err??$)(_.issues.map((J)=>k$(J,w,v$())));throw tg(D,v?.callee),D}return _.value},rg=cn(j$),hn=($)=>(n,g,U)=>{let v=U?{...U,async:!1}:{async:!1},w=n._zod.run({value:g,issues:[]},v);if(w instanceof Promise)throw new t$;return w.issues.length?{success:!1,error:new($??w4)(w.issues.map((_)=>k$(_,v,v$())))}:{success:!0,data:w.value}},ow=hn(j$),mn=($)=>async(n,g,U)=>{let v=U?Object.assign(U,{async:!0}):{async:!0},w=n._zod.run({value:g,issues:[]},v);if(w instanceof Promise)w=await w;return w.issues.length?{success:!1,error:new $(w.issues.map((_)=>k$(_,v,v$())))}:{success:!0,data:w.value}},rw=mn(j$),dg=($)=>(n,g,U)=>{let v=U?Object.assign(U,{direction:"backward"}):{direction:"backward"};return Zn($)(n,g,v)},TW=dg(j$),pg=($)=>(n,g,U)=>{return Zn($)(n,g,U)},lW=pg(j$),eg=($)=>async(n,g,U)=>{let v=U?Object.assign(U,{direction:"backward"}):{direction:"backward"};return cn($)(n,g,v)},ZW=eg(j$),ag=($)=>async(n,g,U)=>{return cn($)(n,g,U)},cW=ag(j$),sg=($)=>(n,g,U)=>{let v=U?Object.assign(U,{direction:"backward"}):{direction:"backward"};return hn($)(n,g,v)},hW=sg(j$),$1=($)=>(n,g,U)=>{return hn($)(n,g,U)},mW=$1(j$),v1=($)=>async(n,g,U)=>{let v=U?Object.assign(U,{direction:"backward"}):{direction:"backward"};return mn($)(n,g,v)},yW=v1(j$),n1=($)=>async(n,g,U)=>{return mn($)(n,g,U)},tW=n1(j$);var I$={};z$(I$,{xid:()=>aw,uuid7:()=>pW,uuid6:()=>dW,uuid4:()=>rW,uuid:()=>gn,uppercase:()=>q_,unicodeEmail:()=>xJ,undefined:()=>L_,ulid:()=>ew,time:()=>W_,string:()=>k_,sha512_hex:()=>I3,sha512_base64url:()=>V3,sha512_base64:()=>H3,sha384_hex:()=>Y3,sha384_base64url:()=>j3,sha384_base64:()=>k3,sha256_hex:()=>Q3,sha256_base64url:()=>W3,sha256_base64:()=>G3,sha1_hex:()=>D3,sha1_base64url:()=>X3,sha1_base64:()=>J3,rfc5322Email:()=>aW,number:()=>D4,null:()=>V_,nanoid:()=>$_,md5_hex:()=>w3,md5_base64url:()=>b3,md5_base64:()=>_3,mac:()=>b_,lowercase:()=>K_,ksuid:()=>sw,ipv6:()=>__,ipv4:()=>w_,integer:()=>I_,idnEmail:()=>sW,html5Email:()=>eW,hostname:()=>n3,hex:()=>U3,guid:()=>n_,extendedDuration:()=>oW,emoji:()=>U_,email:()=>g_,e164:()=>Q_,duration:()=>v_,domain:()=>g3,datetime:()=>Y_,date:()=>G_,cuid2:()=>pw,cuid:()=>dw,cidrv6:()=>J_,cidrv4:()=>D_,browserEmail:()=>$3,boolean:()=>H_,bigint:()=>j_,base64url:()=>g1,base64:()=>X_});var dw=/^[cC][^\s-]{8,}$/,pw=/^[0-9a-z]+$/,ew=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aw=/^[0-9a-vA-V]{20}$/,sw=/^[A-Za-z0-9]{27}$/,$_=/^[a-zA-Z0-9_-]{21}$/,v_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,oW=/^[-+]?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)?)??$/,n_=/^([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})$/,gn=($)=>{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})$`)},rW=gn(4),dW=gn(6),pW=gn(7),g_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eW=/^[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])?)*$/,aW=/^(([^<>()\[\]\\.,;:\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,}))$/,xJ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,sW=xJ,$3=/^[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])?)*$/,v3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function U_(){return new RegExp(v3,"u")}var w_=/^(?:(?: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-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}|:))$/,b_=($)=>{let n=B$($??":");return new RegExp(`^(?:[0-9A-F]{2}${n}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${n}){5}[0-9a-f]{2}$`)},D_=/^((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])$/,J_=/^(([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])$/,X_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,g1=/^[A-Za-z0-9_-]*$/,n3=/^(?=.{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])?)*\.?$/,g3=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Q_=/^\+[1-9]\d{6,14}$/,fJ="(?:(?:\\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])))",G_=new RegExp(`^${fJ}$`);function EJ($){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 W_($){return new RegExp(`^${EJ($)}$`)}function Y_($){let n=EJ({precision:$.precision}),g=["Z"];if($.local)g.push("");if($.offset)g.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${n}(?:${g.join("|")})`;return new RegExp(`^${fJ}T(?:${U})$`)}var k_=($)=>{let n=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},j_=/^-?\d+n?$/,I_=/^-?\d+$/,D4=/^-?\d+(?:\.\d+)?$/,H_=/^(?:true|false)$/i,V_=/^null$/i;var L_=/^undefined$/i;var K_=/^[^A-Z]*$/,q_=/^[^a-z]*$/,U3=/^[0-9a-fA-F]*$/;function J4($,n){return new RegExp(`^[A-Za-z0-9+/]{${$}}${n}$`)}function X4($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var w3=/^[0-9a-fA-F]{32}$/,_3=J4(22,"=="),b3=X4(22),D3=/^[0-9a-fA-F]{40}$/,J3=J4(27,"="),X3=X4(27),Q3=/^[0-9a-fA-F]{64}$/,G3=J4(43,"="),W3=X4(43),Y3=/^[0-9a-fA-F]{96}$/,k3=J4(64,""),j3=X4(64),I3=/^[0-9a-fA-F]{128}$/,H3=J4(86,"=="),V3=X4(86);var e=k("$ZodCheck",($,n)=>{var g;$._zod??($._zod={}),$._zod.def=n,(g=$._zod).onattach??(g.onattach=[])}),uJ={number:"number",bigint:"bigint",object:"date"},U1=k("$ZodCheckLessThan",($,n)=>{e.init($,n);let g=uJ[typeof n.value];$._zod.onattach.push((U)=>{let v=U._zod.bag,w=(n.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(n.value<w)if(n.inclusive)v.maximum=n.value;else v.exclusiveMaximum=n.value}),$._zod.check=(U)=>{if(n.inclusive?U.value<=n.value:U.value<n.value)return;U.issues.push({origin:g,code:"too_big",maximum:typeof n.value==="object"?n.value.getTime():n.value,input:U.value,inclusive:n.inclusive,inst:$,continue:!n.abort})}}),w1=k("$ZodCheckGreaterThan",($,n)=>{e.init($,n);let g=uJ[typeof n.value];$._zod.onattach.push((U)=>{let v=U._zod.bag,w=(n.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(n.value>w)if(n.inclusive)v.minimum=n.value;else v.exclusiveMinimum=n.value}),$._zod.check=(U)=>{if(n.inclusive?U.value>=n.value:U.value>n.value)return;U.issues.push({origin:g,code:"too_small",minimum:typeof n.value==="object"?n.value.getTime():n.value,input:U.value,inclusive:n.inclusive,inst:$,continue:!n.abort})}}),B_=k("$ZodCheckMultipleOf",($,n)=>{e.init($,n),$._zod.onattach.push((g)=>{var U;(U=g._zod.bag).multipleOf??(U.multipleOf=n.value)}),$._zod.check=(g)=>{if(typeof g.value!==typeof n.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof g.value==="bigint"?g.value%n.value===BigInt(0):Tw(g.value,n.value)===0)return;g.issues.push({origin:typeof g.value,code:"not_multiple_of",divisor:n.value,input:g.value,inst:$,continue:!n.abort})}}),O_=k("$ZodCheckNumberFormat",($,n)=>{e.init($,n),n.format=n.format||"float64";let g=n.format?.includes("int"),U=g?"int":"number",[v,w]=yw[n.format];$._zod.onattach.push((_)=>{let D=_._zod.bag;if(D.format=n.format,D.minimum=v,D.maximum=w,g)D.pattern=I_}),$._zod.check=(_)=>{let D=_.value;if(g){if(!Number.isInteger(D)){_.issues.push({expected:U,format:n.format,code:"invalid_type",continue:!1,input:D,inst:$});return}if(!Number.isSafeInteger(D)){if(D>0)_.issues.push({input:D,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:U,inclusive:!0,continue:!n.abort});else _.issues.push({input:D,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:U,inclusive:!0,continue:!n.abort});return}}if(D<v)_.issues.push({origin:"number",input:D,code:"too_small",minimum:v,inclusive:!0,inst:$,continue:!n.abort});if(D>w)_.issues.push({origin:"number",input:D,code:"too_big",maximum:w,inclusive:!0,inst:$,continue:!n.abort})}}),F_=k("$ZodCheckBigIntFormat",($,n)=>{e.init($,n);let[g,U]=tw[n.format];$._zod.onattach.push((v)=>{let w=v._zod.bag;w.format=n.format,w.minimum=g,w.maximum=U}),$._zod.check=(v)=>{let w=v.value;if(w<g)v.issues.push({origin:"bigint",input:w,code:"too_small",minimum:g,inclusive:!0,inst:$,continue:!n.abort});if(w>U)v.issues.push({origin:"bigint",input:w,code:"too_big",maximum:U,inclusive:!0,inst:$,continue:!n.abort})}}),N_=k("$ZodCheckMaxSize",($,n)=>{var g;e.init($,n),(g=$._zod.def).when??(g.when=(U)=>{let v=U.value;return!Vv(v)&&v.size!==void 0}),$._zod.onattach.push((U)=>{let v=U._zod.bag.maximum??Number.POSITIVE_INFINITY;if(n.maximum<v)U._zod.bag.maximum=n.maximum}),$._zod.check=(U)=>{let v=U.value;if(v.size<=n.maximum)return;U.issues.push({origin:g4(v),code:"too_big",maximum:n.maximum,inclusive:!0,input:v,inst:$,continue:!n.abort})}}),i_=k("$ZodCheckMinSize",($,n)=>{var g;e.init($,n),(g=$._zod.def).when??(g.when=(U)=>{let v=U.value;return!Vv(v)&&v.size!==void 0}),$._zod.onattach.push((U)=>{let v=U._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(n.minimum>v)U._zod.bag.minimum=n.minimum}),$._zod.check=(U)=>{let v=U.value;if(v.size>=n.minimum)return;U.issues.push({origin:g4(v),code:"too_small",minimum:n.minimum,inclusive:!0,input:v,inst:$,continue:!n.abort})}}),P_=k("$ZodCheckSizeEquals",($,n)=>{var g;e.init($,n),(g=$._zod.def).when??(g.when=(U)=>{let v=U.value;return!Vv(v)&&v.size!==void 0}),$._zod.onattach.push((U)=>{let v=U._zod.bag;v.minimum=n.size,v.maximum=n.size,v.size=n.size}),$._zod.check=(U)=>{let v=U.value,w=v.size;if(w===n.size)return;let _=w>n.size;U.issues.push({origin:g4(v),..._?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:U.value,inst:$,continue:!n.abort})}}),S_=k("$ZodCheckMaxLength",($,n)=>{var g;e.init($,n),(g=$._zod.def).when??(g.when=(U)=>{let v=U.value;return!Vv(v)&&v.length!==void 0}),$._zod.onattach.push((U)=>{let v=U._zod.bag.maximum??Number.POSITIVE_INFINITY;if(n.maximum<v)U._zod.bag.maximum=n.maximum}),$._zod.check=(U)=>{let v=U.value;if(v.length<=n.maximum)return;let _=U4(v);U.issues.push({origin:_,code:"too_big",maximum:n.maximum,inclusive:!0,input:v,inst:$,continue:!n.abort})}}),z_=k("$ZodCheckMinLength",($,n)=>{var g;e.init($,n),(g=$._zod.def).when??(g.when=(U)=>{let v=U.value;return!Vv(v)&&v.length!==void 0}),$._zod.onattach.push((U)=>{let v=U._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(n.minimum>v)U._zod.bag.minimum=n.minimum}),$._zod.check=(U)=>{let v=U.value;if(v.length>=n.minimum)return;let _=U4(v);U.issues.push({origin:_,code:"too_small",minimum:n.minimum,inclusive:!0,input:v,inst:$,continue:!n.abort})}}),M_=k("$ZodCheckLengthEquals",($,n)=>{var g;e.init($,n),(g=$._zod.def).when??(g.when=(U)=>{let v=U.value;return!Vv(v)&&v.length!==void 0}),$._zod.onattach.push((U)=>{let v=U._zod.bag;v.minimum=n.length,v.maximum=n.length,v.length=n.length}),$._zod.check=(U)=>{let v=U.value,w=v.length;if(w===n.length)return;let _=U4(v),D=w>n.length;U.issues.push({origin:_,...D?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:U.value,inst:$,continue:!n.abort})}}),yn=k("$ZodCheckStringFormat",($,n)=>{var g,U;if(e.init($,n),$._zod.onattach.push((v)=>{let w=v._zod.bag;if(w.format=n.format,n.pattern)w.patterns??(w.patterns=new Set),w.patterns.add(n.pattern)}),n.pattern)(g=$._zod).check??(g.check=(v)=>{if(n.pattern.lastIndex=0,n.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:n.format,input:v.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:$,continue:!n.abort})});else(U=$._zod).check??(U.check=()=>{})}),R_=k("$ZodCheckRegex",($,n)=>{yn.init($,n),$._zod.check=(g)=>{if(n.pattern.lastIndex=0,n.pattern.test(g.value))return;g.issues.push({origin:"string",code:"invalid_format",format:"regex",input:g.value,pattern:n.pattern.toString(),inst:$,continue:!n.abort})}}),A_=k("$ZodCheckLowerCase",($,n)=>{n.pattern??(n.pattern=K_),yn.init($,n)}),x_=k("$ZodCheckUpperCase",($,n)=>{n.pattern??(n.pattern=q_),yn.init($,n)}),f_=k("$ZodCheckIncludes",($,n)=>{e.init($,n);let g=B$(n.includes),U=new RegExp(typeof n.position==="number"?`^.{${n.position}}${g}`:g);n.pattern=U,$._zod.onattach.push((v)=>{let w=v._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(v)=>{if(v.value.includes(n.includes,n.position))return;v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:v.value,inst:$,continue:!n.abort})}}),E_=k("$ZodCheckStartsWith",($,n)=>{e.init($,n);let g=new RegExp(`^${B$(n.prefix)}.*`);n.pattern??(n.pattern=g),$._zod.onattach.push((U)=>{let v=U._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(g)}),$._zod.check=(U)=>{if(U.value.startsWith(n.prefix))return;U.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:U.value,inst:$,continue:!n.abort})}}),C_=k("$ZodCheckEndsWith",($,n)=>{e.init($,n);let g=new RegExp(`.*${B$(n.suffix)}$`);n.pattern??(n.pattern=g),$._zod.onattach.push((U)=>{let v=U._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(g)}),$._zod.check=(U)=>{if(U.value.endsWith(n.suffix))return;U.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:U.value,inst:$,continue:!n.abort})}});function CJ($,n,g){if($.issues.length)n.issues.push(...L$(g,$.issues))}var u_=k("$ZodCheckProperty",($,n)=>{e.init($,n),$._zod.check=(g)=>{let U=n.schema._zod.run({value:g.value[n.property],issues:[]},{});if(U instanceof Promise)return U.then((v)=>CJ(v,g,n.property));CJ(U,g,n.property);return}}),T_=k("$ZodCheckMimeType",($,n)=>{e.init($,n);let g=new Set(n.mime);$._zod.onattach.push((U)=>{U._zod.bag.mime=n.mime}),$._zod.check=(U)=>{if(g.has(U.value.type))return;U.issues.push({code:"invalid_value",values:n.mime,input:U.value.type,inst:$,continue:!n.abort})}}),l_=k("$ZodCheckOverwrite",($,n)=>{e.init($,n),$._zod.check=(g)=>{g.value=n.tx(g.value)}});class _1{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(`
5
- `).filter((w)=>w),U=Math.min(...g.map((w)=>w.length-w.trimStart().length)),v=g.map((w)=>w.slice(U)).map((w)=>" ".repeat(this.indent*2)+w);for(let w of v)this.content.push(w)}compile(){let $=Function,n=this?.args,U=[...(this?.content??[""]).map((v)=>` ${v}`)];return new $(...n,U.join(`
6
- `))}}var Z_={major:4,minor:3,patch:0};var E=k("$ZodType",($,n)=>{var g;$??($={}),$._zod.def=n,$._zod.bag=$._zod.bag||{},$._zod.version=Z_;let U=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))U.unshift($);for(let v of U)for(let w of v._zod.onattach)w($);if(U.length===0)(g=$._zod).deferred??(g.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let v=(_,D,J)=>{let X=qv(_),G;for(let j of D){if(j._zod.def.when){if(!j._zod.def.when(_))continue}else if(X)continue;let L=_.issues.length,K=j._zod.check(_);if(K instanceof Promise&&J?.async===!1)throw new t$;if(G||K instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await K,_.issues.length===L)return;if(!X)X=qv(_,L)});else{if(_.issues.length===L)continue;if(!X)X=qv(_,L)}}if(G)return G.then(()=>{return _});return _},w=(_,D,J)=>{if(qv(_))return _.aborted=!0,_;let X=v(D,U,J);if(X instanceof Promise){if(J.async===!1)throw new t$;return X.then((G)=>$._zod.parse(G,J))}return $._zod.parse(X,J)};$._zod.run=(_,D)=>{if(D.skipChecks)return $._zod.parse(_,D);if(D.direction==="backward"){let X=$._zod.parse({value:_.value,issues:[]},{...D,skipChecks:!0});if(X instanceof Promise)return X.then((G)=>{return w(G,_,D)});return w(X,_,D)}let J=$._zod.parse(_,D);if(J instanceof Promise){if(D.async===!1)throw new t$;return J.then((X)=>v(X,U,D))}return v(J,U,D)}}Z($,"~standard",()=>({validate:(v)=>{try{let w=ow($,v);return w.success?{value:w.data}:{issues:w.error?.issues}}catch(w){return rw($,v).then((_)=>_.success?{value:_.data}:{issues:_.error?.issues})}},vendor:"zod",version:1}))}),Un=k("$ZodString",($,n)=>{E.init($,n),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??k_($._zod.bag),$._zod.parse=(g,U)=>{if(n.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}}),p=k("$ZodStringFormat",($,n)=>{yn.init($,n),Un.init($,n)}),h_=k("$ZodGUID",($,n)=>{n.pattern??(n.pattern=n_),p.init($,n)}),m_=k("$ZodUUID",($,n)=>{if(n.version){let U={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(U===void 0)throw Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=gn(U))}else n.pattern??(n.pattern=gn());p.init($,n)}),y_=k("$ZodEmail",($,n)=>{n.pattern??(n.pattern=g_),p.init($,n)}),t_=k("$ZodURL",($,n)=>{p.init($,n),$._zod.check=(g)=>{try{let U=g.value.trim(),v=new URL(U);if(n.hostname){if(n.hostname.lastIndex=0,!n.hostname.test(v.hostname))g.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:g.value,inst:$,continue:!n.abort})}if(n.protocol){if(n.protocol.lastIndex=0,!n.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol))g.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:g.value,inst:$,continue:!n.abort})}if(n.normalize)g.value=v.href;else g.value=U;return}catch(U){g.issues.push({code:"invalid_format",format:"url",input:g.value,inst:$,continue:!n.abort})}}}),o_=k("$ZodEmoji",($,n)=>{n.pattern??(n.pattern=U_()),p.init($,n)}),r_=k("$ZodNanoID",($,n)=>{n.pattern??(n.pattern=$_),p.init($,n)}),d_=k("$ZodCUID",($,n)=>{n.pattern??(n.pattern=dw),p.init($,n)}),p_=k("$ZodCUID2",($,n)=>{n.pattern??(n.pattern=pw),p.init($,n)}),e_=k("$ZodULID",($,n)=>{n.pattern??(n.pattern=ew),p.init($,n)}),a_=k("$ZodXID",($,n)=>{n.pattern??(n.pattern=aw),p.init($,n)}),s_=k("$ZodKSUID",($,n)=>{n.pattern??(n.pattern=sw),p.init($,n)}),$0=k("$ZodISODateTime",($,n)=>{n.pattern??(n.pattern=Y_(n)),p.init($,n)}),v0=k("$ZodISODate",($,n)=>{n.pattern??(n.pattern=G_),p.init($,n)}),n0=k("$ZodISOTime",($,n)=>{n.pattern??(n.pattern=W_(n)),p.init($,n)}),g0=k("$ZodISODuration",($,n)=>{n.pattern??(n.pattern=v_),p.init($,n)}),U0=k("$ZodIPv4",($,n)=>{n.pattern??(n.pattern=w_),p.init($,n),$._zod.bag.format="ipv4"}),w0=k("$ZodIPv6",($,n)=>{n.pattern??(n.pattern=__),p.init($,n),$._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:!n.abort})}}}),_0=k("$ZodMAC",($,n)=>{n.pattern??(n.pattern=b_(n.delimiter)),p.init($,n),$._zod.bag.format="mac"}),b0=k("$ZodCIDRv4",($,n)=>{n.pattern??(n.pattern=D_),p.init($,n)}),D0=k("$ZodCIDRv6",($,n)=>{n.pattern??(n.pattern=J_),p.init($,n),$._zod.check=(g)=>{let U=g.value.split("/");try{if(U.length!==2)throw Error();let[v,w]=U;if(!w)throw Error();let _=Number(w);if(`${_}`!==w)throw Error();if(_<0||_>128)throw Error();new URL(`http://[${v}]`)}catch{g.issues.push({code:"invalid_format",format:"cidrv6",input:g.value,inst:$,continue:!n.abort})}}});function J0($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var X0=k("$ZodBase64",($,n)=>{n.pattern??(n.pattern=X_),p.init($,n),$._zod.bag.contentEncoding="base64",$._zod.check=(g)=>{if(J0(g.value))return;g.issues.push({code:"invalid_format",format:"base64",input:g.value,inst:$,continue:!n.abort})}});function eJ($){if(!g1.test($))return!1;let n=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),g=n.padEnd(Math.ceil(n.length/4)*4,"=");return J0(g)}var Q0=k("$ZodBase64URL",($,n)=>{n.pattern??(n.pattern=g1),p.init($,n),$._zod.bag.contentEncoding="base64url",$._zod.check=(g)=>{if(eJ(g.value))return;g.issues.push({code:"invalid_format",format:"base64url",input:g.value,inst:$,continue:!n.abort})}}),G0=k("$ZodE164",($,n)=>{n.pattern??(n.pattern=Q_),p.init($,n)});function aJ($,n=null){try{let g=$.split(".");if(g.length!==3)return!1;let[U]=g;if(!U)return!1;let v=JSON.parse(atob(U));if("typ"in v&&v?.typ!=="JWT")return!1;if(!v.alg)return!1;if(n&&(!("alg"in v)||v.alg!==n))return!1;return!0}catch{return!1}}var W0=k("$ZodJWT",($,n)=>{p.init($,n),$._zod.check=(g)=>{if(aJ(g.value,n.alg))return;g.issues.push({code:"invalid_format",format:"jwt",input:g.value,inst:$,continue:!n.abort})}}),Y0=k("$ZodCustomStringFormat",($,n)=>{p.init($,n),$._zod.check=(g)=>{if(n.fn(g.value))return;g.issues.push({code:"invalid_format",format:n.format,input:g.value,inst:$,continue:!n.abort})}}),G1=k("$ZodNumber",($,n)=>{E.init($,n),$._zod.pattern=$._zod.bag.pattern??D4,$._zod.parse=(g,U)=>{if(n.coerce)try{g.value=Number(g.value)}catch(_){}let v=g.value;if(typeof v==="number"&&!Number.isNaN(v)&&Number.isFinite(v))return g;let w=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:$,...w?{received:w}:{}}),g}}),k0=k("$ZodNumberFormat",($,n)=>{O_.init($,n),G1.init($,n)}),Q4=k("$ZodBoolean",($,n)=>{E.init($,n),$._zod.pattern=H_,$._zod.parse=(g,U)=>{if(n.coerce)try{g.value=Boolean(g.value)}catch(w){}let v=g.value;if(typeof v==="boolean")return g;return g.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:$}),g}}),W1=k("$ZodBigInt",($,n)=>{E.init($,n),$._zod.pattern=j_,$._zod.parse=(g,U)=>{if(n.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}}),j0=k("$ZodBigIntFormat",($,n)=>{F_.init($,n),W1.init($,n)}),I0=k("$ZodSymbol",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{let v=g.value;if(typeof v==="symbol")return g;return g.issues.push({expected:"symbol",code:"invalid_type",input:v,inst:$}),g}}),H0=k("$ZodUndefined",($,n)=>{E.init($,n),$._zod.pattern=L_,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(g,U)=>{let v=g.value;if(typeof v>"u")return g;return g.issues.push({expected:"undefined",code:"invalid_type",input:v,inst:$}),g}}),V0=k("$ZodNull",($,n)=>{E.init($,n),$._zod.pattern=V_,$._zod.values=new Set([null]),$._zod.parse=(g,U)=>{let v=g.value;if(v===null)return g;return g.issues.push({expected:"null",code:"invalid_type",input:v,inst:$}),g}}),L0=k("$ZodAny",($,n)=>{E.init($,n),$._zod.parse=(g)=>g}),K0=k("$ZodUnknown",($,n)=>{E.init($,n),$._zod.parse=(g)=>g}),q0=k("$ZodNever",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{return g.issues.push({expected:"never",code:"invalid_type",input:g.value,inst:$}),g}}),B0=k("$ZodVoid",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{let v=g.value;if(typeof v>"u")return g;return g.issues.push({expected:"void",code:"invalid_type",input:v,inst:$}),g}}),O0=k("$ZodDate",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{if(n.coerce)try{g.value=new Date(g.value)}catch(D){}let v=g.value,w=v instanceof Date;if(w&&!Number.isNaN(v.getTime()))return g;return g.issues.push({expected:"date",code:"invalid_type",input:v,...w?{received:"Invalid Date"}:{},inst:$}),g}});function lJ($,n,g){if($.issues.length)n.issues.push(...L$(g,$.issues));n.value[g]=$.value}var F0=k("$ZodArray",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{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 w=[];for(let _=0;_<v.length;_++){let D=v[_],J=n.element._zod.run({value:D,issues:[]},U);if(J instanceof Promise)w.push(J.then((X)=>lJ(X,g,_)));else lJ(J,g,_)}if(w.length)return Promise.all(w).then(()=>g);return g}});function Q1($,n,g,U,v){if($.issues.length){if(v&&!(g in U))return;n.issues.push(...L$(g,$.issues))}if($.value===void 0){if(g in U)n.value[g]=void 0}else n.value[g]=$.value}function sJ($){let n=Object.keys($.shape);for(let U of n)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let g=mw($.shape);return{...$,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(g)}}function $X($,n,g,U,v,w){let _=[],D=v.keySet,J=v.catchall._zod,X=J.def.type,G=J.optout==="optional";for(let j in n){if(D.has(j))continue;if(X==="never"){_.push(j);continue}let L=J.run({value:n[j],issues:[]},U);if(L instanceof Promise)$.push(L.then((K)=>Q1(K,g,j,n,G)));else Q1(L,g,j,n,G)}if(_.length)g.issues.push({code:"unrecognized_keys",keys:_,input:n,inst:w});if(!$.length)return g;return Promise.all($).then(()=>{return g})}var vX=k("$ZodObject",($,n)=>{if(E.init($,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){let D=n.shape;Object.defineProperty(n,"shape",{get:()=>{let J={...D};return Object.defineProperty(n,"shape",{value:J}),J}})}let U=Tn(()=>sJ(n));Z($._zod,"propValues",()=>{let D=n.shape,J={};for(let X in D){let G=D[X]._zod;if(G.values){J[X]??(J[X]=new Set);for(let j of G.values)J[X].add(j)}}return J});let v=$n,w=n.catchall,_;$._zod.parse=(D,J)=>{_??(_=U.value);let X=D.value;if(!v(X))return D.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),D;D.value={};let G=[],j=_.shape;for(let L of _.keys){let K=j[L],I=K._zod.optout==="optional",H=K._zod.run({value:X[L],issues:[]},J);if(H instanceof Promise)G.push(H.then((S)=>Q1(S,D,L,X,I)));else Q1(H,D,L,X,I)}if(!w)return G.length?Promise.all(G).then(()=>D):D;return $X(G,X,D,J,U.value,$)}}),N0=k("$ZodObjectJIT",($,n)=>{vX.init($,n);let g=$._zod.parse,U=Tn(()=>sJ(n)),v=(L)=>{let K=new _1(["shape","payload","ctx"]),I=U.value,H=(m)=>{let a=yg(m);return`shape[${a}]._zod.run({ value: input[${a}], issues: [] }, ctx)`};K.write("const input = payload.value;");let S=Object.create(null),i=0;for(let m of I.keys)S[m]=`key_${i++}`;K.write("const newResult = {};");for(let m of I.keys){let a=S[m],s=yg(m),g$=L[m]?._zod?.optout==="optional";if(K.write(`const ${a} = ${H(m)};`),g$)K.write(`
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.26",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(n===-1)return null;let i=this._buffer.toString("utf8",0,n);return this._buffer=this._buffer.subarray(n+1),jt(i)}clear(){this._buffer=void 0}}function jt(n){return Y2.parse(JSON.parse(n))}function L2(n){return JSON.stringify(n)+`
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
+ `).filter((w)=>w),g=Math.min(...$.map((w)=>w.length-w.trimStart().length)),v=$.map((w)=>w.slice(g)).map((w)=>" ".repeat(this.indent*2)+w);for(let w of v)this.content.push(w)}compile(){let n=Function,i=this?.args,g=[...(this?.content??[""]).map((v)=>` ${v}`)];return new n(...i,g.join(`
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
7
  if (${a}.issues.length) {
8
8
  if (${s} in input) {
9
9
  payload.issues = payload.issues.concat(${a}.issues.map(iss => ({
@@ -21,7 +21,7 @@ import{createRequire as g9}from"node:module";var oG=Object.create;var{getPrototy
21
21
  newResult[${s}] = ${a}.value;
22
22
  }
23
23
 
24
- `);else K.write(`
24
+ `);else u.write(`
25
25
  if (${a}.issues.length) {
26
26
  payload.issues = payload.issues.concat(${a}.issues.map(iss => ({
27
27
  ...iss,
@@ -37,7 +37,1525 @@ import{createRequire as g9}from"node:module";var oG=Object.create;var{getPrototy
37
37
  newResult[${s}] = ${a}.value;
38
38
  }
39
39
 
40
- `)}K.write("payload.value = newResult;"),K.write("return payload;");let c=K.compile();return(m,a)=>c(L,m,a)},w,_=$n,D=!e6.jitless,X=D&&Zw.value,G=n.catchall,j;$._zod.parse=(L,K)=>{j??(j=U.value);let I=L.value;if(!_(I))return L.issues.push({expected:"object",code:"invalid_type",input:I,inst:$}),L;if(D&&X&&K?.async===!1&&K.jitless!==!0){if(!w)w=v(n.shape);if(L=w(L,K),!G)return L;return $X([],I,L,K,j,$)}return g(L,K)}});function ZJ($,n,g,U){for(let w of $)if(w.issues.length===0)return n.value=w.value,n;let v=$.filter((w)=>!qv(w));if(v.length===1)return n.value=v[0].value,v[0];return n.issues.push({code:"invalid_union",input:n.value,inst:g,errors:$.map((w)=>w.issues.map((_)=>k$(_,U,v$())))}),n}var G4=k("$ZodUnion",($,n)=>{E.init($,n),Z($._zod,"optin",()=>n.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),Z($._zod,"optout",()=>n.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),Z($._zod,"values",()=>{if(n.options.every((v)=>v._zod.values))return new Set(n.options.flatMap((v)=>Array.from(v._zod.values)));return}),Z($._zod,"pattern",()=>{if(n.options.every((v)=>v._zod.pattern)){let v=n.options.map((w)=>w._zod.pattern);return new RegExp(`^(${v.map((w)=>v4(w.source)).join("|")})$`)}return});let g=n.options.length===1,U=n.options[0]._zod.run;$._zod.parse=(v,w)=>{if(g)return U(v,w);let _=!1,D=[];for(let J of n.options){let X=J._zod.run({value:v.value,issues:[]},w);if(X instanceof Promise)D.push(X),_=!0;else{if(X.issues.length===0)return X;D.push(X)}}if(!_)return ZJ(D,v,$,w);return Promise.all(D).then((J)=>{return ZJ(J,v,$,w)})}});function cJ($,n,g,U){let v=$.filter((w)=>w.issues.length===0);if(v.length===1)return n.value=v[0].value,n;if(v.length===0)n.issues.push({code:"invalid_union",input:n.value,inst:g,errors:$.map((w)=>w.issues.map((_)=>k$(_,U,v$())))});else n.issues.push({code:"invalid_union",input:n.value,inst:g,errors:[],inclusive:!1});return n}var i0=k("$ZodXor",($,n)=>{G4.init($,n),n.inclusive=!1;let g=n.options.length===1,U=n.options[0]._zod.run;$._zod.parse=(v,w)=>{if(g)return U(v,w);let _=!1,D=[];for(let J of n.options){let X=J._zod.run({value:v.value,issues:[]},w);if(X instanceof Promise)D.push(X),_=!0;else D.push(X)}if(!_)return cJ(D,v,$,w);return Promise.all(D).then((J)=>{return cJ(J,v,$,w)})}}),P0=k("$ZodDiscriminatedUnion",($,n)=>{n.inclusive=!1,G4.init($,n);let g=$._zod.parse;Z($._zod,"propValues",()=>{let v={};for(let w of n.options){let _=w._zod.propValues;if(!_||Object.keys(_).length===0)throw Error(`Invalid discriminated union option at index "${n.options.indexOf(w)}"`);for(let[D,J]of Object.entries(_)){if(!v[D])v[D]=new Set;for(let X of J)v[D].add(X)}}return v});let U=Tn(()=>{let v=n.options,w=new Map;for(let _ of v){let D=_._zod.propValues?.[n.discriminator];if(!D||D.size===0)throw Error(`Invalid discriminated union option at index "${n.options.indexOf(_)}"`);for(let J of D){if(w.has(J))throw Error(`Duplicate discriminator value "${String(J)}"`);w.set(J,_)}}return w});$._zod.parse=(v,w)=>{let _=v.value;if(!$n(_))return v.issues.push({code:"invalid_type",expected:"object",input:_,inst:$}),v;let D=U.value.get(_?.[n.discriminator]);if(D)return D._zod.run(v,w);if(n.unionFallback)return g(v,w);return v.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:_,path:[n.discriminator],inst:$}),v}}),S0=k("$ZodIntersection",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{let v=g.value,w=n.left._zod.run({value:v,issues:[]},U),_=n.right._zod.run({value:v,issues:[]},U);if(w instanceof Promise||_ instanceof Promise)return Promise.all([w,_]).then(([J,X])=>{return hJ(g,J,X)});return hJ(g,w,_)}});function c_($,n){if($===n)return{valid:!0,data:$};if($ instanceof Date&&n instanceof Date&&+$===+n)return{valid:!0,data:$};if(Kv($)&&Kv(n)){let g=Object.keys(n),U=Object.keys($).filter((w)=>g.indexOf(w)!==-1),v={...$,...n};for(let w of U){let _=c_($[w],n[w]);if(!_.valid)return{valid:!1,mergeErrorPath:[w,..._.mergeErrorPath]};v[w]=_.data}return{valid:!0,data:v}}if(Array.isArray($)&&Array.isArray(n)){if($.length!==n.length)return{valid:!1,mergeErrorPath:[]};let g=[];for(let U=0;U<$.length;U++){let v=$[U],w=n[U],_=c_(v,w);if(!_.valid)return{valid:!1,mergeErrorPath:[U,..._.mergeErrorPath]};g.push(_.data)}return{valid:!0,data:g}}return{valid:!1,mergeErrorPath:[]}}function hJ($,n,g){if(n.issues.length)$.issues.push(...n.issues);if(g.issues.length)$.issues.push(...g.issues);if(qv($))return $;let U=c_(n.value,g.value);if(!U.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(U.mergeErrorPath)}`);return $.value=U.data,$}var Y1=k("$ZodTuple",($,n)=>{E.init($,n);let g=n.items;$._zod.parse=(U,v)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({input:w,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let _=[],D=[...g].reverse().findIndex((G)=>G._zod.optin!=="optional"),J=D===-1?0:g.length-D;if(!n.rest){let G=w.length>g.length,j=w.length<J-1;if(G||j)return U.issues.push({...G?{code:"too_big",maximum:g.length,inclusive:!0}:{code:"too_small",minimum:g.length},input:w,inst:$,origin:"array"}),U}let X=-1;for(let G of g){if(X++,X>=w.length){if(X>=J)continue}let j=G._zod.run({value:w[X],issues:[]},v);if(j instanceof Promise)_.push(j.then((L)=>b1(L,U,X)));else b1(j,U,X)}if(n.rest){let G=w.slice(g.length);for(let j of G){X++;let L=n.rest._zod.run({value:j,issues:[]},v);if(L instanceof Promise)_.push(L.then((K)=>b1(K,U,X)));else b1(L,U,X)}}if(_.length)return Promise.all(_).then(()=>U);return U}});function b1($,n,g){if($.issues.length)n.issues.push(...L$(g,$.issues));n.value[g]=$.value}var z0=k("$ZodRecord",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{let v=g.value;if(!Kv(v))return g.issues.push({expected:"record",code:"invalid_type",input:v,inst:$}),g;let w=[],_=n.keyType._zod.values;if(_){g.value={};let D=new Set;for(let X of _)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){D.add(typeof X==="number"?X.toString():X);let G=n.valueType._zod.run({value:v[X],issues:[]},U);if(G instanceof Promise)w.push(G.then((j)=>{if(j.issues.length)g.issues.push(...L$(X,j.issues));g.value[X]=j.value}));else{if(G.issues.length)g.issues.push(...L$(X,G.issues));g.value[X]=G.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=n.keyType._zod.run({value:D,issues:[]},U);if(J instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof D==="string"&&D4.test(D)&&J.issues.length&&J.issues.some((j)=>j.code==="invalid_type"&&j.expected==="number")){let j=n.keyType._zod.run({value:Number(D),issues:[]},U);if(j instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(j.issues.length===0)J=j}if(J.issues.length){if(n.mode==="loose")g.value[D]=v[D];else g.issues.push({code:"invalid_key",origin:"record",issues:J.issues.map((j)=>k$(j,U,v$())),input:D,path:[D],inst:$});continue}let G=n.valueType._zod.run({value:v[D],issues:[]},U);if(G instanceof Promise)w.push(G.then((j)=>{if(j.issues.length)g.issues.push(...L$(D,j.issues));g.value[J.value]=j.value}));else{if(G.issues.length)g.issues.push(...L$(D,G.issues));g.value[J.value]=G.value}}}if(w.length)return Promise.all(w).then(()=>g);return g}}),M0=k("$ZodMap",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{let v=g.value;if(!(v instanceof Map))return g.issues.push({expected:"map",code:"invalid_type",input:v,inst:$}),g;let w=[];g.value=new Map;for(let[_,D]of v){let J=n.keyType._zod.run({value:_,issues:[]},U),X=n.valueType._zod.run({value:D,issues:[]},U);if(J instanceof Promise||X instanceof Promise)w.push(Promise.all([J,X]).then(([G,j])=>{mJ(G,j,g,_,v,$,U)}));else mJ(J,X,g,_,v,$,U)}if(w.length)return Promise.all(w).then(()=>g);return g}});function mJ($,n,g,U,v,w,_){if($.issues.length)if(n4.has(typeof U))g.issues.push(...L$(U,$.issues));else g.issues.push({code:"invalid_key",origin:"map",input:v,inst:w,issues:$.issues.map((D)=>k$(D,_,v$()))});if(n.issues.length)if(n4.has(typeof U))g.issues.push(...L$(U,n.issues));else g.issues.push({origin:"map",code:"invalid_element",input:v,inst:w,key:U,issues:n.issues.map((D)=>k$(D,_,v$()))});g.value.set($.value,n.value)}var R0=k("$ZodSet",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{let v=g.value;if(!(v instanceof Set))return g.issues.push({input:v,inst:$,expected:"set",code:"invalid_type"}),g;let w=[];g.value=new Set;for(let _ of v){let D=n.valueType._zod.run({value:_,issues:[]},U);if(D instanceof Promise)w.push(D.then((J)=>yJ(J,g)));else yJ(D,g)}if(w.length)return Promise.all(w).then(()=>g);return g}});function yJ($,n){if($.issues.length)n.issues.push(...$.issues);n.value.add($.value)}var A0=k("$ZodEnum",($,n)=>{E.init($,n);let g=Cn(n.entries),U=new Set(g);$._zod.values=U,$._zod.pattern=new RegExp(`^(${g.filter((v)=>n4.has(typeof v)).map((v)=>typeof v==="string"?B$(v):v.toString()).join("|")})$`),$._zod.parse=(v,w)=>{let _=v.value;if(U.has(_))return v;return v.issues.push({code:"invalid_value",values:g,input:_,inst:$}),v}}),x0=k("$ZodLiteral",($,n)=>{if(E.init($,n),n.values.length===0)throw Error("Cannot create literal schema with no valid values");let g=new Set(n.values);$._zod.values=g,$._zod.pattern=new RegExp(`^(${n.values.map((U)=>typeof U==="string"?B$(U):U?B$(U.toString()):String(U)).join("|")})$`),$._zod.parse=(U,v)=>{let w=U.value;if(g.has(w))return U;return U.issues.push({code:"invalid_value",values:n.values,input:w,inst:$}),U}}),f0=k("$ZodFile",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{let v=g.value;if(v instanceof File)return g;return g.issues.push({expected:"file",code:"invalid_type",input:v,inst:$}),g}}),E0=k("$ZodTransform",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{if(U.direction==="backward")throw new sv($.constructor.name);let v=n.transform(g.value,g);if(U.async)return(v instanceof Promise?v:Promise.resolve(v)).then((_)=>{return g.value=_,g});if(v instanceof Promise)throw new t$;return g.value=v,g}});function tJ($,n){if($.issues.length&&n===void 0)return{issues:[],value:void 0};return $}var k1=k("$ZodOptional",($,n)=>{E.init($,n),$._zod.optin="optional",$._zod.optout="optional",Z($._zod,"values",()=>{return n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0}),Z($._zod,"pattern",()=>{let g=n.innerType._zod.pattern;return g?new RegExp(`^(${v4(g.source)})?$`):void 0}),$._zod.parse=(g,U)=>{if(n.innerType._zod.optin==="optional"){let v=n.innerType._zod.run(g,U);if(v instanceof Promise)return v.then((w)=>tJ(w,g.value));return tJ(v,g.value)}if(g.value===void 0)return g;return n.innerType._zod.run(g,U)}}),C0=k("$ZodExactOptional",($,n)=>{k1.init($,n),Z($._zod,"values",()=>n.innerType._zod.values),Z($._zod,"pattern",()=>n.innerType._zod.pattern),$._zod.parse=(g,U)=>{return n.innerType._zod.run(g,U)}}),u0=k("$ZodNullable",($,n)=>{E.init($,n),Z($._zod,"optin",()=>n.innerType._zod.optin),Z($._zod,"optout",()=>n.innerType._zod.optout),Z($._zod,"pattern",()=>{let g=n.innerType._zod.pattern;return g?new RegExp(`^(${v4(g.source)}|null)$`):void 0}),Z($._zod,"values",()=>{return n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0}),$._zod.parse=(g,U)=>{if(g.value===null)return g;return n.innerType._zod.run(g,U)}}),T0=k("$ZodDefault",($,n)=>{E.init($,n),$._zod.optin="optional",Z($._zod,"values",()=>n.innerType._zod.values),$._zod.parse=(g,U)=>{if(U.direction==="backward")return n.innerType._zod.run(g,U);if(g.value===void 0)return g.value=n.defaultValue,g;let v=n.innerType._zod.run(g,U);if(v instanceof Promise)return v.then((w)=>oJ(w,n));return oJ(v,n)}});function oJ($,n){if($.value===void 0)$.value=n.defaultValue;return $}var l0=k("$ZodPrefault",($,n)=>{E.init($,n),$._zod.optin="optional",Z($._zod,"values",()=>n.innerType._zod.values),$._zod.parse=(g,U)=>{if(U.direction==="backward")return n.innerType._zod.run(g,U);if(g.value===void 0)g.value=n.defaultValue;return n.innerType._zod.run(g,U)}}),Z0=k("$ZodNonOptional",($,n)=>{E.init($,n),Z($._zod,"values",()=>{let g=n.innerType._zod.values;return g?new Set([...g].filter((U)=>U!==void 0)):void 0}),$._zod.parse=(g,U)=>{let v=n.innerType._zod.run(g,U);if(v instanceof Promise)return v.then((w)=>rJ(w,$));return rJ(v,$)}});function rJ($,n){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:n});return $}var c0=k("$ZodSuccess",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{if(U.direction==="backward")throw new sv("ZodSuccess");let v=n.innerType._zod.run(g,U);if(v instanceof Promise)return v.then((w)=>{return g.value=w.issues.length===0,g});return g.value=v.issues.length===0,g}}),h0=k("$ZodCatch",($,n)=>{E.init($,n),Z($._zod,"optin",()=>n.innerType._zod.optin),Z($._zod,"optout",()=>n.innerType._zod.optout),Z($._zod,"values",()=>n.innerType._zod.values),$._zod.parse=(g,U)=>{if(U.direction==="backward")return n.innerType._zod.run(g,U);let v=n.innerType._zod.run(g,U);if(v instanceof Promise)return v.then((w)=>{if(g.value=w.value,w.issues.length)g.value=n.catchValue({...g,error:{issues:w.issues.map((_)=>k$(_,U,v$()))},input:g.value}),g.issues=[];return g});if(g.value=v.value,v.issues.length)g.value=n.catchValue({...g,error:{issues:v.issues.map((w)=>k$(w,U,v$()))},input:g.value}),g.issues=[];return g}}),m0=k("$ZodNaN",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{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}}),y0=k("$ZodPipe",($,n)=>{E.init($,n),Z($._zod,"values",()=>n.in._zod.values),Z($._zod,"optin",()=>n.in._zod.optin),Z($._zod,"optout",()=>n.out._zod.optout),Z($._zod,"propValues",()=>n.in._zod.propValues),$._zod.parse=(g,U)=>{if(U.direction==="backward"){let w=n.out._zod.run(g,U);if(w instanceof Promise)return w.then((_)=>D1(_,n.in,U));return D1(w,n.in,U)}let v=n.in._zod.run(g,U);if(v instanceof Promise)return v.then((w)=>D1(w,n.out,U));return D1(v,n.out,U)}});function D1($,n,g){if($.issues.length)return $.aborted=!0,$;return n._zod.run({value:$.value,issues:$.issues},g)}var W4=k("$ZodCodec",($,n)=>{E.init($,n),Z($._zod,"values",()=>n.in._zod.values),Z($._zod,"optin",()=>n.in._zod.optin),Z($._zod,"optout",()=>n.out._zod.optout),Z($._zod,"propValues",()=>n.in._zod.propValues),$._zod.parse=(g,U)=>{if((U.direction||"forward")==="forward"){let w=n.in._zod.run(g,U);if(w instanceof Promise)return w.then((_)=>J1(_,n,U));return J1(w,n,U)}else{let w=n.out._zod.run(g,U);if(w instanceof Promise)return w.then((_)=>J1(_,n,U));return J1(w,n,U)}}});function J1($,n,g){if($.issues.length)return $.aborted=!0,$;if((g.direction||"forward")==="forward"){let v=n.transform($.value,$);if(v instanceof Promise)return v.then((w)=>X1($,w,n.out,g));return X1($,v,n.out,g)}else{let v=n.reverseTransform($.value,$);if(v instanceof Promise)return v.then((w)=>X1($,w,n.in,g));return X1($,v,n.in,g)}}function X1($,n,g,U){if($.issues.length)return $.aborted=!0,$;return g._zod.run({value:n,issues:$.issues},U)}var t0=k("$ZodReadonly",($,n)=>{E.init($,n),Z($._zod,"propValues",()=>n.innerType._zod.propValues),Z($._zod,"values",()=>n.innerType._zod.values),Z($._zod,"optin",()=>n.innerType?._zod?.optin),Z($._zod,"optout",()=>n.innerType?._zod?.optout),$._zod.parse=(g,U)=>{if(U.direction==="backward")return n.innerType._zod.run(g,U);let v=n.innerType._zod.run(g,U);if(v instanceof Promise)return v.then(dJ);return dJ(v)}});function dJ($){return $.value=Object.freeze($.value),$}var o0=k("$ZodTemplateLiteral",($,n)=>{E.init($,n);let g=[];for(let U of n.parts)if(typeof U==="object"&&U!==null){if(!U._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...U._zod.traits].shift()}`);let v=U._zod.pattern instanceof RegExp?U._zod.pattern.source:U._zod.pattern;if(!v)throw Error(`Invalid template literal part: ${U._zod.traits}`);let w=v.startsWith("^")?1:0,_=v.endsWith("$")?v.length-1:v.length;g.push(v.slice(w,_))}else if(U===null||hw.has(typeof U))g.push(B$(`${U}`));else throw Error(`Invalid template literal part: ${U}`);$._zod.pattern=new RegExp(`^${g.join("")}$`),$._zod.parse=(U,v)=>{if(typeof U.value!=="string")return U.issues.push({input:U.value,inst:$,expected:"string",code:"invalid_type"}),U;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(U.value))return U.issues.push({input:U.value,inst:$,code:"invalid_format",format:n.format??"template_literal",pattern:$._zod.pattern.source}),U;return U}}),r0=k("$ZodFunction",($,n)=>{return E.init($,n),$._def=n,$._zod.def=n,$.implement=(g)=>{if(typeof g!=="function")throw Error("implement() must be called with a function");return function(...U){let v=$._def.input?og($._def.input,U):U,w=Reflect.apply(g,this,v);if($._def.output)return og($._def.output,w);return w}},$.implementAsync=(g)=>{if(typeof g!=="function")throw Error("implementAsync() must be called with a function");return async function(...U){let v=$._def.input?await rg($._def.input,U):U,w=await Reflect.apply(g,this,v);if($._def.output)return await rg($._def.output,w);return w}},$._zod.parse=(g,U)=>{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 U=$.constructor;if(Array.isArray(g[0]))return new U({type:"function",input:new Y1({type:"tuple",items:g[0],rest:g[1]}),output:$._def.output});return new U({type:"function",input:g[0],output:$._def.output})},$.output=(g)=>{return new $.constructor({type:"function",input:$._def.input,output:g})},$}),d0=k("$ZodPromise",($,n)=>{E.init($,n),$._zod.parse=(g,U)=>{return Promise.resolve(g.value).then((v)=>n.innerType._zod.run({value:v,issues:[]},U))}}),p0=k("$ZodLazy",($,n)=>{E.init($,n),Z($._zod,"innerType",()=>n.getter()),Z($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),Z($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),Z($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),Z($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(g,U)=>{return $._zod.innerType._zod.run(g,U)}}),e0=k("$ZodCustom",($,n)=>{e.init($,n),E.init($,n),$._zod.parse=(g,U)=>{return g},$._zod.check=(g)=>{let U=g.value,v=n.fn(U);if(v instanceof Promise)return v.then((w)=>pJ(w,g,U,$));pJ(v,g,U,$);return}});function pJ($,n,g,U){if(!$){let v={code:"custom",input:g,inst:U,path:[...U._zod.def.path??[]],continue:!U._zod.def.abort};if(U._zod.def.params)v.params=U._zod.def.params;n.issues.push(ln(v))}}var wn={};z$(wn,{zhTW:()=>c2,zhCN:()=>Z2,yo:()=>h2,vi:()=>l2,uz:()=>T2,ur:()=>u2,uk:()=>I4,ua:()=>C2,tr:()=>E2,th:()=>f2,ta:()=>x2,sv:()=>A2,sl:()=>R2,ru:()=>M2,pt:()=>z2,ps:()=>P2,pl:()=>S2,ota:()=>i2,no:()=>N2,nl:()=>F2,ms:()=>O2,mk:()=>B2,lt:()=>q2,ko:()=>K2,km:()=>k4,kh:()=>L2,ka:()=>V2,ja:()=>H2,it:()=>I2,is:()=>j2,id:()=>k2,hy:()=>Y2,hu:()=>W2,he:()=>G2,frCA:()=>Q2,fr:()=>X2,fi:()=>J2,fa:()=>D2,es:()=>b2,eo:()=>_2,en:()=>Y4,de:()=>w2,da:()=>U2,cs:()=>g2,ca:()=>n2,bg:()=>v2,be:()=>$2,az:()=>s0,ar:()=>a0});var K3=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function n(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:"مدخل"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${v.expected}، ولكن تم إدخال ${D}`;return`مدخلات غير مقبولة: يفترض إدخال ${w}، ولكن تم إدخال ${D}`}case"invalid_value":if(v.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${B(v.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[w.format]??v.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${v.divisor}`;case"unrecognized_keys":return`معرف${v.keys.length>1?"ات":""} غريب${v.keys.length>1?"ة":""}: ${V(v.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${v.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${v.origin}`;default:return"مدخل غير مقبول"}}};function a0(){return{localeError:K3()}}var q3=()=>{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 n(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"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}, daxil olan ${D}`}case"invalid_value":if(v.values.length===1)return`Yanlış dəyər: gözlənilən ${B(v.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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ış ${g[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":""}: ${V(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 s0(){return{localeError:q3()}}function nX($,n,g,U){let v=Math.abs($),w=v%10,_=v%100;if(_>=11&&_<=19)return U;if(w===1)return n;if(w>=2&&w<=4)return g;return U}var B3=()=>{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 n(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:"увод"},U={nan:"NaN",number:"лік",array:"масіў"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Няправільны ўвод: чакаўся instanceof ${v.expected}, атрымана ${D}`;return`Няправільны ўвод: чакаўся ${w}, атрымана ${D}`}case"invalid_value":if(v.values.length===1)return`Няправільны ўвод: чакалася ${B(v.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(v.origin);if(_){let D=Number(v.maximum),J=nX(D,_.unit.one,_.unit.few,_.unit.many);return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна ${_.verb} ${w}${v.maximum.toString()} ${J}`}return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна быць ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=n(v.origin);if(_){let D=Number(v.minimum),J=nX(D,_.unit.one,_.unit.few,_.unit.many);return`Занадта малы: чакалася, што ${v.origin} павінна ${_.verb} ${w}${v.minimum.toString()} ${J}`}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`Няправільны ${g[w.format]??v.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${v.keys.length>1?"ключы":"ключ"}: ${V(v.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${v.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${v.origin}`;default:return"Няправільны ўвод"}}};function $2(){return{localeError:B3()}}var O3=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function n(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:"вход"},U={nan:"NaN",number:"число",array:"масив"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Невалиден вход: очакван instanceof ${v.expected}, получен ${D}`;return`Невалиден вход: очакван ${w}, получен ${D}`}case"invalid_value":if(v.values.length===1)return`Невалиден вход: очакван ${B(v.values[0])}`;return`Невалидна опция: очаквано едно от ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${_} ${g[w.format]??v.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${v.divisor}`;case"unrecognized_keys":return`Неразпознат${v.keys.length>1?"и":""} ключ${v.keys.length>1?"ове":""}: ${V(v.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${v.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${v.origin}`;default:return"Невалиден вход"}}};function v2(){return{localeError:O3()}}var F3=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function n(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"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}, s'ha rebut ${D}`}case"invalid_value":if(v.values.length===1)return`Valor invàlid: s'esperava ${B(v.values[0])}`;return`Opció invàlida: s'esperava una de ${V(v.values," o ")}`;case"too_big":{let w=v.inclusive?"com a màxim":"menys de",_=n(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",_=n(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 ${g[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":""}: ${V(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 n2(){return{localeError:F3()}}var N3=()=>{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 n(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"},U={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}, obdrženo ${D}`}case"invalid_value":if(v.values.length===1)return`Neplatný vstup: očekáváno ${B(v.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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: ${V(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 g2(){return{localeError:N3()}}var i3=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function n(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"},U={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=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Ugyldigt input: forventede instanceof ${v.expected}, fik ${D}`;return`Ugyldigt input: forventede ${w}, fik ${D}`}case"invalid_value":if(v.values.length===1)return`Ugyldig værdi: forventede ${B(v.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(v.origin),D=U[v.origin]??v.origin;if(_)return`For stor: forventede ${D??"value"} ${_.verb} ${w} ${v.maximum.toString()} ${_.unit??"elementer"}`;return`For stor: forventede ${D??"value"} havde ${w} ${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=n(v.origin),D=U[v.origin]??v.origin;if(_)return`For lille: forventede ${D} ${_.verb} ${w} ${v.minimum.toString()} ${_.unit}`;return`For lille: forventede ${D} 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 ${g[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"}: ${V(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 U2(){return{localeError:i3()}}var P3=()=>{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 n(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"},U={nan:"NaN",number:"Zahl",array:"Array"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Ungültige Eingabe: erwartet instanceof ${v.expected}, erhalten ${D}`;return`Ungültige Eingabe: erwartet ${w}, erhalten ${D}`}case"invalid_value":if(v.values.length===1)return`Ungültige Eingabe: erwartet ${B(v.values[0])}`;return`Ungültige Option: erwartet eine von ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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: ${g[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"}: ${V(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 w2(){return{localeError:P3()}}var S3=()=>{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 n(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"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;return`Invalid input: expected ${w}, received ${D}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${B(v.values[0])}`;return`Invalid option: expected one of ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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":""}: ${V(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 Y4(){return{localeError:S3()}}var z3=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function n(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"},U={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Nevalida enigo: atendiĝis instanceof ${v.expected}, riceviĝis ${D}`;return`Nevalida enigo: atendiĝis ${w}, riceviĝis ${D}`}case"invalid_value":if(v.values.length===1)return`Nevalida enigo: atendiĝis ${B(v.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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":""}: ${V(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 _2(){return{localeError:z3()}}var M3=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function n(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"},U={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=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Entrada inválida: se esperaba instanceof ${v.expected}, recibido ${D}`;return`Entrada inválida: se esperaba ${w}, recibido ${D}`}case"invalid_value":if(v.values.length===1)return`Entrada inválida: se esperaba ${B(v.values[0])}`;return`Opción inválida: se esperaba una de ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(v.origin),D=U[v.origin]??v.origin;if(_)return`Demasiado grande: se esperaba que ${D??"valor"} tuviera ${w}${v.maximum.toString()} ${_.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${D??"valor"} fuera ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=n(v.origin),D=U[v.origin]??v.origin;if(_)return`Demasiado pequeño: se esperaba que ${D} tuviera ${w}${v.minimum.toString()} ${_.unit}`;return`Demasiado pequeño: se esperaba que ${D} 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 ${g[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":""}: ${V(v.keys,", ")}`;case"invalid_key":return`Llave inválida en ${U[v.origin]??v.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${U[v.origin]??v.origin}`;default:return"Entrada inválida"}}};function b2(){return{localeError:M3()}}var R3=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function n(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:"ورودی"},U={nan:"NaN",number:"عدد",array:"آرایه"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`ورودی نامعتبر: می‌بایست instanceof ${v.expected} می‌بود، ${D} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${w} می‌بود، ${D} دریافت شد`}case"invalid_value":if(v.values.length===1)return`ورودی نامعتبر: می‌بایست ${B(v.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${V(v.values,"|")} می‌بود`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[w.format]??v.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${v.divisor} باشد`;case"unrecognized_keys":return`کلید${v.keys.length>1?"های":""} ناشناس: ${V(v.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${v.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${v.origin}`;default:return"ورودی نامعتبر"}}};function D2(){return{localeError:R3()}}var A3=()=>{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 n(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"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Virheellinen tyyppi: odotettiin instanceof ${v.expected}, oli ${D}`;return`Virheellinen tyyppi: odotettiin ${w}, oli ${D}`}case"invalid_value":if(v.values.length===1)return`Virheellinen syöte: täytyy olla ${B(v.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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"}: ${V(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 J2(){return{localeError:A3()}}var x3=()=>{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 n(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"},U={nan:"NaN",number:"nombre",array:"tableau"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Entrée invalide : instanceof ${v.expected} attendu, ${D} reçu`;return`Entrée invalide : ${w} attendu, ${D} reçu`}case"invalid_value":if(v.values.length===1)return`Entrée invalide : ${B(v.values[0])} attendu`;return`Option invalide : une valeur parmi ${V(v.values,"|")} attendue`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[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":""} : ${V(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 X2(){return{localeError:x3()}}var f3=()=>{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 n(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"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Entrée invalide : attendu instanceof ${v.expected}, reçu ${D}`;return`Entrée invalide : attendu ${w}, reçu ${D}`}case"invalid_value":if(v.values.length===1)return`Entrée invalide : attendu ${B(v.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"≤":"<",_=n(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?"≥":">",_=n(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`${g[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":""} : ${V(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 Q2(){return{localeError:f3()}}var E3=()=>{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"}},n={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,U=(X)=>{let G=g(X);if(G)return G.label;return X??$.unknown.label},v=(X)=>`ה${U(X)}`,w=(X)=>{return(g(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},_=(X)=>{if(!X)return null;return n[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 G=X.expected,j=J[G??""]??U(G),L=N(X.input),K=J[L]??$[L]?.label??L;if(/^[A-Z]/.test(X.expected))return`קלט לא תקין: צריך להיות instanceof ${X.expected}, התקבל ${K}`;return`קלט לא תקין: צריך להיות ${j}, התקבל ${K}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${B(X.values[0])}`;let G=X.values.map((K)=>B(K));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${G[0]} או ${G[1]}`;let j=G[G.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${G.slice(0,-1).join(", ")} או ${j}`}case"too_big":{let G=_(X.origin),j=v(X.origin??"value");if(X.origin==="string")return`${G?.longLabel??"ארוך"} מדי: ${j} צריכה להכיל ${X.maximum.toString()} ${G?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){let I=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${j} צריך להיות ${I}`}if(X.origin==="array"||X.origin==="set"){let I=X.origin==="set"?"צריכה":"צריך",H=X.inclusive?`${X.maximum} ${G?.unit??""} או פחות`:`פחות מ-${X.maximum} ${G?.unit??""}`;return`גדול מדי: ${j} ${I} להכיל ${H}`.trim()}let L=X.inclusive?"<=":"<",K=w(X.origin??"value");if(G?.unit)return`${G.longLabel} מדי: ${j} ${K} ${L}${X.maximum.toString()} ${G.unit}`;return`${G?.longLabel??"גדול"} מדי: ${j} ${K} ${L}${X.maximum.toString()}`}case"too_small":{let G=_(X.origin),j=v(X.origin??"value");if(X.origin==="string")return`${G?.shortLabel??"קצר"} מדי: ${j} צריכה להכיל ${X.minimum.toString()} ${G?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){let I=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${j} צריך להיות ${I}`}if(X.origin==="array"||X.origin==="set"){let I=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){let S=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${j} ${I} להכיל ${S}`}let H=X.inclusive?`${X.minimum} ${G?.unit??""} או יותר`:`יותר מ-${X.minimum} ${G?.unit??""}`;return`קטן מדי: ${j} ${I} להכיל ${H}`.trim()}let L=X.inclusive?">=":">",K=w(X.origin??"value");if(G?.unit)return`${G.shortLabel} מדי: ${j} ${K} ${L}${X.minimum.toString()} ${G.unit}`;return`${G?.shortLabel??"קטן"} מדי: ${j} ${K} ${L}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${G.prefix}"`;if(G.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${G.suffix}"`;if(G.format==="includes")return`המחרוזת חייבת לכלול "${G.includes}"`;if(G.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${G.pattern}`;let j=D[G.format],L=j?.label??G.format,I=(j?.gender??"m")==="f"?"תקינה":"תקין";return`${L} לא ${I}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${V(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${v(X.origin??"array")}`;default:return"קלט לא תקין"}}};function G2(){return{localeError:E3()}}var C3=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function n(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"},U={nan:"NaN",number:"szám",array:"tömb"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}, a kapott érték ${D}`}case"invalid_value":if(v.values.length===1)return`Érvénytelen bemenet: a várt érték ${B(v.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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":""}: ${V(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 W2(){return{localeError:C3()}}function gX($,n,g){return Math.abs($)===1?n:g}function tn($){if(!$)return"";let n=["ա","ե","ը","ի","ո","ու","օ"],g=$[$.length-1];return $+(n.includes(g)?"ն":"ը")}var u3=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function n(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:"մուտք"},U={nan:"NaN",number:"թիվ",array:"զանգված"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${v.expected}, ստացվել է ${D}`;return`Սխալ մուտքագրում․ սպասվում էր ${w}, ստացվել է ${D}`}case"invalid_value":if(v.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${B(v.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(v.origin);if(_){let D=Number(v.maximum),J=gX(D,_.unit.one,_.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${tn(v.origin??"արժեք")} կունենա ${w}${v.maximum.toString()} ${J}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${tn(v.origin??"արժեք")} լինի ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=n(v.origin);if(_){let D=Number(v.minimum),J=gX(D,_.unit.one,_.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${tn(v.origin)} կունենա ${w}${v.minimum.toString()} ${J}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${tn(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`Սխալ ${g[w.format]??v.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${v.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${v.keys.length>1?"ներ":""}. ${V(v.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${tn(v.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${tn(v.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function Y2(){return{localeError:u3()}}var T3=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function n(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"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Input tidak valid: diharapkan instanceof ${v.expected}, diterima ${D}`;return`Input tidak valid: diharapkan ${w}, diterima ${D}`}case"invalid_value":if(v.values.length===1)return`Input tidak valid: diharapkan ${B(v.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[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":""}: ${V(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 k2(){return{localeError:T3()}}var l3=()=>{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 n(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"},U={nan:"NaN",number:"númer",array:"fylki"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}`}case"invalid_value":if(v.values.length===1)return`Rangt gildi: gert ráð fyrir ${B(v.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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"}: ${V(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 j2(){return{localeError:l3()}}var Z3=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function n(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"},U={nan:"NaN",number:"numero",array:"vettore"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Input non valido: atteso instanceof ${v.expected}, ricevuto ${D}`;return`Input non valido: atteso ${w}, ricevuto ${D}`}case"invalid_value":if(v.values.length===1)return`Input non valido: atteso ${B(v.values[0])}`;return`Opzione non valida: atteso uno tra ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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"}: ${V(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 I2(){return{localeError:Z3()}}var c3=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function n(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:"入力値"},U={nan:"NaN",number:"数値",array:"配列"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`無効な入力: instanceof ${v.expected}が期待されましたが、${D}が入力されました`;return`無効な入力: ${w}が期待されましたが、${D}が入力されました`}case"invalid_value":if(v.values.length===1)return`無効な入力: ${B(v.values[0])}が期待されました`;return`無効な選択: ${V(v.values,"、")}のいずれかである必要があります`;case"too_big":{let w=v.inclusive?"以下である":"より小さい",_=n(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?"以上である":"より大きい",_=n(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`無効な${g[w.format]??v.format}`}case"not_multiple_of":return`無効な数値: ${v.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${v.keys.length>1?"群":""}: ${V(v.keys,"、")}`;case"invalid_key":return`${v.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${v.origin}内の無効な値`;default:return"無効な入力"}}};function H2(){return{localeError:c3()}}var h3=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function n(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:"შეყვანა"},U={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${v.expected}, მიღებული ${D}`;return`არასწორი შეყვანა: მოსალოდნელი ${w}, მიღებული ${D}`}case"invalid_value":if(v.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${B(v.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${V(v.values,"|")}-დან`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`არასწორი ${g[w.format]??v.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${v.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${v.keys.length>1?"ები":"ი"}: ${V(v.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${v.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${v.origin}-ში`;default:return"არასწორი შეყვანა"}}};function V2(){return{localeError:h3()}}var m3=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function n(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:"ទិន្នន័យបញ្ចូល"},U={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${v.expected} ប៉ុន្តែទទួលបាន ${D}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${w} ប៉ុន្តែទទួលបាន ${D}`}case"invalid_value":if(v.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${B(v.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`មិនត្រឹមត្រូវ៖ ${g[w.format]??v.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${v.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${V(v.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function k4(){return{localeError:m3()}}function L2(){return k4()}var y3=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function n(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:"입력"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`잘못된 입력: 예상 타입은 instanceof ${v.expected}, 받은 타입은 ${D}입니다`;return`잘못된 입력: 예상 타입은 ${w}, 받은 타입은 ${D}입니다`}case"invalid_value":if(v.values.length===1)return`잘못된 입력: 값은 ${B(v.values[0])} 이어야 합니다`;return`잘못된 옵션: ${V(v.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let w=v.inclusive?"이하":"미만",_=w==="미만"?"이어야 합니다":"여야 합니다",D=n(v.origin),J=D?.unit??"요소";if(D)return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()}${J} ${w}${_}`;return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()} ${w}${_}`}case"too_small":{let w=v.inclusive?"이상":"초과",_=w==="이상"?"이어야 합니다":"여야 합니다",D=n(v.origin),J=D?.unit??"요소";if(D)return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()}${J} ${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`잘못된 ${g[w.format]??v.format}`}case"not_multiple_of":return`잘못된 숫자: ${v.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${V(v.keys,", ")}`;case"invalid_key":return`잘못된 키: ${v.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${v.origin}`;default:return"잘못된 입력"}}};function K2(){return{localeError:y3()}}var j4=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function UX($){let n=Math.abs($),g=n%10,U=n%100;if(U>=11&&U<=19||g===0)return"many";if(g===1)return"one";return"few"}var t3=()=>{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 n(v,w,_,D){let J=$[v]??null;if(J===null)return J;return{unit:J.unit[w],verb:J.verb[D][_?"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"},U={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=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Gautas tipas ${D}, o tikėtasi - instanceof ${v.expected}`;return`Gautas tipas ${D}, o tikėtasi - ${w}`}case"invalid_value":if(v.values.length===1)return`Privalo būti ${B(v.values[0])}`;return`Privalo būti vienas iš ${V(v.values,"|")} pasirinkimų`;case"too_big":{let w=U[v.origin]??v.origin,_=n(v.origin,UX(Number(v.maximum)),v.inclusive??!1,"smaller");if(_?.verb)return`${j4(w??v.origin??"reikšmė")} ${_.verb} ${v.maximum.toString()} ${_.unit??"elementų"}`;let D=v.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${j4(w??v.origin??"reikšmė")} turi būti ${D} ${v.maximum.toString()} ${_?.unit}`}case"too_small":{let w=U[v.origin]??v.origin,_=n(v.origin,UX(Number(v.minimum)),v.inclusive??!1,"bigger");if(_?.verb)return`${j4(w??v.origin??"reikšmė")} ${_.verb} ${v.minimum.toString()} ${_.unit??"elementų"}`;let D=v.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${j4(w??v.origin??"reikšmė")} turi būti ${D} ${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 ${g[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"}: ${V(v.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let w=U[v.origin]??v.origin;return`${j4(w??v.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function q2(){return{localeError:t3()}}var o3=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function n(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:"внес"},U={nan:"NaN",number:"број",array:"низа"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Грешен внес: се очекува instanceof ${v.expected}, примено ${D}`;return`Грешен внес: се очекува ${w}, примено ${D}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${B(v.values[0])}`;return`Грешана опција: се очекува една ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[w.format]??v.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${V(v.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${v.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${v.origin}`;default:return"Грешен внес"}}};function B2(){return{localeError:o3()}}var r3=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function n(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"},U={nan:"NaN",number:"nombor"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Input tidak sah: dijangka instanceof ${v.expected}, diterima ${D}`;return`Input tidak sah: dijangka ${w}, diterima ${D}`}case"invalid_value":if(v.values.length===1)return`Input tidak sah: dijangka ${B(v.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[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: ${V(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 O2(){return{localeError:r3()}}var d3=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function n(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"},U={nan:"NaN",number:"getal"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Ongeldige invoer: verwacht instanceof ${v.expected}, ontving ${D}`;return`Ongeldige invoer: verwacht ${w}, ontving ${D}`}case"invalid_value":if(v.values.length===1)return`Ongeldige invoer: verwacht ${B(v.values[0])}`;return`Ongeldige optie: verwacht één van ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(v.origin),D=v.origin==="date"?"laat":v.origin==="string"?"lang":"groot";if(_)return`Te ${D}: verwacht dat ${v.origin??"waarde"} ${w}${v.maximum.toString()} ${_.unit??"elementen"} ${_.verb}`;return`Te ${D}: verwacht dat ${v.origin??"waarde"} ${w}${v.maximum.toString()} is`}case"too_small":{let w=v.inclusive?">=":">",_=n(v.origin),D=v.origin==="date"?"vroeg":v.origin==="string"?"kort":"klein";if(_)return`Te ${D}: verwacht dat ${v.origin} ${w}${v.minimum.toString()} ${_.unit} ${_.verb}`;return`Te ${D}: 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: ${g[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":""}: ${V(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 F2(){return{localeError:d3()}}var p3=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function n(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"},U={nan:"NaN",number:"tall",array:"liste"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Ugyldig input: forventet instanceof ${v.expected}, fikk ${D}`;return`Ugyldig input: forventet ${w}, fikk ${D}`}case"invalid_value":if(v.values.length===1)return`Ugyldig verdi: forventet ${B(v.values[0])}`;return`Ugyldig valg: forventet en av ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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"}: ${V(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 N2(){return{localeError:p3()}}var e3=()=>{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 n(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"},U={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Fâsit giren: umulan instanceof ${v.expected}, alınan ${D}`;return`Fâsit giren: umulan ${w}, alınan ${D}`}case"invalid_value":if(v.values.length===1)return`Fâsit giren: umulan ${B(v.values[0])}`;return`Fâsit tercih: mûteberler ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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":""}: ${V(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 i2(){return{localeError:e3()}}var a3=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function n(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:"ورودي"},U={nan:"NaN",number:"عدد",array:"ارې"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`ناسم ورودي: باید instanceof ${v.expected} وای, مګر ${D} ترلاسه شو`;return`ناسم ورودي: باید ${w} وای, مګر ${D} ترلاسه شو`}case"invalid_value":if(v.values.length===1)return`ناسم ورودي: باید ${B(v.values[0])} وای`;return`ناسم انتخاب: باید یو له ${V(v.values,"|")} څخه وای`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[w.format]??v.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${v.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${v.keys.length>1?"کلیډونه":"کلیډ"}: ${V(v.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${v.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${v.origin} کې`;default:return"ناسمه ورودي"}}};function P2(){return{localeError:a3()}}var s3=()=>{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 n(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"},U={nan:"NaN",number:"liczba",array:"tablica"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}, otrzymano ${D}`}case"invalid_value":if(v.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${B(v.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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) ${g[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":""}: ${V(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 S2(){return{localeError:s3()}}var $Y=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function n(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"},U={nan:"NaN",number:"número",null:"nulo"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Tipo inválido: esperado instanceof ${v.expected}, recebido ${D}`;return`Tipo inválido: esperado ${w}, recebido ${D}`}case"invalid_value":if(v.values.length===1)return`Entrada inválida: esperado ${B(v.values[0])}`;return`Opção inválida: esperada uma das ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[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":""}: ${V(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 z2(){return{localeError:$Y()}}function wX($,n,g,U){let v=Math.abs($),w=v%10,_=v%100;if(_>=11&&_<=19)return U;if(w===1)return n;if(w>=2&&w<=4)return g;return U}var vY=()=>{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 n(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:"ввод"},U={nan:"NaN",number:"число",array:"массив"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Неверный ввод: ожидалось instanceof ${v.expected}, получено ${D}`;return`Неверный ввод: ожидалось ${w}, получено ${D}`}case"invalid_value":if(v.values.length===1)return`Неверный ввод: ожидалось ${B(v.values[0])}`;return`Неверный вариант: ожидалось одно из ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(v.origin);if(_){let D=Number(v.maximum),J=wX(D,_.unit.one,_.unit.few,_.unit.many);return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет иметь ${w}${v.maximum.toString()} ${J}`}return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет ${w}${v.maximum.toString()}`}case"too_small":{let w=v.inclusive?">=":">",_=n(v.origin);if(_){let D=Number(v.minimum),J=wX(D,_.unit.one,_.unit.few,_.unit.many);return`Слишком маленькое значение: ожидалось, что ${v.origin} будет иметь ${w}${v.minimum.toString()} ${J}`}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`Неверный ${g[w.format]??v.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспознанн${v.keys.length>1?"ые":"ый"} ключ${v.keys.length>1?"и":""}: ${V(v.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${v.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${v.origin}`;default:return"Неверные входные данные"}}};function M2(){return{localeError:vY()}}var nY=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function n(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"},U={nan:"NaN",number:"število",array:"tabela"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Neveljaven vnos: pričakovano instanceof ${v.expected}, prejeto ${D}`;return`Neveljaven vnos: pričakovano ${w}, prejeto ${D}`}case"invalid_value":if(v.values.length===1)return`Neveljaven vnos: pričakovano ${B(v.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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č"}: ${V(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 R2(){return{localeError:nY()}}var gY=()=>{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 n(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"},U={nan:"NaN",number:"antal",array:"lista"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Ogiltig inmatning: förväntat instanceof ${v.expected}, fick ${D}`;return`Ogiltig inmatning: förväntat ${w}, fick ${D}`}case"invalid_value":if(v.values.length===1)return`Ogiltig inmatning: förväntat ${B(v.values[0])}`;return`Ogiltigt val: förväntade en av ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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) ${g[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"}: ${V(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 A2(){return{localeError:gY()}}var UY=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function n(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"},U={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${v.expected}, பெறப்பட்டது ${D}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${w}, பெறப்பட்டது ${D}`}case"invalid_value":if(v.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${B(v.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${V(v.values,"|")} இல் ஒன்று`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`தவறான ${g[w.format]??v.format}`}case"not_multiple_of":return`தவறான எண்: ${v.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${v.keys.length>1?"கள்":""}: ${V(v.keys,", ")}`;case"invalid_key":return`${v.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${v.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function x2(){return{localeError:UY()}}var wY=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function n(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:"ข้อมูลที่ป้อน"},U={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${v.expected} แต่ได้รับ ${D}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${w} แต่ได้รับ ${D}`}case"invalid_value":if(v.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${B(v.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"ไม่เกิน":"น้อยกว่า",_=n(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?"อย่างน้อย":"มากกว่า",_=n(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`รูปแบบไม่ถูกต้อง: ${g[w.format]??v.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${v.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${V(v.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${v.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${v.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function f2(){return{localeError:wY()}}var _Y=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function n(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"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Geçersiz değer: beklenen instanceof ${v.expected}, alınan ${D}`;return`Geçersiz değer: beklenen ${w}, alınan ${D}`}case"invalid_value":if(v.values.length===1)return`Geçersiz değer: beklenen ${B(v.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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":""}: ${V(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 E2(){return{localeError:_Y()}}var bY=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function n(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:"вхідні дані"},U={nan:"NaN",number:"число",array:"масив"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Неправильні вхідні дані: очікується instanceof ${v.expected}, отримано ${D}`;return`Неправильні вхідні дані: очікується ${w}, отримано ${D}`}case"invalid_value":if(v.values.length===1)return`Неправильні вхідні дані: очікується ${B(v.values[0])}`;return`Неправильна опція: очікується одне з ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`Неправильний ${g[w.format]??v.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${v.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${v.keys.length>1?"і":""}: ${V(v.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${v.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${v.origin}`;default:return"Неправильні вхідні дані"}}};function I4(){return{localeError:bY()}}function C2(){return I4()}var DY=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function n(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:"ان پٹ"},U={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`غلط ان پٹ: instanceof ${v.expected} متوقع تھا، ${D} موصول ہوا`;return`غلط ان پٹ: ${w} متوقع تھا، ${D} موصول ہوا`}case"invalid_value":if(v.values.length===1)return`غلط ان پٹ: ${B(v.values[0])} متوقع تھا`;return`غلط آپشن: ${V(v.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`غلط ${g[w.format]??v.format}`}case"not_multiple_of":return`غلط نمبر: ${v.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${v.keys.length>1?"ز":""}: ${V(v.keys,"، ")}`;case"invalid_key":return`${v.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${v.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function u2(){return{localeError:DY()}}var JY=()=>{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 n(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"},U={nan:"NaN",number:"raqam",array:"massiv"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${v.expected}, qabul qilingan ${D}`;return`Noto‘g‘ri kirish: kutilgan ${w}, qabul qilingan ${D}`}case"invalid_value":if(v.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${B(v.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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 ${g[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":""}: ${V(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 T2(){return{localeError:JY()}}var XY=()=>{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 n(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"},U={nan:"NaN",number:"số",array:"mảng"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}, nhận được ${D}`}case"invalid_value":if(v.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${B(v.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`${g[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: ${V(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 l2(){return{localeError:XY()}}var QY=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function n(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:"输入"},U={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`无效输入:期望 instanceof ${v.expected},实际接收 ${D}`;return`无效输入:期望 ${w},实际接收 ${D}`}case"invalid_value":if(v.values.length===1)return`无效输入:期望 ${B(v.values[0])}`;return`无效选项:期望以下之一 ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`无效${g[w.format]??v.format}`}case"not_multiple_of":return`无效数字:必须是 ${v.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${V(v.keys,", ")}`;case"invalid_key":return`${v.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${v.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Z2(){return{localeError:QY()}}var GY=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function n(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:"輸入"},U={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;if(/^[A-Z]/.test(v.expected))return`無效的輸入值:預期為 instanceof ${v.expected},但收到 ${D}`;return`無效的輸入值:預期為 ${w},但收到 ${D}`}case"invalid_value":if(v.values.length===1)return`無效的輸入值:預期為 ${B(v.values[0])}`;return`無效的選項:預期為以下其中之一 ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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`無效的 ${g[w.format]??v.format}`}case"not_multiple_of":return`無效的數字:必須為 ${v.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${v.keys.length>1?"們":""}:${V(v.keys,"、")}`;case"invalid_key":return`${v.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${v.origin} 中有無效的值`;default:return"無效的輸入值"}}};function c2(){return{localeError:GY()}}var WY=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function n(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é"},U={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(v)=>{switch(v.code){case"invalid_type":{let w=U[v.expected]??v.expected,_=N(v.input),D=U[_]??_;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 ${w}, àmọ̀ a rí ${D}`}case"invalid_value":if(v.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${B(v.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${V(v.values,"|")}`;case"too_big":{let w=v.inclusive?"<=":"<",_=n(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?">=":">",_=n(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: ${g[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ọ̀: ${V(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 h2(){return{localeError:WY()}}var _X,H4=Symbol("ZodOutput"),V4=Symbol("ZodInput");class m2{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...n){let g=n[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 n=this._map.get($);if(n&&typeof n==="object"&&"id"in n)this._idmap.delete(n.id);return this._map.delete($),this}get($){let n=$._zod.parent;if(n){let g={...this.get(n)??{}};delete g.id;let U={...g,...this._map.get($)};return Object.keys(U).length?U:void 0}return this._map.get($)}has($){return this._map.has($)}}function on(){return new m2}(_X=globalThis).__zod_globalRegistry??(_X.__zod_globalRegistry=on());var U$=globalThis.__zod_globalRegistry;function y2($,n){return new $({type:"string",...P(n)})}function t2($,n){return new $({type:"string",coerce:!0,...P(n)})}function j1($,n){return new $({type:"string",format:"email",check:"string_format",abort:!1,...P(n)})}function L4($,n){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...P(n)})}function I1($,n){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...P(n)})}function H1($,n){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(n)})}function V1($,n){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(n)})}function L1($,n){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(n)})}function K4($,n){return new $({type:"string",format:"url",check:"string_format",abort:!1,...P(n)})}function K1($,n){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...P(n)})}function q1($,n){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(n)})}function B1($,n){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...P(n)})}function O1($,n){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(n)})}function F1($,n){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...P(n)})}function N1($,n){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...P(n)})}function i1($,n){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(n)})}function P1($,n){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(n)})}function S1($,n){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(n)})}function o2($,n){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...P(n)})}function z1($,n){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(n)})}function M1($,n){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(n)})}function R1($,n){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...P(n)})}function A1($,n){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...P(n)})}function x1($,n){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...P(n)})}function f1($,n){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...P(n)})}var q4={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function r2($,n){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(n)})}function d2($,n){return new $({type:"string",format:"date",check:"string_format",...P(n)})}function p2($,n){return new $({type:"string",format:"time",check:"string_format",precision:null,...P(n)})}function e2($,n){return new $({type:"string",format:"duration",check:"string_format",...P(n)})}function a2($,n){return new $({type:"number",checks:[],...P(n)})}function s2($,n){return new $({type:"number",coerce:!0,checks:[],...P(n)})}function $b($,n){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...P(n)})}function vb($,n){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...P(n)})}function nb($,n){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...P(n)})}function gb($,n){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...P(n)})}function Ub($,n){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...P(n)})}function wb($,n){return new $({type:"boolean",...P(n)})}function _b($,n){return new $({type:"boolean",coerce:!0,...P(n)})}function bb($,n){return new $({type:"bigint",...P(n)})}function Db($,n){return new $({type:"bigint",coerce:!0,...P(n)})}function Jb($,n){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(n)})}function Xb($,n){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(n)})}function Qb($,n){return new $({type:"symbol",...P(n)})}function Gb($,n){return new $({type:"undefined",...P(n)})}function Wb($,n){return new $({type:"null",...P(n)})}function Yb($){return new $({type:"any"})}function kb($){return new $({type:"unknown"})}function jb($,n){return new $({type:"never",...P(n)})}function Ib($,n){return new $({type:"void",...P(n)})}function Hb($,n){return new $({type:"date",...P(n)})}function Vb($,n){return new $({type:"date",coerce:!0,...P(n)})}function Lb($,n){return new $({type:"nan",...P(n)})}function O$($,n){return new U1({check:"less_than",...P(n),value:$,inclusive:!1})}function G$($,n){return new U1({check:"less_than",...P(n),value:$,inclusive:!0})}function F$($,n){return new w1({check:"greater_than",...P(n),value:$,inclusive:!1})}function b$($,n){return new w1({check:"greater_than",...P(n),value:$,inclusive:!0})}function rn($){return F$(0,$)}function dn($){return O$(0,$)}function pn($){return G$(0,$)}function en($){return b$(0,$)}function o$($,n){return new B_({check:"multiple_of",...P(n),value:$})}function r$($,n){return new N_({check:"max_size",...P(n),maximum:$})}function N$($,n){return new i_({check:"min_size",...P(n),minimum:$})}function _v($,n){return new P_({check:"size_equals",...P(n),size:$})}function bv($,n){return new S_({check:"max_length",...P(n),maximum:$})}function C$($,n){return new z_({check:"min_length",...P(n),minimum:$})}function Dv($,n){return new M_({check:"length_equals",...P(n),length:$})}function Bv($,n){return new R_({check:"string_format",format:"regex",...P(n),pattern:$})}function Ov($){return new A_({check:"string_format",format:"lowercase",...P($)})}function Fv($){return new x_({check:"string_format",format:"uppercase",...P($)})}function Nv($,n){return new f_({check:"string_format",format:"includes",...P(n),includes:$})}function iv($,n){return new E_({check:"string_format",format:"starts_with",...P(n),prefix:$})}function Pv($,n){return new C_({check:"string_format",format:"ends_with",...P(n),suffix:$})}function an($,n,g){return new u_({check:"property",property:$,schema:n,...P(g)})}function Sv($,n){return new T_({check:"mime_type",mime:$,...P(n)})}function K$($){return new l_({check:"overwrite",tx:$})}function zv($){return K$((n)=>n.normalize($))}function Mv(){return K$(($)=>$.trim())}function Rv(){return K$(($)=>$.toLowerCase())}function Av(){return K$(($)=>$.toUpperCase())}function xv(){return K$(($)=>lw($))}function Kb($,n,g){return new $({type:"array",element:n,...P(g)})}function kY($,n,g){return new $({type:"union",options:n,...P(g)})}function jY($,n,g){return new $({type:"union",options:n,inclusive:!1,...P(g)})}function IY($,n,g,U){return new $({type:"union",options:g,discriminator:n,...P(U)})}function HY($,n,g){return new $({type:"intersection",left:n,right:g})}function VY($,n,g,U){let v=g instanceof E;return new $({type:"tuple",items:n,rest:v?g:null,...P(v?U:g)})}function LY($,n,g,U){return new $({type:"record",keyType:n,valueType:g,...P(U)})}function KY($,n,g,U){return new $({type:"map",keyType:n,valueType:g,...P(U)})}function qY($,n,g){return new $({type:"set",valueType:n,...P(g)})}function BY($,n,g){let U=Array.isArray(n)?Object.fromEntries(n.map((v)=>[v,v])):n;return new $({type:"enum",entries:U,...P(g)})}function OY($,n,g){return new $({type:"enum",entries:n,...P(g)})}function FY($,n,g){return new $({type:"literal",values:Array.isArray(n)?n:[n],...P(g)})}function qb($,n){return new $({type:"file",...P(n)})}function NY($,n){return new $({type:"transform",transform:n})}function iY($,n){return new $({type:"optional",innerType:n})}function PY($,n){return new $({type:"nullable",innerType:n})}function SY($,n,g){return new $({type:"default",innerType:n,get defaultValue(){return typeof g==="function"?g():cw(g)}})}function zY($,n,g){return new $({type:"nonoptional",innerType:n,...P(g)})}function MY($,n){return new $({type:"success",innerType:n})}function RY($,n,g){return new $({type:"catch",innerType:n,catchValue:typeof g==="function"?g:()=>g})}function AY($,n,g){return new $({type:"pipe",in:n,out:g})}function xY($,n){return new $({type:"readonly",innerType:n})}function fY($,n,g){return new $({type:"template_literal",parts:n,...P(g)})}function EY($,n){return new $({type:"lazy",getter:n})}function CY($,n){return new $({type:"promise",innerType:n})}function Bb($,n,g){let U=P(g);return U.abort??(U.abort=!0),new $({type:"custom",check:"custom",fn:n,...U})}function Ob($,n,g){return new $({type:"custom",check:"custom",fn:n,...P(g)})}function Fb($){let n=bX((g)=>{return g.addIssue=(U)=>{if(typeof U==="string")g.issues.push(ln(U,g.value,n._zod.def));else{let v=U;if(v.fatal)v.continue=!1;v.code??(v.code="custom"),v.input??(v.input=g.value),v.inst??(v.inst=n),v.continue??(v.continue=!n._zod.def.abort),g.issues.push(ln(v))}},$(g.value,g)});return n}function bX($,n){let g=new e({check:"custom",...P(n)});return g._zod.check=$,g}function Nb($){let n=new e({check:"describe"});return n._zod.onattach=[(g)=>{let U=U$.get(g)??{};U$.add(g,{...U,description:$})}],n._zod.check=()=>{},n}function ib($){let n=new e({check:"meta"});return n._zod.onattach=[(g)=>{let U=U$.get(g)??{};U$.add(g,{...U,...$})}],n._zod.check=()=>{},n}function Pb($,n){let g=P(n),U=g.truthy??["true","1","yes","on","y","enabled"],v=g.falsy??["false","0","no","off","n","disabled"];if(g.case!=="sensitive")U=U.map((K)=>typeof K==="string"?K.toLowerCase():K),v=v.map((K)=>typeof K==="string"?K.toLowerCase():K);let w=new Set(U),_=new Set(v),D=$.Codec??W4,J=$.Boolean??Q4,G=new($.String??Un)({type:"string",error:g.error}),j=new J({type:"boolean",error:g.error}),L=new D({type:"pipe",in:G,out:j,transform:(K,I)=>{let H=K;if(g.case!=="sensitive")H=H.toLowerCase();if(w.has(H))return!0;else if(_.has(H))return!1;else return I.issues.push({code:"invalid_value",expected:"stringbool",values:[...w,..._],input:I.value,inst:L,continue:!1}),{}},reverseTransform:(K,I)=>{if(K===!0)return U[0]||"true";else return v[0]||"false"},error:g.error});return L}function sn($,n,g,U={}){let v=P(U),w={...P(U),check:"string_format",type:"string",format:n,fn:typeof g==="function"?g:(D)=>g.test(D),...v};if(g instanceof RegExp)w.pattern=g;return new $(w)}function fv($){let n=$?.target??"draft-2020-12";if(n==="draft-4")n="draft-04";if(n==="draft-7")n="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??U$,target:n,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function r($,n,g={path:[],schemaPath:[]}){var U;let v=$._zod.def,w=n.seen.get($);if(w){if(w.count++,g.schemaPath.includes($))w.cycle=g.path;return w.schema}let _={schema:{},count:1,cycle:void 0,path:g.path};n.seen.set($,_);let D=$._zod.toJSONSchema?.();if(D)_.schema=D;else{let G={...g,schemaPath:[...g.schemaPath,$],path:g.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(n,_.schema,G);else{let L=_.schema,K=n.processors[v.type];if(!K)throw Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);K($,n,L,G)}let j=$._zod.parent;if(j){if(!_.ref)_.ref=j;r(j,n,G),n.seen.get(j).isParent=!0}}let J=n.metadataRegistry.get($);if(J)Object.assign(_.schema,J);if(n.io==="input"&&W$($))delete _.schema.examples,delete _.schema.default;if(n.io==="input"&&_.schema._prefault)(U=_.schema).default??(U.default=_.schema._prefault);return delete _.schema._prefault,n.seen.get($).schema}function Ev($,n){let g=$.seen.get(n);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let U=new Map;for(let _ of $.seen.entries()){let D=$.metadataRegistry.get(_[0])?.id;if(D){let J=U.get(D);if(J&&J!==_[0])throw Error(`Duplicate schema id "${D}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);U.set(D,_[0])}}let v=(_)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let j=$.external.registry.get(_[0])?.id,L=$.external.uri??((I)=>I);if(j)return{ref:L(j)};let K=_[1].defId??_[1].schema.id??`schema${$.counter++}`;return _[1].defId=K,{defId:K,ref:`${L("__shared")}#/${D}/${K}`}}if(_[1]===g)return{ref:"#"};let X=`${"#"}/${D}/`,G=_[1].schema.id??`__schema${$.counter++}`;return{defId:G,ref:X+G}},w=(_)=>{if(_[1].schema.$ref)return;let D=_[1],{ref:J,defId:X}=v(_);if(D.def={...D.schema},X)D.defId=X;let G=D.schema;for(let j in G)delete G[j];G.$ref=J};if($.cycles==="throw")for(let _ of $.seen.entries()){let D=_[1];if(D.cycle)throw Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
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>
41
41
 
42
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let _ of $.seen.entries()){let D=_[1];if(n===_[0]){w(_);continue}if($.external){let X=$.external.registry.get(_[0])?.id;if(n!==_[0]&&X){w(_);continue}}if($.metadataRegistry.get(_[0])?.id){w(_);continue}if(D.cycle){w(_);continue}if(D.count>1){if($.reused==="ref"){w(_);continue}}}}function Cv($,n){let g=$.seen.get(n);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(_)=>{let D=$.seen.get(_);if(D.ref===null)return;let J=D.def??D.schema,X={...J},G=D.ref;if(D.ref=null,G){U(G);let L=$.seen.get(G),K=L.schema;if(K.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))J.allOf=J.allOf??[],J.allOf.push(K);else Object.assign(J,K);if(Object.assign(J,X),_._zod.parent===G)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(!(H in X))delete J[H]}if(K.$ref)for(let H in J){if(H==="$ref"||H==="allOf")continue;if(H in L.def&&JSON.stringify(J[H])===JSON.stringify(L.def[H]))delete J[H]}}let j=_._zod.parent;if(j&&j!==G){U(j);let L=$.seen.get(j);if(L?.schema.$ref){if(J.$ref=L.schema.$ref,L.def)for(let K in J){if(K==="$ref"||K==="allOf")continue;if(K in L.def&&JSON.stringify(J[K])===JSON.stringify(L.def[K]))delete J[K]}}}$.override({zodSchema:_,jsonSchema:J,path:D.path??[]})};for(let _ of[...$.seen.entries()].reverse())U(_[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 _=$.external.registry.get(n)?.id;if(!_)throw Error("Schema is missing an `id` property");v.$id=$.external.uri(_)}Object.assign(v,g.def??g.schema);let w=$.external?.defs??{};for(let _ of $.seen.entries()){let D=_[1];if(D.def&&D.defId)w[D.defId]=D.def}if($.external);else if(Object.keys(w).length>0)if($.target==="draft-2020-12")v.$defs=w;else v.definitions=w;try{let _=JSON.parse(JSON.stringify(v));return Object.defineProperty(_,"~standard",{value:{...n["~standard"],jsonSchema:{input:$6(n,"input",$.processors),output:$6(n,"output",$.processors)}},enumerable:!1,writable:!1}),_}catch(_){throw Error("Error converting schema to JSON.")}}function W$($,n){let g=n??{seen:new Set};if(g.seen.has($))return!1;g.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return W$(U.element,g);if(U.type==="set")return W$(U.valueType,g);if(U.type==="lazy")return W$(U.getter(),g);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return W$(U.innerType,g);if(U.type==="intersection")return W$(U.left,g)||W$(U.right,g);if(U.type==="record"||U.type==="map")return W$(U.keyType,g)||W$(U.valueType,g);if(U.type==="pipe")return W$(U.in,g)||W$(U.out,g);if(U.type==="object"){for(let v in U.shape)if(W$(U.shape[v],g))return!0;return!1}if(U.type==="union"){for(let v of U.options)if(W$(v,g))return!0;return!1}if(U.type==="tuple"){for(let v of U.items)if(W$(v,g))return!0;if(U.rest&&W$(U.rest,g))return!0;return!1}return!1}var Sb=($,n={})=>(g)=>{let U=fv({...g,processors:n});return r($,U),Ev(U,$),Cv(U,$)},$6=($,n,g={})=>(U)=>{let{libraryOptions:v,target:w}=U??{},_=fv({...v??{},target:w,io:n,processors:g});return r($,_),Ev(_,$),Cv(_,$)};var uY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zb=($,n,g,U)=>{let v=g;v.type="string";let{minimum:w,maximum:_,format:D,patterns:J,contentEncoding:X}=$._zod.bag;if(typeof w==="number")v.minLength=w;if(typeof _==="number")v.maxLength=_;if(D){if(v.format=uY[D]??D,v.format==="")delete v.format;if(D==="time")delete v.format}if(X)v.contentEncoding=X;if(J&&J.size>0){let G=[...J];if(G.length===1)v.pattern=G[0].source;else if(G.length>1)v.allOf=[...G.map((j)=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:j.source}))]}},Mb=($,n,g,U)=>{let v=g,{minimum:w,maximum:_,format:D,multipleOf:J,exclusiveMaximum:X,exclusiveMinimum:G}=$._zod.bag;if(typeof D==="string"&&D.includes("int"))v.type="integer";else v.type="number";if(typeof G==="number")if(n.target==="draft-04"||n.target==="openapi-3.0")v.minimum=G,v.exclusiveMinimum=!0;else v.exclusiveMinimum=G;if(typeof w==="number"){if(v.minimum=w,typeof G==="number"&&n.target!=="draft-04")if(G>=w)delete v.minimum;else delete v.exclusiveMinimum}if(typeof X==="number")if(n.target==="draft-04"||n.target==="openapi-3.0")v.maximum=X,v.exclusiveMaximum=!0;else v.exclusiveMaximum=X;if(typeof _==="number"){if(v.maximum=_,typeof X==="number"&&n.target!=="draft-04")if(X<=_)delete v.maximum;else delete v.exclusiveMaximum}if(typeof J==="number")v.multipleOf=J},Rb=($,n,g,U)=>{g.type="boolean"},Ab=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},xb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},fb=($,n,g,U)=>{if(n.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},Eb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Cb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},ub=($,n,g,U)=>{g.not={}},Tb=($,n,g,U)=>{},lb=($,n,g,U)=>{},Zb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},cb=($,n,g,U)=>{let v=$._zod.def,w=Cn(v.entries);if(w.every((_)=>typeof _==="number"))g.type="number";if(w.every((_)=>typeof _==="string"))g.type="string";g.enum=w},hb=($,n,g,U)=>{let v=$._zod.def,w=[];for(let _ of v.values)if(_===void 0){if(n.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof _==="bigint")if(n.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(g.type=_===null?"null":typeof _,n.target==="draft-04"||n.target==="openapi-3.0")g.enum=[_];else g.const=_}else{if(w.every((_)=>typeof _==="number"))g.type="number";if(w.every((_)=>typeof _==="string"))g.type="string";if(w.every((_)=>typeof _==="boolean"))g.type="boolean";if(w.every((_)=>_===null))g.type="null";g.enum=w}},mb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},yb=($,n,g,U)=>{let v=g,w=$._zod.pattern;if(!w)throw Error("Pattern not found in template literal");v.type="string",v.pattern=w.source},tb=($,n,g,U)=>{let v=g,w={type:"string",format:"binary",contentEncoding:"binary"},{minimum:_,maximum:D,mime:J}=$._zod.bag;if(_!==void 0)w.minLength=_;if(D!==void 0)w.maxLength=D;if(J)if(J.length===1)w.contentMediaType=J[0],Object.assign(v,w);else Object.assign(v,w),v.anyOf=J.map((X)=>({contentMediaType:X}));else Object.assign(v,w)},ob=($,n,g,U)=>{g.type="boolean"},rb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},db=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},pb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},eb=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},ab=($,n,g,U)=>{if(n.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},sb=($,n,g,U)=>{let v=g,w=$._zod.def,{minimum:_,maximum:D}=$._zod.bag;if(typeof _==="number")v.minItems=_;if(typeof D==="number")v.maxItems=D;v.type="array",v.items=r(w.element,n,{...U,path:[...U.path,"items"]})},$D=($,n,g,U)=>{let v=g,w=$._zod.def;v.type="object",v.properties={};let _=w.shape;for(let X in _)v.properties[X]=r(_[X],n,{...U,path:[...U.path,"properties",X]});let D=new Set(Object.keys(_)),J=new Set([...D].filter((X)=>{let G=w.shape[X]._zod;if(n.io==="input")return G.optin===void 0;else return G.optout===void 0}));if(J.size>0)v.required=Array.from(J);if(w.catchall?._zod.def.type==="never")v.additionalProperties=!1;else if(!w.catchall){if(n.io==="output")v.additionalProperties=!1}else if(w.catchall)v.additionalProperties=r(w.catchall,n,{...U,path:[...U.path,"additionalProperties"]})},C1=($,n,g,U)=>{let v=$._zod.def,w=v.inclusive===!1,_=v.options.map((D,J)=>r(D,n,{...U,path:[...U.path,w?"oneOf":"anyOf",J]}));if(w)g.oneOf=_;else g.anyOf=_},vD=($,n,g,U)=>{let v=$._zod.def,w=r(v.left,n,{...U,path:[...U.path,"allOf",0]}),_=r(v.right,n,{...U,path:[...U.path,"allOf",1]}),D=(X)=>("allOf"in X)&&Object.keys(X).length===1,J=[...D(w)?w.allOf:[w],...D(_)?_.allOf:[_]];g.allOf=J},nD=($,n,g,U)=>{let v=g,w=$._zod.def;v.type="array";let _=n.target==="draft-2020-12"?"prefixItems":"items",D=n.target==="draft-2020-12"?"items":n.target==="openapi-3.0"?"items":"additionalItems",J=w.items.map((L,K)=>r(L,n,{...U,path:[...U.path,_,K]})),X=w.rest?r(w.rest,n,{...U,path:[...U.path,D,...n.target==="openapi-3.0"?[w.items.length]:[]]}):null;if(n.target==="draft-2020-12"){if(v.prefixItems=J,X)v.items=X}else if(n.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:G,maximum:j}=$._zod.bag;if(typeof G==="number")v.minItems=G;if(typeof j==="number")v.maxItems=j},gD=($,n,g,U)=>{let v=g,w=$._zod.def;if(v.type="object",n.target==="draft-07"||n.target==="draft-2020-12")v.propertyNames=r(w.keyType,n,{...U,path:[...U.path,"propertyNames"]});v.additionalProperties=r(w.valueType,n,{...U,path:[...U.path,"additionalProperties"]});let _=w.keyType._zod.def;if(_.type==="enum"){let J=Cn(_.entries).filter((X)=>typeof X==="string"||typeof X==="number");if(J.length>0)v.required=J}},UD=($,n,g,U)=>{let v=$._zod.def,w=r(v.innerType,n,U),_=n.seen.get($);if(n.target==="openapi-3.0")_.ref=v.innerType,g.nullable=!0;else g.anyOf=[w,{type:"null"}]},wD=($,n,g,U)=>{let v=$._zod.def;r(v.innerType,n,U);let w=n.seen.get($);w.ref=v.innerType},_D=($,n,g,U)=>{let v=$._zod.def;r(v.innerType,n,U);let w=n.seen.get($);w.ref=v.innerType,g.default=JSON.parse(JSON.stringify(v.defaultValue))},bD=($,n,g,U)=>{let v=$._zod.def;r(v.innerType,n,U);let w=n.seen.get($);if(w.ref=v.innerType,n.io==="input")g._prefault=JSON.parse(JSON.stringify(v.defaultValue))},DD=($,n,g,U)=>{let v=$._zod.def;r(v.innerType,n,U);let w=n.seen.get($);w.ref=v.innerType;let _;try{_=v.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=_},JD=($,n,g,U)=>{let v=$._zod.def,w=n.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;r(w,n,U);let _=n.seen.get($);_.ref=w},XD=($,n,g,U)=>{let v=$._zod.def;r(v.innerType,n,U);let w=n.seen.get($);w.ref=v.innerType,g.readOnly=!0},QD=($,n,g,U)=>{let v=$._zod.def;r(v.innerType,n,U);let w=n.seen.get($);w.ref=v.innerType},u1=($,n,g,U)=>{let v=$._zod.def;r(v.innerType,n,U);let w=n.seen.get($);w.ref=v.innerType},GD=($,n,g,U)=>{let v=$._zod.innerType;r(v,n,U);let w=n.seen.get($);w.ref=v},E1={string:zb,number:Mb,boolean:Rb,bigint:Ab,symbol:xb,null:fb,undefined:Eb,void:Cb,never:ub,any:Tb,unknown:lb,date:Zb,enum:cb,literal:hb,nan:mb,template_literal:yb,file:tb,success:ob,custom:rb,function:db,transform:pb,map:eb,set:ab,array:sb,object:$D,union:C1,intersection:vD,tuple:nD,record:gD,nullable:UD,nonoptional:wD,default:_D,prefault:bD,catch:DD,pipe:JD,readonly:XD,promise:QD,optional:u1,lazy:GD};function v6($,n){if("_idmap"in $){let U=$,v=fv({...n,processors:E1}),w={};for(let J of U._idmap.entries()){let[X,G]=J;r(G,v)}let _={},D={registry:U,uri:n?.uri,defs:w};v.external=D;for(let J of U._idmap.entries()){let[X,G]=J;Ev(v,G),_[X]=Cv(v,G)}if(Object.keys(w).length>0){let J=v.target==="draft-2020-12"?"$defs":"definitions";_.__shared={[J]:w}}return{schemas:_}}let g=fv({...n,processors:E1});return r($,g),Ev(g,$),Cv(g,$)}class WD{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 n=$?.target??"draft-2020-12";if(n==="draft-4")n="draft-04";if(n==="draft-7")n="draft-07";this.ctx=fv({processors:E1,target:n,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,n={path:[],schemaPath:[]}){return r($,this.ctx,n)}emit($,n){if(n){if(n.cycles)this.ctx.cycles=n.cycles;if(n.reused)this.ctx.reused=n.reused;if(n.external)this.ctx.external=n.external}Ev(this.ctx,$);let g=Cv(this.ctx,$),{"~standard":U,...v}=g;return v}}var DX={};var B4={};z$(B4,{xor:()=>SU,xid:()=>s1,void:()=>OU,uuidv7:()=>y1,uuidv6:()=>m1,uuidv4:()=>h1,uuid:()=>c1,url:()=>t1,unknown:()=>Y$,union:()=>N6,undefined:()=>qU,ulid:()=>a1,uint64:()=>LU,uint32:()=>IU,tuple:()=>e4,transform:()=>P6,templateLiteral:()=>lU,symbol:()=>KU,superRefine:()=>Bg,success:()=>CU,stringbool:()=>rU,stringFormat:()=>XU,string:()=>h,strictObject:()=>iU,set:()=>AU,refine:()=>qg,record:()=>p$,readonly:()=>jg,promise:()=>ZU,preprocess:()=>pU,prefault:()=>Jg,pipe:()=>Jn,partialRecord:()=>zU,optional:()=>bn,object:()=>n$,number:()=>hv,nullish:()=>EU,nullable:()=>Dn,null:()=>l4,nonoptional:()=>Xg,never:()=>F6,nativeEnum:()=>xU,nanoid:()=>d1,nan:()=>uU,meta:()=>tU,map:()=>RU,mac:()=>nU,looseRecord:()=>MU,looseObject:()=>PU,literal:()=>l$,lazy:()=>Vg,ksuid:()=>$U,keyof:()=>NU,jwt:()=>JU,json:()=>dU,ipv6:()=>gU,ipv4:()=>vU,intersection:()=>d4,int64:()=>VU,int32:()=>jU,int:()=>_6,instanceof:()=>oU,httpUrl:()=>o1,hostname:()=>QU,hex:()=>GU,hash:()=>WU,guid:()=>Z1,function:()=>cU,float64:()=>kU,float32:()=>YU,file:()=>fU,exactOptional:()=>Ug,enum:()=>i6,emoji:()=>r1,email:()=>l1,e164:()=>DU,discriminatedUnion:()=>Yn,describe:()=>yU,date:()=>FU,custom:()=>mU,cuid2:()=>e1,cuid:()=>p1,codec:()=>TU,cidrv6:()=>wU,cidrv4:()=>UU,check:()=>hU,catch:()=>Wg,boolean:()=>d$,bigint:()=>HU,base64url:()=>bU,base64:()=>_U,array:()=>T$,any:()=>BU,_function:()=>cU,_default:()=>bg,_ZodString:()=>b6,ZodXor:()=>t4,ZodXID:()=>Y6,ZodVoid:()=>m4,ZodUnknown:()=>c4,ZodUnion:()=>Wn,ZodUndefined:()=>u4,ZodUUID:()=>i$,ZodURL:()=>Xn,ZodULID:()=>W6,ZodType:()=>C,ZodTuple:()=>p4,ZodTransform:()=>ng,ZodTemplateLiteral:()=>Ig,ZodSymbol:()=>C4,ZodSuccess:()=>Qg,ZodStringFormat:()=>o,ZodString:()=>lv,ZodSet:()=>s4,ZodRecord:()=>kn,ZodReadonly:()=>kg,ZodPromise:()=>Lg,ZodPrefault:()=>Dg,ZodPipe:()=>M6,ZodOptional:()=>S6,ZodObject:()=>Gn,ZodNumberFormat:()=>Jv,ZodNumber:()=>cv,ZodNullable:()=>wg,ZodNull:()=>T4,ZodNonOptional:()=>z6,ZodNever:()=>h4,ZodNanoID:()=>X6,ZodNaN:()=>Yg,ZodMap:()=>a4,ZodMAC:()=>E4,ZodLiteral:()=>$g,ZodLazy:()=>Hg,ZodKSUID:()=>k6,ZodJWT:()=>B6,ZodIntersection:()=>r4,ZodIPv6:()=>I6,ZodIPv4:()=>j6,ZodGUID:()=>_n,ZodFunction:()=>Kg,ZodFile:()=>vg,ZodExactOptional:()=>gg,ZodEnum:()=>Tv,ZodEmoji:()=>J6,ZodEmail:()=>D6,ZodE164:()=>q6,ZodDiscriminatedUnion:()=>o4,ZodDefault:()=>_g,ZodDate:()=>Qn,ZodCustomStringFormat:()=>Zv,ZodCustom:()=>jn,ZodCodec:()=>R6,ZodCatch:()=>Gg,ZodCUID2:()=>G6,ZodCUID:()=>Q6,ZodCIDRv6:()=>V6,ZodCIDRv4:()=>H6,ZodBoolean:()=>mv,ZodBigIntFormat:()=>O6,ZodBigInt:()=>yv,ZodBase64URL:()=>K6,ZodBase64:()=>L6,ZodArray:()=>y4,ZodAny:()=>Z4});var T1={};z$(T1,{uppercase:()=>Fv,trim:()=>Mv,toUpperCase:()=>Av,toLowerCase:()=>Rv,startsWith:()=>iv,slugify:()=>xv,size:()=>_v,regex:()=>Bv,property:()=>an,positive:()=>rn,overwrite:()=>K$,normalize:()=>zv,nonpositive:()=>pn,nonnegative:()=>en,negative:()=>dn,multipleOf:()=>o$,minSize:()=>N$,minLength:()=>C$,mime:()=>Sv,maxSize:()=>r$,maxLength:()=>bv,lte:()=>G$,lt:()=>O$,lowercase:()=>Ov,length:()=>Dv,includes:()=>Nv,gte:()=>b$,gt:()=>F$,endsWith:()=>Pv});var uv={};z$(uv,{time:()=>jD,duration:()=>ID,datetime:()=>YD,date:()=>kD,ZodISOTime:()=>U6,ZodISODuration:()=>w6,ZodISODateTime:()=>n6,ZodISODate:()=>g6});var n6=k("ZodISODateTime",($,n)=>{$0.init($,n),o.init($,n)});function YD($){return r2(n6,$)}var g6=k("ZodISODate",($,n)=>{v0.init($,n),o.init($,n)});function kD($){return d2(g6,$)}var U6=k("ZodISOTime",($,n)=>{n0.init($,n),o.init($,n)});function jD($){return p2(U6,$)}var w6=k("ZodISODuration",($,n)=>{g0.init($,n),o.init($,n)});function ID($){return e2(w6,$)}var JX=($,n)=>{w4.init($,n),$.name="ZodError",Object.defineProperties($,{format:{value:(g)=>nn($,g)},flatten:{value:(g)=>vn($,g)},addIssue:{value:(g)=>{$.issues.push(g),$.message=JSON.stringify($.issues,un,2)}},addIssues:{value:(g)=>{$.issues.push(...g),$.message=JSON.stringify($.issues,un,2)}},isEmpty:{get(){return $.issues.length===0}}})},HD=k("ZodError",JX),J$=k("ZodError",JX,{Parent:Error});var O4=Zn(J$),F4=cn(J$),N4=hn(J$),i4=mn(J$),P4=dg(J$),S4=pg(J$),z4=eg(J$),M4=ag(J$),R4=sg(J$),A4=$1(J$),x4=v1(J$),f4=n1(J$);var C=k("ZodType",($,n)=>{return E.init($,n),Object.assign($["~standard"],{jsonSchema:{input:$6($,"input"),output:$6($,"output")}}),$.toJSONSchema=Sb($,{}),$.def=n,$.type=n.type,Object.defineProperty($,"_def",{value:n}),$.check=(...g)=>{return $.clone(O.mergeDefs(n,{checks:[...n.checks??[],...g.map((U)=>typeof U==="function"?{_zod:{check:U,def:{check:"custom"},onattach:[]}}:U)]}),{parent:!0})},$.with=$.check,$.clone=(g,U)=>_$($,g,U),$.brand=()=>$,$.register=(g,U)=>{return g.add($,U),$},$.parse=(g,U)=>O4($,g,U,{callee:$.parse}),$.safeParse=(g,U)=>N4($,g,U),$.parseAsync=async(g,U)=>F4($,g,U,{callee:$.parseAsync}),$.safeParseAsync=async(g,U)=>i4($,g,U),$.spa=$.safeParseAsync,$.encode=(g,U)=>P4($,g,U),$.decode=(g,U)=>S4($,g,U),$.encodeAsync=async(g,U)=>z4($,g,U),$.decodeAsync=async(g,U)=>M4($,g,U),$.safeEncode=(g,U)=>R4($,g,U),$.safeDecode=(g,U)=>A4($,g,U),$.safeEncodeAsync=async(g,U)=>x4($,g,U),$.safeDecodeAsync=async(g,U)=>f4($,g,U),$.refine=(g,U)=>$.check(qg(g,U)),$.superRefine=(g)=>$.check(Bg(g)),$.overwrite=(g)=>$.check(K$(g)),$.optional=()=>bn($),$.exactOptional=()=>Ug($),$.nullable=()=>Dn($),$.nullish=()=>bn(Dn($)),$.nonoptional=(g)=>Xg($,g),$.array=()=>T$($),$.or=(g)=>N6([$,g]),$.and=(g)=>d4($,g),$.transform=(g)=>Jn($,P6(g)),$.default=(g)=>bg($,g),$.prefault=(g)=>Jg($,g),$.catch=(g)=>Wg($,g),$.pipe=(g)=>Jn($,g),$.readonly=()=>jg($),$.describe=(g)=>{let U=$.clone();return U$.add(U,{description:g}),U},Object.defineProperty($,"description",{get(){return U$.get($)?.description},configurable:!0}),$.meta=(...g)=>{if(g.length===0)return U$.get($);let U=$.clone();return U$.add(U,g[0]),U},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(g)=>g($),$}),b6=k("_ZodString",($,n)=>{Un.init($,n),C.init($,n),$._zod.processJSONSchema=(U,v,w)=>zb($,U,v,w);let g=$._zod.bag;$.format=g.format??null,$.minLength=g.minimum??null,$.maxLength=g.maximum??null,$.regex=(...U)=>$.check(Bv(...U)),$.includes=(...U)=>$.check(Nv(...U)),$.startsWith=(...U)=>$.check(iv(...U)),$.endsWith=(...U)=>$.check(Pv(...U)),$.min=(...U)=>$.check(C$(...U)),$.max=(...U)=>$.check(bv(...U)),$.length=(...U)=>$.check(Dv(...U)),$.nonempty=(...U)=>$.check(C$(1,...U)),$.lowercase=(U)=>$.check(Ov(U)),$.uppercase=(U)=>$.check(Fv(U)),$.trim=()=>$.check(Mv()),$.normalize=(...U)=>$.check(zv(...U)),$.toLowerCase=()=>$.check(Rv()),$.toUpperCase=()=>$.check(Av()),$.slugify=()=>$.check(xv())}),lv=k("ZodString",($,n)=>{Un.init($,n),b6.init($,n),$.email=(g)=>$.check(j1(D6,g)),$.url=(g)=>$.check(K4(Xn,g)),$.jwt=(g)=>$.check(f1(B6,g)),$.emoji=(g)=>$.check(K1(J6,g)),$.guid=(g)=>$.check(L4(_n,g)),$.uuid=(g)=>$.check(I1(i$,g)),$.uuidv4=(g)=>$.check(H1(i$,g)),$.uuidv6=(g)=>$.check(V1(i$,g)),$.uuidv7=(g)=>$.check(L1(i$,g)),$.nanoid=(g)=>$.check(q1(X6,g)),$.guid=(g)=>$.check(L4(_n,g)),$.cuid=(g)=>$.check(B1(Q6,g)),$.cuid2=(g)=>$.check(O1(G6,g)),$.ulid=(g)=>$.check(F1(W6,g)),$.base64=(g)=>$.check(R1(L6,g)),$.base64url=(g)=>$.check(A1(K6,g)),$.xid=(g)=>$.check(N1(Y6,g)),$.ksuid=(g)=>$.check(i1(k6,g)),$.ipv4=(g)=>$.check(P1(j6,g)),$.ipv6=(g)=>$.check(S1(I6,g)),$.cidrv4=(g)=>$.check(z1(H6,g)),$.cidrv6=(g)=>$.check(M1(V6,g)),$.e164=(g)=>$.check(x1(q6,g)),$.datetime=(g)=>$.check(YD(g)),$.date=(g)=>$.check(kD(g)),$.time=(g)=>$.check(jD(g)),$.duration=(g)=>$.check(ID(g))});function h($){return y2(lv,$)}var o=k("ZodStringFormat",($,n)=>{p.init($,n),b6.init($,n)}),D6=k("ZodEmail",($,n)=>{y_.init($,n),o.init($,n)});function l1($){return j1(D6,$)}var _n=k("ZodGUID",($,n)=>{h_.init($,n),o.init($,n)});function Z1($){return L4(_n,$)}var i$=k("ZodUUID",($,n)=>{m_.init($,n),o.init($,n)});function c1($){return I1(i$,$)}function h1($){return H1(i$,$)}function m1($){return V1(i$,$)}function y1($){return L1(i$,$)}var Xn=k("ZodURL",($,n)=>{t_.init($,n),o.init($,n)});function t1($){return K4(Xn,$)}function o1($){return K4(Xn,{protocol:/^https?$/,hostname:I$.domain,...O.normalizeParams($)})}var J6=k("ZodEmoji",($,n)=>{o_.init($,n),o.init($,n)});function r1($){return K1(J6,$)}var X6=k("ZodNanoID",($,n)=>{r_.init($,n),o.init($,n)});function d1($){return q1(X6,$)}var Q6=k("ZodCUID",($,n)=>{d_.init($,n),o.init($,n)});function p1($){return B1(Q6,$)}var G6=k("ZodCUID2",($,n)=>{p_.init($,n),o.init($,n)});function e1($){return O1(G6,$)}var W6=k("ZodULID",($,n)=>{e_.init($,n),o.init($,n)});function a1($){return F1(W6,$)}var Y6=k("ZodXID",($,n)=>{a_.init($,n),o.init($,n)});function s1($){return N1(Y6,$)}var k6=k("ZodKSUID",($,n)=>{s_.init($,n),o.init($,n)});function $U($){return i1(k6,$)}var j6=k("ZodIPv4",($,n)=>{U0.init($,n),o.init($,n)});function vU($){return P1(j6,$)}var E4=k("ZodMAC",($,n)=>{_0.init($,n),o.init($,n)});function nU($){return o2(E4,$)}var I6=k("ZodIPv6",($,n)=>{w0.init($,n),o.init($,n)});function gU($){return S1(I6,$)}var H6=k("ZodCIDRv4",($,n)=>{b0.init($,n),o.init($,n)});function UU($){return z1(H6,$)}var V6=k("ZodCIDRv6",($,n)=>{D0.init($,n),o.init($,n)});function wU($){return M1(V6,$)}var L6=k("ZodBase64",($,n)=>{X0.init($,n),o.init($,n)});function _U($){return R1(L6,$)}var K6=k("ZodBase64URL",($,n)=>{Q0.init($,n),o.init($,n)});function bU($){return A1(K6,$)}var q6=k("ZodE164",($,n)=>{G0.init($,n),o.init($,n)});function DU($){return x1(q6,$)}var B6=k("ZodJWT",($,n)=>{W0.init($,n),o.init($,n)});function JU($){return f1(B6,$)}var Zv=k("ZodCustomStringFormat",($,n)=>{Y0.init($,n),o.init($,n)});function XU($,n,g={}){return sn(Zv,$,n,g)}function QU($){return sn(Zv,"hostname",I$.hostname,$)}function GU($){return sn(Zv,"hex",I$.hex,$)}function WU($,n){let g=n?.enc??"hex",U=`${$}_${g}`,v=I$[U];if(!v)throw Error(`Unrecognized hash format: ${U}`);return sn(Zv,U,v,n)}var cv=k("ZodNumber",($,n)=>{G1.init($,n),C.init($,n),$._zod.processJSONSchema=(U,v,w)=>Mb($,U,v,w),$.gt=(U,v)=>$.check(F$(U,v)),$.gte=(U,v)=>$.check(b$(U,v)),$.min=(U,v)=>$.check(b$(U,v)),$.lt=(U,v)=>$.check(O$(U,v)),$.lte=(U,v)=>$.check(G$(U,v)),$.max=(U,v)=>$.check(G$(U,v)),$.int=(U)=>$.check(_6(U)),$.safe=(U)=>$.check(_6(U)),$.positive=(U)=>$.check(F$(0,U)),$.nonnegative=(U)=>$.check(b$(0,U)),$.negative=(U)=>$.check(O$(0,U)),$.nonpositive=(U)=>$.check(G$(0,U)),$.multipleOf=(U,v)=>$.check(o$(U,v)),$.step=(U,v)=>$.check(o$(U,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 hv($){return a2(cv,$)}var Jv=k("ZodNumberFormat",($,n)=>{k0.init($,n),cv.init($,n)});function _6($){return $b(Jv,$)}function YU($){return vb(Jv,$)}function kU($){return nb(Jv,$)}function jU($){return gb(Jv,$)}function IU($){return Ub(Jv,$)}var mv=k("ZodBoolean",($,n)=>{Q4.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>Rb($,g,U,v)});function d$($){return wb(mv,$)}var yv=k("ZodBigInt",($,n)=>{W1.init($,n),C.init($,n),$._zod.processJSONSchema=(U,v,w)=>Ab($,U,v,w),$.gte=(U,v)=>$.check(b$(U,v)),$.min=(U,v)=>$.check(b$(U,v)),$.gt=(U,v)=>$.check(F$(U,v)),$.gte=(U,v)=>$.check(b$(U,v)),$.min=(U,v)=>$.check(b$(U,v)),$.lt=(U,v)=>$.check(O$(U,v)),$.lte=(U,v)=>$.check(G$(U,v)),$.max=(U,v)=>$.check(G$(U,v)),$.positive=(U)=>$.check(F$(BigInt(0),U)),$.negative=(U)=>$.check(O$(BigInt(0),U)),$.nonpositive=(U)=>$.check(G$(BigInt(0),U)),$.nonnegative=(U)=>$.check(b$(BigInt(0),U)),$.multipleOf=(U,v)=>$.check(o$(U,v));let g=$._zod.bag;$.minValue=g.minimum??null,$.maxValue=g.maximum??null,$.format=g.format??null});function HU($){return bb(yv,$)}var O6=k("ZodBigIntFormat",($,n)=>{j0.init($,n),yv.init($,n)});function VU($){return Jb(O6,$)}function LU($){return Xb(O6,$)}var C4=k("ZodSymbol",($,n)=>{I0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>xb($,g,U,v)});function KU($){return Qb(C4,$)}var u4=k("ZodUndefined",($,n)=>{H0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>Eb($,g,U,v)});function qU($){return Gb(u4,$)}var T4=k("ZodNull",($,n)=>{V0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>fb($,g,U,v)});function l4($){return Wb(T4,$)}var Z4=k("ZodAny",($,n)=>{L0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>Tb($,g,U,v)});function BU(){return Yb(Z4)}var c4=k("ZodUnknown",($,n)=>{K0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>lb($,g,U,v)});function Y$(){return kb(c4)}var h4=k("ZodNever",($,n)=>{q0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>ub($,g,U,v)});function F6($){return jb(h4,$)}var m4=k("ZodVoid",($,n)=>{B0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>Cb($,g,U,v)});function OU($){return Ib(m4,$)}var Qn=k("ZodDate",($,n)=>{O0.init($,n),C.init($,n),$._zod.processJSONSchema=(U,v,w)=>Zb($,U,v,w),$.min=(U,v)=>$.check(b$(U,v)),$.max=(U,v)=>$.check(G$(U,v));let g=$._zod.bag;$.minDate=g.minimum?new Date(g.minimum):null,$.maxDate=g.maximum?new Date(g.maximum):null});function FU($){return Hb(Qn,$)}var y4=k("ZodArray",($,n)=>{F0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>sb($,g,U,v),$.element=n.element,$.min=(g,U)=>$.check(C$(g,U)),$.nonempty=(g)=>$.check(C$(1,g)),$.max=(g,U)=>$.check(bv(g,U)),$.length=(g,U)=>$.check(Dv(g,U)),$.unwrap=()=>$.element});function T$($,n){return Kb(y4,$,n)}function NU($){let n=$._zod.def.shape;return i6(Object.keys(n))}var Gn=k("ZodObject",($,n)=>{N0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>$D($,g,U,v),O.defineLazy($,"shape",()=>{return n.shape}),$.keyof=()=>i6(Object.keys($._zod.def.shape)),$.catchall=(g)=>$.clone({...$._zod.def,catchall:g}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Y$()}),$.loose=()=>$.clone({...$._zod.def,catchall:Y$()}),$.strict=()=>$.clone({...$._zod.def,catchall:F6()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(g)=>{return O.extend($,g)},$.safeExtend=(g)=>{return O.safeExtend($,g)},$.merge=(g)=>O.merge($,g),$.pick=(g)=>O.pick($,g),$.omit=(g)=>O.omit($,g),$.partial=(...g)=>O.partial(S6,$,g[0]),$.required=(...g)=>O.required(z6,$,g[0])});function n$($,n){let g={type:"object",shape:$??{},...O.normalizeParams(n)};return new Gn(g)}function iU($,n){return new Gn({type:"object",shape:$,catchall:F6(),...O.normalizeParams(n)})}function PU($,n){return new Gn({type:"object",shape:$,catchall:Y$(),...O.normalizeParams(n)})}var Wn=k("ZodUnion",($,n)=>{G4.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>C1($,g,U,v),$.options=n.options});function N6($,n){return new Wn({type:"union",options:$,...O.normalizeParams(n)})}var t4=k("ZodXor",($,n)=>{Wn.init($,n),i0.init($,n),$._zod.processJSONSchema=(g,U,v)=>C1($,g,U,v),$.options=n.options});function SU($,n){return new t4({type:"union",options:$,inclusive:!1,...O.normalizeParams(n)})}var o4=k("ZodDiscriminatedUnion",($,n)=>{Wn.init($,n),P0.init($,n)});function Yn($,n,g){return new o4({type:"union",options:n,discriminator:$,...O.normalizeParams(g)})}var r4=k("ZodIntersection",($,n)=>{S0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>vD($,g,U,v)});function d4($,n){return new r4({type:"intersection",left:$,right:n})}var p4=k("ZodTuple",($,n)=>{Y1.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>nD($,g,U,v),$.rest=(g)=>$.clone({...$._zod.def,rest:g})});function e4($,n,g){let U=n instanceof E,v=U?g:n;return new p4({type:"tuple",items:$,rest:U?n:null,...O.normalizeParams(v)})}var kn=k("ZodRecord",($,n)=>{z0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>gD($,g,U,v),$.keyType=n.keyType,$.valueType=n.valueType});function p$($,n,g){return new kn({type:"record",keyType:$,valueType:n,...O.normalizeParams(g)})}function zU($,n,g){let U=_$($);return U._zod.values=void 0,new kn({type:"record",keyType:U,valueType:n,...O.normalizeParams(g)})}function MU($,n,g){return new kn({type:"record",keyType:$,valueType:n,mode:"loose",...O.normalizeParams(g)})}var a4=k("ZodMap",($,n)=>{M0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>eb($,g,U,v),$.keyType=n.keyType,$.valueType=n.valueType,$.min=(...g)=>$.check(N$(...g)),$.nonempty=(g)=>$.check(N$(1,g)),$.max=(...g)=>$.check(r$(...g)),$.size=(...g)=>$.check(_v(...g))});function RU($,n,g){return new a4({type:"map",keyType:$,valueType:n,...O.normalizeParams(g)})}var s4=k("ZodSet",($,n)=>{R0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>ab($,g,U,v),$.min=(...g)=>$.check(N$(...g)),$.nonempty=(g)=>$.check(N$(1,g)),$.max=(...g)=>$.check(r$(...g)),$.size=(...g)=>$.check(_v(...g))});function AU($,n){return new s4({type:"set",valueType:$,...O.normalizeParams(n)})}var Tv=k("ZodEnum",($,n)=>{A0.init($,n),C.init($,n),$._zod.processJSONSchema=(U,v,w)=>cb($,U,v,w),$.enum=n.entries,$.options=Object.values(n.entries);let g=new Set(Object.keys(n.entries));$.extract=(U,v)=>{let w={};for(let _ of U)if(g.has(_))w[_]=n.entries[_];else throw Error(`Key ${_} not found in enum`);return new Tv({...n,checks:[],...O.normalizeParams(v),entries:w})},$.exclude=(U,v)=>{let w={...n.entries};for(let _ of U)if(g.has(_))delete w[_];else throw Error(`Key ${_} not found in enum`);return new Tv({...n,checks:[],...O.normalizeParams(v),entries:w})}});function i6($,n){let g=Array.isArray($)?Object.fromEntries($.map((U)=>[U,U])):$;return new Tv({type:"enum",entries:g,...O.normalizeParams(n)})}function xU($,n){return new Tv({type:"enum",entries:$,...O.normalizeParams(n)})}var $g=k("ZodLiteral",($,n)=>{x0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>hb($,g,U,v),$.values=new Set(n.values),Object.defineProperty($,"value",{get(){if(n.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function l$($,n){return new $g({type:"literal",values:Array.isArray($)?$:[$],...O.normalizeParams(n)})}var vg=k("ZodFile",($,n)=>{f0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>tb($,g,U,v),$.min=(g,U)=>$.check(N$(g,U)),$.max=(g,U)=>$.check(r$(g,U)),$.mime=(g,U)=>$.check(Sv(Array.isArray(g)?g:[g],U))});function fU($){return qb(vg,$)}var ng=k("ZodTransform",($,n)=>{E0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>pb($,g,U,v),$._zod.parse=(g,U)=>{if(U.direction==="backward")throw new sv($.constructor.name);g.addIssue=(w)=>{if(typeof w==="string")g.issues.push(O.issue(w,g.value,n));else{let _=w;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=g.value),_.inst??(_.inst=$),g.issues.push(O.issue(_))}};let v=n.transform(g.value,g);if(v instanceof Promise)return v.then((w)=>{return g.value=w,g});return g.value=v,g}});function P6($){return new ng({type:"transform",transform:$})}var S6=k("ZodOptional",($,n)=>{k1.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>u1($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function bn($){return new S6({type:"optional",innerType:$})}var gg=k("ZodExactOptional",($,n)=>{C0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>u1($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function Ug($){return new gg({type:"optional",innerType:$})}var wg=k("ZodNullable",($,n)=>{u0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>UD($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function Dn($){return new wg({type:"nullable",innerType:$})}function EU($){return bn(Dn($))}var _g=k("ZodDefault",($,n)=>{T0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>_D($,g,U,v),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function bg($,n){return new _g({type:"default",innerType:$,get defaultValue(){return typeof n==="function"?n():O.shallowClone(n)}})}var Dg=k("ZodPrefault",($,n)=>{l0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>bD($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function Jg($,n){return new Dg({type:"prefault",innerType:$,get defaultValue(){return typeof n==="function"?n():O.shallowClone(n)}})}var z6=k("ZodNonOptional",($,n)=>{Z0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>wD($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function Xg($,n){return new z6({type:"nonoptional",innerType:$,...O.normalizeParams(n)})}var Qg=k("ZodSuccess",($,n)=>{c0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>ob($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function CU($){return new Qg({type:"success",innerType:$})}var Gg=k("ZodCatch",($,n)=>{h0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>DD($,g,U,v),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function Wg($,n){return new Gg({type:"catch",innerType:$,catchValue:typeof n==="function"?n:()=>n})}var Yg=k("ZodNaN",($,n)=>{m0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>mb($,g,U,v)});function uU($){return Lb(Yg,$)}var M6=k("ZodPipe",($,n)=>{y0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>JD($,g,U,v),$.in=n.in,$.out=n.out});function Jn($,n){return new M6({type:"pipe",in:$,out:n})}var R6=k("ZodCodec",($,n)=>{M6.init($,n),W4.init($,n)});function TU($,n,g){return new R6({type:"pipe",in:$,out:n,transform:g.decode,reverseTransform:g.encode})}var kg=k("ZodReadonly",($,n)=>{t0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>XD($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function jg($){return new kg({type:"readonly",innerType:$})}var Ig=k("ZodTemplateLiteral",($,n)=>{o0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>yb($,g,U,v)});function lU($,n){return new Ig({type:"template_literal",parts:$,...O.normalizeParams(n)})}var Hg=k("ZodLazy",($,n)=>{p0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>GD($,g,U,v),$.unwrap=()=>$._zod.def.getter()});function Vg($){return new Hg({type:"lazy",getter:$})}var Lg=k("ZodPromise",($,n)=>{d0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>QD($,g,U,v),$.unwrap=()=>$._zod.def.innerType});function ZU($){return new Lg({type:"promise",innerType:$})}var Kg=k("ZodFunction",($,n)=>{r0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>db($,g,U,v)});function cU($){return new Kg({type:"function",input:Array.isArray($?.input)?e4($?.input):$?.input??T$(Y$()),output:$?.output??Y$()})}var jn=k("ZodCustom",($,n)=>{e0.init($,n),C.init($,n),$._zod.processJSONSchema=(g,U,v)=>rb($,g,U,v)});function hU($){let n=new e({check:"custom"});return n._zod.check=$,n}function mU($,n){return Bb(jn,$??(()=>!0),n)}function qg($,n={}){return Ob(jn,$,n)}function Bg($){return Fb($)}var yU=Nb,tU=ib;function oU($,n={}){let g=new jn({type:"custom",check:"custom",fn:(U)=>U instanceof $,abort:!0,...O.normalizeParams(n)});return g._zod.bag.Class=$,g._zod.check=(U)=>{if(!(U.value instanceof $))U.issues.push({code:"invalid_type",expected:$.name,input:U.value,inst:g,path:[...g._zod.def.path??[]]})},g}var rU=(...$)=>Pb({Codec:R6,Boolean:mv,String:lv},...$);function dU($){let n=Vg(()=>{return N6([h($),hv(),d$(),l4(),T$(n),p$(h(),n)])});return n}function pU($,n){return Jn(P6($),n)}var Xv={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 VD($){v$({customError:$})}function LD(){return v$().customError}var Og;(function($){})(Og||(Og={}));var M={...B4,...T1,iso:uv},ZY=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 cY($,n){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 n??"draft-2020-12"}function hY($,n){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 n.rootSchema;let U=n.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===U){let v=g[1];if(!v||!n.defs[v])throw Error(`Reference not found: ${$}`);return n.defs[v]}throw Error(`Reference not found: ${$}`)}function XX($,n){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return M.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(n.refs.has(v))return n.refs.get(v);if(n.processing.has(v))return M.lazy(()=>{if(!n.refs.has(v))throw Error(`Circular reference not resolved: ${v}`);return n.refs.get(v)});n.processing.add(v);let w=hY(v,n),_=X$(w,n);return n.refs.set(v,_),n.processing.delete(v),_}if($.enum!==void 0){let v=$.enum;if(n.version==="openapi-3.0"&&$.nullable===!0&&v.length===1&&v[0]===null)return M.null();if(v.length===0)return M.never();if(v.length===1)return M.literal(v[0]);if(v.every((_)=>typeof _==="string"))return M.enum(v);let w=v.map((_)=>M.literal(_));if(w.length<2)return w[0];return M.union([w[0],w[1],...w.slice(2)])}if($.const!==void 0)return M.literal($.const);let g=$.type;if(Array.isArray(g)){let v=g.map((w)=>{let _={...$,type:w};return XX(_,n)});if(v.length===0)return M.never();if(v.length===1)return v[0];return M.union(v)}if(!g)return M.any();let U;switch(g){case"string":{let v=M.string();if($.format){let w=$.format;if(w==="email")v=v.check(M.email());else if(w==="uri"||w==="uri-reference")v=v.check(M.url());else if(w==="uuid"||w==="guid")v=v.check(M.uuid());else if(w==="date-time")v=v.check(M.iso.datetime());else if(w==="date")v=v.check(M.iso.date());else if(w==="time")v=v.check(M.iso.time());else if(w==="duration")v=v.check(M.iso.duration());else if(w==="ipv4")v=v.check(M.ipv4());else if(w==="ipv6")v=v.check(M.ipv6());else if(w==="mac")v=v.check(M.mac());else if(w==="cidr")v=v.check(M.cidrv4());else if(w==="cidr-v6")v=v.check(M.cidrv6());else if(w==="base64")v=v.check(M.base64());else if(w==="base64url")v=v.check(M.base64url());else if(w==="e164")v=v.check(M.e164());else if(w==="jwt")v=v.check(M.jwt());else if(w==="emoji")v=v.check(M.emoji());else if(w==="nanoid")v=v.check(M.nanoid());else if(w==="cuid")v=v.check(M.cuid());else if(w==="cuid2")v=v.check(M.cuid2());else if(w==="ulid")v=v.check(M.ulid());else if(w==="xid")v=v.check(M.xid());else if(w==="ksuid")v=v.check(M.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));U=v;break}case"number":case"integer":{let v=g==="integer"?M.number().int():M.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);U=v;break}case"boolean":{U=M.boolean();break}case"null":{U=M.null();break}case"object":{let v={},w=$.properties||{},_=new Set($.required||[]);for(let[J,X]of Object.entries(w)){let G=X$(X,n);v[J]=_.has(J)?G:G.optional()}if($.propertyNames){let J=X$($.propertyNames,n),X=$.additionalProperties&&typeof $.additionalProperties==="object"?X$($.additionalProperties,n):M.any();if(Object.keys(v).length===0){U=M.record(J,X);break}let G=M.object(v).passthrough(),j=M.looseRecord(J,X);U=M.intersection(G,j);break}if($.patternProperties){let J=$.patternProperties,X=Object.keys(J),G=[];for(let L of X){let K=X$(J[L],n),I=M.string().regex(new RegExp(L));G.push(M.looseRecord(I,K))}let j=[];if(Object.keys(v).length>0)j.push(M.object(v).passthrough());if(j.push(...G),j.length===0)U=M.object({}).passthrough();else if(j.length===1)U=j[0];else{let L=M.intersection(j[0],j[1]);for(let K=2;K<j.length;K++)L=M.intersection(L,j[K]);U=L}break}let D=M.object(v);if($.additionalProperties===!1)U=D.strict();else if(typeof $.additionalProperties==="object")U=D.catchall(X$($.additionalProperties,n));else U=D.passthrough();break}case"array":{let{prefixItems:v,items:w}=$;if(v&&Array.isArray(v)){let _=v.map((J)=>X$(J,n)),D=w&&typeof w==="object"&&!Array.isArray(w)?X$(w,n):void 0;if(D)U=M.tuple(_).rest(D);else U=M.tuple(_);if(typeof $.minItems==="number")U=U.check(M.minLength($.minItems));if(typeof $.maxItems==="number")U=U.check(M.maxLength($.maxItems))}else if(Array.isArray(w)){let _=w.map((J)=>X$(J,n)),D=$.additionalItems&&typeof $.additionalItems==="object"?X$($.additionalItems,n):void 0;if(D)U=M.tuple(_).rest(D);else U=M.tuple(_);if(typeof $.minItems==="number")U=U.check(M.minLength($.minItems));if(typeof $.maxItems==="number")U=U.check(M.maxLength($.maxItems))}else if(w!==void 0){let _=X$(w,n),D=M.array(_);if(typeof $.minItems==="number")D=D.min($.minItems);if(typeof $.maxItems==="number")D=D.max($.maxItems);U=D}else U=M.array(M.any());break}default:throw Error(`Unsupported type: ${g}`)}if($.description)U=U.describe($.description);if($.default!==void 0)U=U.default($.default);return U}function X$($,n){if(typeof $==="boolean")return $?M.any():M.never();let g=XX($,n),U=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let D=$.anyOf.map((X)=>X$(X,n)),J=M.union(D);g=U?M.intersection(g,J):J}if($.oneOf&&Array.isArray($.oneOf)){let D=$.oneOf.map((X)=>X$(X,n)),J=M.xor(D);g=U?M.intersection(g,J):J}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)g=U?g:M.any();else{let D=U?g:X$($.allOf[0],n),J=U?0:1;for(let X=J;X<$.allOf.length;X++)D=M.intersection(D,X$($.allOf[X],n));g=D}if($.nullable===!0&&n.version==="openapi-3.0")g=M.nullable(g);if($.readOnly===!0)g=M.readonly(g);let v={},w=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let D of w)if(D in $)v[D]=$[D];let _=["contentEncoding","contentMediaType","contentSchema"];for(let D of _)if(D in $)v[D]=$[D];for(let D of Object.keys($))if(!ZY.has(D))v[D]=$[D];if(Object.keys(v).length>0)n.registry.add(g,v);return g}function eU($,n){if(typeof $==="boolean")return $?M.any():M.never();let g=cY($,n?.defaultTarget),U=$.$defs||$.definitions||{},v={version:g,defs:U,refs:new Map,processing:new Set,rootSchema:$,registry:n?.registry??U$};return X$($,v)}var In={};z$(In,{string:()=>mY,number:()=>yY,date:()=>rY,boolean:()=>tY,bigint:()=>oY});function mY($){return t2(lv,$)}function yY($){return s2(cv,$)}function tY($){return _b(mv,$)}function oY($){return Db(yv,$)}function rY($){return Vb(Qn,$)}v$(Y4());var dY=A6;var QX=A6??KD;if(typeof QX.object!=="function")throw Error("Failed to resolve Zod namespace");var l=QX;Cw(b);var kX=n$({}).passthrough().openapi({description:"Structured context for the error (varies by error code)"}),qD=n$({code:h().openapi({description:"Machine-stable error code from the error catalog",example:"session_not_found"}),message:h().openapi({description:"Human-readable error description",example:"The requested session does not exist."}),retryable:d$().openapi({description:"Whether clients SHOULD retry this request",example:!1}),details:kX.optional(),fix_hint:h().optional().openapi({description:"Actionable guidance for humans to resolve the error",example:"Verify the session ID is correct."})}).openapi("ErrorObject"),aU=n$({code:h().openapi({description:"Machine-stable warning code",example:"partial_data"}),message:h().openapi({description:"Human-readable warning description",example:"Some optional fields were unavailable."}),details:kX.optional()}).openapi("ErrorWarning"),yV=n$({error:qD,trace_id:h().optional().openapi({description:"Distributed tracing correlation ID",example:"trace_abc123"}),request_id:h().openapi({description:"Unique request identifier",example:"req_xyz789"}),warnings:T$(aU).optional().openapi({description:"Non-fatal warnings returned alongside the error"})}).openapi("ErrorResponse"),Qv=h().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"}),Z$=h().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=h().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"}),pY=n$({source_type:l$("git"),repo_id:Qv,git_sha:Z$,file_path:d}).openapi("GitContentRef"),eY=n$({source_type:l$("upload"),project_id:h().openapi({description:"Project identifier",example:"proj_docs"}),upload_batch_id:h().openapi({description:"Upload batch identifier",example:"upload_20260208"}),file_path:d.openapi({description:"Path to file in upload batch",example:"spec.md"})}).openapi("UploadContentRef"),Hn=Yn("source_type",[pY,eY]).openapi("ContentRef"),aY=n$({type:l$("session")}).openapi("SessionAnchor"),sY=n$({type:l$("review")}).openapi("ReviewAnchor"),sU=h().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"}),$5=n$({type:l$("block"),block_id:sU}).openapi("BlockAnchor"),v5=n$({type:l$("range"),block_id:sU,start_offset:hv().int().min(0).openapi({description:"Start byte offset within the block"}),end_offset:hv().int().min(0).openapi({description:"End byte offset within the block"})}).openapi("RangeAnchor"),Gv=Yn("type",[aY,sY,$5,v5]).openapi("Anchor"),tV=h().optional().openapi({description:"Client-generated idempotency key for safe retries",example:"scope:install_abc:op_123"}),jX=n$({limit:In.number().int().min(1).max(100).default(50).optional(),cursor:h().optional()}),oV=n$({next_cursor:h().nullable(),has_more:d$()}),GX=20,WX=64,YX=256,n5=/^[a-zA-Z][a-zA-Z0-9_-]*$/,Wv=p$(h(),Y$()).superRefine(($,n)=>{let g=Object.keys($);if(g.length>GX){n.addIssue({code:Xv.custom,message:`Too many keys: ${g.length} exceeds maximum of ${GX}`});return}for(let U of g){if(U.length<1||U.length>WX){n.addIssue({code:Xv.custom,message:`Key "${U}" length ${U.length} is outside range 1-${WX}`,path:[U]});continue}if(!n5.test(U))n.addIssue({code:Xv.custom,message:`Key "${U}" must start with a letter and contain only letters, digits, underscores, and hyphens`,path:[U]});let v=$[U];if(typeof v!=="string"){n.addIssue({code:Xv.custom,message:`Value for key "${U}" must be a string, got ${typeof v}`,path:[U]});continue}if(v.length>YX)n.addIssue({code:Xv.custom,message:`Value for key "${U}" length ${v.length} exceeds maximum of ${YX}`,path:[U]})}}).openapi("FlatJsonbMap"),rV=Wv.optional().default({});var g5=n$({code:h(),message:h(),retryable:d$(),details:p$(h(),Y$()).optional(),fix_hint:h().optional()}),pV=n$({error:g5,trace_id:h().optional(),request_id:h()}),U5=n$({code:h(),message:h().optional(),details:p$(h(),Y$()).optional()}),eV=n$({data:Y$().optional(),warnings:T$(U5).optional(),request_id:h()}),x6={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 IX($){return[x6.IDEMPOTENCY_KEY_IN_FLIGHT,x6.RATE_LIMITED,x6.DB_ERROR,x6.SOURCE_UNAVAILABLE,x6.SOURCE_TIMEOUT,x6.SERVICE_UNAVAILABLE].includes($)}var LX=b.object({idempotency:b.enum(["always","keyed","none"]).optional(),retry_classification:b.enum(["safe","transient","manual"]).optional()}).openapi("AgentSurfaceRetrySemantics"),w5=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"),_5=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"),b5=b.object({ok:b.literal(!0),request_id:b.string(),result:b.unknown(),warnings:b.array(aU).optional(),pagination:w5.optional(),advisory:_5.optional(),retry:LX.optional()}).openapi("AgentSurfaceSuccessEnvelope"),D5=b.object({ok:b.literal(!1),error:qD,request_id:b.string(),warnings:b.array(aU).optional(),retry:LX.optional()}).openapi("AgentSurfaceErrorEnvelope");function e$($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function Yv($,n){let g=$[n];return typeof g==="string"&&g.trim().length>0?g:void 0}function KX($,n){let g=$[n];return typeof g==="boolean"?g:void 0}function BD($,n){let g=$[n];if(typeof g!=="number"||!Number.isInteger(g)||g<0)return;return g}function qX($){if(!Array.isArray($))return[];return $.flatMap((n)=>{if(typeof n==="string"&&n.trim().length>0)return[{code:"warning",message:n}];let g=e$(n);if(!g)return[];let U=Yv(g,"message");if(!U)return[];let v=Yv(g,"code")??"warning",w=e$(g.details)??void 0;return[{code:v,message:U,...w?{details:w}:{}}]})}function HX($){let n=e$($);if(!n)return;let g={},U=n.next_cursor;if(typeof U==="string"||U===null)g.next_cursor=U;let v=KX(n,"has_more");if(v!==void 0)g.has_more=v;let w=BD(n,"total");if(w!==void 0)g.total=w;let _=BD(n,"limit");if(_!==void 0&&_>0)g.limit=_;let D=BD(n,"offset");if(D!==void 0)g.offset=D;return Object.keys(g).length>0?g:void 0}function VX($){let n=e$($);if(!n)return;let g=e$(n.advisory_artifact)??e$(n.advisory)??n,U=Yv(g,"artifact_kind"),v=KX(g,"non_authoritative"),w=Yv(g,"status"),_=e$(g.target),D=e$(g.provenance);if(U===void 0&&v===void 0&&_===null&&D===null)return;let J={};if(U!==void 0)J.artifact_kind=U;if(v!==void 0)J.non_authoritative=v;if(w!==void 0)J.status=w;if(_){let X=Yv(_,"target_type"),G=Yv(_,"target_id");if(X!==void 0)J.target_type=X;if(G!==void 0)J.target_id=G}if(D){let X={},G=Yv(D,"source_type"),j=Yv(D,"source_label"),L=Yv(D,"source_model");if(G!==void 0)X.source_type=G;if(j!==void 0)X.source_label=j;if(L!==void 0)X.source_model=L;if(Object.keys(X).length>0)J.provenance=X}return J}function BX($){if($.operation==="read")return"always";return $.hasIdempotencyKey?"keyed":"none"}function J5($){if(typeof $.retryable==="boolean")return $.retryable;if(typeof $.errorCode==="string"&&IX($.errorCode))return!0;if($.statusCode===0||$.statusCode===429)return!0;return typeof $.statusCode==="number"&&$.statusCode>=500}function c$($){let n=BX($);return{idempotency:n,retry_classification:n==="none"?"manual":"safe"}}function OX($){let n=BX($);if(!J5($))return{idempotency:n,retry_classification:"manual"};return{idempotency:n,retry_classification:n==="none"?"transient":"safe"}}function FX($,n,g){let U=qX(e$($)?.warnings),v={ok:!0,request_id:n,result:$,...U.length>0?{warnings:U}:{},...HX($)?{pagination:HX($)}:{},...VX($)?{advisory:VX($)}:{},...g?.retry?{retry:g.retry}:{}};return b5.parse(v),v}function NX($){let n=e$($.error.details)??void 0,g=qX($.warnings),U={ok:!1,request_id:$.requestId,error:{code:$.error.code,message:$.error.message,retryable:$.error.retryable,request_id:$.requestId,...n?{details:n}:{},...$.error.fix_hint?{fix_hint:$.error.fix_hint}:{}},...g.length>0?{warnings:g}:{},...$.retry?{retry:$.retry}:{}};return D5.parse(U),U}var $w=b.enum(["content","rules"]).openapi("ReviewRole"),vw=b.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi("ReviewState"),iX=b.enum(["draft","published","deprecated"]).openapi("ReviewPublicationStatus"),X5=b.enum(["git","upload"]).openapi("ReviewSourceType"),Q5=b.enum(["reviewer","approver","observer","owner"]).openapi("ReviewParticipantRole"),G5=b.enum(["read","comment","approve","admin"]).openapi("ReviewParticipantScope"),W5=b.object({email:b.string().email(),name:b.string().max(256).optional(),role:Q5,scopes:b.array(G5).min(1)}).openapi("ReviewParticipantInput"),gL=b.object({repo_id:Qv.optional(),git_sha:Z$.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:$w.default("content"),applicability:Wv.optional(),properties:Wv.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(W5).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)=>{if($.role!=="rules"&&$.applicability!==void 0&&Object.keys($.applicability).length>0)n.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))n.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"),Y5=b.object({review_id:b.string(),role:$w,state:vw,publication_status:iX.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"),UL=b.object({review_id:b.string(),role:$w,state:vw,publication_status:iX.nullable().optional(),source_type:X5,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(),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"),wL=b.object({role:$w.optional(),state:vw.optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(25)}).openapi("ListReviewsQuery"),_L=b.object({reviews:b.array(Y5),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListReviewsResponse"),bL=b.object({state:vw}).openapi("PatchReviewRequest"),DL=b.object({git_sha:b.string().optional(),file_path:b.string().optional(),title:b.string().max(512).optional(),applicability:Wv.optional(),properties:Wv.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 PX=b.enum(["suggestion","needs_changes","blocking"]).openapi({description:"Thread severity level"}),SX=b.enum(["inline","append","hero"]).openapi("CommentAttachmentPlacement"),zX=b.enum(["before","after"]).openapi("CommentAttachmentAnchorPosition"),k5=b.object({mime_type:b.string().min(1),width:b.number().int().nullable(),height:b.number().int().nullable(),blurhash:b.string().nullable()}).openapi("CommentAttachmentAsset"),OD=b.object({asset_id:b.string().min(1),sort_order:b.number().int().nonnegative(),placement:SX,alt_text:b.string().max(500).nullable().optional(),caption:b.string().max(2000).nullable().optional(),anchor_block_id:b.string().nullable().optional(),anchor_position:zX.nullable().optional(),spatial_x:b.number().min(0).max(100).nullable().optional(),spatial_y:b.number().min(0).max(100).nullable().optional()}).openapi("CommentAttachmentRequest"),nw=b.object({asset_id:b.string().min(1),sort_order:b.number().int().nonnegative(),placement:SX,alt_text:b.string().nullable(),caption:b.string().nullable(),anchor_block_id:b.string().nullable(),anchor_position:zX.nullable(),spatial_x:b.number().nullable(),spatial_y:b.number().nullable(),asset:k5}).openapi("CommentAttachmentResponse"),MX=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"),QL=b.object({anchor:Gv.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:PX.optional().default("suggestion")}).openapi("CreateThreadRequest"),RX=b.object({id:b.string().openapi({description:"Unique thread identifier",example:"thr_abc123"}),session_id:b.string(),anchor:Gv,status:b.enum(["open","resolved"]).openapi({description:"Thread status"}),severity:PX,created_at:b.string().datetime(),updated_at:b.string().datetime(),comment_count:b.number().int().min(1),comments:b.array(MX).optional().openapi({description:"Comments in this thread (included on creation)"})}).openapi("Thread"),GL=RX.openapi("CreateThreadResponse"),WL=b.object({body_md:b.string().min(1).max(65536).openapi({description:"Comment body in Markdown (UTF-8, max 64KB)"})}).openapi("CreateCommentRequest"),YL=MX.openapi("CreateCommentResponse"),kL=b.object({status:b.enum(["open","resolved"])}).openapi("UpdateThreadStatusRequest"),jL=RX.openapi("UpdateThreadStatusResponse"),IL=b.object({session_id:b.string(),thread_id:b.string()}),HL=b.object({session_id:b.string(),thread_id:b.string(),comment_id:b.string()});var Fg=b.enum(["open","resolved","withdrawn","wont_fix"]).openapi("FindingStatus"),f6=b.enum(["suggestion","needs_changes","blocking"]).openapi("FindingSeverity"),j5=["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],FD=b.enum(j5).openapi("FindingDecisionState"),qL=b.object({anchor:Gv,body_md:b.string().min(1).max(65536),severity:f6.optional(),attachments:b.array(OD).max(50).optional(),idempotency_key:b.string().max(256).optional(),source_review_id:b.string().optional(),source_finding_id:b.string().optional()}).openapi("CreateFindingRequest"),BL=b.object({finding_id:b.string(),comment_id:b.string(),attachments:b.array(nw),request_id:b.string()}).openapi("CreateFindingResponse"),OL=b.object({status:Fg.optional(),severity:f6.optional(),block_id:b.string().optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(50)}).openapi("ListFindingsQuery"),I5=b.object({finding_id:b.string(),status:Fg,severity:f6.nullable(),anchor:Gv,comment_count:b.number().int().nonnegative(),body_preview:b.string().nullable().optional(),created_at:b.string().datetime(),updated_at:b.string().datetime()}).openapi("FindingSummary"),FL=b.object({findings:b.array(I5),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListFindingsResponse"),H5=b.object({comment_id:b.string(),body_md:b.string(),author_name:b.string().nullable(),author_email:b.string().nullable(),attachments:b.array(nw),created_at:b.string().datetime()}).openapi("FindingComment"),V5=b.object({block_id:b.string(),block_key:b.string().nullable(),block_type:b.string(),properties:b.record(b.string(),b.unknown())}).openapi("FindingBlockContext"),L5=b.object({outcome:FD,decided_at:b.string().datetime(),decided_by:b.string().nullable()}).openapi("FindingDecision"),NL=b.object({finding_id:b.string(),review_id:b.string(),status:Fg,severity:f6.nullable(),anchor:Gv,block_context:V5.nullable(),comments:b.array(H5),decision:L5.nullable(),created_at:b.string().datetime(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("FindingDetailResponse"),iL=b.object({status:Fg.optional(),severity:f6.optional(),expected_version:b.number().int().positive().optional()}).openapi("PatchFindingRequest"),PL=b.object({finding_id:b.string(),review_id:b.string(),status:Fg,severity:f6.nullable(),version:b.number().int().positive(),updated_at:b.string().datetime(),request_id:b.string()}).openapi("PatchFindingResponse"),SL=b.object({body_md:b.string().min(1).max(65536),attachments:b.array(OD).max(50).optional(),idempotency_key:b.string().max(256).optional()}).openapi("CreateFindingCommentRequest"),zL=b.object({comment_id:b.string(),attachments:b.array(nw),request_id:b.string()}).openapi("CreateFindingCommentResponse"),ML=b.object({state:FD,rationale_md:b.string().min(1).max(65536).optional(),expected_version:b.number().int().positive().optional()}).openapi("CreateFindingDecisionRequest"),RL=b.object({decision_id:b.string(),finding_id:b.string(),state:FD,request_id:b.string()}).openapi("CreateFindingDecisionResponse"),AL=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"),xL=b.object({evidence_id:b.string(),finding_id:b.string(),type:b.string(),request_id:b.string()}).openapi("CreateFindingEvidenceResponse");var K5=[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 a$($,n){return $>>>n|$<<32-n}function xX($){let n=new TextEncoder().encode($),g=n.length+9+63>>6<<6>>>0,U=new Uint8Array(g);U.set(n),U[n.length]=128;let v=n.length*8,w=new DataView(U.buffer);w.setUint32(g-8,Math.floor(v/4294967296),!1),w.setUint32(g-4,v>>>0,!1);let _=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],D=new Uint32Array(64);for(let J=0;J<g;J+=64){for(let i=0;i<16;i++)D[i]=w.getUint32(J+i*4,!1);for(let i=16;i<64;i++){let c=a$(D[i-15],7)^a$(D[i-15],18)^D[i-15]>>>3,m=a$(D[i-2],17)^a$(D[i-2],19)^D[i-2]>>>10;D[i]=(D[i-16]+c|0)+(D[i-7]+m|0)>>>0}let[X,G,j,L,K,I,H,S]=_;for(let i=0;i<64;i++){let c=a$(K,6)^a$(K,11)^a$(K,25),m=K&I^~K&H,a=S+c+m+K5[i]+D[i]>>>0,s=a$(X,2)^a$(X,13)^a$(X,22),t=X&G^X&j^G&j,g$=s+t>>>0;S=H,H=I,I=K,K=L+a>>>0,L=j,j=G,G=X,X=a+g$>>>0}_[0]=_[0]+X>>>0,_[1]=_[1]+G>>>0,_[2]=_[2]+j>>>0,_[3]=_[3]+L>>>0,_[4]=_[4]+K>>>0,_[5]=_[5]+I>>>0,_[6]=_[6]+H>>>0,_[7]=_[7]+S>>>0}return _.map((J)=>J.toString(16).padStart(8,"0")).join("")}var gw=l.object({rule_session_id:l.string(),rule_block_id:l.string(),rule_block_key:l.string().optional(),strength:l.enum(["must","should","may","must_not"]),category:l.string(),rule_content:l.string(),rule_session_name:l.string(),applicability_match_reason:l.string().optional()}),q5=3600000,AX=86400000,B5=l.object({repo_id:l.string().nullable(),file_path:l.string().nullable(),review_id:l.string().nullable()}),O5=l.object({fetched_at:l.string(),server_etag:l.string(),latest_rule_session_updated_at:l.string().nullable(),contributing_session_count:l.number().int().nonnegative(),total_rule_count:l.number().int().nonnegative()}),F5=l.object({text:l.string(),json_payload:l.unknown().optional(),structured_payload:l.unknown().optional()}),N5=l.object({scope:B5,compiled_hash:l.string(),rules:l.array(l.object({source_review_id:l.string(),block_id:l.string(),block_index:l.number().int().nonnegative(),strength:l.enum(["must","should","may","must_not"]),category:l.string().nullable(),rule_text:l.string(),specificity:l.number().int().nonnegative(),applicability:l.record(l.string(),l.string())})),plain_text_bundle:l.string(),freshness:O5,rulepack_schema_version:l.literal("rulepack.v1"),renderings:F5.optional()});function i5($,n){return xX(JSON.stringify({plain_text_bundle:$,rules:n}))}function Uw($){return xX(JSON.stringify({repo_id:$.repo_id,file_path:$.file_path,review_id:$.review_id}))}function ND($){let n=typeof $.compiled_hash==="string"&&$.compiled_hash.length>0?$.compiled_hash:i5($.plain_text_bundle,$.rules),g={scope:$.scope,compiled_hash:n,rules:$.rules,plain_text_bundle:$.plain_text_bundle,freshness:{fetched_at:$.fetched_at,server_etag:$.server_etag??`"rules:${n}"`,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 N5.parse(g),g}function P5($){let n=Math.max(0,Math.floor($/1000));if(n<60)return`${n}s`;let g=Math.floor(n/60);if(g<60)return`${g}m`;let U=Math.floor(g/60);if(U<48)return`${U}h`;return`${Math.floor(U/24)}d`}function fX($,n=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 U=Math.max(0,n.getTime()-g),v=Math.floor(U/1000);if(U<=q5)return{status:"fresh",age_ms:U,age_seconds:v,warning:null};let w=P5(U),_=U>AX?`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:U>AX?"confirmed_stale":"presumed_stale",age_ms:U,age_seconds:v,warning:_}}var EX=b.enum(["must","should","may","must_not"]).openapi("RuleStrength"),S5=b.enum(["error","warning","info"]).openapi("RuleCheckFindingSeverity"),z5=b.enum(["document"]).openapi("RuleCheckAnchorMode"),M5=b.object({rule_text:b.string(),strength:EX,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"),CX=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"),lL=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"),ZL=b.object({rules:b.array(M5),total:b.number().int().nonnegative(),limit:b.number().int().positive(),offset:b.number().int().nonnegative(),freshness:CX,compiled_hash:b.string(),request_id:b.string()}).openapi("ListRulesResponse"),cL=b.object({content:b.string().min(1).max(1048576),properties:Wv.optional().default({}),collection_id:b.string().optional(),idempotency_key:b.string().max(256).optional()}).strict().openapi("RuleCheckRequest"),R5=b.object({block_index:b.number().int().nonnegative(),severity:S5,message:b.string(),rule_ref:gw.optional()}).openapi("RuleCheckFinding"),A5=b.object({total:b.number().int().nonnegative(),blocking:b.number().int().nonnegative(),warnings:b.number().int().nonnegative(),suggestions:b.number().int().nonnegative()}).openapi("RuleCheckSummary"),hL=b.object({findings:b.array(R5),summary:A5,anchor_mode:z5.optional(),rules_evaluated:b.number().int().nonnegative(),freshness:CX,compiled_hash:b.string(),request_id:b.string()}).openapi("RuleCheckResponse"),x5=b.object({source:b.enum(["manual","findings","external"]),source_review_id:b.string().optional(),source_label:b.string().max(256).optional()}).openapi("RuleImportProvenance"),mL=b.object({content:b.string().min(1).max(524288),title:b.string().max(512).optional(),applicability:Wv.optional(),provenance:x5.optional(),preview:b.boolean().default(!1),idempotency_key:b.string().max(256).optional()}).strict().openapi("RuleImportRequest"),uX=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"),TX=b.object({block_index:b.number().int().nonnegative(),strength:EX,category:b.string().nullable(),plaintext:b.string()}).openapi("ParsedRuleBlock"),f5=b.object({preview:b.literal(!0),parsed_rules:b.array(TX),total_rules:b.number().int().nonnegative(),warnings:b.array(b.string()),import_metadata:uX,request_id:b.string()}).openapi("RuleImportPreviewResponse"),E5=b.object({preview:b.literal(!1),review_id:b.string(),state:b.literal("draft"),parsed_rules:b.array(TX),total_rules:b.number().int().nonnegative(),warnings:b.array(b.string()),import_metadata:uX,request_id:b.string()}).openapi("RuleImportCreateResponse"),yL=b.discriminatedUnion("preview",[f5,E5]);var iD=b.record(b.string(),b.unknown()).openapi("ProjectConfig"),C5=b.enum(["active","deleting","deleted"]).openapi("ProjectState"),rL=b.object({name:b.string().min(1).max(256),config:iD.optional()}).openapi("CreateProjectRequest"),dL=b.object({name:b.string().min(1).max(256).optional(),config:iD.optional()}).openapi("UpdateProjectRequest"),pL=b.object({cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListProjectsQuery"),u5=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"),T5=b.object({id:b.string(),name:b.string(),state:C5,tenant_id:b.string(),config_hash:b.string().nullable(),config:iD.nullable(),created_by_user_id:b.string().nullable(),created_at:b.string().datetime(),latest_batch:u5.nullable().optional(),request_id:b.string()}).openapi("ProjectResponse"),eL=b.object({items:b.array(T5.omit({request_id:!0})),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListProjectsResponse"),aL=b.object({project_id:b.string(),state:b.literal("deleting"),deletion_job_id:b.string(),request_id:b.string()}).openapi("DeleteProjectResponse"),sL=b.object({from_path:d,to_path:d}).refine(($)=>$.from_path!==$.to_path,{message:"from_path and to_path must differ",path:["to_path"]}).openapi("CreateProjectMoveRequest"),$K=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 PD=b.enum(["git","upload"]).openapi("SessionTemplateSourceType"),l5=b.object({participant_id:b.string().min(1).max(256),scope:b.enum(["read","comment","approve"])}).openapi("SessionTemplateParticipantConfig"),Z5=b.object({slack_channel:b.string().max(256).optional(),email_participants:b.boolean().optional()}).openapi("SessionTemplateNotificationConfig"),lX=b.object({participants:b.array(l5).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:Z5.optional()}).openapi("SessionTemplateConfig"),gK=b.object({name:b.string().min(1).max(256),description:b.string().max(4000).optional(),source_type:PD,repo_id:b.string().max(256).optional(),project_id:b.string().max(256).optional(),config:lX}).openapi("CreateSessionTemplateRequest"),UK=b.object({source_type:PD.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"),c5=b.object({id:b.string(),tenant_id:b.string(),name:b.string(),description:b.string().nullable(),source_type:PD,repo_id:b.string().nullable(),project_id:b.string().nullable(),config:lX,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"),wK=b.object({items:b.array(c5.omit({request_id:!0})),next_cursor:b.string().nullable(),request_id:b.string()}).openapi("ListSessionTemplatesResponse");var Ng=b.string().min(1).max(36).openapi("ReviewSetId"),E6=b.enum(["git","upload"]).openapi("ReviewSetSourceType"),ww=b.enum(["review_set","release_bundle","packet"]).openapi("ReviewSetKind"),ZX=b.enum(["active","closed","archived","deleted"]).openapi("ReviewSetState"),h5=b.enum(["topo","lex","lex_fallback"]).openapi("ReviewSetOrderingMethod"),m5=b.enum(["reviewer","approver"]).openapi("ReviewSetParticipantRole"),y5=b.object({email:b.string().email(),roles:b.array(m5).min(1)}).openapi("ReviewSetParticipant"),t5=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"),o5=b.object({repo_id:Qv,git_sha:Z$,file_path:d,required:b.boolean().optional()}).openapi("ReviewSetGitFileEntry"),r5=b.object({project_id:b.string(),upload_batch_id:b.string(),file_path:d,required:b.boolean().optional()}).openapi("ReviewSetUploadFileEntry"),d5=b.union([o5,r5]).openapi("ReviewSetFileEntry"),p5=b.object({allow_mixed_shas:b.boolean().optional(),require_all_files_reviewed:b.boolean().optional()}).openapi("ReviewSetConfig"),DK=b.object({title:b.string().optional(),kind:ww.optional(),source_type:E6,reviews:b.array(t5).max(200).optional(),files:b.array(d5).max(200).optional(),participants:b.array(y5).max(100).optional(),recipe_json:b.record(b.string(),b.unknown()).optional(),config:p5.optional()}).openapi("CreateReviewSetRequest"),e5=b.object({review_id:b.string(),file_path:d,position:b.number().int().nonnegative(),required:b.boolean()}).openapi("ReviewSetItem"),a5=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"),s5=b.object({review_id:b.string(),invitations:b.array(a5)}).openapi("ReviewSetPerFileLinks"),JK=b.object({id:Ng,title:b.string(),kind:ww,state:b.literal("active"),source_type:E6,repo_id:b.string().nullable(),git_sha:b.string().nullable(),project_id:b.string().nullable(),upload_batch_id:b.string().nullable(),ordering_method:h5,items:b.array(e5),links:b.object({set_link:b.string().url()}),per_file_links:b.array(s5),event_id:b.string(),created_at:b.string().datetime(),request_id:b.string().nullable()}).openapi("CreateReviewSetResponse"),cX=b.object({id:Ng,title:b.string().nullable(),kind:ww,state:ZX,source_type:E6,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"),XK=b.object({source_type:E6.optional(),repo_id:Qv.optional(),git_sha:Z$.optional(),project_id:b.string().optional(),upload_batch_id:b.string().optional(),kind:ww.optional(),state:ZX.optional(),cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).default(20)}).openapi("ListReviewSetsQuery"),QK=b.object({items:b.array(cX),next_cursor:b.string().nullable(),request_id:b.string()}).openapi("ListReviewSetsResponse"),GK=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"),WK=cX.extend({request_id:b.string()}).openapi("UpdateReviewSetResponse"),hX=b.enum(["pass","fail","warn"]).openapi("ReviewSetStatusVerdict"),mX=b.object({code:b.string(),message:b.string(),pointers:b.array(b.string())}).openapi("ReviewSetReasonCode"),$7=b.object({review_id:b.string(),file_path:d,required:b.boolean(),verdict:hX,reason_codes:b.array(mX)}).openapi("ReviewSetStatusItem"),v7=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"),YK=b.object({review_set_id:Ng,verdict:hX,reason_codes:b.array(mX),items:b.array($7),policy_snapshot_id:b.string().nullable(),actions_required:b.array(v7).optional(),request_id:b.string()}).openapi("GetReviewSetStatusResponse"),n7=b.enum(["blocked","needs_changes","suggestions","approved","not_started","in_progress"]).openapi("ReviewSetStatusIndicator"),g7=b.object({requested:b.boolean(),decided:b.boolean(),decision:b.enum(["approved","rejected","conditional","pending"])}).openapi("ReviewSetApprovalState"),U7=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:g7.nullable(),status_indicator:n7})}).openapi("ReviewSetOverviewItem"),yX=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"),kK=b.object({id:Ng,title:b.string().nullable(),kind:b.string(),state:b.string(),source_type:E6,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(U7),progress:yX,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"),w7=b.object({id:Ng,title:b.string().nullable(),kind:b.string(),state:b.string(),source_type:E6,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"),_7=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"),b7=b.object({canonicalization:b.literal("jcs"),export_sha256:b.string().regex(/^[0-9a-f]{64}$/).nullable()}).openapi("ReviewSetExportIntegrity"),jK=b.object({schema:b.literal("v2"),view_requested:b.string().nullable(),view_resolved:b.literal("review_set.v1"),set:w7,items:b.array(_7),progress:yX,integrity:b7}).openapi("GetReviewSetExportResponse");var D7=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"),VK=b.object({name:b.string().min(1),description:b.string().nullable().optional(),color:b.string().nullable().optional()}).openapi("CreateCollectionRequest"),LK=b.object({name:b.string().min(1).optional(),description:b.string().nullable().optional(),color:b.string().nullable().optional(),archived:b.boolean().optional()}).openapi("UpdateCollectionRequest"),KK=b.object({cursor:b.string().optional(),limit:b.coerce.number().int().min(1).max(100).optional(),include_archived:b.boolean().optional()}).openapi("ListCollectionsQuery"),J7=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"),qK=b.object({session_id:b.string()}).openapi("AddCollectionSessionRequest"),X7=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"),BK=b.object({url:b.string().url(),title:b.string(),link_type:b.string()}).openapi("CreateCollectionSourceLinkRequest"),OK=b.object({items:b.array(D7.omit({request_id:!0})),cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("ListCollectionsResponse"),FK=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(X7.omit({request_id:!0})),sessions:b.array(J7.omit({request_id:!0})),request_id:b.string()}).openapi("CollectionDetailResponse"),NK=b.object({request_id:b.string()}).openapi("CollectionMutationAck");var tX=b.enum(["git","upload"]).openapi("CorpusSourceType"),Q7=b.enum(["building","ready","failed"]).openapi("CorpusSnapshotStatus"),G7=b.enum(["frontmatter","marker","sidecar","auto"]).openapi("CorpusDocIdentityMode"),oX=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:G7.optional(),include_external_links:b.boolean().optional()}).openapi("CorpusConfig"),SK=b.object({git_sha:Z$,corpus_config:oX.optional()}).openapi("RequestGitSnapshot"),zK=b.object({upload_batch_id:b.string(),corpus_config:oX.optional()}).openapi("RequestUploadSnapshot"),MK=b.object({snapshot_id:b.string(),status:Q7,source_type:tX,repo_id:Qv.optional(),git_sha:Z$.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"),W7=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"),RK=b.object({snapshot_id:b.string(),file_path:d,anchor:b.string().nullable(),backlinks:b.array(W7),request_id:b.string()}).openapi("CorpusBacklinksResponse"),rX=b.object({file_path:d,doc_key:b.string().nullable(),doc_type:b.string().nullable(),title:b.string().nullable()}).openapi("CorpusRepoMapItem"),AK=b.object({snapshot_id:b.string(),git_sha:Z$,files:b.array(rX),request_id:b.string()}).openapi("CorpusGitRepoMapResponse"),xK=b.object({snapshot_id:b.string(),upload_batch_id:b.string(),files:b.array(rX),request_id:b.string()}).openapi("CorpusUploadRepoMapResponse"),Y7=b.object({file_path:d,doc_key:b.string().nullable(),distance:b.number().int().positive(),link_kind:b.string(),via_path:d}).openapi("CorpusImpactRadiusItem"),fK=b.object({snapshot_id:b.string(),session_id:b.string(),file_path:d,impacted_files:b.array(Y7),request_id:b.string()}).openapi("CorpusImpactResponse"),EK=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"),k7=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"),j7=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(k7).optional()}).openapi("CorpusSnapshotArtifactDoc"),I7=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(($)=>$.target_file_path!==void 0!==($.target_url!==void 0),{message:"exactly one of target_file_path or target_url must be present"}).openapi("CorpusSnapshotArtifactEdge"),CK=b.object({schema_version:b.literal("corpus_snapshot.v1"),snapshot_id:b.string(),source_type:tX,repo_id:Qv.optional(),git_sha:Z$.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(j7),edges:b.array(I7),indexer_version:b.string(),config_hash:b.string(),created_at:b.string().datetime(),completed_at:b.string().datetime()}).openapi("CorpusSnapshotArtifact");var lK=b.object({content_ref:Hn.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"),H7=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"),ZK=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(H7).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"),V7=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"),dX=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:Hn,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"),cK=dX.extend({blocks:b.array(V7).optional().openapi({description:"Block summaries (included on creation)"})}).openapi("CreateSessionResponse"),hK=b.object({session_id:b.string().openapi({description:"Session identifier",example:"ses_abc123"})}),mK=dX.openapi("GetSessionResponse"),yK=jX.openapi("GetSessionBlocksQueryParams"),L7=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"),tK=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(L7),next_cursor:b.string().nullable(),has_more:b.boolean(),request_id:b.string()}).openapi("GetSessionBlocksResponse"),K7=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"),oK=b.object({session_id:b.string(),source_content_sha256:b.string(),blocks:b.array(K7),render_profile:b.string().nullable(),etag:b.string().openapi({description:"ETag for cache validation"})}).openapi("GetSessionRenderResponse"),q7=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"),rK=b.object({session_id:b.string(),blocks:b.array(q7),updated_at:b.string().datetime()}).openapi("GetSessionAnnotationsResponse");var eK=b.object({token:b.string().openapi({description:"URL token from magic link",example:"tok_abc123xyz..."})}).openapi("ExchangeTokenRequest"),aK=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"),sK=b.object({access_token:b.string(),token_type:b.literal("Bearer"),expires_in:b.number().int()}).openapi("RefreshTokenResponse"),$q=b.object({email:b.string().email().openapi({description:"Email address to send OTP to"})}).openapi("SendOtpRequest"),vq=b.object({code:b.string().length(6).regex(/^\d{6}$/).openapi({description:"6-digit OTP code",example:"123456"})}).openapi("VerifyOtpRequest"),nq=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 B7=["full","redacted","pseudonymous","block_window.v1","unresolved.v1","response_matrix.v1","delta_review.v1","corpus_context.v1"],O7=["repair_kit.v1"],F7={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 N7($){if(B7.includes($))return $;if(O7.includes($))return $;let n=F7[$];if(n)return n;throw Error(`Unknown export view: ${$}`)}var i7=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"]),P7=b.enum(["json","llm_prompt","llm_prompt.v1"]),_q=b.object({schema:b.literal("v2").default("v2"),view:i7.default("full"),format:P7.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)=>{if(N7($.view)==="block_window.v1"){if(!$.anchors||$.anchors.trim().length===0)n.addIssue({code:b.ZodIssueCode.custom,path:["anchors"],message:"anchors is required when view=block_window.v1"})}}),S7=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"),z7=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"),M7=b.object({id:b.string(),anchor:Gv,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:gw.optional(),comments:b.array(z7)}).openapi("ExportThread"),R7=b.object({open_threads:b.number().int().nonnegative(),resolved_threads:b.number().int().nonnegative(),blocking_threads:b.number().int().nonnegative()}).openapi("ExportIssuePerAnchorStatus"),A7=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:R7}).openapi("ExportIssueAnchor"),x7=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(A7)}).openapi("ExportIssue"),f7=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"),E7=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"),C7=b.string().regex(/^[a-z][a-z0-9_.-]*$/),u7=b.string().regex(/^[a-z][a-z0-9_.-]*\.v[0-9]+$/),T7=b.object({schema_version:u7,authoritative:b.boolean()}).passthrough().openapi("ExtensionEnvelope");var l7=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"),Z7=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"),bq=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:l7,partial:b.boolean().optional(),incomplete_sections:b.array(Z7).optional(),session:b.object({id:b.string(),created_at:b.string().datetime(),status:b.enum(["active","closed","archived"]),content_ref:Hn,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(S7),threads:b.array(M7),issues:b.array(x7).default([]).openapi({description:"Issue summaries with per-anchor status for anchors in this session"}),dispositions:b.array(f7).default([]).openapi({description:"Thread disposition log entries exported for audit/compliance workflows"}),evidence:b.array(E7).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(C7,T7).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 c7=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"),h7=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"),m7=b.object({verdict:b.enum(["pass","fail","warn"]),reasons:b.array(c7)}).openapi("BriefingPolicyStatus"),y7=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"),t7=b.object({items:b.array(y7),total:b.number().int().min(0)}).openapi("BriefingBlockers"),o7=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"),r7=b.object({requested:b.boolean(),decisions:b.array(o7),pending_count:b.number().int().min(0)}).openapi("BriefingApprovalsSummary"),d7=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"),p7=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"),Xq=b.object({schema_version:b.literal("briefing.v1"),session_id:b.string(),content_ref:Hn,title:b.string().nullable(),created_at:b.string().datetime(),delta:h7.optional(),policy_status:m7,blockers:t7,approvals:r7,checks:d7.optional(),threads:p7,computed_at:b.string().datetime(),annotations_version:b.number().int().min(1)}).openapi("BriefingBundle");var e7=b.enum(["review","repo","tenant"]).openapi("SearchScope"),pX=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"),a7=b.enum(["review","block","finding","comment"]).openapi("SearchKind"),_w=b.enum(["open","resolved","draft"]).openapi("SearchStatus"),eX=b.enum(["suggestion","needs_changes","blocking"]).openapi("SearchSeverity"),Wq=b.object({q:b.string().trim().min(1),scope:e7.default("tenant").optional(),mode:pX.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:_w.optional(),severity:eX.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"),s7=b.discriminatedUnion("type",[b.object({type:b.literal("review")}).strict(),b.object({type:b.literal("block"),block_id:sU}).strict()]).openapi("SearchAnchor"),$k=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:s7}).strict().openapi("SearchTarget"),vk=b.object({kind:a7,score:b.number(),entity_id:b.string().min(1),review_id:b.string().min(1),target:$k,snippet:b.string(),finding:b.object({finding_id:b.string().min(1),status:_w,severity:eX.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"),Yq=b.object({results:b.array(vk),total_count:b.number().int().nonnegative(),cursor:b.string().nullable(),has_more:b.boolean(),metadata:b.object({search_mode:pX,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 nk=["properties","applicability"],aX=["ts_"],gk="^[a-z][a-z0-9_]{0,63}$",Uk=b.object({key:b.string(),targets:b.array(b.enum(nk)).min(1),value_format:b.enum(["slug","string"]),description:b.string(),examples:b.array(b.string()).min(1)}).openapi("PropertyVocabularyEntry"),Iq=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(Uk)}).openapi("PropertyVocabulary"),Hq={naming:{case:"snake_case",key_pattern:gk,max_key_length:64},reserved:{canonical_keys:["client","content_type","source_kind","audience","market","surface"],internal_prefixes:[...aX]},tenant_extensions:{allowed:!0,forbidden_prefixes:[...aX],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 C6($){if(!$||typeof $!=="object"||Array.isArray($))return null;return $}function P$($,n){let g=$[n];if(typeof g!=="string")return;let U=g.trim();return U.length>0?U:void 0}function sX($,n){let g=$[n];return typeof g==="string"?g:void 0}function wk($,n){let g=$[n];return typeof g==="number"&&Number.isFinite(g)?g:void 0}function _k($,n){let g=$[n];return typeof g==="boolean"?g:void 0}function SD($,n){return C6($[n])??void 0}function zD($){return P$($,"request_id")}function bk($){if(Array.isArray($))return{entries:$,record:null};let n=C6($);if(!n)throw Error("Expected array or object list payload from upstream API");if(Array.isArray(n.data))return{entries:n.data,record:n};if(Array.isArray(n.items))return{entries:n.items,record:n};return{entries:[],record:n}}function Dk($,n){let{entries:g,record:U}=bk($),w={data:g.flatMap((_)=>{let D=C6(_);if(!D)return[];let J=n(D);return J?[J]:[]})};if(U){let _=wk(U,"total");if(_!==void 0)w.total=_;let D=P$(U,"next_cursor");if(D!==void 0)w.next_cursor=D;let J=_k(U,"has_more");if(J!==void 0)w.has_more=J;let X=zD(U);if(X!==void 0)w.request_id=X}return w}function Jk($){let n=P$($,"id");if(!n)return null;let g=SD($,"proposed_content")??SD($,"proposedContent"),U=P$($,"title")??g?.title,v=P$($,"source_type")??P$($,"sourceType"),w=P$($,"status"),_=P$($,"priority")??P$(g??{},"priority"),D=P$($,"created_at")??P$($,"createdAt"),J=typeof U==="string"&&U.trim().length>0?U.trim():void 0;if(!J||!v||!w||!_||!D)throw Error(`GCI list response missing required fields for id '${n}'`);return{...$,...g&&$.proposed_content===void 0?{proposed_content:g}:{},id:n,title:J,source_type:v,status:w,priority:_,created_at:D}}function bw($){return Dk($,Jk)}function $Q($){let n=C6($);if(!n)throw Error("Expected object payload from upstream API");let g=SD(n,"data")??{...n},U=sX(g,"prompt_fragment")??sX(g,"prompt"),v=zD(n)??zD(g),w={...g};if(U!==void 0)w.prompt_fragment=U;if(v!==void 0&&P$(w,"request_id")===void 0)w.request_id=v;return w}function vQ($){let n=$.rules;if(Array.isArray(n))return n.filter((w)=>w!==null&&typeof w==="object");let g=[],U=$.active_rules;if(Array.isArray(U))for(let w of U){let _=C6(w);if(!_)continue;g.push({id:_.artifact_id,title:_.artifact_type,kind:"artifact",content:_.severity})}let v=$.check_rules;if(Array.isArray(v))for(let w of v){let _=C6(w);if(!_)continue;let{pattern:D,assertion_config:J}=_,X=typeof _.message_template==="string"?_.message_template:typeof _.rule_id==="string"?_.rule_id:null,G=typeof D==="string"?D:typeof J==="string"?J:X;if(typeof G!=="string")continue;g.push({id:_.rule_id,title:_.message_template,kind:_.rule_type,content:G,scope:_.source_artifact_id})}return g}function MD($){return $Q($)}function RD($){return vQ($)}var AD=/^[A-Za-z0-9+/]*={0,2}$/,Dw="local";function ig($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function Xk($,n,g){let U=ig($);if(!U)return n;let v=U.ok===!0&&"result"in U,w=v?ig(U.result):U,_=w!==null?{...w}:{result:v?U.result:$};_.ok=!0,_.request_id=n.request_id;let D=v&&Array.isArray(U.warnings)?U.warnings:n.warnings;if(D!==void 0)_.warnings=D;let J=(v?ig(U.pagination):null)??n.pagination;if(J!==void 0)_.pagination=J;let X=(v?ig(U.advisory):null)??n.advisory;if(X!==void 0)_.advisory=X;let G=g?.retry??(v?ig(U.retry):null);if(G!==null&&G!==void 0)_.retry=G;else if(n.retry!==void 0)_.retry=n.retry;return _}function q($,n,g){let U=FX($,n,g),v=Xk($,U,g);return{content:[{type:"text",text:JSON.stringify(v,null,2)}]}}function Y($,n){let g=$.status===0||$.status>=500||$.status===429,U=NX({requestId:$.requestId,error:{code:$.code,message:$.message,retryable:g,details:$.details,fix_hint:$.fixHint},retry:n?.operation?OX({operation:n.operation,hasIdempotencyKey:n.hasIdempotencyKey,retryable:g,statusCode:$.status,errorCode:$.code}):{retry_classification:g?"transient":"manual"}});return{content:[{type:"text",text:JSON.stringify(U,null,2)}],isError:!0}}function u6($,n,g,U){return new Q($,n,g,U?.requestId??Dw,U?.details,U?.fixHint)}function UQ($,n){if($ instanceof Q)return $;let g=n?.message??($ instanceof Error?$.message:String($));return u6(n?.status??500,n?.code??"internal_error",g,n)}function w$($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("Expected object payload from upstream API");let n=$,g=n.data;if(g&&typeof g==="object"&&!Array.isArray(g))return g;return n}var wQ=1e7;function nQ($){if(typeof $==="string"){let v=$.trim();return v.length>0?v:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let n=$,g=n.base64??n.content_base64??n.content??n.data??n.bytes;if(typeof g!=="string")return null;let U=g.trim();return U.length>0?U:null}function gQ($){if(typeof $==="string"){let U=$.trim();return U.length>0?U:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let n=$,g=n.path??n.file_path??n.filename??n.file_name??n.name;if(typeof g==="string"&&g.trim().length>0)return g.trim();return null}function _Q($){if($===void 0||$===null)return{assets:{}};let n={};if(Array.isArray($)){for(let[U,v]of $.entries()){let w=gQ(v),_=nQ(v);if(!w||!_)return{error:new Q(422,"invalid_argument",`inline_assets[${U}] requires both a path and base64 payload`,"local")};n[w]=_}return{assets:n}}if(typeof $!=="object")return{error:new Q(422,"invalid_argument","inline_assets must be an object map or array","local")};let g=Object.entries($);for(let[U,v]of g){let w=v&&typeof v==="object"&&!Array.isArray(v)?gQ(v):U,_=nQ(v);if(!w||!_)return{error:new Q(422,"invalid_argument",`inline_assets entry '${U}' requires base64 content`,"local")};n[w]=_}return{assets:n}}function bQ($){if(!$||$.length===0)return"Asset path is empty";if($.includes("\x00"))return"Asset path contains NUL byte";let n=$.replace(/\\/g,"/");if(n.startsWith("/"))return"Asset path must be relative (no leading /)";if(n.includes(".."))return"Asset path must not contain '..'";return null}function xD($){let n=$.replace(/\s+/g,"");if(n.length===0)return new Uint8Array;if(n.length%4!==0||!AD.test(n))return null;let g=Buffer.from(n,"base64"),U=n.replace(/=+$/,""),v=g.toString("base64").replace(/=+$/,"");if(U!==v)return null;return Uint8Array.from(g)}var Qk=await Promise.resolve().then(() => tD(jw(),1)),DQ=Qk.version,Gk={Server:Rw,StdioServerTransport:xw,CallToolRequestSchema:Pw,ListToolsRequestSchema:iw};function Jw($){return{content:$.content.map((n)=>({type:n.type,text:n.text})),...$.isError===void 0?{}:{isError:$.isError}}}async function JQ($,n=Gk){let g=new n.Server({name:"typescape",version:DQ},{capabilities:{tools:{}}});g.setRequestHandler(n.ListToolsRequestSchema,async()=>{return{tools:$.getTools().map((w)=>({name:w.name,description:w.description,inputSchema:w.inputSchema}))}}),g.setRequestHandler(n.CallToolRequestSchema,async(v)=>{let{name:w,arguments:_}=v.params,D=$.getHandler(w);if(!D)return Jw(Y(u6(404,"not_found",`Unknown tool: ${w}`,{details:{tool:w},fixHint:"Use tools/list to inspect the registered Typescape tools."})));try{if(_===void 0)return Jw(Y(u6(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 J=await D(_);return Jw(J)}catch(J){return Jw(Y(UQ(J)))}});let U=new n.StdioServerTransport;await g.connect(U),process.stderr.write(`Typescape MCP server v${DQ} started
43
- `)}var Wk=300000;function XQ($){let n=null;return{async getCapabilities(){let g=Date.now();if(n&&g-n.fetchedAt<Wk)return n.features;try{let U=await $.get("/me/capabilities");if(!U.body.features||typeof U.body.features!=="object")throw Error("Capabilities response missing features object");return n={features:U.body.features,fetchedAt:g},n.features}catch(U){if(U instanceof Q)throw U;throw U}},featureDisabledResult(g){return Y(u6(403,"feature_disabled",`Feature '${g}' is not enabled on this server`,{details:{feature:g}}))}}}var Yk=_w.options.filter(($)=>$!=="draft"),QQ={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"]},GQ={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"]},WQ={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"]},YQ={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"]},kQ={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:[]},jQ={type:"object",properties:{review_id:{type:"string",description:"Review ID to retrieve (e.g., rev_01HXYZ...)"}},required:["review_id"]},IQ={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"]},HQ={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"]},fD={type:"object",properties:{review_id:{type:"string",description:"Review ID (e.g., rev_01HXYZ...)"}},required:["review_id"]},VQ={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"]},LQ={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:Yk,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 KQ=["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"],kk="markdown",jk="open",Ik="strict";function Hk($){if($==="approver")return["read","comment","approve"];if($==="observer")return["read"];if($==="owner")return["read","comment","approve","admin"];return["read","comment"]}function Vk($){return $.map((n)=>{let g=n.scopes&&n.scopes.length>0?[...new Set(n.scopes)]:Hk(n.role);return{email:n.email,...n.name?{name:n.name}:{},role:n.role,scopes:g}})}function Lk($,n){let g=[];if(Array.isArray($))g.push(...$);if(Array.isArray(n))for(let w of n){if(typeof w!=="string")continue;let _=w.trim();if(_.length===0)continue;g.push({email:_,role:"reviewer"})}let U=new Set,v=[];for(let w of g){if(!w||typeof w.email!=="string")continue;let _=w.email.trim();if(_.length===0)continue;let D=_.toLowerCase();if(U.has(D))continue;U.add(D),v.push({...w,email:_})}return v}function Kk($){if(!Array.isArray($))return[];let n=new Set,g=[];for(let U of $){if(typeof U!=="string")continue;let v=U.trim().toLowerCase();if(v.length===0)continue;if(n.has(v))continue;n.add(v),g.push(v)}return g}function qk($){if(!$||typeof $!=="object"||Array.isArray($))return null;let n=$.id;return typeof n==="string"&&n.length>0?n:null}function Bk($){if(!$||typeof $!=="object"||Array.isArray($))return null;let n=$;if(typeof n.id==="string"&&n.id.length>0)return n.id;let g=n.project;if(g&&typeof g==="object"&&!Array.isArray(g)&&typeof g.id==="string")return g.id;return null}function Ok($){if(!$||typeof $!=="object"||Array.isArray($))return null;let n=$;if(typeof n.upload_batch_id==="string"&&n.upload_batch_id.length>0)return n.upload_batch_id;let g=n.upload;if(g&&typeof g==="object"&&!Array.isArray(g)&&typeof g.upload_batch_id==="string")return g.upload_batch_id;return null}function Fk($){let n=_Q($.inline_assets);if("error"in n)return n.error;let g=n.assets;if(!$.file_path)return new Q(400,"missing_param","Missing required parameter: file_path","local");let U=typeof $.repo_id==="string"&&$.repo_id.length>0,v=typeof $.git_sha==="string"&&$.git_sha.length>0,w=typeof $.project_id==="string"&&$.project_id.length>0,_=typeof $.upload_batch_id==="string"&&$.upload_batch_id.length>0,D=U&&v,J=w&&_,X=!!$.content_body,G=Object.keys(g).length>0;if(U&&!v||!U&&v)return new Q(422,"invalid_argument","Both repo_id and git_sha are required for git-backed reviews","local");if(w&&!_||!w&&_)return new Q(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 Q(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 Q(422,"invalid_argument",`Unsupported asset_resolution_mode: ${$.asset_resolution_mode}. Supported values: "strict", "warn".`,"local");let j=$.document_type??kk,L=$.identity_restriction??jk,K=$.asset_resolution_mode??Ik,I=j==="image_set",H=j==="pdf";if(I){if(!G&&!J)return new Q(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 Q(400,"missing_param",'document_type "image_set" with upload-batch mode requires filenames.',"local");let t=new Set([".png",".jpg",".jpeg",".webp",".gif",".svg"]);if(G){for(let g$ of Object.keys(g)){let tv=g$.slice(g$.lastIndexOf(".")).toLowerCase();if(!t.has(tv))return new Q(422,"unsupported_media_type",`Unsupported image format for image_set: ${g$}. Supported extensions: ${[...t].join(", ")}`,"local")}if(Object.keys(g).length>100)return new Q(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 Q(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 Q(422,"invalid_argument",'document_type "pdf" does not support content_body; provide inline_assets with one .pdf file.',"local");if(!G&&!J)return new Q(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(G&&J)return new Q(422,"invalid_argument",'document_type "pdf" cannot mix inline_assets and upload-batch inputs.',"local");if(G&&Object.keys(g).length!==1)return new Q(422,"invalid_argument",'document_type "pdf" requires exactly one inline asset.',"local");if(G){let[t]=Object.keys(g);if(!t)return new Q(400,"missing_param",'document_type "pdf" requires inline_assets with exactly one .pdf file.',"local");if(t.slice(t.lastIndexOf(".")).toLowerCase()!==".pdf")return new Q(422,"unsupported_media_type",`Unsupported PDF format: ${t}. Supported extension: .pdf`,"local");if($.file_path!==t)return new Q(422,"invalid_argument",`For document_type "pdf", file_path must match inline_assets key: ${t}`,"local")}}let S=[D,X,J].filter(Boolean).length;if(!I&&!H&&S===0)return new Q(400,"missing_param","Provide one source mode: (repo_id + git_sha), (content_body), or (project_id + upload_batch_id)","local");if(S>1)return new Q(422,"ambiguous_review_input","Cannot mix source modes: choose exactly one of git-backed, inline content_body, or upload-backed.","local");if(!I&&$.filenames&&$.filenames.length>0)return new Q(422,"invalid_argument","filenames is only valid when document_type is image_set.","local");if(!H&&$.filename&&$.filename.trim().length>0)return new Q(422,"invalid_argument",'filename is only valid when document_type is "pdf".',"local");if(L==="domain"&&(!$.allowed_email_domains||$.allowed_email_domains.length===0))return new Q(422,"invalid_argument",'allowed_email_domains is required when identity_restriction is "domain"',"local");if(Object.keys(g).length>0){if(!X&&!I&&!H)return new Q(422,"invalid_argument","inline_assets requires content_body (inline mode)","local");let t=0;for(let[g$,tv]of Object.entries(g)){let mD=bQ(g$);if(mD)return new Q(422,"invalid_argument",`${mD}: ${g$}`,"local");let yD=xD(tv);if(yD===null)return new Q(422,"invalid_argument",`Invalid base64 content for asset: ${g$}`,"local");t+=yD.byteLength}if(t>wQ)return new Q(413,"inline_payload_too_large",`Total decoded inline assets (${t} bytes) exceed 10MB limit. Use the Typescape CLI with upload batch for larger payloads.`,"local")}let i={file_path:$.file_path,document_type:j,identity_restriction:L,asset_resolution_mode:K};if(D)i.repo_id=$.repo_id,i.git_sha=$.git_sha;if(J)i.project_id=$.project_id,i.upload_batch_id=$.upload_batch_id;if(X)i.content_body=$.content_body;if(Object.keys(g).length>0)i.inline_assets=g;let c=Lk($.participants,$.reviewer_emails);if(c.length>0)i.participants=Vk(c);if($.title!==void 0)i.title=$.title;if($.allowed_email_domains!==void 0&&$.allowed_email_domains.length>0)i.allowed_email_domains=$.allowed_email_domains;if($.operator_name!==void 0)i.operator_name=$.operator_name;if($.focus_areas!==void 0&&$.focus_areas.length>0)i.focus_areas=$.focus_areas;if($.framing!==void 0)i.framing=$.framing;if($.carry_forward_findings!==void 0)i.carry_forward_findings=$.carry_forward_findings;if($.carry_forward_filter!==void 0)i.carry_forward_filter=$.carry_forward_filter;if(H)i.filename=$.filename?.trim()||$.file_path.split("/").filter(Boolean).at(-1)||$.file_path;if(I)i.filenames=$.filenames&&$.filenames.length>0?$.filenames:Object.keys(g).sort();if($.purpose!==void 0)i.purpose=$.purpose;if($.properties!==void 0)i.properties=$.properties;let m={};if($.idempotency_key)m["Idempotency-Key"]=$.idempotency_key;if($.expected_version)m["If-Match"]=$.expected_version;let a=Kk($.reviewer_emails),s=H&&G?(()=>{let t=Object.entries(g)[0];if(!t)return null;let[g$,tv]=t;return g$&&tv?{assetPath:g$,base64Content:tv}:null})():null;return{body:i,headers:m,reviewerEmails:a,pdfInlineFallback:s}}async function Nk($,n,g){let U=Array.isArray(g.invitations)?g.invitations:[];if(n.length===0||U.length>0)return U;let v=qk(g.review);if(!v)throw new Q(500,"invalid_upstream_response","Review create response missing review.id; cannot invite reviewer_emails","local");let w=await $.post(`/reviews/${encodeURIComponent(v)}/participants`,{body:{participants:n.map((D)=>({email:D,role:"reviewer"}))}}),_=Array.isArray(w.body.invitations)?w.body.invitations:[];if(_.length>0)return _;throw new Q(502,"invalid_upstream_response","Reviewer invitation follow-up returned no invitations",w.requestId)}async function qQ($,n,g){return $.post("/reviews",{body:n,headers:g})}async function ik($,n){if(!n.pdfInlineFallback)throw new Q(500,"invalid_local_state","PDF fallback requires exactly one inline asset","local");let g=xD(n.pdfInlineFallback.base64Content);if(g===null)throw new Q(422,"invalid_argument",`Invalid base64 content for asset: ${n.pdfInlineFallback.assetPath}`,"local");let U=await $.post("/projects",{body:{name:`MCP Upload ${n.pdfInlineFallback.assetPath}`}}),v=Bk(U.body);if(!v)throw new Q(502,"invalid_upstream_response","Project create response missing project id",U.requestId);let w=new FormData;w.append(n.pdfInlineFallback.assetPath,new Blob([g],{type:"application/pdf"}),n.pdfInlineFallback.assetPath);let _=await $.postFormData(`/projects/${encodeURIComponent(v)}/upload`,w),D=Ok(_.body);if(!D)throw new Q(502,"invalid_upstream_response","Upload response missing upload_batch_id",_.requestId);let J={...n.body,project_id:v,upload_batch_id:D};return delete J.inline_assets,qQ($,J,n.headers)}async function Pk($,n){let g=async(U)=>{let v=await Nk($,n.reviewerEmails,U.body);return q({review:U.body.review,invitations:v},U.requestId)};try{let U=await qQ($,n.body,n.headers);return await g(U)}catch(U){if(U instanceof Q&&n.pdfInlineFallback&&U.code==="feature_disabled"&&U.details?.feature==="inline_assets_enabled")try{let v=await ik($,n);return await g(v)}catch(v){if(v instanceof Q)return Y(v);throw v}if(U instanceof Q)return Y(U);throw U}}function Sk($){if(!$.review_id)return new Q(400,"missing_param","Missing required parameter: review_id","local");let n=typeof $.git_sha==="string"&&$.git_sha.length>0,g=typeof $.content_body==="string"&&$.content_body.length>0,U=typeof $.upload_batch_id==="string"&&$.upload_batch_id.length>0,v=typeof $.project_id==="string"&&$.project_id.length>0;if(v&&!U||!v&&U)return new Q(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed revision","local");let w=[n,g,U].filter(Boolean).length;if(w===0)return new Q(400,"missing_param","One of git_sha, content_body, or upload_batch_id is required","local");if(w>1)return new Q(422,"invalid_argument","git_sha, content_body, and upload_batch_id are mutually exclusive","local");let _=n?$.git_sha:void 0;if(_&&!/^[a-f0-9]{40}$/i.test(_))return new Q(400,"invalid_param",`Invalid git_sha format: must be a 40-character hex string, got "${$.git_sha}"`,"local");let D={};if(_)D.git_sha=_.toLowerCase();if(g)D.content_body=$.content_body;if(U)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 zk($,n){try{let g=await $.post(`/reviews/${encodeURIComponent(n.reviewId)}/revise`,{body:n.body,headers:n.headers});return q(g.body,g.requestId)}catch(g){if(g instanceof Q)return Y(g);throw g}}function BQ($,n){let g=new Map;function U(I){let H=I.indexOf("#");if(H===-1)throw new Q(500,"invalid_review_url","Review link URL is missing fragment token","local");return I.slice(H+1)}async function v(I){let H=g.get(I);if(H&&H.expiresAtMs>Date.now())return H.token;let S=await n.get(`/sessions/${I}/participants`,{query:{role:"reviewer"}}),i=S.body.items?.[0]?.participant_id;if(!i)i=(await n.get(`/sessions/${I}/participants`,{query:{limit:"1"}})).body.items?.[0]?.participant_id;if(!i)throw new Q(422,"no_participants","No participants available to mint a render token",S.requestId);let c=await n.post(`/sessions/${I}/links`,{body:{participant_id:i,scope:"read",single_use:!0,url_token_ttl_minutes:60}}),m=c.body.url;if(!m||typeof m!=="string")throw new Q(500,"invalid_link_response","Failed to mint review link for render",c.requestId);let a=await n.post("/auth/exchange",{body:{url_token:U(m)}}),s=a.body.session_access_token,t=a.body.expires_in_seconds;if(!s||typeof s!=="string")throw new Q(500,"token_exchange_failed","Failed to exchange review link for review access token",a.requestId);let g$=typeof t==="number"&&Number.isFinite(t)?Math.max(0,Math.trunc(t)-30)*1000:300000;return g.set(I,{token:s,expiresAtMs:Date.now()+g$}),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:QQ};$.register(w,async(I)=>{let H=Fk(I);if(H instanceof Q)return Y(H);return Pk(n,H)});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:GQ};$.register(_,async(I)=>{let H=Sk(I);if(H instanceof Q)return Y(H);return zk(n,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:WQ};$.register(D,async(I)=>{let H=I;if(!H.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));let i={schema:typeof H.schema==="string"&&H.schema.trim().length>0?H.schema.trim():"v2"};if(H.view)i.view=H.view;if(H.include_rule_context)i.include_rule_context="true";let c={};if(H.expected_version)c["If-Match"]=H.expected_version;try{let m=await n.get(`/reviews/${H.review_id}/export`,{query:i,headers:c});return q(m.body,m.requestId)}catch(m){if(m instanceof Q)return Y(m);throw m}});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:YQ};$.register(J,async(I)=>{let H=I;if(!H.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));let S={};if(typeof H.include_rules==="boolean")S.include_rules=H.include_rules?"true":"false";if(typeof H.include_lineage==="boolean")S.include_lineage=H.include_lineage?"true":"false";if(typeof H.include_advisory==="boolean")S.include_advisory=H.include_advisory?"true":"false";if(typeof H.include_blocks==="boolean")S.include_blocks=H.include_blocks?"true":"false";if(typeof H.max_rules==="number")S.max_rules=String(H.max_rules);try{let i=await n.get(`/reviews/${encodeURIComponent(H.review_id)}/handoff`,{query:S});return q(i.body,i.requestId)}catch(i){if(i instanceof Q)return Y(i);throw i}});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:kQ};$.register(X,async(I)=>{let H=I,S={};if(H.repo_id)S.repo_id=H.repo_id;if(H.state)S.state=H.state;if(H.file_paths)S.file_paths=H.file_paths;if(H.cursor)S.cursor=H.cursor;if(H.limit!==void 0)S.limit=String(H.limit);if(H.root_review_id)S.root_review_id=H.root_review_id;if(H.supersedes_review_id)S.supersedes_review_id=H.supersedes_review_id;if(H.has_successor!==void 0)S.has_successor=H.has_successor?"true":"false";let i=H.q??H.search;if(i)S.q=i;try{let c=await n.get("/reviews",{query:S});return q(c.body,c.requestId)}catch(c){if(c instanceof Q)return Y(c);throw c}});let G={name:"typescape_get_review",description:"Get details of a specific Typescape review. Returns full review metadata including participants, stats, and provenance.",inputSchema:jQ};$.register(G,async(I)=>{let H=I;if(!H.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{let S=await n.get(`/reviews/${encodeURIComponent(H.review_id)}`);return q(S.body,S.requestId)}catch(S){if(S instanceof Q)return Y(S);throw S}});let j={name:"typescape_get_render",description:"Get the rendered content of a review. Returns immutable block-level HTML structure with block_ids for anchoring.",inputSchema:IQ};$.register(j,async(I)=>{let H=I;if(!H.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));let S={};if(H.include_plaintext)S.include_plaintext="true";try{let i=await v(H.review_id),c=await n.get(`/sessions/${H.review_id}/render`,{query:S,headers:{Authorization:`Bearer ${i}`}});return q(c.body,c.requestId)}catch(i){if(i instanceof Q)return Y(i);throw i}});let L={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:HQ},K=async(I)=>{if(!I.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));let H={};if(I.block_id)H.block_id=I.block_id;if(I.status)H.status=I.status;if(I.cursor)H.cursor=I.cursor;if(I.limit!==void 0)H.limit=String(I.limit);let S=I.q??I.search;if(S)H.q=S;try{let i=await n.get(`/reviews/${encodeURIComponent(I.review_id)}/findings`,{query:H});return q(i.body,i.requestId)}catch(i){if(i instanceof Q)return Y(i);throw i}};$.register(L,async(I)=>{return K(I)}),$.register({name:"typescape_search_reviews",description:"Search reviews by title/file path using server-side query matching.",inputSchema:VQ},async(I)=>{let H=I,S=typeof H.query==="string"?H.query.trim():"";if(!S)return Y(new Q(400,"missing_param","Missing required parameter: query","local"));let i={q:S};if(H.limit!==void 0)i.limit=String(H.limit);if(H.cursor)i.cursor=H.cursor;try{let c=await n.get("/reviews",{query:i});return q(c.body,c.requestId)}catch(c){if(c instanceof Q)return Y(c);throw c}}),$.register({name:"typescape_search_findings",description:"Search findings/comments within a review using server-side query matching.",inputSchema:LQ},async(I)=>{let H=I,S=typeof H.query==="string"?H.query.trim():"";if(!H.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!S)return Y(new Q(400,"missing_param","Missing required parameter: query","local"));return K({review_id:H.review_id,q:S,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:fD},async(I)=>{let H=I;if(!H.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{let S=await n.post(`/reviews/${encodeURIComponent(H.review_id)}/close`,{body:{}});return q(S.body,S.requestId)}catch(S){if(S instanceof Q)return Y(S);throw S}}),$.register({name:"typescape_reopen_review",description:"Reopen a closed review and return it to active state.",inputSchema:fD},async(I)=>{let H=I;if(!H.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{let S=await n.post(`/reviews/${encodeURIComponent(H.review_id)}/reopen`,{body:{}});return q(S.body,S.requestId)}catch(S){if(S instanceof Q)return Y(S);throw S}})}var OQ={type:"object",properties:{review_id:{type:"string",description:"Review ID to export response matrix for (e.g., sess_01HXYZ...)"}},required:["review_id"]},FQ={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"]},NQ={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"]},iQ={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"]},PQ={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"]},SQ={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"]},zQ={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"]},MQ={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"]},RQ={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 xQ=["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"],ED=c$({operation:"read"});function T6($){return c$({operation:"write",hasIdempotencyKey:$})}var Mk="X-Typescape-If-Match";function AQ($,n,g){if(!$)return;if(/^[1-9]\d*$/.test($)){n.expected_version=Number.parseInt($,10);return}g[Mk]=$}function fQ($,n){$.register({name:"typescape_export_response_matrix",description:"Export the response matrix for a review. Returns per-finding decision and evidence summary.",inputSchema:OQ},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{let v=await n.get(`/reviews/${U.review_id}/export`,{query:{view:"response_matrix.v1"}});return q(v.body,v.requestId,{retry:ED})}catch(v){if(v instanceof Q)return Y(v,{operation:"read"});throw v}}),$.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:FQ},async(g)=>{let U=g,v=U.body_md??U.body;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!v)return Y(new Q(400,"missing_param","Missing required parameter: body_md","local"));let w={body_md:v,source:"automation"},_=typeof U.block_id==="string"?U.block_id.trim():void 0;if(_)w.block_id=_;if(U.anchor!==void 0)w.anchor=U.anchor;else if(_)w.anchor={type:"block"};if(U.severity!==void 0)w.severity=U.severity;if(U.tags!==void 0)w.tags=U.tags;if(U.suggestion!==void 0)w.suggestion=U.suggestion;let D={};if(U.idempotency_key)D["Idempotency-Key"]=U.idempotency_key;try{let J=await n.post(`/reviews/${encodeURIComponent(U.review_id)}/findings`,{body:w,headers:D});return q(J.body,J.requestId,{retry:T6(Boolean(U.idempotency_key))})}catch(J){if(J instanceof Q)return Y(J,{operation:"write",hasIdempotencyKey:Boolean(U.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:NQ},async(g)=>{let U=g,v=U.body_md??U.body;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!U.finding_id)return Y(new Q(400,"missing_param","Missing required parameter: finding_id","local"));if(!v)return Y(new Q(400,"missing_param","Missing required parameter: body_md","local"));let w={body_md:v,source:"automation"},_={};if(U.idempotency_key)_["Idempotency-Key"]=U.idempotency_key;try{let D=await n.post(`/reviews/${encodeURIComponent(U.review_id)}/findings/${encodeURIComponent(U.finding_id)}/comments`,{body:w,headers:_});return q(D.body,D.requestId,{retry:T6(Boolean(U.idempotency_key))})}catch(D){if(D instanceof Q)return Y(D,{operation:"write",hasIdempotencyKey:Boolean(U.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:iQ},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!U.finding_id)return Y(new Q(400,"missing_param","Missing required parameter: finding_id","local"));let v=U.decision===void 0?{status:"resolved"}:{disposition:U.decision},w={};AQ(U.expected_version??U.if_match,v,w);try{let _=U.decision===void 0?await n.patch(`/reviews/${encodeURIComponent(U.review_id)}/findings/${encodeURIComponent(U.finding_id)}`,{body:v,headers:w}):await n.post(`/sessions/${U.review_id}/threads/${U.finding_id}/resolve`,{body:v,headers:w});return q(_.body,_.requestId,{retry:T6(!1)})}catch(_){if(_ instanceof Q)return Y(_,{operation:"write"});throw _}}),$.register({name:"typescape_reopen_finding",description:"Reopen a previously resolved finding. Use expected_version or if_match for optimistic concurrency.",inputSchema:PQ},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!U.finding_id)return Y(new Q(400,"missing_param","Missing required parameter: finding_id","local"));let v={},w={};AQ(U.expected_version??U.if_match,v,w);try{v.status="open";let _=await n.patch(`/reviews/${encodeURIComponent(U.review_id)}/findings/${encodeURIComponent(U.finding_id)}`,{body:v,headers:w});return q(_.body,_.requestId,{retry:T6(!1)})}catch(_){if(_ instanceof Q)return Y(_,{operation:"write"});throw _}}),$.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:SQ},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!U.finding_id)return Y(new Q(400,"missing_param","Missing required parameter: finding_id","local"));if(!U.state)return Y(new Q(400,"missing_param","Missing required parameter: state","local"));let v={state:U.state};if(U.rationale_md!==void 0)v.rationale_md=U.rationale_md;try{let w=await n.post(`/reviews/${encodeURIComponent(U.review_id)}/findings/${encodeURIComponent(U.finding_id)}/decision`,{body:v});return q(w.body,w.requestId,{retry:T6(!1)})}catch(w){if(w instanceof Q)return Y(w,{operation:"write"});throw w}}),$.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:zQ},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!U.finding_id)return Y(new Q(400,"missing_param","Missing required parameter: finding_id","local"));let v,w;if(U.evidence_type){v=U.evidence_type.trim(),w={};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(U[J]!==void 0)w[J]=U[J];if(U.body_md!==void 0)w.body=U.body_md,w.text=U.body_md;else if(U.note_md!==void 0)w.body=U.note_md,w.text=U.note_md}else if(U.evidence)v=typeof U.evidence.type==="string"?U.evidence.type.trim():"",w={...U.evidence},delete w.type;else return Y(new Q(400,"missing_param","Missing required parameter: evidence_type","local"));if(!v)return Y(new Q(422,"invalid_argument","evidence_type is required","local"));let _={evidence_type:v,evidence_json:w};if(U.dedupe_key)_.dedupe_key=U.dedupe_key;try{let D=await n.post(`/reviews/${encodeURIComponent(U.review_id)}/findings/${encodeURIComponent(U.finding_id)}/evidence`,{body:_});return q(D.body,D.requestId,{retry:T6(!1)})}catch(D){if(D instanceof Q)return Y(D,{operation:"write"});throw D}}),$.register({name:"typescape_get_decision",description:"Get the latest decision for a specific finding.",inputSchema:MQ},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!U.finding_id)return Y(new Q(400,"missing_param","Missing required parameter: finding_id","local"));try{let v=await n.get(`/reviews/${encodeURIComponent(U.review_id)}/findings/${encodeURIComponent(U.finding_id)}/decision`);return q(v.body,v.requestId,{retry:ED})}catch(v){if(v instanceof Q)return Y(v,{operation:"read"});throw v}}),$.register({name:"typescape_list_evidence",description:"List evidence entries attached to a finding.",inputSchema:RQ},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!U.finding_id)return Y(new Q(400,"missing_param","Missing required parameter: finding_id","local"));let v={};if(U.limit!==void 0)v.limit=String(U.limit);if(U.cursor)v.cursor=U.cursor;try{let w=await n.get(`/reviews/${encodeURIComponent(U.review_id)}/findings/${encodeURIComponent(U.finding_id)}/evidence`,{query:v});return q(w.body,w.requestId,{retry:ED})}catch(w){if(w instanceof Q)return Y(w,{operation:"read"});throw w}})}var Xw=["file","doc","pr","custom"],EQ=new Set(Xw),CQ={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"]},uQ={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"]},TQ={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"}}},lQ={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to retrieve"}},required:["review_set_id"]},ZQ={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:Xw,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"]},cQ={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to resolve"}},required:["review_ref_id"]},hQ={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"]},mQ={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"]},yQ={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"]},tQ={type:"object",properties:{review_id:{type:"string",description:"Review ID to run checks against"}},required:["review_id"]},oQ={type:"object",properties:{},additionalProperties:!1},rQ={type:"object",properties:{},additionalProperties:!1},dQ={type:"object",properties:{},additionalProperties:!1};var pQ=["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 Rk($){return $.replace(/\bSession\b/g,"Review").replace(/\bsession\b/g,"review").replace(/\bThread\b/g,"Finding").replace(/\bthread\b/g,"finding")}function CD($){if(Array.isArray($))return $.map((U)=>CD(U));if($===null||typeof $!=="object")return $;let n=new Map([["session_id","review_id"],["thread_id","finding_id"],["thread_ids","finding_ids"]]),g=Object.entries($).map(([U,v])=>{let w=n.get(U)??U,_=typeof v==="string"&&(U==="description"||U==="message")?Rk(v):CD(v);return[w,_]});return Object.fromEntries(g)}function eQ($,n,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:CQ},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(G){if(G instanceof Q)return Y(G);throw G}if(!v.source_type)return Y(new Q(400,"missing_param","Missing required parameter: source_type","local"));if(v.source_type!=="git"&&v.source_type!=="upload")return Y(new Q(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,D=Array.isArray(v.files)&&v.files.length>0;if(!_&&!D)return Y(new Q(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(_)J.reviews=w;if(D)J.files=v.files;if(v.participants!==void 0)J.participants=v.participants.map((G)=>{if(Array.isArray(G.roles)&&G.roles.length>0)return{email:G.email,roles:G.roles};if(G.role)return{email:G.email,roles:[G.role]};return G});let X={};if(v.idempotency_key)X["Idempotency-Key"]=v.idempotency_key;try{let G=await n.post("/review-sets",{body:J,headers:X});return q(G.body,G.requestId)}catch(G){if(G instanceof Q)return Y(G);throw G}}),$.register({name:"typescape_export_review_set",description:"Export feedback from a review set. Requires features.review_sets to be enabled.",inputSchema:uQ},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(D){if(D instanceof Q)return Y(D);throw D}if(!v.review_set_id)return Y(new Q(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 D=await n.get(`/review-sets/${encodeURIComponent(v.review_set_id)}/export`,{query:_});return q(D.body,D.requestId)}catch(D){if(D instanceof Q)return Y(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:TQ},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(_){if(_ instanceof Q)return Y(_);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 n.get("/review-sets",{query:w});return q(_.body,_.requestId)}catch(_){if(_ instanceof Q)return Y(_);throw _}}),$.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:lQ},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).review_sets)return g.featureDisabledResult("review_sets")}catch(w){if(w instanceof Q)return Y(w);throw w}if(!v.review_set_id)return Y(new Q(400,"missing_param","Missing required parameter: review_set_id","local"));try{let w=await n.get(`/review-sets/${encodeURIComponent(v.review_set_id)}`);return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.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:ZQ},async(U)=>{let v=U;if(!v.source_type)return Y(new Q(400,"missing_param","Missing required parameter: source_type","local"));if(!v.kind)return Y(new Q(400,"missing_param","Missing required parameter: kind","local"));if(!v.key)return Y(new Q(400,"missing_param","Missing required parameter: key","local"));if(!v.head_session_id)return Y(new Q(400,"missing_param","Missing required parameter: head_session_id","local"));let w=v.kind.trim().toLowerCase();if(!EQ.has(w))return Y(new Q(400,"invalid_param",`Invalid parameter: kind must be one of ${Xw.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 D=await n.post("/review-refs",{body:_});return q(D.body,D.requestId)}catch(D){if(D instanceof Q)return Y(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:cQ},async(U)=>{let v=U;if(!v.review_ref_id)return Y(new Q(400,"missing_param","Missing required parameter: review_ref_id","local"));try{let w=await n.get(`/review-refs/${encodeURIComponent(v.review_ref_id)}/resolve`);return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.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:hQ},async(U)=>{let v=U;if(!v.review_ref_id)return Y(new Q(400,"missing_param","Missing required parameter: review_ref_id","local"));if(!v.head_session_id)return Y(new Q(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 n.post(`/review-refs/${encodeURIComponent(v.review_ref_id)}/advance`,{body:w});return q(_.body,_.requestId)}catch(_){if(_ instanceof Q)return Y(_);throw _}}),$.register({name:"typescape_request_approval",description:"Request approval for a review from specified approvers. Sends notifications via configured channels.",inputSchema:mQ},async(U)=>{let v=U;if(!v.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!v.approver_emails||v.approver_emails.length===0)return Y(new Q(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 D=await n.post(`/reviews/${encodeURIComponent(v.review_id)}/request-approval`,{body:w,headers:_});return q(D.body,D.requestId)}catch(D){if(D instanceof Q)return Y(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:yQ},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).policy)return g.featureDisabledResult("policy")}catch(_){if(_ instanceof Q)return Y(_);throw _}if(!v.review_id)return Y(new Q(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 n.get(`/reviews/${encodeURIComponent(v.review_id)}/status`,{query:w});return q(CD(_.body),_.requestId)}catch(_){if(_ instanceof Q)return Y(_);throw _}}),$.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:tQ},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).checks)return g.featureDisabledResult("checks")}catch(w){if(w instanceof Q)return Y(w);throw w}if(!v.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{let w=await n.post(`/reviews/${encodeURIComponent(v.review_id)}/run-checks`,{body:{}});return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.register({name:"typescape_account_usage",description:"Get account usage and quota information (reviews used/limit, remaining, and billing period).",inputSchema:oQ},async()=>{try{let U=await n.get("/account/usage");return q(U.body,U.requestId)}catch(U){if(U instanceof Q)return Y(U);throw U}}),$.register({name:"typescape_account_plan",description:"Get account plan details (plan name/id, status, and limits metadata).",inputSchema:rQ},async()=>{try{let U=await n.get("/account/plan");return q(U.body,U.requestId)}catch(U){if(U instanceof Q)return Y(U);throw U}}),$.register({name:"typescape_get_capabilities",description:"Get authenticated capabilities and effective feature flags. Returns the same payload shape as GET /v1/me/capabilities.",inputSchema:dQ},async()=>{try{let U=await n.get("/me/capabilities");return q(U.body,U.requestId)}catch(U){if(U instanceof Q)return Y(U);throw U}})}var aQ=["typescape_request_snapshot","typescape_get_snapshot","typescape_list_backlinks","typescape_get_impact"],Ak={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier to build a corpus snapshot for"}},required:["repo_id"]},xk={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"]},fk={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"]},Ek={type:"object",properties:{review_id:{type:"string",description:"Review identifier to compute impact radius for"}},required:["review_id"]};function sQ($,n,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:Ak},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof Q)return Y(w);throw w}if(!v.repo_id)return Y(new Q(400,"missing_param","Missing required parameter: repo_id","local"));try{let w=await n.post(`/repos/${encodeURIComponent(v.repo_id)}/snapshots`,{body:{}});return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.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:xk},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof Q)return Y(w);throw w}if(!v.repo_id)return Y(new Q(400,"missing_param","Missing required parameter: repo_id","local"));if(!v.git_sha)return Y(new Q(400,"missing_param","Missing required parameter: git_sha","local"));try{let w=await n.get(`/repos/${encodeURIComponent(v.repo_id)}/snapshots/${encodeURIComponent(v.git_sha)}`);return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.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:fk},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof Q)return Y(w);throw w}if(!v.repo_id)return Y(new Q(400,"missing_param","Missing required parameter: repo_id","local"));if(!v.git_sha)return Y(new Q(400,"missing_param","Missing required parameter: git_sha","local"));if(!v.path)return Y(new Q(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 n.get(`/repos/${encodeURIComponent(v.repo_id)}/snapshots/${encodeURIComponent(v.git_sha)}/backlinks?${w}`);return q(_.body,_.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.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:Ek},async(U)=>{let v=U;try{if(!(await g.getCapabilities()).corpus_snapshots)return g.featureDisabledResult("corpus_snapshots")}catch(w){if(w instanceof Q)return Y(w);throw w}if(!v.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{let w=await n.get(`/reviews/${encodeURIComponent(v.review_id)}/impact`);return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}})}var bG=["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"],S$=c$({operation:"read"}),uD=new Map;function Qw($){return c$({operation:"write",hasIdempotencyKey:$})}function $G($){return $.status===0||$.status===429||$.status>=500}function vG($){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 nG($,n){if($.repo_id)return`/repos/${encodeURIComponent($.repo_id)}/steering-pack?${n}`;return`/sessions/${encodeURIComponent($.review_id)}/steering-pack?${n}`}function Gw($,n){let g=fX($.freshness.fetched_at);return{...n,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 TD($){if(!$||typeof $!=="object"||Array.isArray($))return;let n=$.request_id;return typeof n==="string"?n:void 0}function lD($){let n=$.compiledHash===void 0?null:$.compiledHash;return{rules:$.rules,compiled_hash:n,freshness:$.freshness,...$.requestId?{request_id:$.requestId}:{},...$.cacheMetadata??{}}}function DG($){if(!Array.isArray($))return[];return $.filter((n)=>typeof n==="object"&&n!==null&&!Array.isArray(n))}function Ck($){if(!$||typeof $!=="object"||Array.isArray($))return{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:0};let n=$;return{latest_rule_session_updated_at:typeof n.latest_rule_session_updated_at==="string"?n.latest_rule_session_updated_at:null,contributing_session_count:typeof n.contributing_session_count==="number"&&Number.isFinite(n.contributing_session_count)?n.contributing_session_count:0,total_rule_count:typeof n.total_rule_count==="number"&&Number.isFinite(n.total_rule_count)?n.total_rule_count:0}}function uk($){if(!$||typeof $!=="object"||Array.isArray($))return{};let n={};for(let[g,U]of Object.entries($))if(typeof U==="string"&&U.length>0)n[g]=U;return n}function JG($,n,g){try{return w$($)}catch{throw new Q(502,"invalid_upstream_response",g,n)}}function gG($){let n=new URLSearchParams({format:$.format}),g=Object.entries($.contentProperties).sort(([U],[v])=>U.localeCompare(v));for(let[U,v]of g)n.set(U,v);return`/rules?${n.toString()}`}async function Tk($){let n=await $.api.get(`/reviews/${encodeURIComponent($.reviewId)}`),g=JG(n.body,n.requestId,"Review detail response was not an object"),U=uk(g.properties),v=typeof g.repo_id==="string"&&g.repo_id.length>0?g.repo_id:null,w=typeof g.file_path==="string"&&g.file_path.length>0?g.file_path:null,_=$.filePath??w;if(v)U.repo_id=v;if(_)U.file_path=_;return{reviewId:$.reviewId,repoId:v,filePath:_,contentProperties:U}}async function UG($){let n=new URLSearchParams({format:"text.v1"}),g=new URLSearchParams({format:"prompt_fragment.v1"});if($.scope.file_path)n.set("file_path",$.scope.file_path),g.set("file_path",$.scope.file_path);if($.policySnapshotId)n.set("policy_snapshot_id",$.policySnapshotId),g.set("policy_snapshot_id",$.policySnapshotId);if($.tokenBudget!==void 0&&$.tokenBudget!==null)g.set("token_budget",String($.tokenBudget));let[U,v]=await Promise.all([$.api.getText(nG($.scope,n)),$.api.get(nG($.scope,g))]),w=MD(v.body),_=RD(w),D=ND({scope:$.scope,rules:[],plain_text_bundle:U.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:U.body,json_payload:w,structured_payload:_}});return uD.set(Uw($.scope),D),{text:U.body,normalizedBody:w,structuredPayload:lD({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:TD(w)})}}async function wG($){let n=await Tk({api:$.api,reviewId:$.reviewId,filePath:$.filePath}),[g,U]=await Promise.all([$.api.getText(gG({format:"text",contentProperties:n.contentProperties})),$.api.get(gG({format:"json",contentProperties:n.contentProperties}))]),v=JG(U.body,U.requestId,"Rules response payload was not an object"),w=DG(v.rules),_=Ck(v.freshness),D=TD(v),J=D===void 0?U.requestId:D,X=typeof v.compiled_hash==="string"?v.compiled_hash:null,G={...v,prompt_fragment:g.body,request_id:J},j=lD({rules:w,compiledHash:X,freshness:_,requestId:J}),L=ND({scope:{repo_id:n.repoId,review_id:n.reviewId,file_path:n.filePath},rules:[],plain_text_bundle:g.body,freshness:_,compiled_hash:X??void 0,fetched_at:new Date().toISOString(),renderings:{text:g.body,json_payload:G,structured_payload:w}});return uD.set(Uw({repo_id:n.repoId,review_id:n.reviewId,file_path:n.filePath}),L),{text:g.body,normalizedBody:G,structuredPayload:j}}function _G($,n){let g=uD.get(Uw($));if(!g)return null;if(n==="text")return Gw(g,{text:g.plain_text_bundle,format:"text",cached:!0});if(n==="structured"){let v=DG(g.renderings?.structured_payload);return Gw(g,{...lD({rules:v,compiledHash:g.compiled_hash,freshness:g.freshness,requestId:TD(g.renderings?.json_payload)}),cached:!0})}if(n==="prompt_fragment"){let v=g.renderings?.json_payload;if(v&&typeof v==="object"&&!Array.isArray(v))return Gw(g,{...v,non_authoritative:!0,compatibility_only:!0,cached:!0});return null}let U=g.renderings?.json_payload;if(!U||typeof U!=="object"||Array.isArray(U))return null;return Gw(g,{...U,cached:!0})}var lk={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}}},Zk={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"]},ck={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"}}},hk={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"}}},mk={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."}}},yk={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"]},tk={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"]},ok={type:"object",properties:{include_degraded:{type:"boolean",default:!0,description:"Include degraded rule details"}}},rk={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"]},dk={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 XG($,n,g){$.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:lk},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(K){if(K instanceof Q)return Y(K);throw K}let D=typeof _.repo_id==="string"&&_.repo_id.length>0,J=typeof _.review_id==="string"&&_.review_id.length>0;if(!D&&!J)return Y(new Q(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let X=_.format==="structured"?"structured":_.format==="prompt_fragment"?"prompt_fragment":"text",G=typeof _.file_path==="string"&&_.file_path.trim().length>0?_.file_path.trim():typeof _.path==="string"&&_.path.trim().length>0?_.path.trim():null,j=(K)=>{let I=new URLSearchParams({format:K});if(G)I.set("file_path",G);if(_.policy_snapshot_id)I.set("policy_snapshot_id",_.policy_snapshot_id);if(_.token_budget!==void 0&&_.token_budget!==null)I.set("token_budget",String(_.token_budget));return I},L=vG({repo_id:D?_.repo_id:void 0,review_id:J?_.review_id:void 0,file_path:G});try{let K=J&&!D?await wG({api:n,reviewId:_.review_id,filePath:G}):await UG({api:n,scope:L,tokenBudget:_.token_budget,policySnapshotId:_.policy_snapshot_id});if(X==="text")return q({text:K.text,format:"text"},K.normalizedBody.request_id??"missing_request_id",{retry:S$});let I={...K.normalizedBody};if(I.prompt_fragment&&X==="prompt_fragment")I.non_authoritative=!0,I.compatibility_only=!0;if(X==="structured")I.rules=K.structuredPayload.rules,I.compiled_hash=K.structuredPayload.compiled_hash,I.freshness=K.structuredPayload.freshness;return q(I,I.request_id??"missing_request_id",{retry:S$})}catch(K){if(K instanceof Q){if($G(K)){let I=_G(L,X);if(I)return q(I,K.requestId,{retry:S$})}return Y(K,{operation:"read"})}throw K}}),$.register({name:"typescape_rules_pack",description:"Compatibility-only alias for typescape_get_rules. Prefer typescape_get_rules in new harnesses and workflows.",inputSchema:mk},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(L){if(L instanceof Q)return Y(L);throw L}let D=typeof _.repo_id==="string"?_.repo_id.trim():"",J=typeof _.review_id==="string"?_.review_id.trim():"";if(!D&&!J)return Y(new Q(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let X=_.format??"text",G=typeof _.file_path==="string"&&_.file_path.trim().length>0?_.file_path.trim():typeof _.path==="string"&&_.path.trim().length>0?_.path.trim():null,j=vG({repo_id:D,review_id:J,file_path:G});try{let L=J&&!D?await wG({api:n,reviewId:J,filePath:G}):await UG({api:n,scope:j,tokenBudget:_.token_budget});if(X==="text")return q({text:L.text,format:"text"},L.normalizedBody.request_id??"missing_request_id",{retry:S$});let K=L.normalizedBody;if(X==="structured")return q(L.structuredPayload,K.request_id??"missing_request_id",{retry:S$});if(X==="json")return q(K,K.request_id??"missing_request_id",{retry:S$});let I=typeof K.prompt==="string"?K.prompt:typeof K.prompt_fragment==="string"?K.prompt_fragment:null;if(!I)throw new Q(502,"invalid_upstream_response","Rules pack response is missing prompt content",K.request_id??"missing_request_id");return q({prompt:I,prompt_fragment:I,compatibility_only:!0},K.request_id??"missing_request_id",{retry:S$})}catch(L){if(L instanceof Q){let K=X==="prompt"?"prompt_fragment":X;if($G(L)){let I=_G(j,K);if(I)return q(I,L.requestId,{retry:S$})}return Y(L,{operation:"read"})}throw L}}),$.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:yk},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(J){if(J instanceof Q)return Y(J);throw J}if(!_.content||_.content.length===0)return Y(new Q(400,"missing_param","Missing required parameter: content","local"));let D={content:_.content};if(_.properties!==void 0)D.properties=_.properties;if(_.collection_id!==void 0)D.collection_id=_.collection_id;if(_.idempotency_key!==void 0)D.idempotency_key=_.idempotency_key;try{let J=await n.post("/rules/check",{body:D});return q(J.body,J.requestId,{retry:S$})}catch(J){if(J instanceof Q)return Y(J,{operation:"read"});throw J}}),$.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:tk},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(X){if(X instanceof Q)return Y(X);throw X}if(!_.content||_.content.length===0)return Y(new Q(400,"missing_param","Missing required parameter: content","local"));let D={content:_.content};if(_.title!==void 0)D.title=_.title;if(_.applicability!==void 0)D.applicability=_.applicability;if(_.provenance!==void 0)D.provenance=_.provenance;if(_.preview!==void 0)D.preview=_.preview;if(_.idempotency_key!==void 0)D.idempotency_key=_.idempotency_key;let J={};if(_.idempotency_key)J["Idempotency-Key"]=_.idempotency_key;try{let X=await n.post("/rules/import",{body:D,headers:J});return q(X.body,X.requestId,{retry:Qw(Boolean(_.idempotency_key))})}catch(X){if(X instanceof Q)return Y(X,{operation:"write",hasIdempotencyKey:Boolean(_.idempotency_key)});throw X}});let U=/^gci_[0-9A-HJKMNP-TV-Z]{26}$/;$.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:Zk},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(J){if(J instanceof Q)return Y(J);throw J}if(!_.source_type)return Y(new Q(400,"missing_param","Missing required parameter: source_type","local"));if(_.source_type==="thread"&&!_.finding_id)return Y(new Q(422,"invalid_argument","finding_id is required when source_type is 'thread'","local"));if(_.related_item_ids){let J=_.related_item_ids.findIndex((X)=>!U.test(X));if(J>=0)return Y(new Q(422,"invalid_argument",`related_item_ids[${J}] must be a valid rule proposal id (gci_<26-char ULID>)`,"local"))}let D={};if(_.proposed_content!==void 0){if(typeof _.proposed_content!=="object"||_.proposed_content===null||Array.isArray(_.proposed_content))return Y(new Q(422,"invalid_argument","proposed_content must be an object when provided","local"));Object.assign(D,_.proposed_content)}if(_.title!==void 0&&D.title===void 0)D.title=_.title;if(_.content!==void 0&&D.content===void 0)D.content=_.content;if(_.target_document!==void 0&&D.target_document===void 0)D.target_document=_.target_document;if(_.priority!==void 0&&D.priority===void 0)D.priority=_.priority;if(_.tags!==void 0&&D.tags===void 0)D.tags=_.tags;try{let J=_.source_type==="thread"?"/steering/gcis/from-thread":"/steering/gcis",X=_.source_type==="thread"?{finding_id:_.finding_id,..._.proposed_type?{proposed_type:_.proposed_type}:{},..._.rationale!==void 0?{rationale:_.rationale}:{},...Object.keys(D).length>0?{proposed_content:D}:{}}:{source_type:_.source_type,..._.source_ref?{source_ref:_.source_ref}:{},..._.proposed_type?{proposed_type:_.proposed_type}:{},...Object.keys(D).length>0?{proposed_content:D}:{},..._.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}:{}},G=await n.post(J,{body:X});return q(w$(G.body),G.requestId,{retry:Qw(!1)})}catch(J){if(J instanceof Q)return Y(J,{operation:"write"});throw J}}),$.register({name:"typescape_list_rule_proposals",description:"Canonical rule proposal listing surface. Use to monitor the rules governance pipeline. Requires features.rules.",inputSchema:ck},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(D){if(D instanceof Q)return Y(D);throw D}try{let D={};if(_.status)D.status=_.status;if(_.limit!==void 0&&_.limit!==null)D.limit=String(_.limit);let J=new URLSearchParams(D).toString(),X=await n.get(`/steering/gcis${J?`?${J}`:""}`);return q(bw(X.body),X.requestId,{retry:S$})}catch(D){if(D instanceof Q)return Y(D,{operation:"read"});throw D}}),$.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:hk},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(D){if(D instanceof Q)return Y(D);throw D}try{let D={};if(_.status)D.status=_.status;if(_.kind)D.kind=_.kind;if(_.limit!==void 0&&_.limit!==null)D.limit=String(_.limit);let J=new URLSearchParams(D).toString(),X=await n.get(`/steering/proposals${J?`?${J}`:""}`);return q(X.body,X.requestId,{retry:S$})}catch(D){if(D instanceof Q)return Y(D,{operation:"read"});throw D}}),$.register({name:"typescape_rules_dashboard",description:"Get aggregate rules health metrics: active rule count, average health, degraded rules. Requires features.rules.",inputSchema:ok},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(D){if(D instanceof Q)return Y(D);throw D}try{let D=_.include_degraded!==!1,J,X;try{let G=await n.get("/steering/dashboard/summary");J=G.requestId,X={...w$(G.body)}}catch(G){if(!(G instanceof Q))throw G;let j=await n.get("/steering/dashboard/rules?limit=1&offset=0"),L=w$(j.body),K=typeof L.total==="number"?L.total:typeof L.total_rules==="number"?L.total_rules:0;J=j.requestId,X={summary_unavailable:{code:G.code,message:G.message,request_id:G.requestId},rule_health:{total_rules:K}}}if(D){let G=await n.get("/steering/dashboard/degradation"),j=w$(G.body),L=Array.isArray(j.degraded_rules)?j.degraded_rules:Array.isArray(j.data)?j.data:null;if(!Array.isArray(L))throw new Q(502,"invalid_upstream_response","degraded_rules must be an array",G.requestId);X.degraded_rules=L}return q(X,J,{retry:S$})}catch(D){if(D instanceof Q)return Y(D,{operation:"read"});throw D}}),$.register({name:"typescape_promote_rule_proposal",description:"Convert an approved rule proposal into a rule for operator acceptance. Requires features.rules.",inputSchema:rk},async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(J){if(J instanceof Q)return Y(J);throw J}if(!_.gci_id)return Y(new Q(400,"missing_param","Missing required parameter: gci_id","local"));let D={};if(_.kind!==void 0)D.kind=_.kind;if(_.scope!==void 0)D.scope=_.scope;if(_.content_override!==void 0)D.content_override=_.content_override;try{let J=await n.post(`/steering/gcis/${encodeURIComponent(_.gci_id)}/publish`,{body:D});return q(J.body,J.requestId,{retry:Qw(!1)})}catch(J){if(J instanceof Q)return Y(J,{operation:"write"});throw J}});let v=async(w)=>{let _=w;try{if(!(await g.getCapabilities()).rules)return g.featureDisabledResult("rules")}catch(G){if(G instanceof Q)return Y(G);throw G}if(!_.proposal_id)return Y(new Q(400,"missing_param","Missing required parameter: proposal_id","local"));if(!_.decision)return Y(new Q(400,"missing_param","Missing required parameter: decision","local"));if(_.decision==="reject"&&!_.notes)return Y(new Q(422,"invalid_argument","notes is required when decision is 'reject'","local"));let J={accept:"activate",reject:"reject",deprecate:"deprecate"}[_.decision],X={};if(_.notes!==void 0)X.notes=_.notes;try{let G=await n.post(`/steering/proposals/${encodeURIComponent(_.proposal_id)}/${J}`,{body:X});return q(G.body,G.requestId,{retry:Qw(!1)})}catch(G){if(G instanceof Q)return Y(G,{operation:"write"});throw G}};$.register({name:"typescape_decide_rule_proposal",description:"Accept, reject, or deprecate a rule proposal. Accepting activates the rule immediately. Requires features.rules.",inputSchema:dk},async(w)=>{return v(w)})}var QG=["typescape_list_repos","typescape_connect_repo","typescape_repo_branches","typescape_upload_reviewer_asset"];function pk($){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 ek=5242880,ak=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function GG($,n){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(_)=>{let D=_,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 n.get("/repos",{query:J});return q(X.body,X.requestId)}catch(X){if(X instanceof Q)return Y(X);throw X}});let U={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(U,async(_)=>{let D=_;if(!D.origin_url)return Y(new Q(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 n.post("/repos",{body:J});return q(X.body,X.requestId)}catch(X){if(X instanceof Q)return Y(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(_)=>{let D=_;if(!D.repo_id)return Y(new Q(400,"missing_param","Missing required parameter: repo_id","local"));try{let J=await n.get(`/repos/${encodeURIComponent(D.repo_id)}/branches`);return q(J.body,J.requestId)}catch(J){if(J instanceof Q)return Y(J);throw J}});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"]}};$.register(w,async(_)=>{let D=_;if(!D.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));if(!D.base64_content)return Y(new Q(400,"missing_param","Missing required parameter: base64_content","local"));if(!D.mime_type)return Y(new Q(400,"missing_param","Missing required parameter: mime_type","local"));if(!ak.has(D.mime_type))return Y(new Q(415,"unsupported_media_type",`Unsupported MIME type "${D.mime_type}". Allowed: PNG, JPEG, GIF, WebP.`,"local"));if(!AD.test(D.base64_content))return Y(new Q(400,"invalid_base64","base64_content is not valid base64-encoded data","local"));let J;try{let j=Buffer.from(D.base64_content,"base64");J=new Uint8Array(j)}catch{return Y(new Q(400,"invalid_base64","Failed to decode base64_content","local"))}if(J.byteLength>ek){let j=(J.byteLength/1048576).toFixed(1);return Y(new Q(413,"asset_too_large",`Image is ${j}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}),G=new FormData;if(G.append("file",X,D.filename||`upload.${pk(D.mime_type)}`),G.append("mime_type",D.mime_type),D.alt_text)G.append("alt_text",D.alt_text);try{let j=await n.postFormData(`/sessions/${encodeURIComponent(D.review_id)}/reviewer-assets`,G);return q(j.body,j.requestId)}catch(j){if(j instanceof Q)return Y(j);throw j}})}var WG=["typescape_create_collection","typescape_add_review_to_collection"],sk={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"]},$j={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 YG($,n,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:sk},async(U)=>{let v=U;if(!v.name)return Y(new Q(400,"missing_param","Missing required parameter: name","local"));try{if(!(await g.getCapabilities()).collections_enabled)return g.featureDisabledResult("collections_enabled")}catch(_){if(_ instanceof Q)return Y(_);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 n.post("/collections",{body:w});return q(w$(_.body),_.requestId)}catch(_){if(_ instanceof Q)return Y(_);throw _}}),$.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:$j},async(U)=>{let v=U;if(!v.collection_id)return Y(new Q(400,"missing_param","Missing required parameter: collection_id","local"));if(!v.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{if(!(await g.getCapabilities()).collections_enabled)return g.featureDisabledResult("collections_enabled")}catch(w){if(w instanceof Q)return Y(w);throw w}try{let w=await n.post(`/collections/${encodeURIComponent(v.collection_id)}/sessions`,{body:{session_id:v.review_id}});return q(w$(w.body),w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}})}var kG={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"]},jG={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:[]},IG={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to retrieve"}},required:["artifact_id"]},HG={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"]},VG={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 KG=["typescape_submit_advisory","typescape_list_advisories","typescape_get_advisory","typescape_adopt_advisory","typescape_reject_advisory"],LG=c$({operation:"read"});function ZD($){return c$({operation:"write",hasIdempotencyKey:$})}function vj($){if(!$)return;return{...$,export_sha256:$.export_sha256??$.export_hash,rulepack_sha256:$.rulepack_sha256??$.rulepack_hash,source_content_sha256:$.source_content_sha256??$.source_hash}}function qG($,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:kG},async(g)=>{let U=g,v=U.artifact_kind??U.kind,w=U.body_md??U.body,_=vj(U.basis);if(!v)return Y(new Q(400,"missing_param","Missing required parameter: artifact_kind","local"));if(!U.target_type)return Y(new Q(400,"missing_param","Missing required parameter: target_type","local"));if(!U.target_id)return Y(new Q(400,"missing_param","Missing required parameter: target_id","local"));if(!w)return Y(new Q(400,"missing_param","Missing required parameter: body_md","local"));if(!U.source_label)return Y(new Q(400,"missing_param","Missing required parameter: source_label","local"));if(!U.submitted_by)return Y(new Q(400,"missing_param","Missing required parameter: submitted_by","local"));let D={artifact_kind:v,target:{target_type:U.target_type,target_id:U.target_id},provenance:{source_type:U.source_type??"agent",source_label:U.source_label,submitted_by:U.submitted_by,submitted_at:new Date().toISOString()},payload:{body_md:w,...U.confidence!==void 0&&{confidence:U.confidence},...U.severity_hint!==void 0&&{severity_hint:U.severity_hint},...U.structured_data!==void 0&&{structured_data:U.structured_data},...U.evidence_refs!==void 0&&{evidence_refs:U.evidence_refs}}};if(U.review_id)D.review_id=U.review_id;if(_)D.basis=_;if(U.idempotency_key)D.idempotency_key=U.idempotency_key;let J={};if(U.idempotency_key)J["Idempotency-Key"]=U.idempotency_key;try{let X=await n.post("/advisory-artifacts",{body:D,headers:J});return q(X.body,X.requestId,{retry:ZD(Boolean(U.idempotency_key))})}catch(X){if(X instanceof Q)return Y(X,{operation:"write",hasIdempotencyKey:Boolean(U.idempotency_key)});throw X}}),$.register({name:"typescape_list_advisories",description:"List advisory artifacts with optional filters. Filter by review, target, kind, status, or submitter.",inputSchema:jG},async(g)=>{let U=g,v={};if(U.review_id)v.review_id=U.review_id;if(U.target_type)v.target_type=U.target_type;if(U.target_id)v.target_id=U.target_id;if(U.artifact_kind)v.artifact_kind=U.artifact_kind;if(U.status)v.status=U.status;if(U.submitted_by)v.submitted_by=U.submitted_by;if(U.limit!==void 0)v.limit=String(U.limit);if(U.offset!==void 0)v.offset=String(U.offset);try{let w=await n.get("/advisory-artifacts",{query:v});return q(w.body,w.requestId,{retry:LG})}catch(w){if(w instanceof Q)return Y(w,{operation:"read"});throw w}}),$.register({name:"typescape_get_advisory",description:"Get a single advisory artifact by ID. Returns full artifact with provenance, payload, and adoption state.",inputSchema:IG},async(g)=>{let U=g;if(!U.artifact_id)return Y(new Q(400,"missing_param","Missing required parameter: artifact_id","local"));try{let v=await n.get(`/advisory-artifacts/${encodeURIComponent(U.artifact_id)}`);return q(v.body,v.requestId,{retry:LG})}catch(v){if(v instanceof Q)return Y(v,{operation:"read"});throw v}}),$.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:HG},async(g)=>{let U=g;if(!U.artifact_id)return Y(new Q(400,"missing_param","Missing required parameter: artifact_id","local"));let v={};if(U.rationale)v.rationale=U.rationale;if(U.adoption_review_id)v.adoption_review_id=U.adoption_review_id;if(U.adoption_proposed_change_id)v.adoption_proposed_change_id=U.adoption_proposed_change_id;try{let w=await n.post(`/advisory-artifacts/${encodeURIComponent(U.artifact_id)}/adopt`,{body:v});return q(w.body,w.requestId,{retry:ZD(!1)})}catch(w){if(w instanceof Q)return Y(w,{operation:"write"});throw w}}),$.register({name:"typescape_reject_advisory",description:"Reject an advisory artifact with a reason. Transitions from 'submitted' to 'rejected'. Terminal state.",inputSchema:VG},async(g)=>{let U=g;if(!U.artifact_id)return Y(new Q(400,"missing_param","Missing required parameter: artifact_id","local"));if(!U.rejection_reason)return Y(new Q(400,"missing_param","Missing required parameter: rejection_reason","local"));let v={rejection_reason:U.rejection_reason};try{let w=await n.post(`/advisory-artifacts/${encodeURIComponent(U.artifact_id)}/reject`,{body:v});return q(w.body,w.requestId,{retry:ZD(!1)})}catch(w){if(w instanceof Q)return Y(w,{operation:"write"});throw w}})}var BG={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:[]},OG={type:"object",properties:{receipt_id:{type:"string",description:"Action receipt ID to retrieve"}},required:["receipt_id"]},FG={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to list receipts for"}},required:["artifact_id"]};var NG=["typescape_list_action_receipts","typescape_get_action_receipt","typescape_list_artifact_receipts"],cD=c$({operation:"read"});function iG($,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:BG},async(g)=>{let U=g,v={};if(U.artifact_id)v.artifact_id=U.artifact_id;if(U.action_type)v.action_type=U.action_type;if(U.actor_id)v.actor_id=U.actor_id;if(U.actor_type)v.actor_type=U.actor_type;if(U.review_id)v.review_id=U.review_id;if(U.limit!==void 0)v.limit=String(U.limit);if(U.offset!==void 0)v.offset=String(U.offset);try{let w=await n.get("/action-receipts",{query:v});return q(w.body,w.requestId,{retry:cD})}catch(w){if(w instanceof Q)return Y(w,{operation:"read"});throw w}}),$.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:OG},async(g)=>{let U=g;if(!U.receipt_id)return Y(new Q(400,"missing_param","Missing required parameter: receipt_id","local"));try{let v=await n.get(`/action-receipts/${encodeURIComponent(U.receipt_id)}`);return q(v.body,v.requestId,{retry:cD})}catch(v){if(v instanceof Q)return Y(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:FG},async(g)=>{let U=g;if(!U.artifact_id)return Y(new Q(400,"missing_param","Missing required parameter: artifact_id","local"));try{let v=await n.get(`/advisory-artifacts/${encodeURIComponent(U.artifact_id)}/receipts`);return q(v.body,v.requestId,{retry:cD})}catch(v){if(v instanceof Q)return Y(v,{operation:"read"});throw v}})}var PG=["typescape_create_project","typescape_list_projects","typescape_get_project","typescape_update_project"],nj={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"]},gj={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"}}},Uj={type:"object",properties:{project_id:{type:"string",description:"Project ID (e.g., prj_01HXYZ...)"}},required:["project_id"]},wj={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 SG($,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:nj},async(g)=>{let U=g;if(!U.name)return Y(new Q(400,"missing_param","Missing required parameter: name","local"));let v={name:U.name};if(U.description!==void 0)v.description=U.description;try{let w=await n.post("/projects",{body:v});return q(w$(w.body),w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.register({name:"typescape_list_projects",description:"List projects with optional cursor pagination. Returns an array of projects with pagination metadata.",inputSchema:gj},async(g)=>{let U=g,v={};if(U.limit!==void 0)v.limit=String(U.limit);if(U.cursor!==void 0)v.cursor=U.cursor;try{let w=await n.get("/projects",{query:v});return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.register({name:"typescape_get_project",description:"Get a project by ID. Returns the project details including configuration.",inputSchema:Uj},async(g)=>{let U=g;if(!U.project_id)return Y(new Q(400,"missing_param","Missing required parameter: project_id","local"));try{let v=await n.get(`/projects/${encodeURIComponent(U.project_id)}`);return q(w$(v.body),v.requestId)}catch(v){if(v instanceof Q)return Y(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:wj},async(g)=>{let U=g;if(!U.project_id)return Y(new Q(400,"missing_param","Missing required parameter: project_id","local"));let v={};if(U.name!==void 0)v.name=U.name;if(U.description!==void 0)v.description=U.description;try{let w=await n.request("PATCH",`/projects/${encodeURIComponent(U.project_id)}`,{body:v});return q(w$(w.body),w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}})}var zG=["typescape_create_template","typescape_list_templates","typescape_get_template"],_j={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"]},bj={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"}}},Dj={type:"object",properties:{template_id:{type:"string",description:"Template ID (e.g., tpl_01HXYZ...)"}},required:["template_id"]};function MG($,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:_j},async(g)=>{let U=g;if(!U.name)return Y(new Q(400,"missing_param","Missing required parameter: name","local"));let v={name:U.name};if(U.description!==void 0)v.description=U.description;if(U.source_type!==void 0)v.source_type=U.source_type;if(U.repo_id!==void 0)v.repo_id=U.repo_id;if(U.project_id!==void 0)v.project_id=U.project_id;if(U.config!==void 0)v.config=U.config;try{let w=await n.post("/session-templates",{body:v});return q(w$(w.body),w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.register({name:"typescape_list_templates",description:"List review templates with optional cursor pagination. Returns an array of templates with pagination metadata.",inputSchema:bj},async(g)=>{let U=g,v={};if(U.limit!==void 0)v.limit=String(U.limit);if(U.cursor!==void 0)v.cursor=U.cursor;try{let w=await n.get("/session-templates",{query:v});return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.register({name:"typescape_get_template",description:"Get a review template by ID. Returns the template details including configuration.",inputSchema:Dj},async(g)=>{let U=g;if(!U.template_id)return Y(new Q(400,"missing_param","Missing required parameter: template_id","local"));try{let v=await n.get(`/session-templates/${encodeURIComponent(U.template_id)}`);return q(w$(v.body),v.requestId)}catch(v){if(v instanceof Q)return Y(v);throw v}})}var RG=["typescape_list_issues","typescape_get_issue","typescape_update_issue"],Jj={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"]},Xj={type:"object",properties:{issue_id:{type:"string",description:"Issue ID (e.g., iss_01HXYZ...)"}},required:["issue_id"]},Qj={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 AG($,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:Jj},async(g)=>{let U=g;if(!U.session_id)return Y(new Q(400,"missing_param","Missing required parameter: session_id","local"));let v={};if(U.status!==void 0)v.status=U.status;if(U.severity!==void 0)v.severity=U.severity;if(U.limit!==void 0)v.limit=String(U.limit);if(U.offset!==void 0)v.offset=String(U.offset);try{let w=await n.get("/issues",{query:{...v,session_id:U.session_id}});return q(w.body,w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}}),$.register({name:"typescape_get_issue",description:"Get an issue by ID. Returns the full issue details including anchors, associated threads, and current status.",inputSchema:Xj},async(g)=>{let U=g;if(!U.issue_id)return Y(new Q(400,"missing_param","Missing required parameter: issue_id","local"));try{let v=await n.get(`/issues/${encodeURIComponent(U.issue_id)}`);return q(w$(v.body),v.requestId)}catch(v){if(v instanceof Q)return Y(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:Qj},async(g)=>{let U=g;if(!U.issue_id)return Y(new Q(400,"missing_param","Missing required parameter: issue_id","local"));let v={};if(U.status!==void 0)v.status=U.status;if(U.assignee!==void 0)v.assignee=U.assignee;if(U.priority!==void 0)v.priority=U.priority;try{let w=await n.request("PATCH",`/issues/${encodeURIComponent(U.issue_id)}`,{body:v});return q(w$(w.body),w.requestId)}catch(w){if(w instanceof Q)return Y(w);throw w}})}var xG=["typescape_list_webhooks","typescape_create_webhook","typescape_delete_webhook"],Gj={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:[]},Wj={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"]},Yj={type:"object",properties:{webhook_id:{type:"string",description:"The webhook subscription ID to delete."}},required:["webhook_id"]};function fG($,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:Gj},async(g)=>{let U=g;try{let v=new URLSearchParams;if(U.status)v.set("status",U.status);if(U.limit)v.set("limit",String(U.limit));let w=v.toString(),_=w?`/webhooks?${w}`:"/webhooks",D=await n.get(_);return q(D.body,D.requestId)}catch(v){if(v instanceof Q)return Y(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:Wj},async(g)=>{let U=g;if(!U.url)return Y(new Q(400,"missing_param","Missing required parameter: url","local"));if(!U.events||U.events.length===0)return Y(new Q(400,"missing_param","Missing required parameter: events (must be a non-empty array)","local"));try{let v=await n.post("/webhooks",{body:{url:U.url,events:U.events,description:U.description}});return q(v.body,v.requestId)}catch(v){if(v instanceof Q)return Y(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:Yj},async(g)=>{let U=g;if(!U.webhook_id)return Y(new Q(400,"missing_param","Missing required parameter: webhook_id","local"));try{let v=await n.request("DELETE",`/webhooks/${encodeURIComponent(U.webhook_id)}`,{});return q({deleted:!0,webhook_id:U.webhook_id},v.requestId)}catch(v){if(v instanceof Q)return Y(v);throw v}})}var EG=["typescape_list_events"],kj={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 CG($,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:kj},async(g)=>{let U=g;if(!U.review_id)return Y(new Q(400,"missing_param","Missing required parameter: review_id","local"));try{let v=new URLSearchParams;if(U.cursor)v.set("cursor",U.cursor);if(U.limit)v.set("limit",String(U.limit));let w=v.toString(),_=`/sessions/${encodeURIComponent(U.review_id)}/events${w?`?${w}`:""}`,D=await n.get(_);return q(D.body,D.requestId)}catch(v){if(v instanceof Q)return Y(v);throw v}})}import{readdir as jj,readFile as Ij}from"node:fs/promises";import{dirname as Hj,extname as Vj,resolve as lG}from"node:path";import{fileURLToPath as Lj}from"node:url";var ZG=["typescape_list_playbooks","typescape_get_playbook"],Kj={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:[]},qj={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"]},Bj=Hj(Lj(import.meta.url)),uG=lG(Bj,"../../../../docs/playbooks");function Ww($){let n=$.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);return n}function Oj($){let n=$.trim();if(n.startsWith("[")&&n.endsWith("]"))return n.slice(1,-1).split(",").map((g)=>Ww(g)).filter((g)=>g.length>0);return Ww(n)}function Fj($){let n=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec($);if(!n)return null;let g={},U=n[1].split(/\r?\n/);for(let v=0;v<U.length;){let _=U[v].trim();if(_.length===0||_.startsWith("#")){v+=1;continue}let D=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(_);if(!D){v+=1;continue}let J=D[1],X=D[2],G=X===void 0?"":X.trim();if(G.length>0){g[J]=Oj(G),v+=1;continue}v+=1;let j=[],L={};while(v<U.length){let K=U[v],I=K.trim(),H=/^\s*/.exec(K)[0].length;if(I.length===0){v+=1;continue}if(H<2)break;if(I.startsWith("- ")){j.push(Ww(I.slice(2))),v+=1;continue}let S=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(I);if(!S){v+=1;continue}let i=S[2];L[S[1]]=Ww(i===void 0?"":i),v+=1}g[J]=j.length>0?j:Object.keys(L).length>0?L:""}return g}async function cG(){let $=await jj(uG,{withFileTypes:!0}),n=await Promise.all($.filter((U)=>U.isFile()&&Vj(U.name)===".md").map(async(U)=>{let v=await Ij(lG(uG,U.name),"utf8"),w=Fj(v);if(!w)return null;let _=Array.isArray(w.workflows)?w.workflows.filter((G)=>typeof G==="string"&&G.length>0):[],D=Array.isArray(w.tags)?w.tags.filter((G)=>typeof G==="string"&&G.length>0):void 0,J=Array.isArray(w.min_tools_required)?w.min_tools_required.filter((G)=>typeof G==="string"&&G.length>0):void 0,X=typeof w.compatible_artifacts==="object"&&w.compatible_artifacts!==null&&!Array.isArray(w.compatible_artifacts)?w.compatible_artifacts:void 0;return{name:typeof w.name==="string"?w.name:U.name,version:typeof w.version==="string"?w.version:"0.0.0",summary:typeof w.summary==="string"?w.summary:"",workflows:_,trust_level:typeof w.trust_level==="string"?w.trust_level:"first_party",author:typeof w.author==="string"?w.author:"Typescape",content:v,compatible_api_version:typeof w.compatible_api_version==="string"?w.compatible_api_version:void 0,compatible_artifacts:X,tags:D,min_tools_required:J}})),g=[];for(let U of n)if(U!==null)g.push(U);return g.sort((U,v)=>U.name.localeCompare(v.name))}async function Nj($){return(await cG()).filter((g)=>{if($.workflow&&!g.workflows.includes($.workflow))return!1;if($.trust_level&&g.trust_level!==$.trust_level)return!1;return!0})}async function ij($){let g=(await cG()).find((U)=>U.name.toLowerCase()===$.toLowerCase());return g===void 0?null:g}function TG($){return $.status===0||$.status===404||$.code==="not_found"}function hG($,n){$.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:Kj},async(g)=>{let U=g;try{let v=new URLSearchParams;if(U.workflow)v.set("workflow",U.workflow);if(U.trust_level)v.set("trust_level",U.trust_level);let w=v.toString(),_=w?`/playbooks?${w}`:"/playbooks",D=await n.get(_);return q(D.body,D.requestId)}catch(v){if(v instanceof Q&&TG(v)){let w=await Nj(U);return q({items:w,source:"bundled_local"},Dw)}if(v instanceof Q)return Y(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:qj},async(g)=>{let U=g;if(!U.name)return Y(new Q(400,"missing_param","Missing required parameter: name","local"));try{let v=`/playbooks/${encodeURIComponent(U.name)}`,w=await n.get(v);return q(w.body,w.requestId)}catch(v){if(v instanceof Q&&TG(v)){let w=await ij(U.name);if(w)return q(w,Dw)}if(v instanceof Q)return Y(v);throw v}})}var MO=[...KQ,...xQ,...pQ,...aQ,...bG,...QG,...WG,...KG,...NG,...PG,...zG,...RG,...xG,...EG,...ZG];function hD($,n){let g=XQ(n);BQ($,n),fQ($,n),eQ($,n,g),sQ($,n,g),XG($,n,g),GG($,n),YG($,n,g),qG($,n),iG($,n),SG($,n),MG($,n),AG($,n),fG($,n),CG($,n),hG($,n)}var mG={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 Yw extends Error{missingEnvVars;constructor($){super("Missing required environment variables");this.missingEnvVars=$;this.name="McpConfigError"}}function Pg($,n){let g=$[n];if(!g)return;let U=g.trim();return U.length>0?U:void 0}function Pj($){let n=[];if(!Pg($,"TYPESCAPE_API_KEY"))n.push(`TYPESCAPE_API_KEY: ${mG.TYPESCAPE_API_KEY}`);if(!Pg($,"TYPESCAPE_BASE_URL"))n.push(`TYPESCAPE_BASE_URL: ${mG.TYPESCAPE_BASE_URL}`);return n}function yG($,n=Sg){if(!$||$.trim().length===0)return{timeoutMs:n,warning:null};let g=$.trim();if(/^\d+$/.test(g)){let U=Number(g);if(U>=1000)return{timeoutMs:U,warning:null}}return{timeoutMs:n,warning:`Warning: Invalid TYPESCAPE_TIMEOUT_MS='${$}'. Using default ${n}ms.`}}function tG($=process.env,n=Sg){let g=Pg($,"TYPESCAPE_API_KEY"),U=Pg($,"TYPESCAPE_BASE_URL");if(!g||!U)throw new Yw(Pj($));let v=Pg($,"TYPESCAPE_TIMEOUT_MS"),w=yG(v,n);return{apiKey:g,baseUrl:U,timeoutMs:w.timeoutMs,timeoutWarning:w.warning}}async function Sj(){let $;try{$=tG()}catch(U){if(U instanceof Yw){console.error("Error: Missing required environment variables:");for(let v of U.missingEnvVars)console.error(` - ${v}`);process.exit(1)}throw U}if($.timeoutWarning)console.warn($.timeoutWarning);let n=$J($.baseUrl,$.apiKey,$.timeoutMs),g=rD();hD(g,n),await JQ(g)}if(oD.main==oD.module)Sj().catch(($)=>{console.error("Fatal error:",$ instanceof Error?$.message:String($)),process.exit(1)});export{yG as resolveTimeoutMs};
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 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: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 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"]},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:"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"]},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 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: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 deterministic product-owned 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 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: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 for an optional server-side advisory pass 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"]},_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 agent read path for repository or review context. Fetch this before reasoning about a draft or reconciling reviewer feedback. 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:"Optional server-side advisory pass for markdown content. Do not treat this as a complete review or substitute for agent reasoning. Canonical loop: typescape_get_rules -> read content -> typescape_create_finding. 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=`---
44
+ name: agent-review-loop
45
+ version: "1.0.0"
46
+ summary: "Run the end-to-end agent review loop while keeping user, reviewer, and operator decisions explicit."
47
+ workflows:
48
+ - review-creation
49
+ - rule-evaluation
50
+ - feedback-collection
51
+ - revision
52
+ - approval
53
+ compatible_api_version: "v1"
54
+ compatible_artifacts:
55
+ handoff_bundle: ">=1.0.0"
56
+ rulepack: ">=1.0.0"
57
+ export_schema: "v2"
58
+ trust_level: first_party
59
+ author: "Typescape"
60
+ license: "Apache-2.0"
61
+ tags:
62
+ - agent
63
+ - end-to-end
64
+ - reviewer
65
+ - operator
66
+ min_tools_required:
67
+ - typescape_create_review
68
+ - typescape_get_review
69
+ - typescape_get_render
70
+ - typescape_get_rules
71
+ - typescape_run_checks
72
+ - typescape_create_finding
73
+ - typescape_get_handoff
74
+ - typescape_revise_review
75
+ - typescape_request_approval
76
+ ---
77
+
78
+ # Playbook: Agent Review Loop
79
+
80
+ ## Overview
81
+
82
+ Use this playbook when a user asks an external agent to review content with
83
+ Typescape and then help drive the follow-up loop through revision and approval.
84
+
85
+ Typescape is the deterministic substrate. The agent is the evaluator. The
86
+ agent reads the content, reads the applicable rules, decides where findings are
87
+ warranted, and records them. Typescape stores the basis, anchors, findings,
88
+ rule context, and lifecycle state, but it does not replace the agent's or the
89
+ reviewer's judgment.
90
+
91
+ ## Human Boundaries
92
+
93
+ - **User / author** owns source truth, editorial intent, and final content edits.
94
+ - **Agent** may fetch context, evaluate content, create findings, draft
95
+ revisions, and prepare approval requests.
96
+ - **Reviewer** owns human comments, nuanced editorial judgment, and approval
97
+ feedback.
98
+ - **Operator** owns authoritative actions such as adopting advisories, publishing
99
+ rules, or deciding whether a review is ready to close.
100
+
101
+ Do not silently cross those boundaries. If the next step is a human decision,
102
+ surface the decision cleanly instead of guessing.
103
+
104
+ ## Steps
105
+
106
+ ### 1. Establish the review basis
107
+
108
+ If a review does not already exist, create one. Otherwise fetch the current
109
+ review so you are pinned to the correct \`review_id\`, file identity, and state.
110
+
111
+ **Tools**:
112
+
113
+ - \`typescape_create_review\`
114
+ - \`typescape_get_review\`
115
+
116
+ **Record**:
117
+
118
+ - \`review_id\`
119
+ - file identity (\`repo_id\` + \`git_sha\` + \`file_path\`, or upload path)
120
+ - current state
121
+
122
+ ### 2. Fetch the actual content and applicable rules
123
+
124
+ Fetch both the rendered content and the applicable rule bundle before you
125
+ evaluate anything.
126
+
127
+ **Tools**:
128
+
129
+ - \`typescape_get_render\`
130
+ - \`typescape_get_rules\`
131
+
132
+ The render gives you block IDs and block text. The rules bundle gives you the
133
+ compiled rule text, applicability, and basis hash. Evaluate against both.
134
+
135
+ ### 3. Optionally run checks as a fast signal
136
+
137
+ \`typescape_run_checks\` is useful as a fast system signal, but it is not the
138
+ whole review. Checks may surface system findings or applicability hints, but
139
+ they do not replace block-by-block agent judgment.
140
+
141
+ Use checks to:
142
+
143
+ - confirm the rulepack is active
144
+ - surface obvious machine-detectable issues
145
+ - capture system findings the reviewer should see
146
+
147
+ Do not treat a passing or empty checks run as proof that the content is ready.
148
+
149
+ ### 4. Evaluate block by block and create findings
150
+
151
+ Read each relevant block and compare it against the applicable rules. Create
152
+ findings only where you can explain:
153
+
154
+ - which block is affected
155
+ - which rule or human standard is implicated
156
+ - what the problem is
157
+ - what outcome would resolve it
158
+
159
+ **Tool**: \`typescape_create_finding\`
160
+
161
+ Good findings are specific and anchored. Avoid vague, document-level comments
162
+ when a block-level anchor exists.
163
+
164
+ ### 5. Decide whether the issue is content, rule, or workflow
165
+
166
+ Not every issue should become the same kind of action.
167
+
168
+ - If the content is wrong, create a finding on the content review.
169
+ - If the content is fine but the rule is too broad or incorrect, switch to
170
+ \`challenge-rule\`.
171
+ - If the same reviewer feedback keeps recurring and should become governance,
172
+ switch to \`propose-rule\`.
173
+ - If the problem is missing context from the reviewer or operator, ask for that
174
+ context explicitly instead of inventing it.
175
+
176
+ ### 6. Produce the revision package
177
+
178
+ Once findings are recorded, fetch a stable handoff/export so the next revision
179
+ pass works from explicit basis hashes and current review state.
180
+
181
+ **Tool**: \`typescape_get_handoff\`
182
+
183
+ Use the handoff to drive a revision plan, or hand it to another agent/operator
184
+ who will perform the revision.
185
+
186
+ ### 7. Revise and supersede when instructed
187
+
188
+ If the user asks for a revised draft, produce the new content and revise the
189
+ review using a clear changes summary.
190
+
191
+ **Tool**: \`typescape_revise_review\`
192
+
193
+ Preserve:
194
+
195
+ - predecessor linkage
196
+ - the intended file identity
197
+ - an explicit changes summary
198
+
199
+ ### 8. Request approval, but do not auto-approve
200
+
201
+ When the revision is ready, request approval from the right humans.
202
+
203
+ **Tool**: \`typescape_request_approval\`
204
+
205
+ Do not claim the review is approved until an approver actually records that
206
+ decision. A clean draft is not an approval.
207
+
208
+ ## Completion Criteria
209
+
210
+ - Review basis is pinned and recorded.
211
+ - Applicable rules were fetched before evaluation.
212
+ - Findings are block-specific and explainable.
213
+ - Any revision or supersede step preserves lineage and changes summary.
214
+ - Approval is requested when the work is ready, but not faked or inferred.
215
+
216
+ ## Troubleshooting
217
+
218
+ ### No rules matched
219
+
220
+ Check the review properties and rule applicability before concluding that no
221
+ governance applies. Missing or incorrect properties are often the real cause.
222
+
223
+ ### Checks disagree with the agent
224
+
225
+ That is a signal to inspect the rule text and block context more closely. System
226
+ checks are input, not authority. The agent and reviewer still need to reason
227
+ about the content.
228
+
229
+ ### Reviewer feedback conflicts with a rule
230
+
231
+ Do not hide the conflict. Record the content finding if needed, then route the
232
+ governance issue to \`challenge-rule\` or \`propose-rule\` depending on whether the
233
+ existing rule is wrong or a new rule is needed.
234
+
235
+ ## Related Playbooks
236
+
237
+ - \`create-review\`
238
+ - \`fetch-rules-and-check\`
239
+ - \`reviewer-feedback-loop\`
240
+ - \`revise-from-feedback\`
241
+ - \`challenge-rule\`
242
+ - \`propose-rule\`
243
+ `;var TJ=`---
244
+ name: challenge-rule
245
+ version: "1.0.0"
246
+ summary: "Challenge an active rule with supporting evidence when a finding appears incorrect or overly broad."
247
+ workflows:
248
+ - rule-governance
249
+ - feedback-collection
250
+ compatible_api_version: "v1"
251
+ compatible_artifacts:
252
+ rulepack: ">=1.0.0"
253
+ export_schema: "v2"
254
+ trust_level: first_party
255
+ author: "Typescape"
256
+ license: "Apache-2.0"
257
+ tags:
258
+ - rules
259
+ - governance
260
+ - challenge
261
+ min_tools_required:
262
+ - typescape_get_rules
263
+ - typescape_list_findings
264
+ - typescape_submit_advisory
265
+ - typescape_attach_evidence
266
+ ---
267
+
268
+ # Playbook: Challenge Rule
269
+
270
+ ## Overview
271
+
272
+ Challenge an active governance rule when it produces findings that appear
273
+ incorrect, overly broad, or counterproductive. Use this playbook when a
274
+ reviewer or agent encounters a rule-generated finding that does not fit the
275
+ content context and believes the rule itself should be revised or scoped
276
+ more narrowly.
277
+
278
+ Challenges are submitted as advisory artifacts — they are non-authoritative
279
+ proposals that require operator review before any rule change occurs.
280
+
281
+ ## Prerequisites
282
+
283
+ - An active content review with at least one rule-generated finding to
284
+ challenge.
285
+ - Understanding of the rule that generated the finding (from the rulepack).
286
+ - Concrete evidence explaining why the rule is incorrect or too broad for
287
+ this context.
288
+
289
+ ## Steps
290
+
291
+ ### 1. Identify the problematic finding
292
+
293
+ Locate the finding you want to challenge. Note the rule trace — this tells
294
+ you which rule block produced the finding.
295
+
296
+ **Tool**: \`typescape_list_findings\`
297
+
298
+ **Input**:
299
+
300
+ \`\`\`json
301
+ {
302
+ "review_id": "<review_id>"
303
+ }
304
+ \`\`\`
305
+
306
+ From the results, identify the finding with the issue. Record:
307
+
308
+ - \`finding_id\`
309
+ - \`rule_trace\` (format: \`rule_block:<rule_session_id>:<block_id>\`)
310
+ - \`severity\`
311
+ - \`category\`
312
+ - \`message\`
313
+
314
+ ### 2. Fetch the originating rule
315
+
316
+ Retrieve the full rule text to understand its intent and scope.
317
+
318
+ **Tool**: \`typescape_get_rules\`
319
+
320
+ **Input**:
321
+
322
+ \`\`\`json
323
+ {
324
+ "review_id": "<review_id>"
325
+ }
326
+ \`\`\`
327
+
328
+ Find the rule block matching the \`rule_trace\` from step 1. Note:
329
+
330
+ - The rule's strength marker (\`MUST\`, \`SHOULD\`, \`MAY\`, \`MUST NOT\`)
331
+ - The rule's full text
332
+ - The rule review's applicability properties
333
+ - The rule session ID (for targeting the challenge)
334
+
335
+ ### 3. Gather evidence
336
+
337
+ Build a concrete case for why the rule should be changed. Evidence should
338
+ include at least one of:
339
+
340
+ - **False positive examples**: Content that correctly violates no real
341
+ standard but triggers the rule.
342
+ - **Scope analysis**: Explanation of why the rule's applicability is too
343
+ broad for certain content types.
344
+ - **Contradiction**: Another active rule that conflicts with this one.
345
+ - **Industry standard**: Reference to an external standard that disagrees
346
+ with the rule's guidance.
347
+ - **Impact data**: If available, metrics showing the rule generates more
348
+ noise than signal (high dismiss rate).
349
+
350
+ ### 4. Submit the challenge as an advisory artifact
351
+
352
+ **Tool**: \`typescape_submit_advisory\`
353
+
354
+ **Input**:
355
+
356
+ \`\`\`json
357
+ {
358
+ "target_type": "rule_review",
359
+ "target_id": "<rule_session_id>",
360
+ "artifact_kind": "challenge",
361
+ "body_md": "## Rule Challenge\\n\\n### Rule\\n<rule text>\\n\\n### Finding\\n<finding message on review_id>\\n\\n### Issue\\n<description of why the rule is problematic>\\n\\n### Evidence\\n<concrete examples, contradiction references, or scope analysis>\\n\\n### Proposed Resolution\\n<suggest: narrow applicability | revise rule text | reduce strength | supersede>",
362
+ "basis": {
363
+ "rulepack_sha256": "<compiled_hash>",
364
+ "basis_finding_ids": ["<finding_id>"]
365
+ },
366
+ "confidence": 0.75
367
+ }
368
+ \`\`\`
369
+
370
+ **Expected output**: An advisory artifact with:
371
+
372
+ - \`artifact_id\`
373
+ - \`status\` — should be \`submitted\`
374
+ - \`non_authoritative: true\`
375
+
376
+ **On error**:
377
+
378
+ - \`404\` (rule not found): Verify the \`rule_session_id\` from the rule trace
379
+ is correct. The rule may have been superseded — check its current state.
380
+ - \`409\` (stale basis): The rulepack has changed since you fetched it.
381
+ Re-fetch rules and verify the challenge is still relevant.
382
+ - \`422\` (invalid artifact kind): Use \`"challenge"\` as the artifact kind.
383
+
384
+ ### 5. Attach supporting evidence (optional)
385
+
386
+ If you have additional evidence files (screenshots, comparison documents,
387
+ external references), attach them to the advisory.
388
+
389
+ **Tool**: \`typescape_attach_evidence\`
390
+
391
+ **Input**:
392
+
393
+ \`\`\`json
394
+ {
395
+ "finding_id": "<finding_id>",
396
+ "evidence_type": "document",
397
+ "body_md": "<additional context or external reference>"
398
+ }
399
+ \`\`\`
400
+
401
+ ### 6. Record a decision on the finding
402
+
403
+ While waiting for the challenge to be reviewed, record a decision on the
404
+ original finding to document your position.
405
+
406
+ **Tool**: \`typescape_record_decision\`
407
+
408
+ **Input**:
409
+
410
+ \`\`\`json
411
+ {
412
+ "finding_id": "<finding_id>",
413
+ "decision": "challenged",
414
+ "rationale": "Submitted challenge advisory <artifact_id>. See advisory for full evidence."
415
+ }
416
+ \`\`\`
417
+
418
+ ## Completion Criteria
419
+
420
+ - Challenge advisory submitted with \`artifact_kind: "challenge"\`.
421
+ - Advisory targets the correct rule review (\`target_type: "rule_review"\`).
422
+ - Evidence section includes at least one concrete example.
423
+ - Proposed resolution specifies a clear action (narrow, revise, reduce, or
424
+ supersede).
425
+ - Advisory status is \`submitted\` (pending operator review).
426
+
427
+ ## Troubleshooting
428
+
429
+ ### Rule has already been superseded
430
+
431
+ If the rule trace points to a superseded rule, the challenge may no longer
432
+ be necessary. Check the successor rule — if it addresses the issue, no
433
+ challenge is needed. If the successor has the same problem, challenge the
434
+ successor instead.
435
+
436
+ ### Multiple findings from the same rule
437
+
438
+ If the same rule produces problematic findings across multiple reviews,
439
+ reference all affected \`finding_id\` values in the \`basis.basis_finding_ids\`
440
+ array. A pattern of false positives strengthens the challenge.
441
+
442
+ ### Challenge rejected by operator
443
+
444
+ If the operator rejects the challenge, the advisory status changes to
445
+ \`rejected\` with a \`rejection_reason\`. Review the reason and consider:
446
+
447
+ - Refining the evidence with more concrete examples.
448
+ - Narrowing the challenge to a specific applicability scope.
449
+ - Accepting the rule and revising the content instead.
450
+
451
+ ## Related Playbooks
452
+
453
+ - \`fetch-rules-and-check\` — Understand the rules before challenging
454
+ - \`propose-rule\` — Propose a replacement rule if challenging successfully
455
+ - \`revise-from-feedback\` — Revise content if the challenge is rejected
456
+ `;var ZJ=`---
457
+ name: create-review
458
+ version: "1.0.0"
459
+ summary: "Create a content review from a Git repository file and share it with reviewers."
460
+ workflows:
461
+ - review-creation
462
+ - feedback-collection
463
+ compatible_api_version: "v1"
464
+ compatible_artifacts:
465
+ handoff_bundle: ">=1.0.0"
466
+ export_schema: "v2"
467
+ trust_level: first_party
468
+ author: "Typescape"
469
+ license: "Apache-2.0"
470
+ tags:
471
+ - beginner
472
+ - git
473
+ - review
474
+ min_tools_required:
475
+ - typescape_list_repos
476
+ - typescape_create_review
477
+ - typescape_export_review
478
+ ---
479
+
480
+ # Playbook: Create Review
481
+
482
+ ## Overview
483
+
484
+ Create a content review for a Markdown file in a connected Git repository,
485
+ then export the structured results. Use this playbook when starting a new
486
+ review cycle for a document — it handles repository resolution, review
487
+ creation, and initial export in a single pass.
488
+
489
+ This is the foundational Typescape workflow. Most other playbooks build on
490
+ the review object produced here.
491
+
492
+ ## Prerequisites
493
+
494
+ - A Git repository connected to the Typescape tenant.
495
+ - An API key or token with review-create permission.
496
+ - The target file must be a Markdown file tracked by Git.
497
+ - The target Git SHA must be reachable from the connected repository.
498
+
499
+ ## Steps
500
+
501
+ ### 1. Identify the repository and file
502
+
503
+ Determine the repository ID, file path, and Git SHA for the document to
504
+ review. If you have a local clone, resolve the SHA locally first.
505
+
506
+ **Tool**: \`typescape_list_repos\`
507
+
508
+ **Input**:
509
+
510
+ \`\`\`json
511
+ {}
512
+ \`\`\`
513
+
514
+ **Expected output**: A list of connected repositories with \`repo_id\`,
515
+ \`name\`, and \`default_branch\`.
516
+
517
+ Pick the repository that contains the target file. Note the \`repo_id\`.
518
+
519
+ **Local alternative**: If you have a local Git clone, resolve the current
520
+ HEAD SHA:
521
+
522
+ \`\`\`
523
+ git rev-parse HEAD
524
+ \`\`\`
525
+
526
+ ### 2. Create the review
527
+
528
+ **Tool**: \`typescape_create_review\`
529
+
530
+ **Input**:
531
+
532
+ \`\`\`json
533
+ {
534
+ "repo_id": "<repo_id>",
535
+ "file_path": "<path/to/document.md>",
536
+ "git_sha": "<sha>",
537
+ "title": "Review: <filename>"
538
+ }
539
+ \`\`\`
540
+
541
+ **Expected output**: A review object containing:
542
+
543
+ - \`review_id\` — the session identifier for this review
544
+ - \`share_url\` — a URL reviewers can use to access the review in the portal
545
+ - \`state\` — should be \`"draft"\` or \`"open"\` depending on tenant settings
546
+
547
+ **On error**:
548
+
549
+ - \`404\` (repo not found): Verify the repository is connected via
550
+ \`typescape_list_repos\`. The repo may need to be reconnected.
551
+ - \`409\` (duplicate): A review for this file + SHA combination already exists.
552
+ Use the existing \`review_id\` from the error response rather than creating
553
+ a new one.
554
+ - \`422\` (file not found at SHA): Verify the file path is correct and the SHA
555
+ is reachable. The file must exist at the specified commit.
556
+
557
+ ### 3. Share with reviewers (optional)
558
+
559
+ If specific reviewers should be notified, use the share URL from step 2.
560
+ The portal handles reviewer invitation and access control.
561
+
562
+ For programmatic reviewer assignment, add participants:
563
+
564
+ **Tool**: \`typescape_create_review\` (with participants)
565
+
566
+ **Input**:
567
+
568
+ \`\`\`json
569
+ {
570
+ "repo_id": "<repo_id>",
571
+ "file_path": "<path/to/document.md>",
572
+ "git_sha": "<sha>",
573
+ "title": "Review: <filename>",
574
+ "participants": [{ "email": "reviewer@example.com", "role": "reviewer" }]
575
+ }
576
+ \`\`\`
577
+
578
+ ### 4. Export the review
579
+
580
+ Export the review to get the structured block and thread data. This is useful
581
+ for downstream processing, archival, or feeding into revision workflows.
582
+
583
+ **Tool**: \`typescape_export_review\`
584
+
585
+ **Input**:
586
+
587
+ \`\`\`json
588
+ {
589
+ "review_id": "<review_id>"
590
+ }
591
+ \`\`\`
592
+
593
+ **Expected output**: A structured export containing:
594
+
595
+ - \`blocks\` — the deterministic content blocks parsed from the document
596
+ - \`threads\` — any threads or findings attached to blocks
597
+ - \`decisions\` — any recorded decisions
598
+ - \`metadata\` — review metadata including state, participants, timestamps
599
+
600
+ ### 5. Verify block anchoring
601
+
602
+ Check that the export contains the expected content blocks. Typescape uses
603
+ deterministic block anchoring — the same document at the same SHA always
604
+ produces the same block structure.
605
+
606
+ Verify:
607
+
608
+ - Block count is non-zero.
609
+ - Block IDs are stable (re-exporting produces the same IDs).
610
+ - Source content in blocks matches the original document.
611
+
612
+ ## Completion Criteria
613
+
614
+ - Review created successfully (\`review_id\` obtained).
615
+ - Review state is \`draft\` or \`open\`.
616
+ - Export contains at least the source content blocks.
617
+ - Share URL is accessible (if sharing was requested).
618
+
619
+ ## Troubleshooting
620
+
621
+ ### Review created but export is empty
622
+
623
+ The file may not contain parseable Markdown content. Verify the file at the
624
+ specified SHA contains valid Markdown with at least one block-level element.
625
+
626
+ ### SHA not found
627
+
628
+ The Git SHA must be reachable from the connected repository's tracked
629
+ branches. If the SHA is on a feature branch, ensure the repository
630
+ connection tracks that branch.
631
+
632
+ ### Rate limiting
633
+
634
+ If you receive a \`429\` response, wait for the duration specified in the
635
+ \`Retry-After\` header before retrying. Review creation is idempotent when
636
+ using an \`idempotency_key\`, so retries are safe.
637
+
638
+ ## Related Playbooks
639
+
640
+ - \`revise-from-feedback\` — Apply feedback from an exported review
641
+ - \`fetch-rules-and-check\` — Fetch applicable rules and check content
642
+ - \`challenge-rule\` — Challenge a rule that produced a questionable finding
643
+ - \`propose-rule\` — Propose a new rule from repeated findings
644
+ `;var rJ=`---
645
+ name: fetch-rules-and-check
646
+ version: "1.1.0"
647
+ summary: "Fetch the applicable rule bundle, use checks as a signal, and then perform the real agent evaluation block by block."
648
+ workflows:
649
+ - pre-check
650
+ - rule-evaluation
651
+ compatible_api_version: "v1"
652
+ compatible_artifacts:
653
+ rulepack: ">=1.0.0"
654
+ export_schema: "v2"
655
+ trust_level: first_party
656
+ author: "Typescape"
657
+ license: "Apache-2.0"
658
+ tags:
659
+ - rules
660
+ - pre-check
661
+ - rulepack
662
+ min_tools_required:
663
+ - typescape_get_review
664
+ - typescape_get_render
665
+ - typescape_get_rules
666
+ - typescape_rules_pack
667
+ - typescape_run_checks
668
+ - typescape_create_finding
669
+ ---
670
+
671
+ # Playbook: Fetch Rules and Check Content
672
+
673
+ ## Overview
674
+
675
+ Use this playbook when an agent needs to pull the current governance context
676
+ before reviewing or revising content.
677
+
678
+ Important boundary: \`typescape_run_checks\` is a signal, not the whole review.
679
+ It can confirm that rules apply and may emit system findings, but the real
680
+ content evaluation still happens in the agent harness. The agent must read the
681
+ content and the rules together, reason about the document block by block, and
682
+ record findings explicitly.
683
+
684
+ ## Prerequisites
685
+
686
+ - An existing content review or a known review target.
687
+ - Correct review properties so rule applicability can be resolved.
688
+ - Network access to fetch the latest rule bundle.
689
+
690
+ ## Steps
691
+
692
+ ### 1. Identify the review context
693
+
694
+ Fetch the review metadata first so you know which document and properties you
695
+ are evaluating.
696
+
697
+ **Tool**: \`typescape_get_review\`
698
+
699
+ **Input**:
700
+
701
+ \`\`\`json
702
+ {
703
+ "review_id": "<review_id>"
704
+ }
705
+ \`\`\`
706
+
707
+ Record:
708
+
709
+ - \`review_id\`
710
+ - the review properties that drive applicability
711
+ - current lifecycle state
712
+
713
+ If the properties are wrong or incomplete, fix that before trusting the rule
714
+ results.
715
+
716
+ ### 2. Fetch the rulepack
717
+
718
+ Fetch the compiled rule bundle that applies to this review.
719
+
720
+ **Tools**:
721
+
722
+ - \`typescape_get_rules\`
723
+ - \`typescape_rules_pack\` (compatibility alias when needed)
724
+
725
+ **Input**:
726
+
727
+ \`\`\`json
728
+ {
729
+ "review_id": "<review_id>"
730
+ }
731
+ \`\`\`
732
+
733
+ **Expected output**:
734
+
735
+ - \`rules[]\` or equivalent structured rule entries
736
+ - \`compiled_hash\` / basis hash for stale-write detection
737
+ - freshness metadata when available
738
+
739
+ Do not review from memory or from a cached prompt fragment if you can fetch the
740
+ current bundle. Pull the current rules first.
741
+
742
+ ### 3. Review the active rules
743
+
744
+ Parse the rules into an evaluation plan:
745
+
746
+ - \`must\` / \`must_not\` rules -> highest priority
747
+ - \`should\` rules -> expected but defeasible
748
+ - \`may\` rules -> optional guidance
749
+
750
+ Also note category and applicability so you do not over-apply a narrow rule to
751
+ the wrong content.
752
+
753
+ ### 4. Run checks
754
+
755
+ Run checks to get fast system feedback and to confirm the review is wired up
756
+ correctly.
757
+
758
+ **Tool**: \`typescape_run_checks\`
759
+
760
+ **Input**:
761
+
762
+ \`\`\`json
763
+ {
764
+ "review_id": "<review_id>"
765
+ }
766
+ \`\`\`
767
+
768
+ Treat the result as:
769
+
770
+ - a useful signal
771
+ - possible system findings
772
+ - not a replacement for full agent reasoning
773
+
774
+ If the check run is slow, increase the timeout instead of assuming failure.
775
+
776
+ ### 5. Fetch the actual content blocks
777
+
778
+ Pull the rendered content or handoff/export so the agent evaluates the actual
779
+ block text and block IDs.
780
+
781
+ **Tool**: \`typescape_get_render\`
782
+
783
+ The rule bundle without the content blocks is not enough. The content blocks
784
+ without the rule bundle are not enough. The agent needs both.
785
+
786
+ ### 6. Perform the real evaluation in the agent harness
787
+
788
+ For each relevant block:
789
+
790
+ - compare the block text against the active rules
791
+ - decide whether a finding is warranted
792
+ - explain why the finding exists
793
+ - record it against the specific block
794
+
795
+ **Tool**: \`typescape_create_finding\`
796
+
797
+ This is the core seam between Typescape and the external agent: Typescape
798
+ provides the deterministic rules, anchors, and history; the agent performs the
799
+ judgment.
800
+
801
+ ### 7. Record the rulepack basis
802
+
803
+ For any downstream operations (revisions, advisory submissions), record
804
+ the rulepack basis to enable stale-write detection:
805
+
806
+ \`\`\`json
807
+ {
808
+ "rulepack_sha256": "<compiled_hash from step 2>",
809
+ "fetched_at": "<freshness.fetched_at from step 2>"
810
+ }
811
+ \`\`\`
812
+
813
+ Include this basis in any advisory artifact submissions to prove the
814
+ revision was made against the current rule state.
815
+
816
+ ## Completion Criteria
817
+
818
+ - Current rule bundle was fetched before evaluation.
819
+ - Checks were treated as a signal, not as the sole compliance engine.
820
+ - The agent evaluated real content blocks against the fetched rules.
821
+ - Findings were recorded explicitly where warranted.
822
+ - Rule basis was preserved for downstream use.
823
+
824
+ ## Troubleshooting
825
+
826
+ ### No rules match the review
827
+
828
+ Check the review properties first. Missing or misspelled applicability keys are
829
+ the most common cause.
830
+
831
+ ### Check run stays in pending
832
+
833
+ Cold starts and queue lag can make checks slow. Increase the timeout and treat
834
+ the delay as operational, not as proof that the review has no issues.
835
+
836
+ ### Checks found nothing but the document still looks wrong
837
+
838
+ That is exactly when the agent must keep reading and reasoning. Checks are not
839
+ the whole review.
840
+
841
+ ## Related Playbooks
842
+
843
+ - \`create-review\` — Create the review to check against
844
+ - \`agent-review-loop\`
845
+ - \`reviewer-feedback-loop\`
846
+ - \`revise-from-feedback\`
847
+ `;var mJ=`---
848
+ name: operator-advisory-triage
849
+ version: "1.0.0"
850
+ summary: "Evaluate agent-submitted advisories and decide adopt vs reject with explicit basis checking."
851
+ workflows:
852
+ - governance
853
+ - approval
854
+ - feedback-collection
855
+ compatible_api_version: "v1"
856
+ compatible_artifacts:
857
+ handoff_bundle: ">=1.0.0"
858
+ rulepack: ">=1.0.0"
859
+ export_schema: "v2"
860
+ trust_level: first_party
861
+ author: "Typescape"
862
+ license: "Apache-2.0"
863
+ tags:
864
+ - operator
865
+ - advisory
866
+ - adoption
867
+ - rejection
868
+ min_tools_required:
869
+ - typescape_get_advisory
870
+ - typescape_get_review
871
+ - typescape_get_handoff
872
+ - typescape_get_rules
873
+ - typescape_adopt_advisory
874
+ - typescape_reject_advisory
875
+ ---
876
+
877
+ # Playbook: Operator Advisory Triage
878
+
879
+ ## Overview
880
+
881
+ Use this playbook when an agent has submitted a non-authoritative advisory and
882
+ an operator needs to decide whether to adopt it, reject it, or ask for more
883
+ work. The point is to keep authoritative product state behind an explicit human
884
+ decision.
885
+
886
+ ## Human Boundaries
887
+
888
+ - The **agent** may propose.
889
+ - The **operator** decides whether the proposal becomes product state.
890
+ - The **reviewer** may add domain judgment that the advisory did not capture.
891
+
892
+ Do not adopt an advisory just because it looks plausible. Verify its basis.
893
+
894
+ ## Steps
895
+
896
+ ### 1. Read the advisory as a claim, not as truth
897
+
898
+ **Tool**: \`typescape_get_advisory\`
899
+
900
+ Record:
901
+
902
+ - \`artifact_id\`
903
+ - \`target_type\`
904
+ - \`target_id\`
905
+ - \`artifact_kind\`
906
+ - basis hashes and cited finding IDs
907
+ - confidence
908
+
909
+ ### 2. Verify the current review state
910
+
911
+ Fetch the target review and current handoff/export so you know whether the
912
+ advisory was based on stale state.
913
+
914
+ **Tools**:
915
+
916
+ - \`typescape_get_review\`
917
+ - \`typescape_get_handoff\`
918
+
919
+ Compare the advisory's basis hashes to the current review/export state. If the
920
+ basis is stale, the safest move is usually to reject with a reason that asks for
921
+ regeneration against the latest state.
922
+
923
+ ### 3. Verify rule context when the advisory depends on governance
924
+
925
+ If the advisory cites rules, fetch the current rule bundle.
926
+
927
+ **Tool**: \`typescape_get_rules\`
928
+
929
+ Check whether the rulepack hash or the specific rule text has changed since the
930
+ advisory was written.
931
+
932
+ ### 4. Decide adopt vs reject explicitly
933
+
934
+ Adopt only when all of the following are true:
935
+
936
+ - the basis is current enough to trust
937
+ - the recommendation is understandable and reviewable
938
+ - the action belongs on the operator side of the boundary
939
+
940
+ Reject when:
941
+
942
+ - the basis is stale
943
+ - the recommendation is underspecified
944
+ - the requested action needs more human or reviewer input
945
+ - the recommendation would change product state without enough evidence
946
+
947
+ ### 5. Record the operator decision
948
+
949
+ **Tools**:
950
+
951
+ - \`typescape_adopt_advisory\`
952
+ - \`typescape_reject_advisory\`
953
+
954
+ When rejecting, provide a concrete reason the next agent or operator can act on.
955
+ Good rejection reasons are operational, not vague.
956
+
957
+ ## Completion Criteria
958
+
959
+ - Advisory basis was checked against current review state.
960
+ - Rule context was checked when governance was involved.
961
+ - Adopt/reject was explicit.
962
+ - Rejections include a reason that enables the next pass.
963
+
964
+ ## Troubleshooting
965
+
966
+ ### Advisory cites missing findings
967
+
968
+ Reject and ask the agent to regenerate the advisory from the current review. A
969
+ missing cited finding means the basis chain is broken.
970
+
971
+ ### Advisory is directionally right but incomplete
972
+
973
+ Reject with a targeted request instead of adopting a half-specified change.
974
+ That keeps the authoritative path auditable.
975
+
976
+ ## Related Playbooks
977
+
978
+ - \`agent-review-loop\`
979
+ - \`reviewer-feedback-loop\`
980
+ - \`revise-from-feedback\`
981
+ `;var yJ=`---
982
+ name: propose-rule
983
+ version: "1.0.0"
984
+ summary: "Propose a new governance rule or rule update from repeated findings or reviewer feedback."
985
+ workflows:
986
+ - rule-governance
987
+ - rule-creation
988
+ compatible_api_version: "v1"
989
+ compatible_artifacts:
990
+ rulepack: ">=1.0.0"
991
+ export_schema: "v2"
992
+ trust_level: first_party
993
+ author: "Typescape"
994
+ license: "Apache-2.0"
995
+ tags:
996
+ - rules
997
+ - governance
998
+ - proposal
999
+ min_tools_required:
1000
+ - typescape_propose_rule
1001
+ - typescape_list_findings
1002
+ - typescape_submit_advisory
1003
+ ---
1004
+
1005
+ # Playbook: Propose Rule
1006
+
1007
+ ## Overview
1008
+
1009
+ Propose a new governance rule — or an update to an existing rule — when
1010
+ recurring patterns in review findings suggest a standard should be codified.
1011
+ Use this playbook when you notice the same feedback appearing across
1012
+ multiple content reviews and want to elevate it from ad-hoc comments to an
1013
+ enforceable rule.
1014
+
1015
+ Proposals are submitted through the rule proposal workflow. They require
1016
+ operator approval before becoming active rules.
1017
+
1018
+ ## Prerequisites
1019
+
1020
+ - At least two content reviews with similar findings or feedback patterns.
1021
+ - Understanding of the current rulepack (to avoid duplicating existing rules).
1022
+ - A clear, specific rule statement that can be expressed with a strength
1023
+ marker and category.
1024
+
1025
+ ## Steps
1026
+
1027
+ ### 1. Identify the recurring pattern
1028
+
1029
+ Search across recent reviews for findings or comments that share a common
1030
+ theme.
1031
+
1032
+ **Tool**: \`typescape_search_findings\`
1033
+
1034
+ **Input**:
1035
+
1036
+ \`\`\`json
1037
+ {
1038
+ "query": "<keyword or phrase from recurring feedback>"
1039
+ }
1040
+ \`\`\`
1041
+
1042
+ **Expected output**: A list of findings matching the query, each with
1043
+ \`review_id\`, \`finding_id\`, \`message\`, and \`block_id\`.
1044
+
1045
+ Alternatively, use \`typescape_list_findings\` on each relevant review to
1046
+ collect the evidence set manually.
1047
+
1048
+ Record at least 2-3 finding IDs that demonstrate the pattern.
1049
+
1050
+ ### 2. Check for existing rules
1051
+
1052
+ Before proposing a new rule, verify the pattern is not already covered by
1053
+ an active rule.
1054
+
1055
+ **Tool**: \`typescape_rules_pack\`
1056
+
1057
+ **Input**:
1058
+
1059
+ \`\`\`json
1060
+ {
1061
+ "review_id": "<any_review_id_with_matching_properties>"
1062
+ }
1063
+ \`\`\`
1064
+
1065
+ Search the returned rules for any that address the same concern. If an
1066
+ existing rule partially covers the pattern but is too narrow or too broad,
1067
+ consider a challenge (\`challenge-rule\` playbook) or a superseding proposal
1068
+ instead.
1069
+
1070
+ ### 3. Draft the rule
1071
+
1072
+ Write the rule in Typescape's rule block format:
1073
+
1074
+ \`\`\`
1075
+ **<strength>** | <category>
1076
+ <Rule text describing the standard.>
1077
+ \`\`\`
1078
+
1079
+ **Choosing strength**:
1080
+
1081
+ - \`MUST\` / \`MUST NOT\` — for requirements that are always mandatory
1082
+ - \`SHOULD\` — for recommended practices that permit justified exceptions
1083
+ - \`MAY\` — for optional guidance
1084
+
1085
+ **Choosing category**: \`tone\`, \`formatting\`, \`terminology\`, \`accuracy\`, or
1086
+ \`compliance\`.
1087
+
1088
+ **Rule text guidelines**:
1089
+
1090
+ - Be specific and actionable. A reviewer should be able to determine
1091
+ compliance by reading the content.
1092
+ - Avoid subjective language ("good", "appropriate") without defining the
1093
+ criteria.
1094
+ - Include concrete examples of compliant and non-compliant content when
1095
+ the rule is not self-evident.
1096
+
1097
+ **Example**:
1098
+
1099
+ \`\`\`
1100
+ **should** | terminology
1101
+ Use "select" instead of "click" when describing user interactions with UI
1102
+ elements, to remain input-method neutral (keyboard, touch, assistive tech).
1103
+ \`\`\`
1104
+
1105
+ ### 4. Set applicability
1106
+
1107
+ Determine which content reviews this rule should apply to. Rules match
1108
+ when every key in the rule's applicability is present in the review's
1109
+ properties with the same value.
1110
+
1111
+ Consider:
1112
+
1113
+ - Should this rule apply to all content? (Leave applicability empty.)
1114
+ - Should it apply to specific content types? (Set \`content_type\`.)
1115
+ - Should it be client-specific? (Set \`client\`.)
1116
+
1117
+ Narrow applicability reduces false positives. Start narrow and broaden if
1118
+ the rule proves valuable.
1119
+
1120
+ ### 5. Submit the rule proposal
1121
+
1122
+ **Tool**: \`typescape_propose_rule\`
1123
+
1124
+ **Input**:
1125
+
1126
+ \`\`\`json
1127
+ {
1128
+ "title": "<concise rule title>",
1129
+ "body_md": "**should** | terminology\\nUse \\"select\\" instead of \\"click\\" when describing user interactions with UI elements, to remain input-method neutral.",
1130
+ "applicability": {
1131
+ "content_type": "documentation"
1132
+ },
1133
+ "source_findings": ["<finding_id_1>", "<finding_id_2>"]
1134
+ }
1135
+ \`\`\`
1136
+
1137
+ **Expected output**: A rule proposal object with:
1138
+
1139
+ - \`proposal_id\`
1140
+ - \`status\` — should be \`pending\`
1141
+ - \`rule_review_id\` — the draft rule review created from this proposal
1142
+
1143
+ **On error**:
1144
+
1145
+ - \`422\` (invalid rule format): Verify the strength marker is bold
1146
+ (\`**must**\`, not \`must\`) and the category separator is \`|\`.
1147
+ - \`409\` (duplicate proposal): A proposal for a very similar rule may
1148
+ already exist. Use \`typescape_list_rule_proposals\` to check.
1149
+
1150
+ ### 6. Submit supporting advisory (optional)
1151
+
1152
+ For complex proposals, submit an advisory artifact with detailed rationale.
1153
+
1154
+ **Tool**: \`typescape_submit_advisory\`
1155
+
1156
+ **Input**:
1157
+
1158
+ \`\`\`json
1159
+ {
1160
+ "target_type": "rule_review",
1161
+ "target_id": "<rule_review_id from step 5>",
1162
+ "artifact_kind": "proposal",
1163
+ "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
+ "basis": {
1165
+ "rulepack_sha256": "<current rulepack hash>",
1166
+ "basis_finding_ids": ["<finding_id_1>", "<finding_id_2>"]
1167
+ },
1168
+ "confidence": 0.8
1169
+ }
1170
+ \`\`\`
1171
+
1172
+ ### 7. Monitor proposal status
1173
+
1174
+ Track the proposal's progress through the governance workflow.
1175
+
1176
+ **Tool**: \`typescape_list_rule_proposals\`
1177
+
1178
+ **Input**:
1179
+
1180
+ \`\`\`json
1181
+ {}
1182
+ \`\`\`
1183
+
1184
+ The proposal will move through states:
1185
+
1186
+ - \`pending\` — awaiting operator review
1187
+ - \`approved\` — operator accepted; rule review moves to \`active\`
1188
+ - \`rejected\` — operator declined; check rejection reason
1189
+
1190
+ ## Completion Criteria
1191
+
1192
+ - Rule proposal submitted with valid strength marker and category.
1193
+ - At least 2 source findings cited as evidence for the pattern.
1194
+ - Applicability properties set to the appropriate scope.
1195
+ - Proposal status is \`pending\` (awaiting operator review).
1196
+
1197
+ ## Troubleshooting
1198
+
1199
+ ### Proposal rejected
1200
+
1201
+ Review the rejection reason. Common causes:
1202
+
1203
+ - **Too broad**: The rule applicability matches too many content types.
1204
+ Narrow the scope and resubmit.
1205
+ - **Already covered**: An existing rule addresses the concern. The operator
1206
+ may point to the existing rule.
1207
+ - **Too subjective**: The rule text is not specific enough for deterministic
1208
+ evaluation. Add concrete criteria.
1209
+ - **Insufficient evidence**: Add more source findings or examples.
1210
+
1211
+ ### Rule proposal creates findings on unrelated content
1212
+
1213
+ The applicability is too broad. Update the proposal with narrower
1214
+ properties. If the proposal is already approved, use the \`challenge-rule\`
1215
+ playbook against the newly active rule.
1216
+
1217
+ ### Conflict with existing rule
1218
+
1219
+ If your proposed rule conflicts with an active rule, the operator may
1220
+ require you to also submit a challenge against the conflicting rule. Use
1221
+ the \`challenge-rule\` playbook for the existing rule, referencing the
1222
+ proposal as evidence.
1223
+
1224
+ ## Related Playbooks
1225
+
1226
+ - \`challenge-rule\` — Challenge a rule that needs revision
1227
+ - \`fetch-rules-and-check\` — Check current rules before proposing new ones
1228
+ - \`create-review\` — Create reviews that generate the findings evidence
1229
+ - \`revise-from-feedback\` — Revise content using existing rules
1230
+ `;var dJ=`---
1231
+ name: revise-from-feedback
1232
+ version: "1.0.0"
1233
+ summary: "Consume a handoff bundle and produce a revision plan addressing review findings."
1234
+ workflows:
1235
+ - revision
1236
+ - feedback-collection
1237
+ compatible_api_version: "v1"
1238
+ compatible_artifacts:
1239
+ handoff_bundle: ">=1.0.0"
1240
+ rulepack: ">=1.0.0"
1241
+ export_schema: "v2"
1242
+ trust_level: first_party
1243
+ author: "Typescape"
1244
+ license: "Apache-2.0"
1245
+ tags:
1246
+ - revision
1247
+ - handoff
1248
+ - feedback
1249
+ min_tools_required:
1250
+ - typescape_export_review
1251
+ - typescape_list_findings
1252
+ - typescape_get_rules
1253
+ ---
1254
+
1255
+ # Playbook: Revise from Feedback
1256
+
1257
+ ## Overview
1258
+
1259
+ Consume feedback from an existing content review — via a handoff bundle or
1260
+ direct export — and produce a structured revision plan. Use this playbook
1261
+ after reviewers have left findings on a document and you need to address
1262
+ them systematically.
1263
+
1264
+ This playbook does not apply changes directly. It produces a plan that the
1265
+ agent or operator can execute against the source document.
1266
+
1267
+ ## Prerequisites
1268
+
1269
+ - An existing content review with at least one finding or thread.
1270
+ - Access to the review via \`review_id\`.
1271
+ - The original source document available locally (for producing diffs).
1272
+ - The applicable rulepack fetched (to understand rule context behind findings).
1273
+
1274
+ ## Steps
1275
+
1276
+ ### 1. Fetch the handoff bundle
1277
+
1278
+ The handoff bundle contains the complete review state: blocks, findings,
1279
+ decisions, rule context, and next actions.
1280
+
1281
+ **Tool**: \`typescape_export_review\`
1282
+
1283
+ **Input**:
1284
+
1285
+ \`\`\`json
1286
+ {
1287
+ "review_id": "<review_id>"
1288
+ }
1289
+ \`\`\`
1290
+
1291
+ **Expected output**: A structured export with \`blocks\`, \`threads\`,
1292
+ \`decisions\`, and \`metadata\`.
1293
+
1294
+ **Alternative** (CLI):
1295
+
1296
+ \`\`\`
1297
+ typescape review handoff <review_id>
1298
+ \`\`\`
1299
+
1300
+ This produces the full \`AgentHandoffBundle\` with basis hashes for safe
1301
+ writes.
1302
+
1303
+ ### 2. Fetch applicable rules
1304
+
1305
+ Understanding which rules generated findings helps prioritize and
1306
+ contextualize revisions.
1307
+
1308
+ **Tool**: \`typescape_get_rules\`
1309
+
1310
+ **Input**:
1311
+
1312
+ \`\`\`json
1313
+ {
1314
+ "review_id": "<review_id>"
1315
+ }
1316
+ \`\`\`
1317
+
1318
+ **Expected output**: The rulepack applicable to this review, including rule
1319
+ blocks with strength markers (\`MUST\`, \`SHOULD\`, \`MAY\`, \`MUST NOT\`) and
1320
+ categories.
1321
+
1322
+ ### 3. Classify findings by severity
1323
+
1324
+ Group findings from the export into priority tiers:
1325
+
1326
+ | Priority | Source | Action Required |
1327
+ | -------- | ------------------------- | ----------------------------- |
1328
+ | P0 | \`MUST\` / \`MUST NOT\` rules | Must fix before review passes |
1329
+ | P1 | \`SHOULD\` rules | Should fix; justify if not |
1330
+ | P2 | \`MAY\` rules | Optional improvement |
1331
+ | P3 | Human reviewer comments | Address based on context |
1332
+
1333
+ For each finding, note:
1334
+
1335
+ - The \`finding_id\` and \`block_id\` it targets.
1336
+ - The rule trace (which rule block generated it, if rule-generated).
1337
+ - The severity (\`blocking\`, \`needs_changes\`, \`suggestion\`).
1338
+ - Whether a decision has already been recorded.
1339
+
1340
+ ### 4. Build the revision plan
1341
+
1342
+ For each finding that requires action, produce a revision entry:
1343
+
1344
+ \`\`\`
1345
+ Finding: <finding_id>
1346
+ Block: <block_id>
1347
+ Severity: <blocking|needs_changes|suggestion>
1348
+ Rule: <rule_trace or "human comment">
1349
+ Current text: "<quoted block content>"
1350
+ Proposed change: "<revised text>"
1351
+ Rationale: "<why this change addresses the finding>"
1352
+ \`\`\`
1353
+
1354
+ **Ordering**: Address \`blocking\` findings first, then \`needs_changes\`, then
1355
+ \`suggestion\`. Within each tier, group by block order (top of document first).
1356
+
1357
+ ### 5. Validate against rulepack
1358
+
1359
+ Before finalizing revisions, verify each proposed change does not introduce
1360
+ new violations of other active rules. Cross-reference proposed text against
1361
+ the full rulepack from step 2.
1362
+
1363
+ **Tool**: \`typescape_check_content\` (if available)
1364
+
1365
+ **Input**:
1366
+
1367
+ \`\`\`json
1368
+ {
1369
+ "review_id": "<review_id>",
1370
+ "content": "<revised content block>"
1371
+ }
1372
+ \`\`\`
1373
+
1374
+ ### 6. Submit the revision (optional)
1375
+
1376
+ If the agent has write access, submit the revised content as an advisory
1377
+ artifact for operator review before it becomes authoritative.
1378
+
1379
+ **Tool**: \`typescape_submit_advisory\`
1380
+
1381
+ **Input**:
1382
+
1383
+ \`\`\`json
1384
+ {
1385
+ "target_type": "review",
1386
+ "target_id": "<review_id>",
1387
+ "artifact_kind": "recommendation",
1388
+ "body_md": "<revision plan in Markdown>",
1389
+ "basis": {
1390
+ "export_sha256": "<from handoff bundle>",
1391
+ "rulepack_sha256": "<from rulepack freshness>"
1392
+ },
1393
+ "confidence": 0.85
1394
+ }
1395
+ \`\`\`
1396
+
1397
+ **Expected output**: An advisory artifact ID. The artifact is
1398
+ non-authoritative until an operator explicitly adopts it.
1399
+
1400
+ **On error**:
1401
+
1402
+ - \`409\` (stale basis): The review state has changed since the handoff was
1403
+ fetched. Re-fetch the export and rebuild the revision plan.
1404
+ - \`422\` (invalid target): Verify the \`review_id\` and \`target_type\` are correct.
1405
+
1406
+ ## Completion Criteria
1407
+
1408
+ - All blocking findings have a corresponding revision entry.
1409
+ - Revision plan covers at least all \`MUST\` and \`MUST NOT\` violations.
1410
+ - Each proposed change includes rationale tied to the originating finding.
1411
+ - If submitted as advisory: artifact ID obtained, status is \`submitted\`.
1412
+
1413
+ ## Troubleshooting
1414
+
1415
+ ### Findings reference blocks that no longer exist
1416
+
1417
+ The document may have been revised since the findings were created. Re-fetch
1418
+ the export to get current block state. If blocks have shifted, findings may
1419
+ need re-anchoring — check the \`block_id\` stability.
1420
+
1421
+ ### Rule trace points to superseded rule
1422
+
1423
+ The originating rule may have been superseded since the finding was created.
1424
+ Check the rule's current state. If superseded, the finding may no longer be
1425
+ relevant — but still address it if the successor rule covers the same
1426
+ concern.
1427
+
1428
+ ### Conflicting findings
1429
+
1430
+ Two findings on the same block may suggest contradictory changes. Prioritize
1431
+ by severity (blocking > needs_changes > suggestion), then by rule strength.
1432
+ If still conflicting, flag for human resolution.
1433
+
1434
+ ## Related Playbooks
1435
+
1436
+ - \`create-review\` — Create the initial review that produces findings
1437
+ - \`fetch-rules-and-check\` — Fetch rules and run checks before revising
1438
+ - \`propose-rule\` — Propose a new rule from patterns found during revision
1439
+ `;var eJ=`---
1440
+ name: reviewer-feedback-loop
1441
+ version: "1.0.0"
1442
+ summary: "Help a human reviewer turn live findings into a revision, escalation, or governance action without overwriting reviewer judgment."
1443
+ workflows:
1444
+ - feedback-collection
1445
+ - revision
1446
+ - rule-governance
1447
+ compatible_api_version: "v1"
1448
+ compatible_artifacts:
1449
+ handoff_bundle: ">=1.0.0"
1450
+ rulepack: ">=1.0.0"
1451
+ export_schema: "v2"
1452
+ trust_level: first_party
1453
+ author: "Typescape"
1454
+ license: "Apache-2.0"
1455
+ tags:
1456
+ - reviewer
1457
+ - triage
1458
+ - revision
1459
+ - governance
1460
+ min_tools_required:
1461
+ - typescape_get_review
1462
+ - typescape_list_findings
1463
+ - typescape_get_handoff
1464
+ - typescape_post_comment
1465
+ - typescape_record_decision
1466
+ - typescape_submit_advisory
1467
+ ---
1468
+
1469
+ # Playbook: Reviewer Feedback Loop
1470
+
1471
+ ## Overview
1472
+
1473
+ Use this playbook when a reviewer has already started leaving feedback and an
1474
+ agent needs to help organize, draft, or escalate that feedback without taking
1475
+ over the reviewer's job.
1476
+
1477
+ The agent can synthesize, draft, and route. The reviewer still owns the
1478
+ judgment.
1479
+
1480
+ ## Human Boundaries
1481
+
1482
+ - Do not resolve findings unless the reviewer or operator explicitly asks.
1483
+ - Do not replace a reviewer's position with an agent-generated rationale.
1484
+ - Do not collapse multiple reviewer concerns into one finding if that loses
1485
+ meaning the reviewer cares about.
1486
+
1487
+ ## Steps
1488
+
1489
+ ### 1. Fetch the current review state
1490
+
1491
+ **Tools**:
1492
+
1493
+ - \`typescape_get_review\`
1494
+ - \`typescape_list_findings\`
1495
+ - \`typescape_get_handoff\`
1496
+
1497
+ Use the handoff/export when you need the full block context, not just the
1498
+ finding summaries.
1499
+
1500
+ ### 2. Separate the kinds of feedback
1501
+
1502
+ Group findings into:
1503
+
1504
+ - reviewer-authored content feedback
1505
+ - system findings from checks
1506
+ - agent-authored findings that may need clarification
1507
+ - governance issues that point to a rule problem rather than a content problem
1508
+
1509
+ This separation matters because the next action is different for each kind.
1510
+
1511
+ ### 3. Draft the smallest useful next action
1512
+
1513
+ For each finding, decide whether the next best step is:
1514
+
1515
+ - a revision plan
1516
+ - a reviewer reply/comment
1517
+ - a finding decision
1518
+ - an advisory for operator review
1519
+ - a governance escalation (\`challenge-rule\` or \`propose-rule\`)
1520
+
1521
+ Prefer the smallest action that keeps the loop moving without skipping human
1522
+ decisions.
1523
+
1524
+ ### 4. Record clarifying reviewer context when needed
1525
+
1526
+ If the reviewer wants to sharpen or clarify an existing finding, post a comment
1527
+ that makes the expected change explicit.
1528
+
1529
+ **Tool**: \`typescape_post_comment\`
1530
+
1531
+ ### 5. Record explicit decisions rather than implied ones
1532
+
1533
+ If the reviewer has decided a finding is accepted, deferred, or challenged,
1534
+ record that decision clearly instead of leaving it implicit in chat.
1535
+
1536
+ **Tool**: \`typescape_record_decision\`
1537
+
1538
+ ### 6. Escalate when the problem is bigger than one review
1539
+
1540
+ If the reviewer feedback reveals a repeated pattern or a broken rule, do not
1541
+ bury that in one document revision. Escalate it:
1542
+
1543
+ - repeated guidance becoming policy -> \`propose-rule\`
1544
+ - a rule producing bad outcomes -> \`challenge-rule\`
1545
+ - revision recommendation that still needs operator adoption ->
1546
+ \`typescape_submit_advisory\`
1547
+
1548
+ ## Completion Criteria
1549
+
1550
+ - Current review state was fetched before drafting actions.
1551
+ - Human, system, and governance concerns are separated cleanly.
1552
+ - Reviewer decisions remain explicit and human-owned.
1553
+ - Repeated patterns are escalated instead of trapped in one document.
1554
+
1555
+ ## Related Playbooks
1556
+
1557
+ - \`agent-review-loop\`
1558
+ - \`revise-from-feedback\`
1559
+ - \`challenge-rule\`
1560
+ - \`propose-rule\`
1561
+ `;var AY=[{filename:"agent-review-loop.md",content:oJ},{filename:"challenge-rule.md",content:TJ},{filename:"create-review.md",content:ZJ},{filename:"fetch-rules-and-check.md",content:rJ},{filename:"operator-advisory-triage.md",content:mJ},{filename:"propose-rule.md",content:yJ},{filename:"revise-from-feedback.md",content:dJ},{filename:"reviewer-feedback-loop.md",content:eJ}];function X_(n){let i=n.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);return i}function xY(n){let i=n.trim();if(i.startsWith("[")&&i.endsWith("]"))return i.slice(1,-1).split(",").map(($)=>X_($)).filter(($)=>$.length>0);return X_(i)}function hY(n){let i=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(n);if(!i)return null;let $={},g=i[1].split(/\r?\n/);for(let v=0;v<g.length;){let _=g[v].trim();if(_.length===0||_.startsWith("#")){v+=1;continue}let U=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(_);if(!U){v+=1;continue}let k=U.at(1);if(typeof k!=="string"||k.length===0){v+=1;continue}let l=(U.at(2)??"").trim();if(l.length>0){$[k]=xY(l),v+=1;continue}v+=1;let J=[],Q={};while(v<g.length){let j=g[v],u=j.trim(),W=/^\s*/.exec(j)?.[0].length??0;if(u.length===0){v+=1;continue}if(W<2)break;if(u.startsWith("- ")){J.push(X_(u.slice(2))),v+=1;continue}let Y=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(u);if(!Y){v+=1;continue}let B=Y.at(1);if(typeof B!=="string"||B.length===0){v+=1;continue}Q[B]=X_(Y.at(2)??""),v+=1}if(J.length>0)$[k]=J;else if(Object.keys(Q).length>0)$[k]=Q;else $[k]=""}return $}function T0(n){if(!Array.isArray(n))return;return n.filter((i)=>typeof i==="string"&&i.length>0)}function CY(n){if(typeof n!=="object"||n===null||Array.isArray(n))return;let i=Object.entries(n).filter(($)=>typeof $[1]==="string");if(i.length===0)return;return Object.fromEntries(i)}function EY(n){let i=hY(n.content);if(i===null)throw Error(`Bundled playbook ${n.filename} is missing required frontmatter`);let $=n.filename.replace(/\.md$/i,""),g=typeof i.name==="string"&&i.name.length>0?i.name:$,v=T0(i.workflows)??[];return{name:g,version:typeof i.version==="string"&&i.version.length>0?i.version:"0.0.0",summary:typeof i.summary==="string"?i.summary:"",workflows:v,trust_level:typeof i.trust_level==="string"&&i.trust_level.length>0?i.trust_level:"first_party",author:typeof i.author==="string"&&i.author.length>0?i.author:"Typescape",content:n.content,compatible_api_version:typeof i.compatible_api_version==="string"&&i.compatible_api_version.length>0?i.compatible_api_version:void 0,compatible_artifacts:CY(i.compatible_artifacts),tags:T0(i.tags),min_tools_required:T0(i.min_tools_required)}}var pJ=AY.map(EY).sort((n,i)=>n.name.localeCompare(i.name));function aJ(n={}){return pJ.filter((i)=>{if(n.workflow&&!i.workflows.includes(n.workflow))return!1;if(n.trustLevel&&i.trust_level.toLowerCase()!==n.trustLevel.toLowerCase())return!1;return!0}).map((i)=>({...i}))}function sJ(n){let i=n.trim().toLowerCase();if(i.length===0)return null;let $=pJ.find((g)=>g.name.toLowerCase()===i);return $===void 0?null:{...$}}var vX=["typescape_list_playbooks","typescape_get_playbook"],oY={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:[]},TY={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 nX(n){return n.status===0||n.status===404||n.code==="not_found"}function iX(n,i){n.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:oY},async($)=>{let g=$;try{let v=new URLSearchParams;if(g.workflow)v.set("workflow",g.workflow);if(g.trust_level)v.set("trust_level",g.trust_level);let w=v.toString(),_=w?`/playbooks?${w}`:"/playbooks",U=await i.get(_);return H(U.body,U.requestId)}catch(v){if(v instanceof D&&nX(v)){let w=aJ({workflow:g.workflow,trustLevel:g.trust_level});return H({items:w,source:"bundled_local"},U_)}if(v instanceof D)return G(v);throw v}}),n.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:TY},async($)=>{let g=$;if(!g.name)return G(mv(400,"missing_param","Missing required parameter: name"));try{let v=`/playbooks/${encodeURIComponent(g.name)}`,w=await i.get(v);return H(w.body,w.requestId)}catch(v){if(v instanceof D&&nX(v)){let w=sJ(g.name);if(w)return H(w,U_)}if(v instanceof D)return G(v);throw v}})}var lq=[...LD,...xD,...vJ,...$J,...JJ,...QJ,...YJ,...LJ,...NJ,...PJ,...zJ,...RJ,...xJ,...CJ,...vX];function Z0(n,i){let $=tD(i);OD(n,i),hD(n,i),iJ(n,i,$),gJ(n,i,$),tJ(n,i,$),WJ(n,i),IJ(n,i,$),KJ(n,i),cJ(n,i),SJ(n,i),MJ(n,i),AJ(n,i),hJ(n,i),EJ(n,i),iX(n,i)}var $X={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 G_ extends Error{missingEnvVars;constructor(n){super("Missing required environment variables");this.missingEnvVars=n;this.name="McpConfigError"}}function Ow(n,i){let $=n[i];if(!$)return;let g=$.trim();return g.length>0?g:void 0}function ZY(n){let i=[];if(!Ow(n,"TYPESCAPE_API_KEY"))i.push(`TYPESCAPE_API_KEY: ${$X.TYPESCAPE_API_KEY}`);if(!Ow(n,"TYPESCAPE_BASE_URL"))i.push(`TYPESCAPE_BASE_URL: ${$X.TYPESCAPE_BASE_URL}`);return i}function gX(n,i=Bw){if(!n||n.trim().length===0)return{timeoutMs:i,warning:null};let $=n.trim();if(/^\d+$/.test($)){let g=Number($);if(g>=1000)return{timeoutMs:g,warning:null}}return{timeoutMs:i,warning:`Warning: Invalid TYPESCAPE_TIMEOUT_MS='${n}'. Using default ${i}ms.`}}function wX(n=process.env,i=Bw){let $=Ow(n,"TYPESCAPE_API_KEY"),g=Ow(n,"TYPESCAPE_BASE_URL");if(!$||!g)throw new G_(ZY(n));let v=Ow(n,"TYPESCAPE_TIMEOUT_MS"),w=gX(v,i);return{apiKey:$,baseUrl:g,timeoutMs:w.timeoutMs,timeoutWarning:w.warning}}async function rY(){let n;try{n=wX()}catch(g){if(g instanceof G_){console.error("Error: Missing required environment variables:");for(let v of g.missingEnvVars)console.error(` - ${v}`);process.exit(1)}throw g}if(n.timeoutWarning)console.warn(n.timeoutWarning);let i=i2(n.baseUrl,n.apiKey,n.timeoutMs),$=e0();Z0($,i),await GD($)}if(d0.main==d0.module)rY().catch((n)=>{console.error("Fatal error:",n instanceof Error?n.message:String(n)),process.exit(1)});export{gX as resolveTimeoutMs};